Refine search
protected DeleteVersionsNode getDeepCopy() { DeleteVersionsNode node = new DeleteVersionsNode(ts, mvcc); for (Map.Entry<Long, SortedSet<Long>> e : deletesMap.entrySet()) { node.deletesMap.put(e.getKey(), new TreeSet<>(e.getValue())); } for (Map.Entry<Long, SortedSet<Long>> e : mvccCountingMap.entrySet()) { node.mvccCountingMap.put(e.getKey(), new TreeSet<>(e.getValue())); } return node; } }
@Override protected VisibilityDeleteVersionsNode getDeepCopy() { VisibilityDeleteVersionsNode node = new VisibilityDeleteVersionsNode(ts, mvcc, tagInfo); for (Map.Entry<Long, SortedMap<Long, TagInfo>> e : deletesMap.entrySet()) { node.deletesMap.put(e.getKey(), new TreeMap<>(e.getValue())); } for (Map.Entry<Long, SortedSet<Long>> e : mvccCountingMap.entrySet()) { node.mvccCountingMap.put(e.getKey(), new TreeSet<>(e.getValue())); } return node; }
/** * Compile the column family (i.e. schema) information * into a Map. Useful for parsing and aggregation by debugging, * logging, and administration tools. * @return Map */ @Override public Map<String, Object> getFingerprint() { Map<String, Object> map = new HashMap<>(); List<String> families = new ArrayList<>(this.familyMap.entrySet().size()); // ideally, we would also include table information, but that information // is not stored in each Operation instance. map.put("families", families); for (Map.Entry<byte [], List<Cell>> entry : this.familyMap.entrySet()) { families.add(Bytes.toStringBinary(entry.getKey())); } return map; }
/** * A sensible definition of {@link #pollFirstEntry} in terms of the {@code iterator} of the {@code * entrySet} of {@code descendingMap}. If you override {@code descendingMap}, you may wish to * override {@code pollFirstEntry} to forward to this implementation. */ protected Entry<K, V> standardPollLastEntry() { return Iterators.pollNext(descendingMap().entrySet().iterator()); }
protected Mutation(Mutation clone) { super(clone); this.row = clone.getRow(); this.ts = clone.getTimestamp(); this.familyMap = clone.getFamilyCellMap().entrySet().stream(). collect(Collectors.toMap(e -> e.getKey(), e -> new ArrayList<>(e.getValue()), (k, v) -> { throw new RuntimeException("collisions!!!"); }, () -> new TreeMap<>(Bytes.BYTES_COMPARATOR))); }
SegmentsForSequence build() { final NavigableMap<Long, SegmentsOfInterval> map = new TreeMap<>(); for (Entry<SegmentIdWithShardSpec, Pair<SegmentWithState, List<SegmentWithState>>> entry : intervalToSegments.entrySet()) { map.put( entry.getKey().getInterval().getStartMillis(), new SegmentsOfInterval(entry.getKey().getInterval(), entry.getValue().lhs, entry.getValue().rhs) ); } return new SegmentsForSequence(map, lastSegmentId); } }
@Override public long serializedSizeInBytes() { long nbBytes = 0L; // .writeBoolean for signedLongs boolean nbBytes += 1; // .writeInt for number of different high values nbBytes += 4; for (Entry<Integer, BitmapDataProvider> entry : highToBitmap.entrySet()) { // .writeInt for high nbBytes += 4; // The low bitmap size in bytes nbBytes += entry.getValue().serializedSizeInBytes(); } return nbBytes; }
private void applyPendingStateToHBase(NavigableMap<byte[], byte[]> pendingMap) throws Exception { List<Mutation> mutations = new ArrayList<>(); for (Map.Entry<byte[], byte[]> entry : pendingMap.entrySet()) { byte[] rowKey = entry.getKey(); byte[] value = entry.getValue(); if (Arrays.equals(value, encoder.getTombstoneValue())) { mutations.add(new Delete(getRowKeyForStateKey(rowKey))); } else { List<Mutation> mutationsForRow = prepareMutateRow(getRowKeyForStateKey(rowKey), columnFamily, Collections.singletonMap(STATE_QUALIFIER, value)); mutations.addAll(mutationsForRow); } } hbaseClient.batchMutate(mutations); }