if (currentKeyGroupRange.getEndKeyGroup() > targetKeyGroupRange.getEndKeyGroup()) { RocksDBKeySerializationUtils.serializeKeyGroup( targetKeyGroupRange.getEndKeyGroup() + 1, beginKeyGroupBytes); RocksDBKeySerializationUtils.serializeKeyGroup( currentKeyGroupRange.getEndKeyGroup() + 1, endKeyGroupBytes); deleteRange(db, columnFamilyHandles, beginKeyGroupBytes, endKeyGroupBytes);
RocksDBKeySerializationUtils.serializeKeyGroup(stateBackend.getKeyGroupRange().getEndKeyGroup() + 1, stopKeyGroupPrefixBytes);
(testKeyGroupRange.getEndKeyGroup() - testKeyGroupRange.getStartKeyGroup()) / 2; KeyGroupRange subKeyGroupRange2 = new KeyGroupRange(midpoint + 1, testKeyGroupRange.getEndKeyGroup());
KeyGroupRange subKeyGroupRange2 = new KeyGroupRange(subKeyGroupRange1.getEndKeyGroup() + 1, maxParallelism - 1);
KeyGroupRange subKeyGroupRange2 = new KeyGroupRange(subKeyGroupRange1.getEndKeyGroup() + 1, maxParallelism - 1);
/** * Registers a KvState instance for the given key group index. * * @param keyGroupRange Key group range to register * @param kvStateId ID of the KvState instance at the key group index. * @param kvStateAddress Server address of the KvState instance at the key group index. * @throws IndexOutOfBoundsException If key group range start < 0 or key group range end >= Number of key groups */ public void registerKvState(KeyGroupRange keyGroupRange, KvStateID kvStateId, InetSocketAddress kvStateAddress) { if (keyGroupRange.getStartKeyGroup() < 0 || keyGroupRange.getEndKeyGroup() >= numKeyGroups) { throw new IndexOutOfBoundsException("Key group index"); } for (int kgIdx = keyGroupRange.getStartKeyGroup(); kgIdx <= keyGroupRange.getEndKeyGroup(); ++kgIdx) { if (kvStateIds[kgIdx] == null && kvStateAddresses[kgIdx] == null) { numRegisteredKeyGroups++; } kvStateIds[kgIdx] = kvStateId; kvStateAddresses[kgIdx] = kvStateAddress; } }
/** * Registers a KvState instance for the given key group index. * * @param keyGroupRange Key group range to register * @param kvStateId ID of the KvState instance at the key group index. * @param kvStateAddress Server address of the KvState instance at the key group index. * @throws IndexOutOfBoundsException If key group range start < 0 or key group range end >= Number of key groups */ public void registerKvState(KeyGroupRange keyGroupRange, KvStateID kvStateId, InetSocketAddress kvStateAddress) { if (keyGroupRange.getStartKeyGroup() < 0 || keyGroupRange.getEndKeyGroup() >= numKeyGroups) { throw new IndexOutOfBoundsException("Key group index"); } for (int kgIdx = keyGroupRange.getStartKeyGroup(); kgIdx <= keyGroupRange.getEndKeyGroup(); ++kgIdx) { if (kvStateIds[kgIdx] == null && kvStateAddresses[kgIdx] == null) { numRegisteredKeyGroups++; } kvStateIds[kgIdx] = kvStateId; kvStateAddresses[kgIdx] = kvStateAddress; } }
/** * Registers a KvState instance for the given key group index. * * @param keyGroupRange Key group range to register * @param kvStateId ID of the KvState instance at the key group index. * @param kvStateAddress Server address of the KvState instance at the key group index. * @throws IndexOutOfBoundsException If key group range start < 0 or key group range end >= Number of key groups */ public void registerKvState(KeyGroupRange keyGroupRange, KvStateID kvStateId, InetSocketAddress kvStateAddress) { if (keyGroupRange.getStartKeyGroup() < 0 || keyGroupRange.getEndKeyGroup() >= numKeyGroups) { throw new IndexOutOfBoundsException("Key group index"); } for (int kgIdx = keyGroupRange.getStartKeyGroup(); kgIdx <= keyGroupRange.getEndKeyGroup(); ++kgIdx) { if (kvStateIds[kgIdx] == null && kvStateAddresses[kgIdx] == null) { numRegisteredKeyGroups++; } kvStateIds[kgIdx] = kvStateId; kvStateAddresses[kgIdx] = kvStateAddress; } }
/** * Registers a KvState instance for the given key group index. * * @param keyGroupRange Key group range to register * @param kvStateId ID of the KvState instance at the key group index. * @param kvStateAddress Server address of the KvState instance at the key group index. * @throws IndexOutOfBoundsException If key group range start < 0 or key group range end >= Number of key groups */ void registerKvState(KeyGroupRange keyGroupRange, KvStateID kvStateId, KvStateServerAddress kvStateAddress) { if (keyGroupRange.getStartKeyGroup() < 0 || keyGroupRange.getEndKeyGroup() >= numKeyGroups) { throw new IndexOutOfBoundsException("Key group index"); } for (int kgIdx = keyGroupRange.getStartKeyGroup(); kgIdx <= keyGroupRange.getEndKeyGroup(); ++kgIdx) { if (kvStateIds[kgIdx] == null && kvStateAddresses[kgIdx] == null) { numRegisteredKeyGroups++; } kvStateIds[kgIdx] = kvStateId; kvStateAddresses[kgIdx] = kvStateAddress; } }
/** * Registers a KvState instance for the given key group index. * * @param keyGroupRange Key group range to unregister. * @throws IndexOutOfBoundsException If key group range start < 0 or key group range end >= Number of key groups * @throws IllegalArgumentException If no location information registered for a key group index in the range. */ void unregisterKvState(KeyGroupRange keyGroupRange) { if (keyGroupRange.getStartKeyGroup() < 0 || keyGroupRange.getEndKeyGroup() >= numKeyGroups) { throw new IndexOutOfBoundsException("Key group index"); } for (int kgIdx = keyGroupRange.getStartKeyGroup(); kgIdx <= keyGroupRange.getEndKeyGroup(); ++kgIdx) { if (kvStateIds[kgIdx] == null || kvStateAddresses[kgIdx] == null) { throw new IllegalArgumentException("Not registered. Probably registration/unregistration race."); } numRegisteredKeyGroups--; kvStateIds[kgIdx] = null; kvStateAddresses[kgIdx] = null; } }
/** * Registers a KvState instance for the given key group index. * * @param keyGroupRange Key group range to unregister. * @throws IndexOutOfBoundsException If key group range start < 0 or key group range end >= Number of key groups * @throws IllegalArgumentException If no location information registered for a key group index in the range. */ void unregisterKvState(KeyGroupRange keyGroupRange) { if (keyGroupRange.getStartKeyGroup() < 0 || keyGroupRange.getEndKeyGroup() >= numKeyGroups) { throw new IndexOutOfBoundsException("Key group index"); } for (int kgIdx = keyGroupRange.getStartKeyGroup(); kgIdx <= keyGroupRange.getEndKeyGroup(); ++kgIdx) { if (kvStateIds[kgIdx] == null || kvStateAddresses[kgIdx] == null) { throw new IllegalArgumentException("Not registered. Probably registration/unregistration race."); } numRegisteredKeyGroups--; kvStateIds[kgIdx] = null; kvStateAddresses[kgIdx] = null; } }
/** * Registers a KvState instance for the given key group index. * * @param keyGroupRange Key group range to unregister. * @throws IndexOutOfBoundsException If key group range start < 0 or key group range end >= Number of key groups * @throws IllegalArgumentException If no location information registered for a key group index in the range. */ void unregisterKvState(KeyGroupRange keyGroupRange) { if (keyGroupRange.getStartKeyGroup() < 0 || keyGroupRange.getEndKeyGroup() >= numKeyGroups) { throw new IndexOutOfBoundsException("Key group index"); } for (int kgIdx = keyGroupRange.getStartKeyGroup(); kgIdx <= keyGroupRange.getEndKeyGroup(); ++kgIdx) { if (kvStateIds[kgIdx] == null || kvStateAddresses[kgIdx] == null) { throw new IllegalArgumentException("Not registered. Probably registration/unregistration race."); } numRegisteredKeyGroups--; kvStateIds[kgIdx] = null; kvStateAddresses[kgIdx] = null; } }
/** * Registers a KvState instance for the given key group index. * * @param keyGroupRange Key group range to unregister. * @throws IndexOutOfBoundsException If key group range start < 0 or key group range end >= Number of key groups * @throws IllegalArgumentException If no location information registered for a key group index in the range. */ void unregisterKvState(KeyGroupRange keyGroupRange) { if (keyGroupRange.getStartKeyGroup() < 0 || keyGroupRange.getEndKeyGroup() >= numKeyGroups) { throw new IndexOutOfBoundsException("Key group index"); } for (int kgIdx = keyGroupRange.getStartKeyGroup(); kgIdx <= keyGroupRange.getEndKeyGroup(); ++kgIdx) { if (kvStateIds[kgIdx] == null || kvStateAddresses[kgIdx] == null) { throw new IllegalArgumentException("Not registered. Probably registration/unregistration race."); } numRegisteredKeyGroups--; kvStateIds[kgIdx] = null; kvStateAddresses[kgIdx] = null; } }
if (currentKeyGroupRange.getEndKeyGroup() > targetKeyGroupRange.getEndKeyGroup()) { RocksDBKeySerializationUtils.serializeKeyGroup( targetKeyGroupRange.getEndKeyGroup() + 1, beginKeyGroupBytes); RocksDBKeySerializationUtils.serializeKeyGroup( currentKeyGroupRange.getEndKeyGroup() + 1, endKeyGroupBytes); deleteRange(db, columnFamilyHandles, beginKeyGroupBytes, endKeyGroupBytes);
if (currentKeyGroupRange.getEndKeyGroup() > targetKeyGroupRange.getEndKeyGroup()) { RocksDBKeySerializationUtils.serializeKeyGroup( targetKeyGroupRange.getEndKeyGroup() + 1, beginKeyGroupBytes); RocksDBKeySerializationUtils.serializeKeyGroup( currentKeyGroupRange.getEndKeyGroup() + 1, endKeyGroupBytes); deleteRange(db, columnFamilyHandles, beginKeyGroupBytes, endKeyGroupBytes);
dos.writeInt((keyGroupsStateSnapshot.getKeyGroupRange().getEndKeyGroup())); Map<Integer, Tuple2<Long, Integer>> metaInfos = keyGroupsStateSnapshot.getMetaInfos(); dos.writeInt(metaInfos.size()); dos.writeInt((incrementSnapshot.getKeyGroupRange().getEndKeyGroup()));
RocksDBKeySerializationUtils.serializeKeyGroup(stateBackend.getKeyGroupRange().getEndKeyGroup() + 1, stopKeyGroupPrefixBytes);
RocksDBKeySerializationUtils.serializeKeyGroup(stateBackend.getKeyGroupRange().getEndKeyGroup() + 1, stopKeyGroupPrefixBytes);