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); }
/** * 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; }
private static boolean shouldCopyHFileMetaKey(byte[] key) { return !HFile.isReservedFileInfoKey(key); }
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); }
/** * 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; }
/** * 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; }