Skip to content
Permalink
Browse files
[HELIX-4] Removing file based implementation
  • Loading branch information
kishoreg committed Nov 9, 2012
1 parent 0c01988 commit 99d394bfb4e2fcc561f39d59a94f9c64f48399fd
Show file tree
Hide file tree
Showing 88 changed files with 92 additions and 7,797 deletions.
0 build 100644 → 100755
Empty file.
@@ -26,8 +26,8 @@

import org.apache.helix.TestHelper;
import org.apache.helix.mock.controller.ClusterController;
import org.apache.helix.mock.storage.MockParticipant;
import org.apache.helix.mock.storage.MockParticipant.ErrTransition;
import org.apache.helix.mock.participant.MockParticipant;
import org.apache.helix.mock.participant.MockParticipant.ErrTransition;
import org.apache.helix.tools.ClusterSetup;
import org.apache.helix.tools.ClusterStateVerifier;
import org.apache.helix.webapp.resources.JsonParameters;
@@ -31,8 +31,8 @@
import org.apache.helix.manager.zk.ZKHelixDataAccessor;
import org.apache.helix.manager.zk.ZkBaseDataAccessor;
import org.apache.helix.mock.controller.ClusterController;
import org.apache.helix.mock.storage.MockParticipant;
import org.apache.helix.mock.storage.MockParticipant.ErrTransition;
import org.apache.helix.mock.participant.MockParticipant;
import org.apache.helix.mock.participant.MockParticipant.ErrTransition;
import org.apache.helix.model.LiveInstance;
import org.apache.helix.model.Message;
import org.apache.helix.tools.ClusterSetup;
@@ -26,8 +26,8 @@

import org.apache.helix.TestHelper;
import org.apache.helix.mock.controller.ClusterController;
import org.apache.helix.mock.storage.MockParticipant;
import org.apache.helix.mock.storage.MockParticipant.ErrTransition;
import org.apache.helix.mock.participant.MockParticipant;
import org.apache.helix.mock.participant.MockParticipant.ErrTransition;
import org.apache.helix.tools.ClusterSetup;
import org.apache.helix.tools.ClusterStateVerifier;
import org.apache.helix.webapp.resources.JsonParameters;

This file was deleted.

@@ -25,10 +25,7 @@
* for zk-based cluster managers, the getZKXXX(..zkClient) that takes a zkClient parameter
* are intended for session expiry test purpose
*/
import org.apache.helix.manager.file.DynamicFileHelixManager;
import org.apache.helix.manager.file.StaticFileHelixManager;
import org.apache.helix.manager.zk.ZKHelixManager;
import org.apache.helix.store.file.FilePropertyStore;
import org.apache.log4j.Logger;


@@ -55,54 +52,4 @@ public static HelixManager getZKHelixManager(String clusterName,
return new ZKHelixManager(clusterName, instanceName, type, zkAddr);
}

/**
* Construct a file-based cluster manager using a static cluster-view file the
* cluster-view file contains pre-computed state transition messages from initial
* OFFLINE states to ideal states
*
* @param clusterName
* @param instanceName
* @param type
* @param clusterViewFile
* @return
* @throws Exception
*/
@Deprecated
public static HelixManager getStaticFileHelixManager(String clusterName,
String instanceName,
InstanceType type,
String clusterViewFile) throws Exception
{
if (type != InstanceType.PARTICIPANT)
{
throw new IllegalArgumentException("Static file-based cluster manager doesn't support type other than participant");
}
return new StaticFileHelixManager(clusterName, instanceName, type, clusterViewFile);
}

/**
* Construct a dynamic file-based cluster manager
*
* @param clusterName
* @param instanceName
* @param type
* @param file
* property store: all dynamic-file based participants/controller shall use the
* same file property store to avoid race condition in updating files
* @return
* @throws Exception
*/
@Deprecated
public static HelixManager getDynamicFileHelixManager(String clusterName,
String instanceName,
InstanceType type,
FilePropertyStore<ZNRecord> store) throws Exception
{
if (type != InstanceType.PARTICIPANT && type != InstanceType.CONTROLLER)
{
throw new IllegalArgumentException("Dynamic file-based cluster manager doesn't support types other than participant and controller");
}

return new DynamicFileHelixManager(clusterName, instanceName, type, store);
}
}
@@ -92,34 +92,23 @@
private final int delay;

public BootstrapProcess(String zkConnectString, String clusterName,
String instanceName, String file, String stateModel, int delay)
String instanceName, String stateModel, int delay)
{
this.zkConnectString = zkConnectString;
this.clusterName = clusterName;
this.instanceName = instanceName;
this._file = file;
stateModelType = stateModel;
this.delay = delay;
}

public void start() throws Exception
{
if (_file == null)
{
manager = HelixManagerFactory.getZKHelixManager(clusterName,
instanceName,
InstanceType.PARTICIPANT,
zkConnectString);

}
else
{
manager = HelixManagerFactory.getStaticFileHelixManager(clusterName,
instanceName,
InstanceType.PARTICIPANT,
_file);

}

stateModelFactory = new BootstrapHandler();
// genericStateMachineHandler = new StateMachineEngine();
// genericStateMachineHandler.registerStateModelFactory("MasterSlave", stateModelFactory);
@@ -133,12 +122,6 @@ public void start() throws Exception
MessageType.USER_DEFINE_MSG.toString(),
new CustomMessageHandlerFactory());
manager.connect();
if (_file != null)
{
ClusterStateVerifier.verifyFileBasedClusterStates(_file, instanceName,
stateModelFactory);

}
}

public static class CustomMessageHandlerFactory implements
@@ -312,7 +295,6 @@ public static void main(String[] args) throws Exception
String zkConnectString = "localhost:2181";
String clusterName = "storage-integration-cluster";
String instanceName = "localhost_8905";
String file = null;
String stateModelValue = "MasterSlave";
int delay = 0;
boolean skipZeroArgs = true;// false is for dev testing
@@ -327,16 +309,6 @@ public static void main(String[] args) throws Exception
int port = Integer.parseInt(portString);
instanceName = host + "_" + port;

file = cmd.getOptionValue(configFile);
if (file != null)
{
File f = new File(file);
if (!f.exists())
{
System.err.println("static config file doesn't exist");
System.exit(1);
}
}

stateModelValue = cmd.getOptionValue(stateModel);
if (cmd.hasOption(transDelay))
@@ -359,7 +331,7 @@ public static void main(String[] args) throws Exception
System.out.println("Starting Process with ZK:" + zkConnectString);

BootstrapProcess process = new BootstrapProcess(zkConnectString,
clusterName, instanceName, file, stateModelValue, delay);
clusterName, instanceName, stateModelValue, delay);

process.start();
Thread.currentThread().join();

0 comments on commit 99d394b

Please sign in to comment.