本文整理汇总了Java中org.apache.accumulo.minicluster.MiniAccumuloCluster.start方法的典型用法代码示例。如果您正苦于以下问题:Java MiniAccumuloCluster.start方法的具体用法?Java MiniAccumuloCluster.start怎么用?Java MiniAccumuloCluster.start使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.accumulo.minicluster.MiniAccumuloCluster
的用法示例。
在下文中一共展示了MiniAccumuloCluster.start方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupMiniAccumulo
import org.apache.accumulo.minicluster.MiniAccumuloCluster; //导入方法依赖的package包/类
@BeforeClass
public static void setupMiniAccumulo() throws Exception {
try {
// try to put in target dir
File targetDir = new File("target");
if (targetDir.exists() && targetDir.isDirectory()) {
baseDir = new File(targetDir, "accumuloExportIT-" + UUID.randomUUID());
} else {
baseDir = new File(FileUtils.getTempDirectory(), "accumuloExportIT-" + UUID.randomUUID());
}
FileUtils.deleteDirectory(baseDir);
MiniAccumuloConfig cfg = new MiniAccumuloConfig(baseDir, ACCUMULO_PASSWORD);
cluster = new MiniAccumuloCluster(cfg);
cluster.start();
} catch (IOException | InterruptedException e) {
throw new IllegalStateException(e);
}
}
示例2: setUpClass
import org.apache.accumulo.minicluster.MiniAccumuloCluster; //导入方法依赖的package包/类
@Override
public void setUpClass() throws IOException, InterruptedException {
log.info("Starting Accumulo MiniAccumuloCluster...");
try {
tmpDir.create();
MiniAccumuloConfig miniCfg = new MiniAccumuloConfig(tmpDir.getRoot(), PASSWORD);
miniCfg.setInstanceName("goraTest");
miniCfg.setZooKeeperPort(56321);
cluster = new MiniAccumuloCluster(miniCfg);
cluster.start();
} catch (Exception e) {
LOG.error("Error starting Accumulo MiniAccumuloCluster: {}", e.getMessage());
// cleanup
tearDownClass();
}
}
示例3: createAccumuloCluster
import org.apache.accumulo.minicluster.MiniAccumuloCluster; //导入方法依赖的package包/类
@BeforeClass
public static void createAccumuloCluster() throws Exception {
macDir = File.createTempFile("miniaccumulocluster", null);
Assert.assertTrue(macDir.delete());
Assert.assertTrue(macDir.mkdir());
macDir.deleteOnExit();
MiniAccumuloConfig config = new MiniAccumuloConfig(macDir, "");
config.setNumTservers(2);
mac = new MiniAccumuloCluster(config);
mac.start();
ZooKeeperInstance zkInst = new ZooKeeperInstance(mac.getInstanceName(), mac.getZooKeepers());
Connector c = zkInst.getConnector("root", new PasswordToken(""));
// Add in auths for "en"
c.securityOperations().changeUserAuthorizations("root", new Authorizations("en"));
zk = new TestingServer();
}
示例4: setupMAC
import org.apache.accumulo.minicluster.MiniAccumuloCluster; //导入方法依赖的package包/类
@BeforeClass
public static void setupMAC() throws Exception {
File tmp = Files.createTempDir();
tmp.deleteOnExit();
conf = new MiniAccumuloConfig(tmp, "foo");
conf.setNumTservers(2);
mac = new MiniAccumuloCluster(conf);
mac.start();
ZooKeeperInstance zkInst = new ZooKeeperInstance(mac.getInstanceName(), mac.getZooKeepers());
Connector con = zkInst.getConnector("root", new PasswordToken("foo"));
con.tableOperations().create(Defaults.DATA_TABLE);
con.tableOperations().create(Defaults.METADATA_TABLE);
zk = new TestingServer();
}
示例5: setUpAccumulo
import org.apache.accumulo.minicluster.MiniAccumuloCluster; //导入方法依赖的package包/类
@BeforeClass
public static void setUpAccumulo() throws Exception {
instanceName = System.getProperty(IT_INSTANCE_NAME_PROP, "it-instance-default");
File instanceDir = new File("target/accumulo-maven-plugin/" + instanceName);
boolean instanceClear =
System.getProperty(IT_INSTANCE_CLEAR_PROP, "true").equalsIgnoreCase("true");
if (instanceDir.exists() && instanceClear) {
FileUtils.deleteDirectory(instanceDir);
}
if (!instanceDir.exists()) {
MiniAccumuloConfig cfg = new MiniAccumuloConfig(instanceDir, PASSWORD);
cfg.setInstanceName(instanceName);
cluster = new MiniAccumuloCluster(cfg);
cluster.start();
startedCluster = true;
}
miniAccumulo = new MiniAccumuloInstance(instanceName, instanceDir);
conn = miniAccumulo.getConnector(USER, new PasswordToken(PASSWORD));
}
示例6: setUpBeforeClass
import org.apache.accumulo.minicluster.MiniAccumuloCluster; //导入方法依赖的package包/类
@BeforeClass
public static void setUpBeforeClass() throws Exception {
folder.create();
MiniAccumuloConfig cfg = new MiniAccumuloConfig(folder.newFolder("miniAccumulo"), new String(password.getPassword()));
cluster = new MiniAccumuloCluster(cfg);
cluster.start();
props = new InitializationProperties();
props.setAccumuloInstance(cluster.getInstanceName());
props.setAccumuloUser("root");
props.setAccumuloPassword("secret");
props.setZookeeperRoot("/accismus");
props.setZookeepers(cluster.getZooKeepers());
props.setAccumuloTable("data");
props.setNumThreads(5);
props.setObservers(Collections.singletonMap(PackageObserver.UPDATE_COLUMN, PackageObserver.class.getName()));
Admin.initialize(props);
miniAccismus = new MiniAccismus(props);
miniAccismus.start();
}
示例7: beforeClass
import org.apache.accumulo.minicluster.MiniAccumuloCluster; //导入方法依赖的package包/类
@BeforeClass
public static void beforeClass() throws Exception {
temp.create();
final MiniAccumuloConfig macConfig = new MiniAccumuloConfig(temp.newFolder("mac"), "secret");
mac = new MiniAccumuloCluster(macConfig);
mac.start();
conf = TestConfiguration.createMinimalConfigurationForTest();
conf.getAccumulo().setInstanceName(mac.getInstanceName());
conf.getAccumulo().setZookeepers(mac.getZooKeepers());
setupSSL(conf);
}
示例8: beforeClass
import org.apache.accumulo.minicluster.MiniAccumuloCluster; //导入方法依赖的package包/类
@BeforeClass
public static void beforeClass() throws Exception {
final MiniAccumuloConfig macConfig = new MiniAccumuloConfig(temp.newFolder("mac"), "secret");
mac = new MiniAccumuloCluster(macConfig);
mac.start();
conf = TestConfiguration.createMinimalConfigurationForTest();
conf.getAccumulo().setInstanceName(mac.getInstanceName());
conf.getAccumulo().setZookeepers(mac.getZooKeepers());
setupSSL(conf);
}
示例9: setUpClass
import org.apache.accumulo.minicluster.MiniAccumuloCluster; //导入方法依赖的package包/类
@Override
public void setUpClass() throws Exception {
super.setUpClass();
log.info("Starting Accumulo MiniAccumuloCluster...");
try {
tmpDir.create();
cluster = new MiniAccumuloCluster(tmpDir.getRoot(), PASSWORD);
cluster.start();
} catch (Exception e) {
LOG.error("Error starting Accumulo MiniAccumuloCluster: {}", e.getMessage());
// cleanup
tearDownClass();
}
}
示例10: setUp
import org.apache.accumulo.minicluster.MiniAccumuloCluster; //导入方法依赖的package包/类
@Before
@SuppressWarnings("unchecked")
public void setUp() throws Exception {
cluster = new MiniAccumuloCluster(temporaryFolder.getRoot(), PASSWORD);
cluster.start();
Properties properties = DataStoreFactory.createProps();
properties.setProperty(
GORA_DATASTORE + AccumuloStore.MOCK_PROPERTY,
"false");
properties.setProperty(
GORA_DATASTORE + AccumuloStore.INSTANCE_NAME_PROPERTY,
cluster.getInstanceName());
properties.setProperty(
GORA_DATASTORE + AccumuloStore.ZOOKEEPERS_NAME_PROPERTY,
cluster.getZooKeepers());
properties.setProperty(
GORA_DATASTORE + AccumuloStore.PASSWORD_PROPERTY,
PASSWORD);
employeeStore = DataStoreFactory.createDataStore(
AccumuloStore.class,
String.class,
Employee.class,
new Configuration(),
properties);
}
示例11: startMiniCluster
import org.apache.accumulo.minicluster.MiniAccumuloCluster; //导入方法依赖的package包/类
public MiniAccumuloCluster startMiniCluster(File tempFile) {
try {
amc = new MiniAccumuloCluster(tempFile, "password");
amc.start();
return amc;
}catch (IOException | InterruptedException e){
e.printStackTrace();
}
return null;
}
示例12: startMiniAccumulo
import org.apache.accumulo.minicluster.MiniAccumuloCluster; //导入方法依赖的package包/类
/**
* Start the {@link MiniAccumuloCluster}.
*/
public void startMiniAccumulo() throws IOException, InterruptedException, AccumuloException, AccumuloSecurityException {
final File miniDataDir = Files.createTempDir();
// Setup and start the Mini Accumulo.
final MiniAccumuloConfig cfg = new MiniAccumuloConfig(miniDataDir, PASSWORD);
cluster = new MiniAccumuloCluster(cfg);
cluster.start();
}
示例13: startMiniAccumulo
import org.apache.accumulo.minicluster.MiniAccumuloCluster; //导入方法依赖的package包/类
/**
* Setup a Mini Accumulo cluster that uses a temporary directory to store its data.
*
* @return A Mini Accumulo cluster.
*/
private static MiniAccumuloCluster startMiniAccumulo() throws IOException, InterruptedException, AccumuloException, AccumuloSecurityException {
final File miniDataDir = Files.createTempDir();
// Setup and start the Mini Accumulo.
final MiniAccumuloCluster accumulo = new MiniAccumuloCluster(miniDataDir, "password");
accumulo.start();
// Store a connector to the Mini Accumulo.
final Instance instance = new ZooKeeperInstance(accumulo.getInstanceName(), accumulo.getZooKeepers());
accumuloConn = instance.getConnector("root", new PasswordToken("password"));
return accumulo;
}
示例14: setUpInstance
import org.apache.accumulo.minicluster.MiniAccumuloCluster; //导入方法依赖的package包/类
/**
* Sets up the {@link MiniAccumuloCluster} or the {@link MockInstance}.
* @throws Exception
*/
public void setUpInstance() throws Exception {
if (!isMock) {
log.info("Setting up " + driverName + " MiniAccumulo cluster...");
// Create and Run MiniAccumulo Cluster
tempDir = Files.createTempDir();
tempDir.deleteOnExit();
miniAccumuloCluster = new MiniAccumuloCluster(tempDir, userpwd);
copyHadoopHomeToTemp();
miniAccumuloCluster.getConfig().setInstanceName(instanceName);
log.info(driverName + " MiniAccumulo instance starting up...");
miniAccumuloCluster.start();
Thread.sleep(1000);
log.info(driverName + " MiniAccumulo instance started");
log.info("Creating connector to " + driverName + " MiniAccumulo instance...");
zooKeeperInstance = new ZooKeeperInstance(miniAccumuloCluster.getClientConfig());
instance = zooKeeperInstance;
connector = zooKeeperInstance.getConnector(user, new PasswordToken(userpwd));
log.info("Created connector to " + driverName + " MiniAccumulo instance");
} else {
log.info("Setting up " + driverName + " mock instance...");
mockInstance = new MockInstance(instanceName);
instance = mockInstance;
connector = mockInstance.getConnector(user, new PasswordToken(userpwd));
log.info("Created connector to " + driverName + " mock instance");
}
zooKeepers = instance.getZooKeepers();
}
示例15: startMiniAccumulo
import org.apache.accumulo.minicluster.MiniAccumuloCluster; //导入方法依赖的package包/类
private static MiniAccumuloCluster startMiniAccumulo() throws IOException, InterruptedException, AccumuloException, AccumuloSecurityException {
final File miniDataDir = Files.createTempDir();
// Setup and start the Mini Accumulo.
final MiniAccumuloCluster accumulo = new MiniAccumuloCluster(
miniDataDir, "password");
accumulo.start();
// Store a connector to the Mini Accumulo.
final Instance instance = new ZooKeeperInstance(
accumulo.getInstanceName(), accumulo.getZooKeepers());
accCon = instance.getConnector("root", new PasswordToken("password"));
return accumulo;
}