/** * Parses all the HRegionInfo instances from the passed in stream until EOF. Presumes the * HRegionInfo's were serialized to the stream with {@link #toDelimitedByteArray()} * @param bytes serialized bytes * @param offset the start offset into the byte[] buffer * @param length how far we should read into the byte[] buffer * @return All the hregioninfos that are in the byte array. Keeps reading till we hit the end. * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0 * Use {@link RegionInfo#parseDelimitedFrom(byte[], int, int)}. */ @Deprecated public static List<HRegionInfo> parseDelimitedFrom(final byte[] bytes, final int offset, final int length) throws IOException { if (bytes == null) { throw new IllegalArgumentException("Can't build an object with empty bytes array"); } DataInputBuffer in = new DataInputBuffer(); List<HRegionInfo> hris = new ArrayList<>(); try { in.reset(bytes, offset, length); while (in.available() > 0) { HRegionInfo hri = parseFrom(in); hris.add(hri); } } finally { in.close(); } return hris; }
/** * Parses all the RegionInfo instances from the passed in stream until EOF. Presumes the * RegionInfo's were serialized to the stream with oDelimitedByteArray() * @param bytes serialized bytes * @param offset the start offset into the byte[] buffer * @param length how far we should read into the byte[] buffer * @return All the RegionInfos that are in the byte array. Keeps reading till we hit the end. * @throws IOException */ static List<RegionInfo> parseDelimitedFrom(final byte[] bytes, final int offset, final int length) throws IOException { if (bytes == null) { throw new IllegalArgumentException("Can't build an object with empty bytes array"); } DataInputBuffer in = new DataInputBuffer(); List<RegionInfo> ris = new ArrayList<>(); try { in.reset(bytes, offset, length); while (in.available() > 0) { RegionInfo ri = parseFrom(in); ris.add(ri); } } finally { in.close(); } return ris; } }
private Set<KeyExtent> parseMigrations(String migrations) { if (migrations == null) return Collections.emptySet(); try { Set<KeyExtent> result = new HashSet<>(); DataInputBuffer buffer = new DataInputBuffer(); byte[] data = Base64.getDecoder().decode(migrations); buffer.reset(data, data.length); while (buffer.available() > 0) { KeyExtent extent = new KeyExtent(); extent.readFields(buffer); result.add(extent); } return result; } catch (Exception ex) { throw new RuntimeException(ex); } }
private Map<Table.ID,MergeInfo> parseMerges(String merges) { if (merges == null) return null; try { Map<Table.ID,MergeInfo> result = new HashMap<>(); DataInputBuffer buffer = new DataInputBuffer(); byte[] data = Base64.getDecoder().decode(merges); buffer.reset(data, data.length); while (buffer.available() > 0) { MergeInfo mergeInfo = new MergeInfo(); mergeInfo.readFields(buffer); result.put(mergeInfo.extent.getTableId(), mergeInfo); } return result; } catch (Exception ex) { throw new RuntimeException(ex); } }
/** * Parses all the HRegionInfo instances from the passed in stream until EOF. Presumes the * HRegionInfo's were serialized to the stream with {@link #toDelimitedByteArray()} * @param bytes serialized bytes * @param offset the start offset into the byte[] buffer * @param length how far we should read into the byte[] buffer * @return All the hregioninfos that are in the byte array. Keeps reading till we hit the end. * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0 * Use {@link RegionInfo#parseDelimitedFrom(byte[], int, int)}. */ @Deprecated public static List<HRegionInfo> parseDelimitedFrom(final byte[] bytes, final int offset, final int length) throws IOException { if (bytes == null) { throw new IllegalArgumentException("Can't build an object with empty bytes array"); } DataInputBuffer in = new DataInputBuffer(); List<HRegionInfo> hris = new ArrayList<>(); try { in.reset(bytes, offset, length); while (in.available() > 0) { HRegionInfo hri = parseFrom(in); hris.add(hri); } } finally { in.close(); } return hris; }
/** * Parses all the RegionInfo instances from the passed in stream until EOF. Presumes the * RegionInfo's were serialized to the stream with oDelimitedByteArray() * @param bytes serialized bytes * @param offset the start offset into the byte[] buffer * @param length how far we should read into the byte[] buffer * @return All the RegionInfos that are in the byte array. Keeps reading till we hit the end. * @throws IOException */ static List<RegionInfo> parseDelimitedFrom(final byte[] bytes, final int offset, final int length) throws IOException { if (bytes == null) { throw new IllegalArgumentException("Can't build an object with empty bytes array"); } DataInputBuffer in = new DataInputBuffer(); List<RegionInfo> ris = new ArrayList<>(); try { in.reset(bytes, offset, length); while (in.available() > 0) { RegionInfo ri = parseFrom(in); ris.add(ri); } } finally { in.close(); } return ris; } }
public int available() throws IOException { return din.available(); } public boolean markSupport() { return false; }
public int available() throws IOException { return din.available(); } public boolean markSupport() { return false; }
private Set<KeyExtent> parseMigrations(String migrations) { if (migrations == null) return Collections.emptySet(); try { Set<KeyExtent> result = new HashSet<KeyExtent>(); DataInputBuffer buffer = new DataInputBuffer(); byte[] data = Base64.decodeBase64(migrations.getBytes(UTF_8)); buffer.reset(data, data.length); while (buffer.available() > 0) { KeyExtent extent = new KeyExtent(); extent.readFields(buffer); result.add(extent); } return result; } catch (Exception ex) { throw new RuntimeException(ex); } }
private Set<KeyExtent> parseMigrations(String migrations) { if (migrations == null) return Collections.emptySet(); try { Set<KeyExtent> result = new HashSet<>(); DataInputBuffer buffer = new DataInputBuffer(); byte[] data = Base64.decodeBase64(migrations.getBytes(UTF_8)); buffer.reset(data, data.length); while (buffer.available() > 0) { KeyExtent extent = new KeyExtent(); extent.readFields(buffer); result.add(extent); } return result; } catch (Exception ex) { throw new RuntimeException(ex); } }
private Map<Text,MergeInfo> parseMerges(String merges) { if (merges == null) return null; try { Map<Text,MergeInfo> result = new HashMap<Text,MergeInfo>(); DataInputBuffer buffer = new DataInputBuffer(); byte[] data = Base64.decodeBase64(merges.getBytes(UTF_8)); buffer.reset(data, data.length); while (buffer.available() > 0) { MergeInfo mergeInfo = new MergeInfo(); mergeInfo.readFields(buffer); result.put(mergeInfo.range.getTableId(), mergeInfo); } return result; } catch (Exception ex) { throw new RuntimeException(ex); } }
/** * Parses all the HRegionInfo instances from the passed in stream until EOF. Presumes the * HRegionInfo's were serialized to the stream with {@link #toDelimitedByteArray()} * @param bytes serialized bytes * @param offset the start offset into the byte[] buffer * @param length how far we should read into the byte[] buffer * @return All the hregioninfos that are in the byte array. Keeps reading till we hit the end. * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0 * Use {@link RegionInfo#parseDelimitedFrom(byte[], int, int)}. */ @Deprecated public static List<HRegionInfo> parseDelimitedFrom(final byte[] bytes, final int offset, final int length) throws IOException { if (bytes == null) { throw new IllegalArgumentException("Can't build an object with empty bytes array"); } DataInputBuffer in = new DataInputBuffer(); List<HRegionInfo> hris = new ArrayList<>(); try { in.reset(bytes, offset, length); while (in.available() > 0) { HRegionInfo hri = parseFrom(in); hris.add(hri); } } finally { in.close(); } return hris; }
private Map<String,MergeInfo> parseMerges(String merges) { if (merges == null) return null; try { Map<String,MergeInfo> result = new HashMap<>(); DataInputBuffer buffer = new DataInputBuffer(); byte[] data = Base64.decodeBase64(merges.getBytes(UTF_8)); buffer.reset(data, data.length); while (buffer.available() > 0) { MergeInfo mergeInfo = new MergeInfo(); mergeInfo.readFields(buffer); result.put(mergeInfo.extent.getTableId(), mergeInfo); } return result; } catch (Exception ex) { throw new RuntimeException(ex); } }
/** * Parses all the HRegionInfo instances from the passed in stream until EOF. Presumes the * HRegionInfo's were serialized to the stream with {@link #toDelimitedByteArray()} * @param bytes serialized bytes * @param offset the start offset into the byte[] buffer * @param length how far we should read into the byte[] buffer * @return All the hregioninfos that are in the byte array. Keeps reading till we hit the end. */ public static List<HRegionInfo> parseDelimitedFrom(final byte[] bytes, final int offset, final int length) throws IOException { if (bytes == null) { throw new IllegalArgumentException("Can't build an object with empty bytes array"); } DataInputBuffer in = new DataInputBuffer(); List<HRegionInfo> hris = new ArrayList<HRegionInfo>(); try { in.reset(bytes, offset, length); while (in.available() > 0) { HRegionInfo hri = parseFrom(in); hris.add(hri); } } finally { in.close(); } return hris; }
/** * Parses all the RegionInfo instances from the passed in stream until EOF. Presumes the * RegionInfo's were serialized to the stream with oDelimitedByteArray() * @param bytes serialized bytes * @param offset the start offset into the byte[] buffer * @param length how far we should read into the byte[] buffer * @return All the RegionInfos that are in the byte array. Keeps reading till we hit the end. * @throws IOException */ static List<RegionInfo> parseDelimitedFrom(final byte[] bytes, final int offset, final int length) throws IOException { if (bytes == null) { throw new IllegalArgumentException("Can't build an object with empty bytes array"); } DataInputBuffer in = new DataInputBuffer(); List<RegionInfo> ris = new ArrayList<>(); try { in.reset(bytes, offset, length); while (in.available() > 0) { RegionInfo ri = parseFrom(in); ris.add(ri); } } finally { in.close(); } return ris; } }
try { in.reset(bytes, offset, length); while (in.available() > 0) { EntityGroupInfo egi = parseFrom(in); egis.add(egi);
/** * @param bytes serialized bytes * @return All the hregioninfos that are in the byte array. Keeps reading * till we hit the end. * @throws IOException e */ public static List<HRegionInfo> getHRegionInfos(final byte [] bytes, final int offset, final int length) throws IOException { if (bytes == null) { throw new IllegalArgumentException("Can't build a writable with empty " + "bytes array"); } DataInputBuffer in = new DataInputBuffer(); List<HRegionInfo> hris = new ArrayList<HRegionInfo>(); try { in.reset(bytes, offset, length); while (in.available() > 0) { HRegionInfo hri = new HRegionInfo(); hri.readFields(in); hris.add(hri); } } finally { in.close(); } return hris; }