View Javadoc

1   package org.apache.helix.controller.stages;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *   http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import org.apache.helix.ClusterMessagingService;
23  import org.apache.helix.ConfigAccessor;
24  import org.apache.helix.ConfigChangeListener;
25  import org.apache.helix.ControllerChangeListener;
26  import org.apache.helix.CurrentStateChangeListener;
27  import org.apache.helix.ExternalViewChangeListener;
28  import org.apache.helix.HealthStateChangeListener;
29  import org.apache.helix.HelixAdmin;
30  import org.apache.helix.HelixDataAccessor;
31  import org.apache.helix.HelixManager;
32  import org.apache.helix.HelixManagerProperties;
33  import org.apache.helix.IdealStateChangeListener;
34  import org.apache.helix.InstanceConfigChangeListener;
35  import org.apache.helix.InstanceType;
36  import org.apache.helix.LiveInstanceChangeListener;
37  import org.apache.helix.LiveInstanceInfoProvider;
38  import org.apache.helix.MessageListener;
39  import org.apache.helix.PreConnectCallback;
40  import org.apache.helix.PropertyKey;
41  import org.apache.helix.ScopedConfigChangeListener;
42  import org.apache.helix.ZNRecord;
43  import org.apache.helix.healthcheck.ParticipantHealthReportCollector;
44  import org.apache.helix.model.HelixConfigScope.ConfigScopeProperty;
45  import org.apache.helix.participant.StateMachineEngine;
46  import org.apache.helix.store.zk.ZkHelixPropertyStore;
47  
48  public class DummyClusterManager implements HelixManager
49  {
50    HelixDataAccessor _accessor;
51    String _clusterName;
52    String _sessionId;
53  
54    public DummyClusterManager(String clusterName, HelixDataAccessor accessor)
55    {
56      _clusterName = clusterName;
57      _accessor = accessor;
58      _sessionId = "session_" + clusterName;
59    }
60  
61    @Override
62    public void connect() throws Exception
63    {
64      // TODO Auto-generated method stub
65  
66    }
67  
68    @Override
69    public boolean isConnected()
70    {
71      // TODO Auto-generated method stub
72      return false;
73    }
74  
75    @Override
76    public void disconnect()
77    {
78      // TODO Auto-generated method stub
79  
80    }
81  
82    @Override
83    public void addIdealStateChangeListener(IdealStateChangeListener listener) throws Exception
84    {
85      // TODO Auto-generated method stub
86  
87    }
88  
89    @Override
90    public void addLiveInstanceChangeListener(LiveInstanceChangeListener listener) throws Exception
91    {
92      // TODO Auto-generated method stub
93  
94    }
95  
96    @Override
97    public void addConfigChangeListener(ConfigChangeListener listener) throws Exception
98    {
99      // TODO Auto-generated method stub
100 
101   }
102 
103   @Override
104   public void addMessageListener(MessageListener listener, String instanceName) throws Exception
105   {
106     // TODO Auto-generated method stub
107 
108   }
109 
110   @Override
111   public void addCurrentStateChangeListener(CurrentStateChangeListener listener,
112                                             String instanceName,
113                                             String sessionId) throws Exception
114   {
115     // TODO Auto-generated method stub
116 
117   }
118 
119   @Override
120   public void addExternalViewChangeListener(ExternalViewChangeListener listener) throws Exception
121   {
122     // TODO Auto-generated method stub
123 
124   }
125 
126   @Override
127   public boolean removeListener(PropertyKey key, Object listener)
128   {
129     // TODO Auto-generated method stub
130     return false;
131   }
132 
133   @Override
134   public String getClusterName()
135   {
136     return _clusterName;
137   }
138 
139   @Override
140   public String getInstanceName()
141   {
142     // TODO Auto-generated method stub
143     return null;
144   }
145 
146   @Override
147   public String getSessionId()
148   {
149     return _sessionId;
150   }
151 
152   @Override
153   public long getLastNotificationTime()
154   {
155     // TODO Auto-generated method stub
156     return 0;
157   }
158 
159   @Override
160   public void addControllerListener(ControllerChangeListener listener)
161   {
162     // TODO Auto-generated method stub
163 
164   }
165 
166   @Override
167   public HelixAdmin getClusterManagmentTool()
168   {
169     // TODO Auto-generated method stub
170     return null;
171   }
172 
173   @Override
174   public ClusterMessagingService getMessagingService()
175   {
176     // TODO Auto-generated method stub
177     return null;
178   }
179 
180   @Override
181   public ParticipantHealthReportCollector getHealthReportCollector()
182   {
183     // TODO Auto-generated method stub
184     return null;
185   }
186 
187   @Override
188   public InstanceType getInstanceType()
189   {
190     // TODO Auto-generated method stub
191     return null;
192   }
193 
194   @Override
195   public String getVersion()
196   {
197     // TODO Auto-generated method stub
198     return null;
199   }
200 
201   @Override
202   public void addHealthStateChangeListener(HealthStateChangeListener listener,
203                                            String instanceName) throws Exception
204   {
205     // TODO Auto-generated method stub
206 
207   }
208 
209   @Override
210   public StateMachineEngine getStateMachineEngine()
211   {
212     // TODO Auto-generated method stub
213     return null;
214   }
215 
216   @Override
217   public boolean isLeader()
218   {
219     // TODO Auto-generated method stub
220     return false;
221   }
222 
223   @Override
224   public ConfigAccessor getConfigAccessor()
225   {
226     // TODO Auto-generated method stub
227     return null;
228   }
229 
230   @Override
231   public void startTimerTasks()
232   {
233     // TODO Auto-generated method stub
234 
235   }
236 
237   @Override
238   public void stopTimerTasks()
239   {
240     // TODO Auto-generated method stub
241 
242   }
243 
244   @Override
245   public HelixDataAccessor getHelixDataAccessor()
246   {
247     return _accessor;
248   }
249 
250   @Override
251   public void addPreConnectCallback(PreConnectCallback callback)
252   {
253     // TODO Auto-generated method stub
254     
255   }
256 
257   @Override
258   public ZkHelixPropertyStore<ZNRecord> getHelixPropertyStore()
259   {
260     // TODO Auto-generated method stub
261     return null;
262   }
263   
264   @Override
265   public void addInstanceConfigChangeListener(InstanceConfigChangeListener listener) throws Exception {
266   	// TODO Auto-generated method stub
267 
268   }
269 
270   @Override
271   public void addConfigChangeListener(ScopedConfigChangeListener listener, ConfigScopeProperty scope)
272           throws Exception {
273   	// TODO Auto-generated method stub
274 
275   }
276 
277   @Override
278   public void setLiveInstanceInfoProvider(
279       LiveInstanceInfoProvider liveInstanceInfoProvider)
280   {
281     // TODO Auto-generated method stub
282     
283   }
284 
285   @Override
286   public HelixManagerProperties getProperties() {
287     // TODO Auto-generated method stub
288     return null;
289   }
290 }