gpt4 book ai didi

org.apache.accumulo.core.client.ZooKeeperInstance.getConfiguration()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-17 01:00:40 24 4
gpt4 key购买 nike

本文整理了Java中org.apache.accumulo.core.client.ZooKeeperInstance.getConfiguration()方法的一些代码示例,展示了ZooKeeperInstance.getConfiguration()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZooKeeperInstance.getConfiguration()方法的具体详情如下:
包路径:org.apache.accumulo.core.client.ZooKeeperInstance
类名称:ZooKeeperInstance
方法名:getConfiguration

ZooKeeperInstance.getConfiguration介绍

暂无

代码示例

代码示例来源:origin: Accla/graphulo

public String locateTablet(String tableName, String splitName) {
  String tabletName = null;
  try {
    //${accumulo.VERSION.1.6}TabletLocator tc = TabletLocator.getLocator(instance, new Text(Tables.getTableId(instance, tableName))); // 1.6 change to getLocator for 1.6
 ClientContext cc = new ClientContext(instance, new Credentials(principal, token), instance.getConfiguration()); // 1.7
    // Change in API in 1.7 and 1.8 -- second parameter is String instead of Text
    String str = Tables.getTableId(instance, tableName);
    TabletLocator tc = getTabletLocator(cc, str); // use dynamic invocation to cross the API change
    
    org.apache.accumulo.core.client.impl.TabletLocator.TabletLocation loc =
        //${accumulo.VERSION.1.6}tc.locateTablet(new Credentials(principal, token), new Text(splitName), false, false); // 1.6
   tc.locateTablet(cc, new Text(splitName), false, false); // 1.7
    tabletName = loc.tablet_location;
    log.debug("TableName="+tableName+", TABLET_NAME = "+tabletName);
  } catch (TableNotFoundException | AccumuloException | AccumuloSecurityException e) {
    log.warn("",e);
    e.printStackTrace();
  }
return tabletName;
}

代码示例来源:origin: Accla/graphulo

public MasterClientService.Client getMasterClient() throws TTransportException {
  //${accumulo.VERSION.1.6}return MasterClient.getConnection(getInstance()); // 1.6
return MasterClient.getConnection(new ClientContext(instance, new Credentials(principal, token), instance.getConfiguration())); // 1.7
}

代码示例来源:origin: Accla/graphulo

public TabletClientService.Iface getTabletClient (String tserverAddress) throws TTransportException {
  com.google.common.net.HostAndPort address = AddressUtil.parseAddress(tserverAddress,false);
//${accumulo.VERSION.1.6}return ThriftUtil.getTServerClient( tserverAddress, instance.getConfiguration()); // 1.6
return ThriftUtil.getTServerClient( address, new ClientContext(instance, new Credentials(principal, token), instance.getConfiguration())); // 1.7
}

代码示例来源:origin: org.teiid.connectors/connector-accumulo

private void checkTabletServerExists(ZooKeeperInstance inst, String userName, String password)
    throws ResourceException {
  ClientService.Client client = null;
  try {
    Pair<String,Client> pair = ServerClient.getConnection(new ClientContext(inst, new Credentials(userName, new PasswordToken(password)), inst.getConfiguration()), true, 10);
    client = pair.getSecond();
  } catch (TTransportException e) {
    throw new ResourceException(AccumuloManagedConnectionFactory.UTIL.getString("no_tserver"), e);
  } finally {
    if (client != null) {
      ServerClient.close(client);
    }
  }
}

代码示例来源:origin: org.teiid.wildfly.connectors/connector-accumulo

private void checkTabletServerExists(ZooKeeperInstance inst, String userName, String password)
    throws ResourceException {
  ClientService.Client client = null;
  try {
    Pair<String,Client> pair = ServerClient.getConnection(new ClientContext(inst, new Credentials(userName, new PasswordToken(password)), inst.getConfiguration()), true, 10);
    client = pair.getSecond();
  } catch (TTransportException e) {
    throw new ResourceException(AccumuloManagedConnectionFactory.UTIL.getString("no_tserver"), e);
  } finally {
    if (client != null) {
      ServerClient.close(client);
    }
  }
}

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com