当前位置: 首页>>代码示例>>Java>>正文


Java MiniAccumuloCluster.start方法代码示例

本文整理汇总了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);
  }
}
 
开发者ID:apache,项目名称:fluo-recipes,代码行数:21,代码来源:AccumuloExportITBase.java

示例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();
  }
}
 
开发者ID:apache,项目名称:gora,代码行数:17,代码来源:GoraAccumuloTestDriver.java

示例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();
}
 
开发者ID:joshelser,项目名称:cosmos,代码行数:22,代码来源:CosmosIntegrationTest.java

示例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();
}
 
开发者ID:joshelser,项目名称:cosmos,代码行数:18,代码来源:GroupByIntegrationTest.java

示例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));
}
 
开发者ID:apache,项目名称:fluo,代码行数:20,代码来源:ITBase.java

示例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();
}
 
开发者ID:keith-turner,项目名称:jinex,代码行数:23,代码来源:LoadTest.java

示例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);
}
 
开发者ID:NationalSecurityAgency,项目名称:qonduit,代码行数:12,代码来源:TwoWaySSLFailureIT.java

示例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);
}
 
开发者ID:NationalSecurityAgency,项目名称:qonduit,代码行数:11,代码来源:TwoWaySSLIT.java

示例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();
  }
}
 
开发者ID:jianglibo,项目名称:gora-boot,代码行数:15,代码来源:GoraAccumuloTestDriver.java

示例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);
}
 
开发者ID:jianglibo,项目名称:gora-boot,代码行数:28,代码来源:AuthenticationTokenTest.java

示例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;
    }
 
开发者ID:IIDP,项目名称:OSTMap,代码行数:14,代码来源:AmcHelper.java

示例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();
}
 
开发者ID:apache,项目名称:incubator-rya,代码行数:12,代码来源:MiniAccumuloClusterInstance.java

示例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;
}
 
开发者ID:apache,项目名称:incubator-rya,代码行数:19,代码来源:DemoDriver.java

示例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();
}
 
开发者ID:apache,项目名称:incubator-rya,代码行数:32,代码来源:AccumuloInstanceDriver.java

示例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;
}
 
开发者ID:apache,项目名称:incubator-rya,代码行数:16,代码来源:AccumuloIndexSetColumnVisibilityTest.java


注:本文中的org.apache.accumulo.minicluster.MiniAccumuloCluster.start方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。