org.apache.hadoop.hbase.io.hfile.HFile.isReservedFileInfoKey()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(3.0k)|赞(0)|评价(0)|浏览(104)

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

HFile.isReservedFileInfoKey介绍

[英]Return true if the given file info key is reserved for internal use.
[中]如果给定的文件信息密钥保留供内部使用,则返回true。

代码示例

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

private static boolean shouldCopyHFileMetaKey(byte[] key) {
 // skip encoding to keep hfile meta consistent with data block info, see HBASE-15085
 if (Bytes.equals(key, HFileDataBlockEncoder.DATA_BLOCK_ENCODING)) {
  return false;
 }
 return !HFile.isReservedFileInfoKey(key);
}

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

/**
 * Append the given key/value pair to the file info, optionally checking the
 * key prefix.
 *
 * @param k key to add
 * @param v value to add
 * @param checkPrefix whether to check that the provided key does not start
 *          with the reserved prefix
 * @return this file info object
 * @throws IOException if the key or value is invalid
 */
public FileInfo append(final byte[] k, final byte[] v,
  final boolean checkPrefix) throws IOException {
 if (k == null || v == null) {
  throw new NullPointerException("Key nor value may be null");
 }
 if (checkPrefix && isReservedFileInfoKey(k)) {
  throw new IOException("Keys with a " + FileInfo.RESERVED_PREFIX
    + " are reserved");
 }
 put(k, v);
 return this;
}

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

private static boolean shouldCopyHFileMetaKey(byte[] key) {
 return !HFile.isReservedFileInfoKey(key);
}

代码示例来源:origin: harbby/presto-connectors

private static boolean shouldCopyHFileMetaKey(byte[] key) {
 // skip encoding to keep hfile meta consistent with data block info, see HBASE-15085
 if (Bytes.equals(key, HFileDataBlockEncoder.DATA_BLOCK_ENCODING)) {
  return false;
 }
 return !HFile.isReservedFileInfoKey(key);
}

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

/**
 * Append the given key/value pair to the file info, optionally checking the
 * key prefix.
 *
 * @param k key to add
 * @param v value to add
 * @param checkPrefix whether to check that the provided key does not start
 *          with the reserved prefix
 * @return this file info object
 * @throws IOException if the key or value is invalid
 */
public FileInfo append(final byte[] k, final byte[] v,
  final boolean checkPrefix) throws IOException {
 if (k == null || v == null) {
  throw new NullPointerException("Key nor value may be null");
 }
 if (checkPrefix && isReservedFileInfoKey(k)) {
  throw new IOException("Keys with a " + FileInfo.RESERVED_PREFIX
    + " are reserved");
 }
 put(k, v);
 return this;
}

代码示例来源:origin: harbby/presto-connectors

/**
 * Append the given key/value pair to the file info, optionally checking the
 * key prefix.
 *
 * @param k key to add
 * @param v value to add
 * @param checkPrefix whether to check that the provided key does not start
 *          with the reserved prefix
 * @return this file info object
 * @throws IOException if the key or value is invalid
 */
public FileInfo append(final byte[] k, final byte[] v,
  final boolean checkPrefix) throws IOException {
 if (k == null || v == null) {
  throw new NullPointerException("Key nor value may be null");
 }
 if (checkPrefix && isReservedFileInfoKey(k)) {
  throw new IOException("Keys with a " + FileInfo.RESERVED_PREFIX
    + " are reserved");
 }
 put(k, v);
 return this;
}

相关文章