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


Java MiniAccumuloConfig类代码示例

本文整理汇总了Java中org.apache.accumulo.minicluster.MiniAccumuloConfig的典型用法代码示例。如果您正苦于以下问题:Java MiniAccumuloConfig类的具体用法?Java MiniAccumuloConfig怎么用?Java MiniAccumuloConfig使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MiniAccumuloConfig类属于org.apache.accumulo.minicluster包,在下文中一共展示了MiniAccumuloConfig类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setupMiniAccumulo

import org.apache.accumulo.minicluster.MiniAccumuloConfig; //导入依赖的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.MiniAccumuloConfig; //导入依赖的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.MiniAccumuloConfig; //导入依赖的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.MiniAccumuloConfig; //导入依赖的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.MiniAccumuloConfig; //导入依赖的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.MiniAccumuloConfig; //导入依赖的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.MiniAccumuloConfig; //导入依赖的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.MiniAccumuloConfig; //导入依赖的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: startMiniAccumulo

import org.apache.accumulo.minicluster.MiniAccumuloConfig; //导入依赖的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

示例10: createCluster

import org.apache.accumulo.minicluster.MiniAccumuloConfig; //导入依赖的package包/类
private static void createCluster() throws IOException, InterruptedException, AccumuloSecurityException, AccumuloException {
    if (tempFolder.exists()) {
        FileUtils.cleanDirectory(tempFolder);
    }
    final MiniAccumuloConfig miniAccumuloConfig = new MiniAccumuloConfig(tempFolder, PASSWORD);
    cluster = new MiniAccumuloCluster(miniAccumuloConfig);
    Runtime.getRuntime().addShutdownHook(new Thread() {
        @Override
        public void run() {
            try {
                cluster.stop();
                tempFolder.delete();
            } catch (final IOException | InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
    });
    cluster.start();
    // Create user USER with permissions to create a table
    cluster.getConnector(ROOT, PASSWORD).securityOperations().createLocalUser(USER, new PasswordToken(PASSWORD));
    cluster.getConnector(ROOT, PASSWORD).securityOperations().grantSystemPermission(USER, SystemPermission.CREATE_TABLE);
    // Create properties
    accumuloProperties = new AccumuloProperties();
    accumuloProperties.setStoreClass(AccumuloStore.class);
    accumuloProperties.setInstance(cluster.getInstanceName());
    accumuloProperties.setZookeepers(cluster.getZooKeepers());
    accumuloProperties.setUser(MiniAccumuloClusterProvider.USER);
    accumuloProperties.setPassword(MiniAccumuloClusterProvider.PASSWORD);
    accumuloProperties.setOperationDeclarationPaths("sparkAccumuloOperationsDeclarations.json");
}
 
开发者ID:gchq,项目名称:Gaffer,代码行数:31,代码来源:MiniAccumuloClusterProvider.java

示例11: setUpBeforeClass

import org.apache.accumulo.minicluster.MiniAccumuloConfig; //导入依赖的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();
}
 
开发者ID:astralway,项目名称:phrasecount,代码行数:9,代码来源:PhraseCounterTest.java

示例12: setupClusters

import org.apache.accumulo.minicluster.MiniAccumuloConfig; //导入依赖的package包/类
@BeforeClass
public static void setupClusters() throws Exception {
    MiniAccumuloConfig macConf = new MiniAccumuloConfig(tmpdir, "password");
    macConf.setNumTservers(1);

    accumuloCluster = new MiniAccumuloCluster(macConf);
    accumuloCluster.start();
}
 
开发者ID:sigmoidanalytics,项目名称:spork,代码行数:9,代码来源:TestAccumuloPigCluster.java

示例13: setup

import org.apache.accumulo.minicluster.MiniAccumuloConfig; //导入依赖的package包/类
@BeforeClass
public static void setup() throws IOException, InterruptedException {
  macConfig = new MiniAccumuloConfig(tmp, "root");
  macConfig.setNumTservers(2);
  mac = new MiniAccumuloCluster(macConfig);
  
  mac.start();
  
  // Do this now so we don't forget later (or get an exception)
  tmp.deleteOnExit();
}
 
开发者ID:joshelser,项目名称:cosmos,代码行数:12,代码来源:GroupByRowSuffixIteratorTest.java

示例14: startMiniAccumulo

import org.apache.accumulo.minicluster.MiniAccumuloConfig; //导入依赖的package包/类
private void startMiniAccumulo() {
  try {
    // start mini accumulo cluster
    MiniAccumuloConfig cfg = new MiniAccumuloConfig(new File(config.getMiniDataDir()), PASSWORD);
    cluster = new MiniAccumuloCluster(cfg);
    cluster.start();

    log.debug("Started MiniAccumulo(accumulo=" + cluster.getInstanceName() + " zk="
        + cluster.getZooKeepers() + ")");

    // configuration that must overridden
    config.setAccumuloInstance(cluster.getInstanceName());
    config.setAccumuloUser(USER);
    config.setAccumuloPassword(PASSWORD);
    config.setAccumuloZookeepers(cluster.getZooKeepers());
    config.setInstanceZookeepers(cluster.getZooKeepers() + "/fluo");

    // configuration that only needs to be set if not by user
    if ((config.containsKey(FluoConfiguration.ACCUMULO_TABLE_PROP) == false)
        || config.getAccumuloTable().trim().isEmpty()) {
      config.setAccumuloTable("fluo");
    }

    InitializationOptions opts = new InitializationOptions();
    try (FluoAdmin admin = FluoFactory.newAdmin(config)) {
      admin.initialize(opts);
    }

    File miniProps = new File(clientPropsPath(config));
    config.getClientConfiguration().save(miniProps);

    log.debug("Wrote MiniFluo client properties to {}", miniProps.getAbsolutePath());

  } catch (Exception e) {
    throw new RuntimeException(e);
  }
}
 
开发者ID:apache,项目名称:fluo,代码行数:38,代码来源:MiniFluoImpl.java

示例15: initConfig

import org.apache.accumulo.minicluster.MiniAccumuloConfig; //导入依赖的package包/类
private void initConfig() {
    tempDir = Files.createTempDir();
    miniAccumuloConfig = new MiniAccumuloConfig(tempDir,ROOT_PASSWORD);
    miniAccumuloConfig.setZooKeeperPort(ZOOKEEPER_PORT);
    miniAccumuloConfig.setInstanceName(INSTANCE_NAME);
    log.info("attempting to start minicluster in " + tempDir.getAbsolutePath());
}
 
开发者ID:calrissian,项目名称:accumulo-recipes,代码行数:8,代码来源:AccumuloMiniClusterDriver.java


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