本文整理了Java中org.apache.accumulo.core.client.Instance.getInstanceID()
方法的一些代码示例,展示了Instance.getInstanceID()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Instance.getInstanceID()
方法的具体详情如下:
包路径:org.apache.accumulo.core.client.Instance
类名称:Instance
方法名:getInstanceID
[英]Returns a unique string that identifies this instance of accumulo.
[中]返回标识此accumulo实例的唯一字符串。
代码示例来源:origin: org.apache.accumulo/accumulo-server-base
@Override
public TCredentials toThrift(Instance instance) {
if (!AS_THRIFT.getInstanceId().equals(instance.getInstanceID()))
throw new IllegalArgumentException("Unexpected instance used for "
+ SystemCredentials.class.getSimpleName() + ": " + instance.getInstanceID());
return AS_THRIFT;
}
代码示例来源:origin: NationalSecurityAgency/datawave
private static String getKey(Instance instance, String metadataTableName, Set<Authorizations> auths) {
StringBuilder builder = new StringBuilder();
builder.append(instance.getInstanceID()).append('\0');
builder.append(metadataTableName).append('\0');
builder.append(auths);
return builder.toString();
}
代码示例来源:origin: org.apache.accumulo/accumulo-server-base
public ServerConfigurationFactory(Instance instance) {
this.instance = instance;
instanceID = instance.getInstanceID();
addInstanceToCaches(instanceID);
}
代码示例来源:origin: org.apache.accumulo/accumulo-server-base
private UniqueNameAllocator() {
nextNamePath = Constants.ZROOT + "/" + HdfsZooInstance.getInstance().getInstanceID()
+ Constants.ZNEXT_FILE;
rand = new Random();
}
代码示例来源:origin: org.apache.accumulo/accumulo-server-base
private String getPath() {
return ZooUtil.getRoot(instance.getInstanceID()) + Constants.ZTABLES + "/" + tableId
+ Constants.ZTABLE_CONF;
}
代码示例来源:origin: org.apache.accumulo/accumulo-tserver
long getCompactionCancelID() {
String zTablePath = Constants.ZROOT + "/" + tabletServer.getInstance().getInstanceID()
+ Constants.ZTABLES + "/" + extent.getTableId() + Constants.ZTABLE_COMPACT_CANCEL_ID;
try {
return Long
.parseLong(new String(ZooReaderWriter.getInstance().getData(zTablePath, null), UTF_8));
} catch (KeeperException e) {
throw new RuntimeException(e);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
代码示例来源:origin: org.apache.accumulo/accumulo-server-base
protected SecurityOperation(AccumuloServerContext context) {
this.context = context;
ZKUserPath = Constants.ZROOT + "/" + context.getInstance().getInstanceID() + "/users";
zooCache = new ZooCache();
}
代码示例来源:origin: org.apache.accumulo/accumulo-server-base
public void addTable(String tableId, String namespaceId, String tableName,
NodeExistsPolicy existsPolicy)
throws KeeperException, InterruptedException, NamespaceNotFoundException {
prepareNewTableState(instance.getInstanceID(), tableId, namespaceId, tableName, TableState.NEW,
existsPolicy);
updateTableStateCache(tableId);
}
代码示例来源:origin: org.apache.accumulo/accumulo-server
long getCompactionCancelID() {
String zTablePath = Constants.ZROOT + "/" + HdfsZooInstance.getInstance().getInstanceID() + Constants.ZTABLES + "/" + extent.getTableId()
+ Constants.ZTABLE_COMPACT_CANCEL_ID;
try {
return Long.parseLong(new String(ZooReaderWriter.getRetryingInstance().getData(zTablePath, null), UTF_8));
} catch (KeeperException e) {
throw new RuntimeException(e);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
代码示例来源:origin: org.apache.accumulo/accumulo-server
public static synchronized SecurityOperation getInstance() {
String instanceId = HdfsZooInstance.getInstance().getInstanceID();
return getInstance(instanceId, false);
}
代码示例来源:origin: org.apache.accumulo/accumulo-server
public static void main(String[] args) {
Instance instance = HdfsZooInstance.getInstance();
System.out.println("Instance Name: " + instance.getInstanceName());
System.out.println("Instance ID: " + instance.getInstanceID());
System.out.println("ZooKeepers: " + instance.getZooKeepers());
System.out.println("Masters: " + StringUtil.join(instance.getMasterLocations(), ", "));
}
代码示例来源:origin: org.apache.accumulo/accumulo-server
public void clearMergeState(Text tableId) throws IOException, KeeperException, InterruptedException {
synchronized (mergeLock) {
String path = ZooUtil.getRoot(instance.getInstanceID()) + Constants.ZTABLES + "/" + tableId.toString() + "/merge";
ZooReaderWriter.getInstance().recursiveDelete(path, NodeMissingPolicy.SKIP);
mergeLock.notifyAll();
}
nextEvent.event("Merge state of %s cleared", tableId);
}
代码示例来源:origin: org.apache.accumulo/accumulo-proxy
protected Connector getConnector(ByteBuffer login) throws Exception {
String[] pair = ByteBufferUtil.toString(login).split(",", 2);
if (instance.getInstanceID().equals(pair[0])) {
Credentials creds = Credentials.deserialize(pair[1]);
return instance.getConnector(creds.getPrincipal(), creds.getToken());
} else {
throw new org.apache.accumulo.core.client.AccumuloSecurityException(pair[0],
org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode.INVALID_INSTANCEID);
}
}
代码示例来源:origin: org.apache.accumulo/accumulo-master
public void clearMergeState(String tableId)
throws IOException, KeeperException, InterruptedException {
synchronized (mergeLock) {
String path = ZooUtil.getRoot(getInstance().getInstanceID()) + Constants.ZTABLES + "/"
+ tableId + "/merge";
ZooReaderWriter.getInstance().recursiveDelete(path, NodeMissingPolicy.SKIP);
mergeLock.notifyAll();
}
nextEvent.event("Merge state of %s cleared", tableId);
}
代码示例来源:origin: org.apache.accumulo/accumulo-server
private static void deleteInstance(Instance origInstance, String oldPass) throws Exception {
IZooReaderWriter orig = new ZooReaderWriter(origInstance.getZooKeepers(), origInstance.getZooKeepersSessionTimeOut(), oldPass);
orig.recursiveDelete("/accumulo/" + origInstance.getInstanceID(), NodeMissingPolicy.SKIP);
}
}
代码示例来源:origin: org.apache.accumulo/accumulo-server
synchronized public static ZooConfiguration getInstance(Instance inst, AccumuloConfiguration parent) {
if (instance == null) {
propCache = new ZooCache(inst.getZooKeepers(), inst.getZooKeepersSessionTimeOut());
instance = new ZooConfiguration(parent);
instanceId = inst.getInstanceID();
}
return instance;
}
代码示例来源:origin: org.apache.accumulo/accumulo-core
public static void clearCache(Instance instance) {
getZooCache(instance).clear(ZooUtil.getRoot(instance) + Constants.ZTABLES);
getZooCache(instance).clear(ZooUtil.getRoot(instance) + Constants.ZNAMESPACES);
instanceToMapCache.invalidate(instance.getInstanceID());
}
代码示例来源:origin: org.apache.accumulo/accumulo-server-base
public static synchronized SecurityOperation getInstance(AccumuloServerContext context,
boolean initialize) {
if (instance == null) {
String instanceId = context.getInstance().getInstanceID();
instance = new AuditedSecurityOperation(context, getAuthorizor(instanceId, initialize),
getAuthenticator(instanceId, initialize), getPermHandler(instanceId, initialize));
}
return instance;
}
代码示例来源:origin: org.apache.accumulo/accumulo-server-base
public static synchronized SecurityOperation getInstance(AccumuloServerContext context,
boolean initialize) {
if (instance == null) {
String instanceId = context.getInstance().getInstanceID();
instance = new SecurityOperation(context, getAuthorizor(instanceId, initialize),
getAuthenticator(instanceId, initialize), getPermHandler(instanceId, initialize));
}
return instance;
}
代码示例来源:origin: org.apache.accumulo/accumulo-shell
public void printInfo() throws IOException {
reader.print("\n" + SHELL_DESCRIPTION + "\n" + "- \n" + "- version: " + Constants.VERSION + "\n"
+ "- instance name: " + connector.getInstance().getInstanceName() + "\n" + "- instance id: "
+ connector.getInstance().getInstanceID() + "\n" + "- \n"
+ "- type 'help' for a list of available commands\n" + "- \n");
reader.flush();
}
内容来源于网络,如有侵权,请联系作者删除!