public short[] getAdapterIds(final InternalAdapterStore adapterStore) { if ((adapterIds == null) || (adapterIds.length == 0)) { return adapterStore.getAdapterIds(); } else { return adapterIds; } } }
@Override public short[] getAdapterIds() { return persistentInternalAdapterStore.getAdapterIds(); } }
private List<QueryRequest> addQueryRanges( final String tableName, final SinglePartitionQueryRanges r, short[] adapterIds, final InternalAdapterStore adapterStore) { final List<QueryRequest> retVal = new ArrayList<>(); final byte[] partitionKey = ((r.getPartitionKey() == null) || (r.getPartitionKey().length == 0)) ? DynamoDBWriter.EMPTY_PARTITION_KEY : r.getPartitionKey(); if (((adapterIds == null) || (adapterIds.length == 0)) && (adapterStore != null)) { adapterIds = adapterStore.getAdapterIds(); } for (final Short adapterId : adapterIds) { final Collection<ByteArrayRange> sortKeyRanges = r.getSortKeyRanges(); if ((sortKeyRanges != null) && !sortKeyRanges.isEmpty()) { sortKeyRanges.forEach( (sortKeyRange -> retVal.add( getQuery(tableName, partitionKey, sortKeyRange, adapterId)))); } else { retVal.add(getQuery(tableName, partitionKey, null, adapterId)); } } return retVal; }
Collection<Short> adapterIds; if ((typeNames == null) || (typeNames.length == 0)) { adapterIds = Arrays.asList(ArrayUtils.toObject(internalAdapterStore.getAdapterIds())); } else { adapterIds =
public static boolean mergeStats( final DataStatisticsStore statsStore, final InternalAdapterStore internalAdapterStore) { // Get all statistics, remove all statistics, then re-add for (final short adapterId : internalAdapterStore.getAdapterIds()) { InternalDataStatistics<?, ?, ?>[] statsArray; try (final CloseableIterator<InternalDataStatistics<?, ?, ?>> stats = statsStore.getDataStatistics(adapterId)) { statsArray = Iterators.toArray(stats, InternalDataStatistics.class); } // Clear all existing stats statsStore.removeAllStatistics(adapterId); for (final InternalDataStatistics<?, ?, ?> stats : statsArray) { statsStore.incorporateStatistics(stats); } } return true; }