@Override public ByteArray convert(final String value) { return new ByteArray(value); } }
@Override public ByteArray convert(final String value) { return new ByteArray(value); } }
@Override public GeowaveColumnId apply(final String input) { return new ByteArrayColumnId(new ByteArray(input)); } }));
public static Set<ByteArray> getPartitions(final String directory, final String tableNamePrefix) { return Arrays.stream( new File(directory).list((dir, name) -> name.startsWith(tableNamePrefix))).map( str -> str.length() > (tableNamePrefix.length() + 1) ? new ByteArray( ByteArrayUtils.byteArrayFromString(str.substring(tableNamePrefix.length() + 1))) : new ByteArray()).collect(Collectors.toSet()); }
@Override public void fromBinary(byte[] bytes) { final ByteBuffer buf = ByteBuffer.wrap(bytes); this.internalAdapterId = VarintUtils.readUnsignedShort(buf); final byte[] adapterIdBytes = new byte[buf.remaining()]; buf.get(adapterIdBytes); this.adapterId = new ByteArray(adapterIdBytes); } }
@Override public void removeIndex(final String indexName) { remove(new ByteArray(indexName)); } }
@Override public boolean accept( final CommonIndexModel indexModel, final IndexedPersistenceEncoding persistenceEncoding) { return dataIds.contains(new ByteArray(persistenceEncoding.getDataId())); }
public MultiBinLookup(final CoordinateRange[] coordinateRanges) { binIdToRangeMap = new HashMap<>(); for (final CoordinateRange r : coordinateRanges) { binIdToRangeMap.put(new ByteArray(r.getBinId()), r); } }
@Override public void entryIngested(final T entry, final GeoWaveRow... kvs) { for (final GeoWaveRow kv : kvs) { if (entryHasDifferentVisibilities(kv)) { if (ids.add(new ByteArray(kvs[0].getDataId()))) { entriesWithDifferingFieldVisibilities++; } } } }
public static ByteArray[] fromBytes(final byte[] idData) { final ByteBuffer buffer = ByteBuffer.wrap(idData); final int len = VarintUtils.readUnsignedInt(buffer); final ByteArray[] result = new ByteArray[len]; for (int i = 0; i < len; i++) { final int idSize = VarintUtils.readUnsignedInt(buffer); final byte[] id = new byte[idSize]; buffer.get(id); result[i] = new ByteArray(id); } return result; }
@Override public void removeAdapter(final Short internalAdapterId) { if (internalAdapterId == null) { LOGGER.warn("Cannot remove adapter for null internal ID"); return; } remove(new ByteArray(ByteArrayUtils.shortToByteArray(internalAdapterId))); } }
@Override public boolean adapterExists(final Short internalAdapterId) { if (internalAdapterId == null) { LOGGER.warn("Cannot check existence of adapter for null internal ID"); return false; } return objectExists(new ByteArray(ByteArrayUtils.shortToByteArray(internalAdapterId)), null); }
private void incrementSkipRow(final GeoWaveRow row) { if (bitPosition != null) { final byte[] nextRow = IndexUtils.getNextRowForSkip(row.getSortKey(), bitPosition); if (nextRow == null) { reachedEnd = true; } else { skipUntilRow = new ByteArray(nextRow); } } }
@Override protected short byteArrayToShort(final byte[] bytes) { // make sure we use the same String encoding as decoding byt using the // ByteArrayId constructor return ByteArrayUtils.shortFromString(new ByteArray(bytes).getString()); } }
private boolean passesSkipFilter(final GeoWaveRow row) { if ((reachedEnd == true) || ((skipUntilRow != null) && ((skipUntilRow.compareTo(new ByteArray(row.getSortKey()))) > 0))) { return false; } return true; }
public List<ByteArray> getTableRegions(final String tableNameStr) { final ArrayList<ByteArray> regionIdList = Lists.newArrayList(); try (final RegionLocator locator = getRegionLocator(tableNameStr)) { for (final HRegionLocation regionLocation : locator.getAllRegionLocations()) { regionIdList.add(new ByteArray(regionLocation.getRegionInfo().getRegionName())); } } catch (final IOException e) { LOGGER.error("Error accessing region locator for " + tableNameStr, e); } return regionIdList; }
protected T entryToValue(final GeoWaveMetadata entry, final String... authorizations) { final T result = fromValue(entry); if (result != null) { addObjectToCache( new ByteArray(entry.getPrimaryId()), entry.getSecondaryId() == null ? null : new ByteArray(entry.getSecondaryId()), result, authorizations); } return result; }
@Override public AdapterToIndexMapping getIndicesForAdapter(final short adapterId) { final AdapterToIndexMapping mapping = super.internalGetObject( new ByteArray(ByteArrayUtils.shortToByteArray(adapterId)), null, false, null); return (mapping != null) ? mapping : new AdapterToIndexMapping(adapterId, new String[0]); }
public boolean mappingExists(final AdapterToIndexMapping persistedObject) { return objectExists( new ByteArray(ByteArrayUtils.shortToByteArray(persistedObject.getAdapterId())), null); }
@Override protected Mergeable getMergeable(final Cell cell, final byte[] bytes) { return rowTransform.getRowAsMergeableObject( ByteArrayUtils.shortFromString(StringUtils.stringFromBinary(CellUtil.cloneFamily(cell))), new ByteArray(CellUtil.cloneQualifier(cell)), bytes); }