本文整理汇总了Java中org.apache.accumulo.core.client.Instance.getInstanceName方法的典型用法代码示例。如果您正苦于以下问题:Java Instance.getInstanceName方法的具体用法?Java Instance.getInstanceName怎么用?Java Instance.getInstanceName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.accumulo.core.client.Instance
的用法示例。
在下文中一共展示了Instance.getInstanceName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getParams
import org.apache.accumulo.core.client.Instance; //导入方法依赖的package包/类
public Map<String, Serializable> getParams(final Configuration conf) {
// get the configuration parameters
final Instance instance = ConfigUtils.getInstance(conf);
final String instanceId = instance.getInstanceName();
final String zookeepers = instance.getZooKeepers();
final String user = ConfigUtils.getUsername(conf);
final String password = ConfigUtils.getPassword(conf);
final String auths = ConfigUtils.getAuthorizations(conf).toString();
final String tableName = getTableName(conf);
final String tablePrefix = ConfigUtils.getTablePrefix(conf);
final Map<String, Serializable> params = new HashMap<>();
params.put("zookeeper", zookeepers);
params.put("instance", instanceId);
params.put("user", user);
params.put("password", password);
params.put("namespace", tableName);
params.put("gwNamespace", tablePrefix + getClass().getSimpleName());
params.put("Lock Management", LockManagementType.MEMORY.toString());
params.put("Authorization Management Provider", AuthorizationManagementProviderType.EMPTY.toString());
params.put("Authorization Data URL", null);
params.put("Transaction Buffer Size", 10000);
params.put("Query Index Strategy", QueryIndexStrategyType.HEURISTIC_MATCH.toString());
return params;
}
示例2: createDataStore
import org.apache.accumulo.core.client.Instance; //导入方法依赖的package包/类
private static DataStore createDataStore(final Configuration conf) throws IOException {
// get the configuration parameters
final Instance instance = ConfigUtils.getInstance(conf);
final boolean useMock = instance instanceof MockInstance;
final String instanceId = instance.getInstanceName();
final String zookeepers = instance.getZooKeepers();
final String user = ConfigUtils.getUsername(conf);
final String password = ConfigUtils.getPassword(conf);
final String auths = ConfigUtils.getAuthorizations(conf).toString();
final String tableName = getTableName(conf);
final int numParitions = OptionalConfigUtils.getGeoNumPartitions(conf);
final String featureSchemaFormat = "%~#s%" + numParitions + "#r%" + FEATURE_NAME
+ "#cstr%0,3#gh%yyyyMMdd#d::%~#s%3,2#gh::%~#s%#id";
// build the map of parameters
final Map<String, Serializable> params = new HashMap<String, Serializable>();
params.put("instanceId", instanceId);
params.put("zookeepers", zookeepers);
params.put("user", user);
params.put("password", password);
params.put("auths", auths);
params.put("tableName", tableName);
params.put("indexSchemaFormat", featureSchemaFormat);
params.put("useMock", Boolean.toString(useMock));
// fetch the data store from the finder
return DataStoreFinder.getDataStore(params);
}