本文整理汇总了Java中org.apache.accumulo.minicluster.MiniAccumuloConfig.setNumTservers方法的典型用法代码示例。如果您正苦于以下问题:Java MiniAccumuloConfig.setNumTservers方法的具体用法?Java MiniAccumuloConfig.setNumTservers怎么用?Java MiniAccumuloConfig.setNumTservers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.accumulo.minicluster.MiniAccumuloConfig
的用法示例。
在下文中一共展示了MiniAccumuloConfig.setNumTservers方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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();
}
示例2: 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();
}
示例3: 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();
}
示例4: 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();
}
示例5: accumuloInit
import org.apache.accumulo.minicluster.MiniAccumuloConfig; //导入方法依赖的package包/类
public void accumuloInit()
throws AccumuloException,
AccumuloSecurityException,
IOException,
InterruptedException,
SchemaException {
final String miniEnabled = System.getProperty("miniAccumulo");
if ((miniEnabled != null) && miniEnabled.equalsIgnoreCase("false")) {
mode = AccumuloMode.DEPLOYED_ACCUMULO;
}
TYPE = DataUtilities.createType(
"TestPoint",
"location:Point:srid=4326,dim1:Double,dim2:Double,dim3:Double,startTime:Date,stopTime:Date,index:String");
if (mode == AccumuloMode.MINI_ACCUMULO) {
tempDir = Files.createTempDir();
tempDir.deleteOnExit();
log.debug(tempDir.getAbsolutePath());
final MiniAccumuloConfig config = new MiniAccumuloConfig(
tempDir,
DEFAULT_MINI_ACCUMULO_PASSWORD);
config.setNumTservers(4);
miniAccumulo = new MiniAccumuloCluster(
config);
miniAccumulo.start();
zookeeperUrl = miniAccumulo.getZooKeepers();
instancename = miniAccumulo.getInstanceName();
username = "root";
password = DEFAULT_MINI_ACCUMULO_PASSWORD;
}
else if (mode == AccumuloMode.DEPLOYED_ACCUMULO) {
zookeeperUrl = System.getProperty("zookeeperUrl");
instancename = System.getProperty("instance");
username = System.getProperty("username");
password = System.getProperty("password");
}
else {
// intentionally left blank
}
}
示例6: main
import org.apache.accumulo.minicluster.MiniAccumuloConfig; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
Parameters params = new Parameters();
JCommander jc = new JCommander(params);
try {
jc.parse(args);
if (params.args == null || params.args.size() != 2)
throw new ParameterException("Expected two arguments");
} catch (ParameterException pe) {
System.out.println(pe.getMessage());
jc.setProgramName(Mini.class.getSimpleName());
jc.usage();
System.exit(-1);
}
MiniAccumuloConfig cfg = new MiniAccumuloConfig(new File(params.args.get(0)), "secret");
cfg.setZooKeeperPort(params.zookeeperPort);
cfg.setNumTservers(params.tabletServers);
if (params.moreMemory) {
cfg.setMemory(ServerType.TABLET_SERVER, 2, MemoryUnit.GIGABYTE);
Map<String, String> site = new HashMap<>();
site.put(Property.TSERV_DATACACHE_SIZE.getKey(), "768M");
site.put(Property.TSERV_INDEXCACHE_SIZE.getKey(), "256M");
cfg.setSiteConfig(site);
}
MiniAccumuloCluster cluster = new MiniAccumuloCluster(cfg);
cluster.start();
FluoConfiguration fluoConfig = new FluoConfiguration();
fluoConfig.setMiniStartAccumulo(false);
fluoConfig.setAccumuloInstance(cluster.getInstanceName());
fluoConfig.setAccumuloUser("root");
fluoConfig.setAccumuloPassword("secret");
fluoConfig.setAccumuloZookeepers(cluster.getZooKeepers());
fluoConfig.setInstanceZookeepers(cluster.getZooKeepers() + "/fluo");
fluoConfig.setAccumuloTable("data");
fluoConfig.setWorkerThreads(params.workerThreads);
fluoConfig.setApplicationName("phrasecount");
Application.configure(fluoConfig, new Application.Options(17, 17, cluster.getInstanceName(),
cluster.getZooKeepers(), "root", "secret", "pcExport"));
FluoFactory.newAdmin(fluoConfig).initialize(new InitializationOptions());
MiniFluo miniFluo = FluoFactory.newMiniFluo(fluoConfig);
miniFluo.getClientConfiguration().save(new File(params.args.get(1)));
System.out.println();
System.out.println("Wrote : " + params.args.get(1));
}
示例7: setup
import org.apache.accumulo.minicluster.MiniAccumuloConfig; //导入方法依赖的package包/类
@BeforeClass
public static void setup() throws Exception {
macConfig = new MiniAccumuloConfig(tmp, "root");
macConfig.setNumTservers(2);
mac = new MiniAccumuloCluster(macConfig);
mac.start();
instance = new ZooKeeperInstance(mac.getInstanceName(), mac.getZooKeepers());
connector = instance.getConnector("root", new PasswordToken(macConfig.getRootPassword()));
connector.securityOperations().changeUserAuthorizations("root", auths);
columns = Sets.newHashSet();
columns.add(new Index(PAGE_ID));
columns.add(new Index(REVISION_ID));
columns.add(new Index(REVISION_TIMESTAMP));
columns.add(new Index(CONTRIBUTOR_ID));
impl = new CosmosImpl(mac.getZooKeepers());
cosmosSql = new CosmosSql(impl, connector, Defaults.METADATA_TABLE, auths);
new CosmosDriver(cosmosSql, "cosmos", connector, auths, Defaults.METADATA_TABLE);
}