本文整理汇总了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);
}
}
示例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();
}
}
示例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();
}
示例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();
}
示例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));
}
示例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();
}
示例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);
}
示例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);
}
示例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();
}
示例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");
}
示例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();
}
示例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();
}
示例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();
}
示例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);
}
}
示例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());
}