org.apache.hadoop.hbase.util.Bytes.mapKey()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(6.4k)|赞(0)|评价(0)|浏览(83)

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

Bytes.mapKey介绍

暂无

代码示例

代码示例来源:origin: apache/phoenix

public ServerCache createServerCache(byte[] cacheId, QueryPlan delegate)
    throws SQLException, IOException {
  PTable cacheUsingTable = delegate.getTableRef().getTable();
  ConnectionQueryServices services = delegate.getContext().getConnection().getQueryServices();
  List<HRegionLocation> locations = services.getAllTableRegions(
      cacheUsingTable.getPhysicalName().getBytes());
  int nRegions = locations.size();
  Set<HRegionLocation> servers = new HashSet<>(nRegions);
  cacheUsingTableMap.put(Bytes.mapKey(cacheId), cacheUsingTable);
  return new ServerCache(cacheId, servers, new ImmutableBytesWritable(
      new byte[]{}), services, false);
}

代码示例来源:origin: forcedotcom/phoenix

ConnectionQueryServices services = connection.getQueryServices();
Throwable lastThrowable = null;
TableRef cacheUsingTableRef = cacheUsingTableRefMap.get(Bytes.mapKey(cacheId));
byte[] tableName = cacheUsingTableRef.getTable().getPhysicalName().getBytes();
HTableInterface iterateOverTable = services.getTable(tableName);

代码示例来源:origin: apache/phoenix

ConnectionQueryServices services = connection.getQueryServices();
Throwable lastThrowable = null;
final PTable cacheUsingTable = cacheUsingTableMap.get(Bytes.mapKey(cacheId));
byte[] tableName = cacheUsingTable.getPhysicalName().getBytes();
iterateOverTable = services.getTable(tableName);

代码示例来源:origin: apache/phoenix

cacheUsingTableMap.put(Bytes.mapKey(cacheId), cacheUsingTable);
  success = true;
} catch (SQLException e) {

代码示例来源:origin: forcedotcom/phoenix

cacheUsingTableRefMap.put(Bytes.mapKey(cacheId), cacheUsingTableRef);
  success = true;
} catch (SQLException e) {

代码示例来源:origin: alibaba/wasp

@Override
public void setEntityGroupCachePrefetch(byte[] tableName, boolean enable) {
 if (!enable) {
  entityGroupCachePrefetchDisabledTables.add(Bytes.mapKey(tableName));
 } else {
  entityGroupCachePrefetchDisabledTables.remove(Bytes.mapKey(tableName));
 }
}

代码示例来源:origin: alibaba/wasp

@Override
public void clearEntityGroupCache(byte[] tableName) {
 synchronized (this.cachedEntityGroupLocations) {
  this.cachedEntityGroupLocations.remove(Bytes.mapKey(tableName));
 }
}

代码示例来源:origin: alibaba/wasp

@Override
public boolean getEntityGroupCachePrefetch(byte[] tableName) {
 return !entityGroupCachePrefetchDisabledTables.contains(Bytes
   .mapKey(tableName));
}

代码示例来源:origin: co.cask.hbase/hbase

@Override
public void clearRegionCache(final byte [] tableName) {
 synchronized (this.cachedRegionLocations) {
  this.cachedRegionLocations.remove(Bytes.mapKey(tableName));
 }
}

代码示例来源:origin: co.cask.hbase/hbase

public void setRegionCachePrefetch(final byte[] tableName,
  final boolean enable) {
 if (!enable) {
  regionCachePrefetchDisabledTables.add(Bytes.mapKey(tableName));
 }
 else {
  regionCachePrefetchDisabledTables.remove(Bytes.mapKey(tableName));
 }
}

代码示例来源:origin: co.cask.hbase/hbase

public boolean getRegionCachePrefetch(final byte[] tableName) {
 return !regionCachePrefetchDisabledTables.contains(Bytes.mapKey(tableName));
}

代码示例来源:origin: alibaba/wasp

int getNumberOfCachedEntityGroupLocations(final byte[] tableName) {
 Integer key = Bytes.mapKey(tableName);
 synchronized (this.cachedEntityGroupLocations) {
  Map<byte[], EntityGroupLocation> tableLocs = this.cachedEntityGroupLocations
    .get(key);
  if (tableLocs == null) {
   return 0;
  }
  return tableLocs.values().size();
 }
}

代码示例来源:origin: co.cask.hbase/hbase

int getNumberOfCachedRegionLocations(final byte[] tableName) {
 Integer key = Bytes.mapKey(tableName);
 synchronized (this.cachedRegionLocations) {
  Map<byte[], HRegionLocation> tableLocs =
   this.cachedRegionLocations.get(key);
  if (tableLocs == null) {
   return 0;
  }
  return tableLocs.values().size();
 }
}

代码示例来源:origin: co.cask.hbase/hbase

private SoftValueSortedMap<byte [], HRegionLocation> getTableLocations(
  final byte [] tableName) {
 // find the map of cached locations for this table
 Integer key = Bytes.mapKey(tableName);
 SoftValueSortedMap<byte [], HRegionLocation> result;
 synchronized (this.cachedRegionLocations) {
  result = this.cachedRegionLocations.get(key);
  // if tableLocations for this table isn't built yet, make one
  if (result == null) {
   result = new SoftValueSortedMap<byte [], HRegionLocation>(
     Bytes.BYTES_COMPARATOR);
   this.cachedRegionLocations.put(key, result);
  }
 }
 return result;
}

代码示例来源:origin: alibaba/wasp

private SoftValueSortedMap<byte[], EntityGroupLocation> getTableLocations(
  final byte[] tableName) {
 // find the map of cached locations for this table
 Integer key = Bytes.mapKey(tableName);
 SoftValueSortedMap<byte[], EntityGroupLocation> result;
 synchronized (this.cachedEntityGroupLocations) {
  result = this.cachedEntityGroupLocations.get(key);
  // if tableLocations for this table isn't built yet, make one
  if (result == null) {
   result = new SoftValueSortedMap<byte[], EntityGroupLocation>(
     Bytes.BYTES_COMPARATOR);
   this.cachedEntityGroupLocations.put(key, result);
  }
 }
 return result;
}

代码示例来源:origin: com.aliyun.phoenix/ali-phoenix-core

public ServerCache createServerCache(byte[] cacheId, QueryPlan delegate)
    throws SQLException, IOException {
  PTable cacheUsingTable = delegate.getTableRef().getTable();
  ConnectionQueryServices services = delegate.getContext().getConnection().getQueryServices();
  List<HRegionLocation> locations = services.getAllTableRegions(
      cacheUsingTable.getPhysicalName().getBytes());
  int nRegions = locations.size();
  Set<HRegionLocation> servers = new HashSet<>(nRegions);
  cacheUsingTableMap.put(Bytes.mapKey(cacheId), cacheUsingTable);
  return new ServerCache(cacheId, servers, new ImmutableBytesWritable(
      new byte[]{}), services, false);
}

代码示例来源:origin: com.aliyun.phoenix/ali-phoenix-core

cacheUsingTableMap.put(Bytes.mapKey(cacheId), cacheUsingTable);
  success = true;
} catch (SQLException e) {

代码示例来源:origin: com.aliyun.phoenix/ali-phoenix-core

ConnectionQueryServices services = connection.getQueryServices();
Throwable lastThrowable = null;
final PTable cacheUsingTable = cacheUsingTableMap.get(Bytes.mapKey(cacheId));
byte[] tableName = cacheUsingTable.getPhysicalName().getBytes();
iterateOverTable = services.getTable(tableName);

代码示例来源:origin: org.apache.phoenix/phoenix-core

ConnectionQueryServices services = connection.getQueryServices();
Throwable lastThrowable = null;
final PTable cacheUsingTable = cacheUsingTableMap.get(Bytes.mapKey(cacheId));
byte[] tableName = cacheUsingTable.getPhysicalName().getBytes();
iterateOverTable = services.getTable(tableName);

代码示例来源:origin: org.apache.phoenix/phoenix-core

cacheUsingTableMap.put(Bytes.mapKey(cacheId), cacheUsingTable);
  success = true;
} catch (SQLException e) {

相关文章

微信公众号

最新文章

更多