public static List<THRegionLocation> regionLocationsFromHBase(List<HRegionLocation> locations) { List<THRegionLocation> tlocations = new ArrayList<>(locations.size()); for (HRegionLocation hrl:locations) { tlocations.add(regionLocationFromHBase(hrl)); } return tlocations; }
@Override public THRegionLocation getRegionLocation(ByteBuffer table, ByteBuffer row, boolean reload) throws TIOError, TException { RegionLocator locator = null; try { locator = getLocator(table); byte[] rowBytes = byteBufferToByteArray(row); HRegionLocation hrl = locator.getRegionLocation(rowBytes, reload); return ThriftUtilities.regionLocationFromHBase(hrl); } catch (IOException e) { throw getTIOError(e); } finally { if (locator != null) { try { locator.close(); } catch (IOException e) { LOG.warn("Couldn't close the locator.", e); } } } }
public static List<THRegionLocation> regionLocationsFromHBase(List<HRegionLocation> locations) { List<THRegionLocation> tlocations = new ArrayList<>(locations.size()); for (HRegionLocation hrl:locations) { tlocations.add(regionLocationFromHBase(hrl)); } return tlocations; }
public static List<THRegionLocation> regionLocationsFromHBase(List<HRegionLocation> locations) { List<THRegionLocation> tlocations = new ArrayList<>(locations.size()); for (HRegionLocation hrl:locations) { tlocations.add(regionLocationFromHBase(hrl)); } return tlocations; }
@Override public THRegionLocation getRegionLocation(ByteBuffer table, ByteBuffer row, boolean reload) throws TIOError, TException { RegionLocator locator = null; try { locator = getLocator(table); byte[] rowBytes = byteBufferToByteArray(row); HRegionLocation hrl = locator.getRegionLocation(rowBytes, reload); return ThriftUtilities.regionLocationFromHBase(hrl); } catch (IOException e) { throw getTIOError(e); } finally { if (locator != null) { try { locator.close(); } catch (IOException e) { LOG.warn("Couldn't close the locator.", e); } } } }
@Override public THRegionLocation getRegionLocation(ByteBuffer table, ByteBuffer row, boolean reload) throws TIOError, TException { RegionLocator locator = null; try { locator = getLocator(table); byte[] rowBytes = byteBufferToByteArray(row); HRegionLocation hrl = locator.getRegionLocation(rowBytes, reload); return ThriftUtilities.regionLocationFromHBase(hrl); } catch (IOException e) { throw getTIOError(e); } finally { if (locator != null) { try { locator.close(); } catch (IOException e) { LOG.warn("Couldn't close the locator.", e); } } } }