id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
15,200
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/internal/jmx/InstanceMBean.java
InstanceMBean.registerWanPublisherMBeans
private void registerWanPublisherMBeans(WanReplicationService wanReplicationService) { final Map<String, LocalWanStats> wanStats = wanReplicationService.getStats(); if (wanStats == null) { return; } for (Entry<String, LocalWanStats> replicationStatsEntry : wanStats.entrySet(...
java
private void registerWanPublisherMBeans(WanReplicationService wanReplicationService) { final Map<String, LocalWanStats> wanStats = wanReplicationService.getStats(); if (wanStats == null) { return; } for (Entry<String, LocalWanStats> replicationStatsEntry : wanStats.entrySet(...
[ "private", "void", "registerWanPublisherMBeans", "(", "WanReplicationService", "wanReplicationService", ")", "{", "final", "Map", "<", "String", ",", "LocalWanStats", ">", "wanStats", "=", "wanReplicationService", ".", "getStats", "(", ")", ";", "if", "(", "wanStats...
Registers managed beans for all WAN publishers, if any. @param wanReplicationService the WAN replication service
[ "Registers", "managed", "beans", "for", "all", "WAN", "publishers", "if", "any", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/jmx/InstanceMBean.java#L89-L104
15,201
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/util/collection/BiInt2ObjectMap.java
BiInt2ObjectMap.remove
public V remove(final int keyPartA, final int keyPartB) { final long key = compoundKey(keyPartA, keyPartB); return map.remove(key); }
java
public V remove(final int keyPartA, final int keyPartB) { final long key = compoundKey(keyPartA, keyPartB); return map.remove(key); }
[ "public", "V", "remove", "(", "final", "int", "keyPartA", ",", "final", "int", "keyPartB", ")", "{", "final", "long", "key", "=", "compoundKey", "(", "keyPartA", ",", "keyPartB", ")", ";", "return", "map", ".", "remove", "(", "key", ")", ";", "}" ]
Remove a value from the map and return the value. @param keyPartA for the key @param keyPartB for the key @return the previous value if found otherwise null
[ "Remove", "a", "value", "from", "the", "map", "and", "return", "the", "value", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/util/collection/BiInt2ObjectMap.java#L122-L126
15,202
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/util/collection/BiInt2ObjectMap.java
BiInt2ObjectMap.forEach
public void forEach(final EntryConsumer<V> consumer) { for (Map.Entry<Long, V> entry : map.entrySet()) { Long compoundKey = entry.getKey(); final int keyPartA = (int) (compoundKey >>> Integer.SIZE); final int keyPartB = (int) (compoundKey & LOWER_INT_MASK); consum...
java
public void forEach(final EntryConsumer<V> consumer) { for (Map.Entry<Long, V> entry : map.entrySet()) { Long compoundKey = entry.getKey(); final int keyPartA = (int) (compoundKey >>> Integer.SIZE); final int keyPartB = (int) (compoundKey & LOWER_INT_MASK); consum...
[ "public", "void", "forEach", "(", "final", "EntryConsumer", "<", "V", ">", "consumer", ")", "{", "for", "(", "Map", ".", "Entry", "<", "Long", ",", "V", ">", "entry", ":", "map", ".", "entrySet", "(", ")", ")", "{", "Long", "compoundKey", "=", "ent...
Iterate over the entries of the map @param consumer to apply to each entry in the map
[ "Iterate", "over", "the", "entries", "of", "the", "map" ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/util/collection/BiInt2ObjectMap.java#L133-L140
15,203
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/util/collection/BiInt2ObjectMap.java
BiInt2ObjectMap.forEach
public void forEach(final Consumer<V> consumer) { for (Map.Entry<Long, V> entry : map.entrySet()) { consumer.accept(entry.getValue()); } }
java
public void forEach(final Consumer<V> consumer) { for (Map.Entry<Long, V> entry : map.entrySet()) { consumer.accept(entry.getValue()); } }
[ "public", "void", "forEach", "(", "final", "Consumer", "<", "V", ">", "consumer", ")", "{", "for", "(", "Map", ".", "Entry", "<", "Long", ",", "V", ">", "entry", ":", "map", ".", "entrySet", "(", ")", ")", "{", "consumer", ".", "accept", "(", "en...
Iterate over the values in the map @param consumer to apply to each value in the map
[ "Iterate", "over", "the", "values", "in", "the", "map" ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/util/collection/BiInt2ObjectMap.java#L147-L151
15,204
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/query/impl/getters/SuffixModifierUtils.java
SuffixModifierUtils.removeModifierSuffix
public static String removeModifierSuffix(String fullName) { int indexOfFirstOpeningToken = fullName.indexOf(MODIFIER_OPENING_TOKEN); if (indexOfFirstOpeningToken == -1) { return fullName; } int indexOfSecondOpeningToken = fullName.lastIndexOf(MODIFIER_OPENING_TOKEN); ...
java
public static String removeModifierSuffix(String fullName) { int indexOfFirstOpeningToken = fullName.indexOf(MODIFIER_OPENING_TOKEN); if (indexOfFirstOpeningToken == -1) { return fullName; } int indexOfSecondOpeningToken = fullName.lastIndexOf(MODIFIER_OPENING_TOKEN); ...
[ "public", "static", "String", "removeModifierSuffix", "(", "String", "fullName", ")", "{", "int", "indexOfFirstOpeningToken", "=", "fullName", ".", "indexOf", "(", "MODIFIER_OPENING_TOKEN", ")", ";", "if", "(", "indexOfFirstOpeningToken", "==", "-", "1", ")", "{",...
Remove modifier suffix from given fullName. @param fullName @return
[ "Remove", "modifier", "suffix", "from", "given", "fullName", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/query/impl/getters/SuffixModifierUtils.java#L44-L61
15,205
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/query/impl/getters/SuffixModifierUtils.java
SuffixModifierUtils.getModifierSuffix
public static String getModifierSuffix(String fullName, String baseName) { if (fullName.equals(baseName)) { return null; } int indexOfOpeningBracket = fullName.indexOf(MODIFIER_OPENING_TOKEN); return fullName.substring(indexOfOpeningBracket, fullName.length()); }
java
public static String getModifierSuffix(String fullName, String baseName) { if (fullName.equals(baseName)) { return null; } int indexOfOpeningBracket = fullName.indexOf(MODIFIER_OPENING_TOKEN); return fullName.substring(indexOfOpeningBracket, fullName.length()); }
[ "public", "static", "String", "getModifierSuffix", "(", "String", "fullName", ",", "String", "baseName", ")", "{", "if", "(", "fullName", ".", "equals", "(", "baseName", ")", ")", "{", "return", "null", ";", "}", "int", "indexOfOpeningBracket", "=", "fullNam...
Get modifier suffix if fullName contains any otherwise returns null. In contains no validation of input parameters as it assumes the validation has been already done by {@link #removeModifierSuffix(String)} @param fullName @param baseName as returned by {@link #removeModifierSuffix(String)} @return modifier suffix or...
[ "Get", "modifier", "suffix", "if", "fullName", "contains", "any", "otherwise", "returns", "null", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/query/impl/getters/SuffixModifierUtils.java#L74-L80
15,206
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/internal/serialization/impl/ObjectDataInputStream.java
ObjectDataInputStream.readDataAsObject
@Override public <T> T readDataAsObject() throws IOException { Data data = readData(); return data == null ? null : (T) serializationService.toObject(data); }
java
@Override public <T> T readDataAsObject() throws IOException { Data data = readData(); return data == null ? null : (T) serializationService.toObject(data); }
[ "@", "Override", "public", "<", "T", ">", "T", "readDataAsObject", "(", ")", "throws", "IOException", "{", "Data", "data", "=", "readData", "(", ")", ";", "return", "data", "==", "null", "?", "null", ":", "(", "T", ")", "serializationService", ".", "to...
a future optimization would be to skip the construction of the Data object.
[ "a", "future", "optimization", "would", "be", "to", "skip", "the", "construction", "of", "the", "Data", "object", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/serialization/impl/ObjectDataInputStream.java#L339-L343
15,207
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/internal/cluster/impl/ClusterJoinManager.java
ClusterJoinManager.isValidJoinMessage
private boolean isValidJoinMessage(JoinMessage joinMessage) { try { return validateJoinMessage(joinMessage); } catch (ConfigMismatchException e) { throw e; } catch (Exception e) { return false; } }
java
private boolean isValidJoinMessage(JoinMessage joinMessage) { try { return validateJoinMessage(joinMessage); } catch (ConfigMismatchException e) { throw e; } catch (Exception e) { return false; } }
[ "private", "boolean", "isValidJoinMessage", "(", "JoinMessage", "joinMessage", ")", "{", "try", "{", "return", "validateJoinMessage", "(", "joinMessage", ")", ";", "}", "catch", "(", "ConfigMismatchException", "e", ")", "{", "throw", "e", ";", "}", "catch", "(...
rethrows only on ConfigMismatchException; in case of other exception, returns false.
[ "rethrows", "only", "on", "ConfigMismatchException", ";", "in", "case", "of", "other", "exception", "returns", "false", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/cluster/impl/ClusterJoinManager.java#L208-L216
15,208
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/internal/cluster/impl/ClusterJoinManager.java
ClusterJoinManager.handleMasterResponse
public void handleMasterResponse(Address masterAddress, Address callerAddress) { clusterServiceLock.lock(); try { if (logger.isFineEnabled()) { logger.fine(format("Handling master response %s from %s", masterAddress, callerAddress)); } if (clusterServ...
java
public void handleMasterResponse(Address masterAddress, Address callerAddress) { clusterServiceLock.lock(); try { if (logger.isFineEnabled()) { logger.fine(format("Handling master response %s from %s", masterAddress, callerAddress)); } if (clusterServ...
[ "public", "void", "handleMasterResponse", "(", "Address", "masterAddress", ",", "Address", "callerAddress", ")", "{", "clusterServiceLock", ".", "lock", "(", ")", ";", "try", "{", "if", "(", "logger", ".", "isFineEnabled", "(", ")", ")", "{", "logger", ".", ...
Set master address, if required. @param masterAddress address of cluster's master, as provided in {@link MasterResponseOp} @param callerAddress address of node that sent the {@link MasterResponseOp} @see MasterResponseOp
[ "Set", "master", "address", "if", "required", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/cluster/impl/ClusterJoinManager.java#L490-L538
15,209
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/internal/cluster/impl/ClusterJoinManager.java
ClusterJoinManager.shouldMergeTo
private boolean shouldMergeTo(Address thisAddress, Address targetAddress) { String thisAddressStr = "[" + thisAddress.getHost() + "]:" + thisAddress.getPort(); String targetAddressStr = "[" + targetAddress.getHost() + "]:" + targetAddress.getPort(); if (thisAddressStr.equals(targetAddressStr)) ...
java
private boolean shouldMergeTo(Address thisAddress, Address targetAddress) { String thisAddressStr = "[" + thisAddress.getHost() + "]:" + thisAddress.getPort(); String targetAddressStr = "[" + targetAddress.getHost() + "]:" + targetAddress.getPort(); if (thisAddressStr.equals(targetAddressStr)) ...
[ "private", "boolean", "shouldMergeTo", "(", "Address", "thisAddress", ",", "Address", "targetAddress", ")", "{", "String", "thisAddressStr", "=", "\"[\"", "+", "thisAddress", ".", "getHost", "(", ")", "+", "\"]:\"", "+", "thisAddress", ".", "getPort", "(", ")"...
Determines whether this address should merge to target address and called when two sides are equal on all aspects. This is a pure function that must produce always the same output when called with the same parameters. This logic should not be changed, otherwise compatibility will be broken. @param thisAddress this add...
[ "Determines", "whether", "this", "address", "should", "merge", "to", "target", "address", "and", "called", "when", "two", "sides", "are", "equal", "on", "all", "aspects", ".", "This", "is", "a", "pure", "function", "that", "must", "produce", "always", "the",...
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/cluster/impl/ClusterJoinManager.java#L910-L922
15,210
hazelcast/hazelcast
hazelcast-spring/src/main/java/com/hazelcast/spring/transaction/HazelcastTransactionManager.java
HazelcastTransactionManager.getTransactionContext
public static TransactionContext getTransactionContext(HazelcastInstance hazelcastInstance) { TransactionContextHolder transactionContextHolder = (TransactionContextHolder) TransactionSynchronizationManager.getResource(hazelcastInstance); if (transactionContextHolder == null) { ...
java
public static TransactionContext getTransactionContext(HazelcastInstance hazelcastInstance) { TransactionContextHolder transactionContextHolder = (TransactionContextHolder) TransactionSynchronizationManager.getResource(hazelcastInstance); if (transactionContextHolder == null) { ...
[ "public", "static", "TransactionContext", "getTransactionContext", "(", "HazelcastInstance", "hazelcastInstance", ")", "{", "TransactionContextHolder", "transactionContextHolder", "=", "(", "TransactionContextHolder", ")", "TransactionSynchronizationManager", ".", "getResource", ...
Returns the transaction context for the given Hazelcast instance bounded to the current thread. @throws NoTransactionException if the transaction context cannot be found
[ "Returns", "the", "transaction", "context", "for", "the", "given", "Hazelcast", "instance", "bounded", "to", "the", "current", "thread", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast-spring/src/main/java/com/hazelcast/spring/transaction/HazelcastTransactionManager.java#L56-L63
15,211
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/client/impl/protocol/task/dynamicconfig/AbstractAddConfigMessageTask.java
AbstractAddConfigMessageTask.mergePolicyConfig
protected MergePolicyConfig mergePolicyConfig(boolean mergePolicyExist, String mergePolicy, int batchSize) { if (mergePolicyExist) { MergePolicyConfig config = new MergePolicyConfig(mergePolicy, batchSize); return config; } return new MergePolicyConfig(); }
java
protected MergePolicyConfig mergePolicyConfig(boolean mergePolicyExist, String mergePolicy, int batchSize) { if (mergePolicyExist) { MergePolicyConfig config = new MergePolicyConfig(mergePolicy, batchSize); return config; } return new MergePolicyConfig(); }
[ "protected", "MergePolicyConfig", "mergePolicyConfig", "(", "boolean", "mergePolicyExist", ",", "String", "mergePolicy", ",", "int", "batchSize", ")", "{", "if", "(", "mergePolicyExist", ")", "{", "MergePolicyConfig", "config", "=", "new", "MergePolicyConfig", "(", ...
returns a MergePolicyConfig based on given parameters if these exist, or the default MergePolicyConfig
[ "returns", "a", "MergePolicyConfig", "based", "on", "given", "parameters", "if", "these", "exist", "or", "the", "default", "MergePolicyConfig" ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/client/impl/protocol/task/dynamicconfig/AbstractAddConfigMessageTask.java#L88-L94
15,212
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/cp/internal/raft/impl/RaftNodeImpl.java
RaftNodeImpl.start
public void start() { if (!raftIntegration.isReady()) { raftIntegration.schedule(new Runnable() { @Override public void run() { start(); } }, RAFT_NODE_INIT_DELAY_MILLIS, MILLISECONDS); return; } ...
java
public void start() { if (!raftIntegration.isReady()) { raftIntegration.schedule(new Runnable() { @Override public void run() { start(); } }, RAFT_NODE_INIT_DELAY_MILLIS, MILLISECONDS); return; } ...
[ "public", "void", "start", "(", ")", "{", "if", "(", "!", "raftIntegration", ".", "isReady", "(", ")", ")", "{", "raftIntegration", ".", "schedule", "(", "new", "Runnable", "(", ")", "{", "@", "Override", "public", "void", "run", "(", ")", "{", "star...
Starts the periodic tasks, such as voting, leader failure-detection, snapshot handling.
[ "Starts", "the", "periodic", "tasks", "such", "as", "voting", "leader", "failure", "-", "detection", "snapshot", "handling", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/cp/internal/raft/impl/RaftNodeImpl.java#L197-L215
15,213
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/cp/internal/raft/impl/RaftNodeImpl.java
RaftNodeImpl.applyLogEntry
private void applyLogEntry(LogEntry entry) { if (logger.isFineEnabled()) { logger.fine("Processing " + entry); } Object response = null; Object operation = entry.operation(); if (operation instanceof RaftGroupCmd) { if (operation instanceof DestroyRaftGro...
java
private void applyLogEntry(LogEntry entry) { if (logger.isFineEnabled()) { logger.fine("Processing " + entry); } Object response = null; Object operation = entry.operation(); if (operation instanceof RaftGroupCmd) { if (operation instanceof DestroyRaftGro...
[ "private", "void", "applyLogEntry", "(", "LogEntry", "entry", ")", "{", "if", "(", "logger", ".", "isFineEnabled", "(", ")", ")", "{", "logger", ".", "fine", "(", "\"Processing \"", "+", "entry", ")", ";", "}", "Object", "response", "=", "null", ";", "...
Applies the log entry by executing operation attached and set execution result to the related future if any available.
[ "Applies", "the", "log", "entry", "by", "executing", "operation", "attached", "and", "set", "execution", "result", "to", "the", "related", "future", "if", "any", "available", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/cp/internal/raft/impl/RaftNodeImpl.java#L575-L622
15,214
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/cp/internal/raft/impl/RaftNodeImpl.java
RaftNodeImpl.runQueryOperation
public void runQueryOperation(Object operation, SimpleCompletableFuture resultFuture) { long commitIndex = state.commitIndex(); Object result = raftIntegration.runOperation(operation, commitIndex); resultFuture.setResult(result); }
java
public void runQueryOperation(Object operation, SimpleCompletableFuture resultFuture) { long commitIndex = state.commitIndex(); Object result = raftIntegration.runOperation(operation, commitIndex); resultFuture.setResult(result); }
[ "public", "void", "runQueryOperation", "(", "Object", "operation", ",", "SimpleCompletableFuture", "resultFuture", ")", "{", "long", "commitIndex", "=", "state", ".", "commitIndex", "(", ")", ";", "Object", "result", "=", "raftIntegration", ".", "runOperation", "(...
Executes query operation sets execution result to the future.
[ "Executes", "query", "operation", "sets", "execution", "result", "to", "the", "future", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/cp/internal/raft/impl/RaftNodeImpl.java#L639-L643
15,215
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/cp/internal/raft/impl/RaftNodeImpl.java
RaftNodeImpl.installSnapshot
public boolean installSnapshot(SnapshotEntry snapshot) { long commitIndex = state.commitIndex(); if (commitIndex > snapshot.index()) { logger.info("Ignored stale " + snapshot + ", commit index at: " + commitIndex); return false; } else if (commitIndex == snapshot.index())...
java
public boolean installSnapshot(SnapshotEntry snapshot) { long commitIndex = state.commitIndex(); if (commitIndex > snapshot.index()) { logger.info("Ignored stale " + snapshot + ", commit index at: " + commitIndex); return false; } else if (commitIndex == snapshot.index())...
[ "public", "boolean", "installSnapshot", "(", "SnapshotEntry", "snapshot", ")", "{", "long", "commitIndex", "=", "state", ".", "commitIndex", "(", ")", ";", "if", "(", "commitIndex", ">", "snapshot", ".", "index", "(", ")", ")", "{", "logger", ".", "info", ...
Restores the snapshot sent by the leader if it's not applied before. @return true if snapshot is restores, false otherwise.
[ "Restores", "the", "snapshot", "sent", "by", "the", "leader", "if", "it", "s", "not", "applied", "before", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/cp/internal/raft/impl/RaftNodeImpl.java#L779-L811
15,216
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/cp/internal/raft/impl/RaftNodeImpl.java
RaftNodeImpl.updateGroupMembers
public void updateGroupMembers(long logIndex, Collection<Endpoint> members) { state.updateGroupMembers(logIndex, members); printMemberState(); }
java
public void updateGroupMembers(long logIndex, Collection<Endpoint> members) { state.updateGroupMembers(logIndex, members); printMemberState(); }
[ "public", "void", "updateGroupMembers", "(", "long", "logIndex", ",", "Collection", "<", "Endpoint", ">", "members", ")", "{", "state", ".", "updateGroupMembers", "(", "logIndex", ",", "members", ")", ";", "printMemberState", "(", ")", ";", "}" ]
Updates Raft group members. @see RaftState#updateGroupMembers(long, Collection)
[ "Updates", "Raft", "group", "members", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/cp/internal/raft/impl/RaftNodeImpl.java#L839-L842
15,217
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/map/impl/querycache/subscriber/SubscriberAccumulatorHandler.java
SubscriberAccumulatorHandler.pollRemovedCountHolders
private int pollRemovedCountHolders(AtomicReferenceArray<Queue<Integer>> removedCountHolders) { int count = 0; for (int i = 0; i < partitionCount; i++) { Queue<Integer> removalCounts = removedCountHolders.get(i); count += removalCounts.poll(); } return count; ...
java
private int pollRemovedCountHolders(AtomicReferenceArray<Queue<Integer>> removedCountHolders) { int count = 0; for (int i = 0; i < partitionCount; i++) { Queue<Integer> removalCounts = removedCountHolders.get(i); count += removalCounts.poll(); } return count; ...
[ "private", "int", "pollRemovedCountHolders", "(", "AtomicReferenceArray", "<", "Queue", "<", "Integer", ">", ">", "removedCountHolders", ")", "{", "int", "count", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "partitionCount", ";", "i", ...
should be called when `noMissingMapWideEvent` `false`, otherwise polling can cause NPE
[ "should", "be", "called", "when", "noMissingMapWideEvent", "false", "otherwise", "polling", "can", "cause", "NPE" ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/map/impl/querycache/subscriber/SubscriberAccumulatorHandler.java#L167-L174
15,218
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/query/impl/getters/EvictableGetterCache.java
EvictableGetterCache.evictMap
private void evictMap(SampleableConcurrentHashMap<?, ?> map, int triggeringEvictionSize, int afterEvictionSize) { map.purgeStaleEntries(); int mapSize = map.size(); if (mapSize - triggeringEvictionSize >= 0) { for (SampleableConcurrentHashMap.SamplingEntry entry : map.getRandomSample...
java
private void evictMap(SampleableConcurrentHashMap<?, ?> map, int triggeringEvictionSize, int afterEvictionSize) { map.purgeStaleEntries(); int mapSize = map.size(); if (mapSize - triggeringEvictionSize >= 0) { for (SampleableConcurrentHashMap.SamplingEntry entry : map.getRandomSample...
[ "private", "void", "evictMap", "(", "SampleableConcurrentHashMap", "<", "?", ",", "?", ">", "map", ",", "int", "triggeringEvictionSize", ",", "int", "afterEvictionSize", ")", "{", "map", ".", "purgeStaleEntries", "(", ")", ";", "int", "mapSize", "=", "map", ...
It works on best effort basis. If multi-threaded calls involved it may evict all elements, but it's unlikely.
[ "It", "works", "on", "best", "effort", "basis", ".", "If", "multi", "-", "threaded", "calls", "involved", "it", "may", "evict", "all", "elements", "but", "it", "s", "unlikely", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/query/impl/getters/EvictableGetterCache.java#L79-L87
15,219
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/map/impl/mapstore/writebehind/BoundedWriteBehindQueue.java
BoundedWriteBehindQueue.drainTo
@Override public int drainTo(Collection<E> collection) { int size = queue.drainTo(collection); addCapacity(-size); return size; }
java
@Override public int drainTo(Collection<E> collection) { int size = queue.drainTo(collection); addCapacity(-size); return size; }
[ "@", "Override", "public", "int", "drainTo", "(", "Collection", "<", "E", ">", "collection", ")", "{", "int", "size", "=", "queue", ".", "drainTo", "(", "collection", ")", ";", "addCapacity", "(", "-", "size", ")", ";", "return", "size", ";", "}" ]
Removes all elements from this queue and adds them to the given collection. @return number of removed items from this queue.
[ "Removes", "all", "elements", "from", "this", "queue", "and", "adds", "them", "to", "the", "given", "collection", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/map/impl/mapstore/writebehind/BoundedWriteBehindQueue.java#L108-L113
15,220
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/internal/util/ToHeapDataConverter.java
ToHeapDataConverter.toHeapData
public static Data toHeapData(Data data) { if (data == null || data instanceof HeapData) { return data; } return new HeapData(data.toByteArray()); }
java
public static Data toHeapData(Data data) { if (data == null || data instanceof HeapData) { return data; } return new HeapData(data.toByteArray()); }
[ "public", "static", "Data", "toHeapData", "(", "Data", "data", ")", "{", "if", "(", "data", "==", "null", "||", "data", "instanceof", "HeapData", ")", "{", "return", "data", ";", "}", "return", "new", "HeapData", "(", "data", ".", "toByteArray", "(", "...
Converts Data to HeapData. Useful for offheap conversion. @param data @return the onheap representation of data. If data is null, null is returned.
[ "Converts", "Data", "to", "HeapData", ".", "Useful", "for", "offheap", "conversion", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/util/ToHeapDataConverter.java#L36-L41
15,221
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/cache/impl/record/CacheRecordHashMap.java
CacheRecordHashMap.setEntryCounting
@Override public void setEntryCounting(boolean enable) { if (enable) { if (!entryCountingEnable) { // It was disable before but now it will be enable. // Therefore, we increase the entry count as size of records. cacheContext.increaseEntryCount(siz...
java
@Override public void setEntryCounting(boolean enable) { if (enable) { if (!entryCountingEnable) { // It was disable before but now it will be enable. // Therefore, we increase the entry count as size of records. cacheContext.increaseEntryCount(siz...
[ "@", "Override", "public", "void", "setEntryCounting", "(", "boolean", "enable", ")", "{", "if", "(", "enable", ")", "{", "if", "(", "!", "entryCountingEnable", ")", "{", "// It was disable before but now it will be enable.", "// Therefore, we increase the entry count as ...
Called by only same partition thread. So there is no synchronization and visibility problem.
[ "Called", "by", "only", "same", "partition", "thread", ".", "So", "there", "is", "no", "synchronization", "and", "visibility", "problem", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/cache/impl/record/CacheRecordHashMap.java#L56-L72
15,222
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/internal/cluster/impl/ClusterClockImpl.java
ClusterClockImpl.setClusterTimeDiff
void setClusterTimeDiff(long diff) { if (logger.isFineEnabled()) { logger.fine("Setting cluster time diff to " + diff + "ms."); } if (abs(diff) > abs(maxClusterTimeDiff)) { maxClusterTimeDiff = diff; } this.clusterTimeDiff = diff; }
java
void setClusterTimeDiff(long diff) { if (logger.isFineEnabled()) { logger.fine("Setting cluster time diff to " + diff + "ms."); } if (abs(diff) > abs(maxClusterTimeDiff)) { maxClusterTimeDiff = diff; } this.clusterTimeDiff = diff; }
[ "void", "setClusterTimeDiff", "(", "long", "diff", ")", "{", "if", "(", "logger", ".", "isFineEnabled", "(", ")", ")", "{", "logger", ".", "fine", "(", "\"Setting cluster time diff to \"", "+", "diff", "+", "\"ms.\"", ")", ";", "}", "if", "(", "abs", "("...
Set the cluster time diff and records the maximum observed cluster time diff
[ "Set", "the", "cluster", "time", "diff", "and", "records", "the", "maximum", "observed", "cluster", "time", "diff" ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/cluster/impl/ClusterClockImpl.java#L58-L68
15,223
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/cache/impl/maxsize/impl/EntryCountCacheEvictionChecker.java
EntryCountCacheEvictionChecker.calculateMaxPartitionSize
public static int calculateMaxPartitionSize(int maxEntryCount, int partitionCount) { final double balancedPartitionSize = (double) maxEntryCount / (double) partitionCount; final double approximatedStdDev = Math.sqrt(balancedPartitionSize); int stdDevMultiplier; if (maxEntryCount <= STD_...
java
public static int calculateMaxPartitionSize(int maxEntryCount, int partitionCount) { final double balancedPartitionSize = (double) maxEntryCount / (double) partitionCount; final double approximatedStdDev = Math.sqrt(balancedPartitionSize); int stdDevMultiplier; if (maxEntryCount <= STD_...
[ "public", "static", "int", "calculateMaxPartitionSize", "(", "int", "maxEntryCount", ",", "int", "partitionCount", ")", "{", "final", "double", "balancedPartitionSize", "=", "(", "double", ")", "maxEntryCount", "/", "(", "double", ")", "partitionCount", ";", "fina...
for calculating the estimated max size.
[ "for", "calculating", "the", "estimated", "max", "size", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/cache/impl/maxsize/impl/EntryCountCacheEvictionChecker.java#L45-L65
15,224
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/spi/impl/operationservice/impl/OperationRunnerImpl.java
OperationRunnerImpl.ensureQuorumPresent
private void ensureQuorumPresent(Operation op) { QuorumServiceImpl quorumService = operationService.nodeEngine.getQuorumService(); quorumService.ensureQuorumPresent(op); }
java
private void ensureQuorumPresent(Operation op) { QuorumServiceImpl quorumService = operationService.nodeEngine.getQuorumService(); quorumService.ensureQuorumPresent(op); }
[ "private", "void", "ensureQuorumPresent", "(", "Operation", "op", ")", "{", "QuorumServiceImpl", "quorumService", "=", "operationService", ".", "nodeEngine", ".", "getQuorumService", "(", ")", ";", "quorumService", ".", "ensureQuorumPresent", "(", "op", ")", ";", ...
Ensures that the quorum is present if the quorum is configured and the operation service is quorum aware. @param op the operation for which the quorum must be checked for presence @throws QuorumException if the operation requires a quorum and the quorum is not present
[ "Ensures", "that", "the", "quorum", "is", "present", "if", "the", "quorum", "is", "configured", "and", "the", "operation", "service", "is", "quorum", "aware", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/spi/impl/operationservice/impl/OperationRunnerImpl.java#L285-L288
15,225
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/spi/impl/merge/AbstractContainerCollector.java
AbstractContainerCollector.run
public final void run() { int partitionCount = partitionService.getPartitionCount(); latch = new CountDownLatch(partitionCount); for (int partitionId = 0; partitionId < partitionCount; partitionId++) { operationExecutor.execute(new CollectContainerRunnable(partitionId)); } ...
java
public final void run() { int partitionCount = partitionService.getPartitionCount(); latch = new CountDownLatch(partitionCount); for (int partitionId = 0; partitionId < partitionCount; partitionId++) { operationExecutor.execute(new CollectContainerRunnable(partitionId)); } ...
[ "public", "final", "void", "run", "(", ")", "{", "int", "partitionCount", "=", "partitionService", ".", "getPartitionCount", "(", ")", ";", "latch", "=", "new", "CountDownLatch", "(", "partitionCount", ")", ";", "for", "(", "int", "partitionId", "=", "0", ...
Collects the containers from the data structure in a thread-safe way.
[ "Collects", "the", "containers", "from", "the", "data", "structure", "in", "a", "thread", "-", "safe", "way", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/spi/impl/merge/AbstractContainerCollector.java#L89-L102
15,226
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/spi/impl/merge/AbstractContainerCollector.java
AbstractContainerCollector.destroy
public final void destroy() { for (Collection<C> containers : containersByPartitionId.values()) { for (C container : containers) { destroy(container); } } containersByPartitionId.clear(); onDestroy(); }
java
public final void destroy() { for (Collection<C> containers : containersByPartitionId.values()) { for (C container : containers) { destroy(container); } } containersByPartitionId.clear(); onDestroy(); }
[ "public", "final", "void", "destroy", "(", ")", "{", "for", "(", "Collection", "<", "C", ">", "containers", ":", "containersByPartitionId", ".", "values", "(", ")", ")", "{", "for", "(", "C", "container", ":", "containers", ")", "{", "destroy", "(", "c...
Destroys all collected containers.
[ "Destroys", "all", "collected", "containers", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/spi/impl/merge/AbstractContainerCollector.java#L116-L124
15,227
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/map/impl/MapListenerFlagOperator.java
MapListenerFlagOperator.setAndGetAllListenerFlags
private static int setAndGetAllListenerFlags() { int listenerFlags = 0; EntryEventType[] values = EntryEventType.values(); for (EntryEventType eventType : values) { listenerFlags = listenerFlags | eventType.getType(); } return listenerFlags; }
java
private static int setAndGetAllListenerFlags() { int listenerFlags = 0; EntryEventType[] values = EntryEventType.values(); for (EntryEventType eventType : values) { listenerFlags = listenerFlags | eventType.getType(); } return listenerFlags; }
[ "private", "static", "int", "setAndGetAllListenerFlags", "(", ")", "{", "int", "listenerFlags", "=", "0", ";", "EntryEventType", "[", "]", "values", "=", "EntryEventType", ".", "values", "(", ")", ";", "for", "(", "EntryEventType", "eventType", ":", "values", ...
Sets and gets all listener flags.
[ "Sets", "and", "gets", "all", "listener", "flags", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/map/impl/MapListenerFlagOperator.java#L57-L64
15,228
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/client/impl/protocol/task/scheduledexecutor/ScheduledExecutorTaskGetResultFromPartitionMessageTask.java
ScheduledExecutorTaskGetResultFromPartitionMessageTask.sendClientMessage
@Override protected void sendClientMessage(Throwable throwable) { if (throwable instanceof ScheduledTaskResult.ExecutionExceptionDecorator) { super.sendClientMessage(throwable.getCause()); } else { super.sendClientMessage(throwable); } }
java
@Override protected void sendClientMessage(Throwable throwable) { if (throwable instanceof ScheduledTaskResult.ExecutionExceptionDecorator) { super.sendClientMessage(throwable.getCause()); } else { super.sendClientMessage(throwable); } }
[ "@", "Override", "protected", "void", "sendClientMessage", "(", "Throwable", "throwable", ")", "{", "if", "(", "throwable", "instanceof", "ScheduledTaskResult", ".", "ExecutionExceptionDecorator", ")", "{", "super", ".", "sendClientMessage", "(", "throwable", ".", "...
Exceptions may be wrapped in ExecutionExceptionDecorator, the wrapped ExecutionException should be sent to the client. @param throwable
[ "Exceptions", "may", "be", "wrapped", "in", "ExecutionExceptionDecorator", "the", "wrapped", "ExecutionException", "should", "be", "sent", "to", "the", "client", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/client/impl/protocol/task/scheduledexecutor/ScheduledExecutorTaskGetResultFromPartitionMessageTask.java#L92-L99
15,229
hazelcast/hazelcast
hazelcast-client/src/main/java/com/hazelcast/client/impl/clientside/FailoverClientConfigSupport.java
FailoverClientConfigSupport.checkValidAlternative
private static void checkValidAlternative(List<ClientConfig> alternativeClientConfigs) { if (alternativeClientConfigs.isEmpty()) { throw new InvalidConfigurationException("ClientFailoverConfig should have at least one client config."); } ClientConfig mainConfig = alternativeClientCon...
java
private static void checkValidAlternative(List<ClientConfig> alternativeClientConfigs) { if (alternativeClientConfigs.isEmpty()) { throw new InvalidConfigurationException("ClientFailoverConfig should have at least one client config."); } ClientConfig mainConfig = alternativeClientCon...
[ "private", "static", "void", "checkValidAlternative", "(", "List", "<", "ClientConfig", ">", "alternativeClientConfigs", ")", "{", "if", "(", "alternativeClientConfigs", ".", "isEmpty", "(", ")", ")", "{", "throw", "new", "InvalidConfigurationException", "(", "\"Cli...
For a client to be valid alternative, all configurations should be equal except GroupConfig SecurityConfig Discovery related parts of NetworkConfig Credentials related configs @param alternativeClientConfigs to check if they are valid alternative for a single client two switch between clusters @throws InvalidConfigura...
[ "For", "a", "client", "to", "be", "valid", "alternative", "all", "configurations", "should", "be", "equal", "except", "GroupConfig", "SecurityConfig", "Discovery", "related", "parts", "of", "NetworkConfig", "Credentials", "related", "configs" ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast-client/src/main/java/com/hazelcast/client/impl/clientside/FailoverClientConfigSupport.java#L162-L171
15,230
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/internal/json/Json.java
Json.array
public static JsonArray array(String... strings) { if (strings == null) { throw new NullPointerException("values is null"); } JsonArray array = new JsonArray(); for (String value : strings) { array.add(value); } return array; }
java
public static JsonArray array(String... strings) { if (strings == null) { throw new NullPointerException("values is null"); } JsonArray array = new JsonArray(); for (String value : strings) { array.add(value); } return array; }
[ "public", "static", "JsonArray", "array", "(", "String", "...", "strings", ")", "{", "if", "(", "strings", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "\"values is null\"", ")", ";", "}", "JsonArray", "array", "=", "new", "JsonArray"...
Creates a new JsonArray that contains the JSON representations of the given strings. @param strings the strings to be included in the new JSON array @return a new JSON array that contains the given strings
[ "Creates", "a", "new", "JsonArray", "that", "contains", "the", "JSON", "representations", "of", "the", "given", "strings", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/json/Json.java#L258-L267
15,231
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/internal/json/Json.java
Json.parse
public static JsonValue parse(String string) { if (string == null) { throw new NullPointerException("string is null"); } DefaultHandler handler = new DefaultHandler(); new JsonParser(handler).parse(string); return handler.getValue(); }
java
public static JsonValue parse(String string) { if (string == null) { throw new NullPointerException("string is null"); } DefaultHandler handler = new DefaultHandler(); new JsonParser(handler).parse(string); return handler.getValue(); }
[ "public", "static", "JsonValue", "parse", "(", "String", "string", ")", "{", "if", "(", "string", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "\"string is null\"", ")", ";", "}", "DefaultHandler", "handler", "=", "new", "DefaultHandler...
Parses the given input string as JSON. The input must contain a valid JSON value, optionally padded with whitespace. @param string the input string, must be valid JSON @return a value that represents the parsed JSON @throws ParseException if the input is not valid JSON
[ "Parses", "the", "given", "input", "string", "as", "JSON", ".", "The", "input", "must", "contain", "a", "valid", "JSON", "value", "optionally", "padded", "with", "whitespace", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/json/Json.java#L289-L296
15,232
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/util/HashUtil.java
HashUtil.fastLongMix
public static long fastLongMix(long k) { // phi = 2^64 / goldenRatio final long phi = 0x9E3779B97F4A7C15L; long h = k * phi; h ^= h >>> 32; return h ^ (h >>> 16); }
java
public static long fastLongMix(long k) { // phi = 2^64 / goldenRatio final long phi = 0x9E3779B97F4A7C15L; long h = k * phi; h ^= h >>> 32; return h ^ (h >>> 16); }
[ "public", "static", "long", "fastLongMix", "(", "long", "k", ")", "{", "// phi = 2^64 / goldenRatio", "final", "long", "phi", "=", "0x9E3779B97F4A7C15", "", "L", ";", "long", "h", "=", "k", "*", "phi", ";", "h", "^=", "h", ">>>", "32", ";", "return", "...
Hash function based on Knuth's multiplicative method. This version is faster than using Murmur hash but provides acceptable behavior. @param k the long for which the hash will be calculated @return the hash
[ "Hash", "function", "based", "on", "Knuth", "s", "multiplicative", "method", ".", "This", "version", "is", "faster", "than", "using", "Murmur", "hash", "but", "provides", "acceptable", "behavior", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/util/HashUtil.java#L293-L299
15,233
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/map/impl/MapMigrationAwareService.java
MapMigrationAwareService.flushAndRemoveQueryCaches
private void flushAndRemoveQueryCaches(PartitionMigrationEvent event) { int partitionId = event.getPartitionId(); QueryCacheContext queryCacheContext = mapServiceContext.getQueryCacheContext(); PublisherContext publisherContext = queryCacheContext.getPublisherContext(); if (event.getMig...
java
private void flushAndRemoveQueryCaches(PartitionMigrationEvent event) { int partitionId = event.getPartitionId(); QueryCacheContext queryCacheContext = mapServiceContext.getQueryCacheContext(); PublisherContext publisherContext = queryCacheContext.getPublisherContext(); if (event.getMig...
[ "private", "void", "flushAndRemoveQueryCaches", "(", "PartitionMigrationEvent", "event", ")", "{", "int", "partitionId", "=", "event", ".", "getPartitionId", "(", ")", ";", "QueryCacheContext", "queryCacheContext", "=", "mapServiceContext", ".", "getQueryCacheContext", ...
Flush and remove query cache on this source partition.
[ "Flush", "and", "remove", "query", "cache", "on", "this", "source", "partition", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/map/impl/MapMigrationAwareService.java#L98-L114
15,234
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/util/ItemCounter.java
ItemCounter.descendingKeys
public List<T> descendingKeys() { List<T> list = new ArrayList<T>(map.keySet()); sort(list, new Comparator<T>() { @Override public int compare(T o1, T o2) { MutableLong l1 = map.get(o1); MutableLong l2 = map.get(o2); return compare...
java
public List<T> descendingKeys() { List<T> list = new ArrayList<T>(map.keySet()); sort(list, new Comparator<T>() { @Override public int compare(T o1, T o2) { MutableLong l1 = map.get(o1); MutableLong l2 = map.get(o2); return compare...
[ "public", "List", "<", "T", ">", "descendingKeys", "(", ")", "{", "List", "<", "T", ">", "list", "=", "new", "ArrayList", "<", "T", ">", "(", "map", ".", "keySet", "(", ")", ")", ";", "sort", "(", "list", ",", "new", "Comparator", "<", "T", ">"...
Returns a List of keys in descending value order. @return the list of keys
[ "Returns", "a", "List", "of", "keys", "in", "descending", "value", "order", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/util/ItemCounter.java#L63-L80
15,235
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/util/ItemCounter.java
ItemCounter.get
public long get(T item) { MutableLong count = map.get(item); return count == null ? 0 : count.value; }
java
public long get(T item) { MutableLong count = map.get(item); return count == null ? 0 : count.value; }
[ "public", "long", "get", "(", "T", "item", ")", "{", "MutableLong", "count", "=", "map", ".", "get", "(", "item", ")", ";", "return", "count", "==", "null", "?", "0", ":", "count", ".", "value", ";", "}" ]
Get current counter for an item item @param item @return current state of a counter for item
[ "Get", "current", "counter", "for", "an", "item", "item" ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/util/ItemCounter.java#L88-L91
15,236
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/util/ItemCounter.java
ItemCounter.set
public void set(T item, long value) { MutableLong entry = map.get(item); if (entry == null) { entry = MutableLong.valueOf(value); map.put(item, entry); total += value; } else { total -= entry.value; total += value; entry.val...
java
public void set(T item, long value) { MutableLong entry = map.get(item); if (entry == null) { entry = MutableLong.valueOf(value); map.put(item, entry); total += value; } else { total -= entry.value; total += value; entry.val...
[ "public", "void", "set", "(", "T", "item", ",", "long", "value", ")", "{", "MutableLong", "entry", "=", "map", ".", "get", "(", "item", ")", ";", "if", "(", "entry", "==", "null", ")", "{", "entry", "=", "MutableLong", ".", "valueOf", "(", "value",...
Set counter of item to value @param item to set set the value for @param value a new value
[ "Set", "counter", "of", "item", "to", "value" ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/util/ItemCounter.java#L99-L110
15,237
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/util/ItemCounter.java
ItemCounter.add
public void add(T item, long delta) { MutableLong entry = map.get(item); if (entry == null) { entry = MutableLong.valueOf(delta); map.put(item, entry); } else { entry.value += delta; } total += delta; }
java
public void add(T item, long delta) { MutableLong entry = map.get(item); if (entry == null) { entry = MutableLong.valueOf(delta); map.put(item, entry); } else { entry.value += delta; } total += delta; }
[ "public", "void", "add", "(", "T", "item", ",", "long", "delta", ")", "{", "MutableLong", "entry", "=", "map", ".", "get", "(", "item", ")", ";", "if", "(", "entry", "==", "null", ")", "{", "entry", "=", "MutableLong", ".", "valueOf", "(", "delta",...
Add delta to the item @param item @param delta
[ "Add", "delta", "to", "the", "item" ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/util/ItemCounter.java#L127-L136
15,238
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/util/ItemCounter.java
ItemCounter.getAndSet
public long getAndSet(T item, long value) { MutableLong entry = map.get(item); if (entry == null) { entry = MutableLong.valueOf(value); map.put(item, entry); total += value; return 0; } long oldValue = entry.value; total = total -...
java
public long getAndSet(T item, long value) { MutableLong entry = map.get(item); if (entry == null) { entry = MutableLong.valueOf(value); map.put(item, entry); total += value; return 0; } long oldValue = entry.value; total = total -...
[ "public", "long", "getAndSet", "(", "T", "item", ",", "long", "value", ")", "{", "MutableLong", "entry", "=", "map", ".", "get", "(", "item", ")", ";", "if", "(", "entry", "==", "null", ")", "{", "entry", "=", "MutableLong", ".", "valueOf", "(", "v...
Set counter for item and return previous value @param item @param value @return
[ "Set", "counter", "for", "item", "and", "return", "previous", "value" ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/util/ItemCounter.java#L166-L180
15,239
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/internal/networking/nio/iobalancer/LoadMigrationStrategy.java
LoadMigrationStrategy.imbalanceDetected
@Override public boolean imbalanceDetected(LoadImbalance imbalance) { long min = imbalance.minimumLoad; long max = imbalance.maximumLoad; if (min == Long.MIN_VALUE || max == Long.MAX_VALUE) { return false; } long lowerBound = (long) (MIN_MAX_RATIO_MIGRATION_THRES...
java
@Override public boolean imbalanceDetected(LoadImbalance imbalance) { long min = imbalance.minimumLoad; long max = imbalance.maximumLoad; if (min == Long.MIN_VALUE || max == Long.MAX_VALUE) { return false; } long lowerBound = (long) (MIN_MAX_RATIO_MIGRATION_THRES...
[ "@", "Override", "public", "boolean", "imbalanceDetected", "(", "LoadImbalance", "imbalance", ")", "{", "long", "min", "=", "imbalance", ".", "minimumLoad", ";", "long", "max", "=", "imbalance", ".", "maximumLoad", ";", "if", "(", "min", "==", "Long", ".", ...
Checks if an imbalance was detected in the system @param imbalance @return <code>true</code> if imbalance threshold has been reached and migration should be attempted
[ "Checks", "if", "an", "imbalance", "was", "detected", "in", "the", "system" ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/networking/nio/iobalancer/LoadMigrationStrategy.java#L60-L70
15,240
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/internal/networking/nio/iobalancer/LoadMigrationStrategy.java
LoadMigrationStrategy.findPipelineToMigrate
@Override public MigratablePipeline findPipelineToMigrate(LoadImbalance imbalance) { Set<? extends MigratablePipeline> candidates = imbalance.getPipelinesOwnedBy(imbalance.srcOwner); long migrationThreshold = (long) ((imbalance.maximumLoad - imbalance.minimumLoad) * MAXIMUM_NO_OF_EVE...
java
@Override public MigratablePipeline findPipelineToMigrate(LoadImbalance imbalance) { Set<? extends MigratablePipeline> candidates = imbalance.getPipelinesOwnedBy(imbalance.srcOwner); long migrationThreshold = (long) ((imbalance.maximumLoad - imbalance.minimumLoad) * MAXIMUM_NO_OF_EVE...
[ "@", "Override", "public", "MigratablePipeline", "findPipelineToMigrate", "(", "LoadImbalance", "imbalance", ")", "{", "Set", "<", "?", "extends", "MigratablePipeline", ">", "candidates", "=", "imbalance", ".", "getPipelinesOwnedBy", "(", "imbalance", ".", "srcOwner",...
Attempt to find a pipeline to migrate to a new NioThread. @param imbalance describing a snapshot of NioThread load @return the pipeline to migrate to a new NioThread or null if no pipeline needs to be migrated.
[ "Attempt", "to", "find", "a", "pipeline", "to", "migrate", "to", "a", "new", "NioThread", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/networking/nio/iobalancer/LoadMigrationStrategy.java#L79-L96
15,241
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/cache/impl/CacheEventSet.java
CacheEventSet.addEventData
public void addEventData(CacheEventData cacheEventData) { if (events == null) { events = new HashSet<CacheEventData>(); } this.events.add(cacheEventData); }
java
public void addEventData(CacheEventData cacheEventData) { if (events == null) { events = new HashSet<CacheEventData>(); } this.events.add(cacheEventData); }
[ "public", "void", "addEventData", "(", "CacheEventData", "cacheEventData", ")", "{", "if", "(", "events", "==", "null", ")", "{", "events", "=", "new", "HashSet", "<", "CacheEventData", ">", "(", ")", ";", "}", "this", ".", "events", ".", "add", "(", "...
Helper method for adding multiple CacheEventData into this Set @param cacheEventData event data representing a single event's data. @see CacheEventData
[ "Helper", "method", "for", "adding", "multiple", "CacheEventData", "into", "this", "Set" ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/cache/impl/CacheEventSet.java#L92-L97
15,242
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/internal/util/InstantiationUtils.java
InstantiationUtils.newInstanceOrNull
public static <T> T newInstanceOrNull(Class<? extends T> clazz, Object...params) { Constructor<T> constructor = selectMatchingConstructor(clazz, params); if (constructor == null) { return null; } try { return constructor.newInstance(params); } catch (Ille...
java
public static <T> T newInstanceOrNull(Class<? extends T> clazz, Object...params) { Constructor<T> constructor = selectMatchingConstructor(clazz, params); if (constructor == null) { return null; } try { return constructor.newInstance(params); } catch (Ille...
[ "public", "static", "<", "T", ">", "T", "newInstanceOrNull", "(", "Class", "<", "?", "extends", "T", ">", "clazz", ",", "Object", "...", "params", ")", "{", "Constructor", "<", "T", ">", "constructor", "=", "selectMatchingConstructor", "(", "clazz", ",", ...
Create a new instance of a given class. It will search for a constructor matching passed parameters. If a matching constructor is not found then it returns null. Constructor is matching when it can be invoked with given parameters. The order of parameters is significant. When a class constructor contains a primitive ...
[ "Create", "a", "new", "instance", "of", "a", "given", "class", ".", "It", "will", "search", "for", "a", "constructor", "matching", "passed", "parameters", ".", "If", "a", "matching", "constructor", "is", "not", "found", "then", "it", "returns", "null", "."...
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/util/InstantiationUtils.java#L49-L63
15,243
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/internal/dynamicconfig/AggregatingMap.java
AggregatingMap.aggregate
public static <K, V> Map<K, V> aggregate(Map<K, V> map1, Map<K, V> map2) { return new AggregatingMap<K, V>(map1, map2); }
java
public static <K, V> Map<K, V> aggregate(Map<K, V> map1, Map<K, V> map2) { return new AggregatingMap<K, V>(map1, map2); }
[ "public", "static", "<", "K", ",", "V", ">", "Map", "<", "K", ",", "V", ">", "aggregate", "(", "Map", "<", "K", ",", "V", ">", "map1", ",", "Map", "<", "K", ",", "V", ">", "map2", ")", "{", "return", "new", "AggregatingMap", "<", "K", ",", ...
Creates new aggregating maps. @param map1 @param map2 @param <K> @param <V> @return
[ "Creates", "new", "aggregating", "maps", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/dynamicconfig/AggregatingMap.java#L61-L63
15,244
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/spi/impl/operationservice/impl/InvokeOnPartitions.java
InvokeOnPartitions.invokeAsync
@SuppressWarnings("unchecked") <T> ICompletableFuture<Map<Integer, T>> invokeAsync() { assert !invoked : "already invoked"; invoked = true; ensureNotCallingFromPartitionOperationThread(); invokeOnAllPartitions(); return future; }
java
@SuppressWarnings("unchecked") <T> ICompletableFuture<Map<Integer, T>> invokeAsync() { assert !invoked : "already invoked"; invoked = true; ensureNotCallingFromPartitionOperationThread(); invokeOnAllPartitions(); return future; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "<", "T", ">", "ICompletableFuture", "<", "Map", "<", "Integer", ",", "T", ">", ">", "invokeAsync", "(", ")", "{", "assert", "!", "invoked", ":", "\"already invoked\"", ";", "invoked", "=", "true", ";", ...
Executes all the operations on the partitions.
[ "Executes", "all", "the", "operations", "on", "the", "partitions", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/spi/impl/operationservice/impl/InvokeOnPartitions.java#L94-L101
15,245
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/spi/merge/RingbufferMergeData.java
RingbufferMergeData.read
@SuppressWarnings("unchecked") public <E> E read(long sequence) { checkReadSequence(sequence); return (E) items[toIndex(sequence)]; }
java
@SuppressWarnings("unchecked") public <E> E read(long sequence) { checkReadSequence(sequence); return (E) items[toIndex(sequence)]; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "<", "E", ">", "E", "read", "(", "long", "sequence", ")", "{", "checkReadSequence", "(", "sequence", ")", ";", "return", "(", "E", ")", "items", "[", "toIndex", "(", "sequence", ")", "]", ";...
Reads one item from the ringbuffer. @param sequence the sequence of the item to read @param <E> ringbuffer item type @return the ringbuffer item @throws StaleSequenceException if the sequence is smaller then {@link #getHeadSequence()} or larger than {@link #getTailSequence()}
[ "Reads", "one", "item", "from", "the", "ringbuffer", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/spi/merge/RingbufferMergeData.java#L165-L169
15,246
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/cache/impl/AbstractCacheRecordStore.java
AbstractCacheRecordStore.markExpirable
protected void markExpirable(long expiryTime) { if (expiryTime > 0 && expiryTime < Long.MAX_VALUE) { hasEntryWithExpiration = true; } if (isPrimary() && hasEntryWithExpiration) { cacheService.getExpirationManager().scheduleExpirationTask(); } }
java
protected void markExpirable(long expiryTime) { if (expiryTime > 0 && expiryTime < Long.MAX_VALUE) { hasEntryWithExpiration = true; } if (isPrimary() && hasEntryWithExpiration) { cacheService.getExpirationManager().scheduleExpirationTask(); } }
[ "protected", "void", "markExpirable", "(", "long", "expiryTime", ")", "{", "if", "(", "expiryTime", ">", "0", "&&", "expiryTime", "<", "Long", ".", "MAX_VALUE", ")", "{", "hasEntryWithExpiration", "=", "true", ";", "}", "if", "(", "isPrimary", "(", ")", ...
This method marks current replica as expirable and also starts expiration task if necessary. The expiration task runs on only primary replicas. Expiration on backup replicas are dictated by primary replicas. However, it is still important to mark a backup replica as expirable because it might be promoted to be the pri...
[ "This", "method", "marks", "current", "replica", "as", "expirable", "and", "also", "starts", "expiration", "task", "if", "necessary", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/cache/impl/AbstractCacheRecordStore.java#L1615-L1623
15,247
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/util/collection/ArrayUtils.java
ArrayUtils.createCopy
public static <T> T[] createCopy(T[] src) { return Arrays.copyOf(src, src.length); }
java
public static <T> T[] createCopy(T[] src) { return Arrays.copyOf(src, src.length); }
[ "public", "static", "<", "T", ">", "T", "[", "]", "createCopy", "(", "T", "[", "]", "src", ")", "{", "return", "Arrays", ".", "copyOf", "(", "src", ",", "src", ".", "length", ")", ";", "}" ]
Create copy of the src array. @param src @param <T> @return copy of the original array
[ "Create", "copy", "of", "the", "src", "array", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/util/collection/ArrayUtils.java#L37-L39
15,248
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/util/collection/ArrayUtils.java
ArrayUtils.remove
public static <T> T[] remove(T[] src, T object) { int index = indexOf(src, object); if (index == -1) { return src; } T[] dst = (T[]) Array.newInstance(src.getClass().getComponentType(), src.length - 1); System.arraycopy(src, 0, dst, 0, index); if (index < src...
java
public static <T> T[] remove(T[] src, T object) { int index = indexOf(src, object); if (index == -1) { return src; } T[] dst = (T[]) Array.newInstance(src.getClass().getComponentType(), src.length - 1); System.arraycopy(src, 0, dst, 0, index); if (index < src...
[ "public", "static", "<", "T", ">", "T", "[", "]", "remove", "(", "T", "[", "]", "src", ",", "T", "object", ")", "{", "int", "index", "=", "indexOf", "(", "src", ",", "object", ")", ";", "if", "(", "index", "==", "-", "1", ")", "{", "return", ...
Removes an item from the array. If the item has been found, a new array is returned where this item is removed. Otherwise the original array is returned. @param src the src array @param object the object to remove @param <T> the type of the array @return the resulting array
[ "Removes", "an", "item", "from", "the", "array", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/util/collection/ArrayUtils.java#L51-L63
15,249
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/util/collection/ArrayUtils.java
ArrayUtils.append
public static <T> T[] append(T[] array1, T[] array2) { T[] dst = (T[]) Array.newInstance(array1.getClass().getComponentType(), array1.length + array2.length); System.arraycopy(array1, 0, dst, 0, array1.length); System.arraycopy(array2, 0, dst, array1.length, array2.length); return dst; ...
java
public static <T> T[] append(T[] array1, T[] array2) { T[] dst = (T[]) Array.newInstance(array1.getClass().getComponentType(), array1.length + array2.length); System.arraycopy(array1, 0, dst, 0, array1.length); System.arraycopy(array2, 0, dst, array1.length, array2.length); return dst; ...
[ "public", "static", "<", "T", ">", "T", "[", "]", "append", "(", "T", "[", "]", "array1", ",", "T", "[", "]", "array2", ")", "{", "T", "[", "]", "dst", "=", "(", "T", "[", "]", ")", "Array", ".", "newInstance", "(", "array1", ".", "getClass",...
Appends 2 arrays. @param array1 the first array @param array2 the second array @param <T> the type of the array @return the resulting array
[ "Appends", "2", "arrays", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/util/collection/ArrayUtils.java#L73-L78
15,250
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/util/collection/ArrayUtils.java
ArrayUtils.replaceFirst
public static <T> T[] replaceFirst(T[] src, T oldValue, T[] newValues) { int index = indexOf(src, oldValue); if (index == -1) { return src; } T[] dst = (T[]) Array.newInstance(src.getClass().getComponentType(), src.length - 1 + newValues.length); // copy the first p...
java
public static <T> T[] replaceFirst(T[] src, T oldValue, T[] newValues) { int index = indexOf(src, oldValue); if (index == -1) { return src; } T[] dst = (T[]) Array.newInstance(src.getClass().getComponentType(), src.length - 1 + newValues.length); // copy the first p...
[ "public", "static", "<", "T", ">", "T", "[", "]", "replaceFirst", "(", "T", "[", "]", "src", ",", "T", "oldValue", ",", "T", "[", "]", "newValues", ")", "{", "int", "index", "=", "indexOf", "(", "src", ",", "oldValue", ")", ";", "if", "(", "ind...
Replaces the first occurrence of the oldValue by the newValue. If the item is found, a new array is returned. Otherwise the original array is returned. @param src @param oldValue the value to look for @param newValues the value that is inserted. @param <T> the type of the array @return
[ "Replaces", "the", "first", "occurrence", "of", "the", "oldValue", "by", "the", "newValue", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/util/collection/ArrayUtils.java#L91-L108
15,251
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/instance/HazelcastInstanceFactory.java
HazelcastInstanceFactory.getInstanceName
public static String getInstanceName(String instanceName, Config config) { String name = instanceName; if (name == null || name.trim().length() == 0) { name = createInstanceName(config); } return name; }
java
public static String getInstanceName(String instanceName, Config config) { String name = instanceName; if (name == null || name.trim().length() == 0) { name = createInstanceName(config); } return name; }
[ "public", "static", "String", "getInstanceName", "(", "String", "instanceName", ",", "Config", "config", ")", "{", "String", "name", "=", "instanceName", ";", "if", "(", "name", "==", "null", "||", "name", ".", "trim", "(", ")", ".", "length", "(", ")", ...
Return real name for the hazelcast instance's instance @param instanceName - template of the name @param config - config @return - real hazelcast instance's name
[ "Return", "real", "name", "for", "the", "hazelcast", "instance", "s", "instance" ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/instance/HazelcastInstanceFactory.java#L175-L183
15,252
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/cp/internal/raft/impl/state/RaftState.java
RaftState.toCandidate
public VoteRequest toCandidate() { role = RaftRole.CANDIDATE; preCandidateState = null; leaderState = null; candidateState = new CandidateState(majority()); candidateState.grantVote(localEndpoint); persistVote(incrementTerm(), localEndpoint); return new VoteReque...
java
public VoteRequest toCandidate() { role = RaftRole.CANDIDATE; preCandidateState = null; leaderState = null; candidateState = new CandidateState(majority()); candidateState.grantVote(localEndpoint); persistVote(incrementTerm(), localEndpoint); return new VoteReque...
[ "public", "VoteRequest", "toCandidate", "(", ")", "{", "role", "=", "RaftRole", ".", "CANDIDATE", ";", "preCandidateState", "=", "null", ";", "leaderState", "=", "null", ";", "candidateState", "=", "new", "CandidateState", "(", "majority", "(", ")", ")", ";"...
Switches this node to candidate role. Clears pre-candidate and leader states. Initializes candidate state for current majority and grants vote for local endpoint as a candidate. @return vote request to sent to other members during leader election
[ "Switches", "this", "node", "to", "candidate", "role", ".", "Clears", "pre", "-", "candidate", "and", "leader", "states", ".", "Initializes", "candidate", "state", "for", "current", "majority", "and", "grants", "vote", "for", "local", "endpoint", "as", "a", ...
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/cp/internal/raft/impl/state/RaftState.java#L328-L337
15,253
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/cp/internal/raft/impl/state/RaftState.java
RaftState.updateGroupMembers
public void updateGroupMembers(long logIndex, Collection<Endpoint> members) { assert committedGroupMembers == lastGroupMembers : "Cannot update group members to: " + members + " at log index: " + logIndex + " because last group members: " + lastGroupMembers + " is different than ...
java
public void updateGroupMembers(long logIndex, Collection<Endpoint> members) { assert committedGroupMembers == lastGroupMembers : "Cannot update group members to: " + members + " at log index: " + logIndex + " because last group members: " + lastGroupMembers + " is different than ...
[ "public", "void", "updateGroupMembers", "(", "long", "logIndex", ",", "Collection", "<", "Endpoint", ">", "members", ")", "{", "assert", "committedGroupMembers", "==", "lastGroupMembers", ":", "\"Cannot update group members to: \"", "+", "members", "+", "\" at log index...
Initializes the last applied group members with the members and logIndex. This method expects there's no uncommitted membership changes, committed members are the same as the last applied members. Leader state is updated for the members which don't exist in committed members and committed members those don't exist in ...
[ "Initializes", "the", "last", "applied", "group", "members", "with", "the", "members", "and", "logIndex", ".", "This", "method", "expects", "there", "s", "no", "uncommitted", "membership", "changes", "committed", "members", "are", "the", "same", "as", "the", "...
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/cp/internal/raft/impl/state/RaftState.java#L384-L409
15,254
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/collection/impl/queue/QueueContainer.java
QueueContainer.init
public void init(boolean fromBackup) { if (!fromBackup && store.isEnabled()) { Set<Long> keys = store.loadAllKeys(); if (keys != null) { long maxId = -1; for (Long key : keys) { QueueItem item = new QueueItem(this, key, null); ...
java
public void init(boolean fromBackup) { if (!fromBackup && store.isEnabled()) { Set<Long> keys = store.loadAllKeys(); if (keys != null) { long maxId = -1; for (Long key : keys) { QueueItem item = new QueueItem(this, key, null); ...
[ "public", "void", "init", "(", "boolean", "fromBackup", ")", "{", "if", "(", "!", "fromBackup", "&&", "store", ".", "isEnabled", "(", ")", ")", "{", "Set", "<", "Long", ">", "keys", "=", "store", ".", "loadAllKeys", "(", ")", ";", "if", "(", "keys"...
Initializes the item queue with items from the queue store if the store is enabled and if item queue is not being initialized as a part of a backup operation. If the item queue is being initialized as a part of a backup operation then the operation is in charge of adding items to a queue and the items are not loaded fr...
[ "Initializes", "the", "item", "queue", "with", "items", "from", "the", "queue", "store", "if", "the", "store", "is", "enabled", "and", "if", "item", "queue", "is", "not", "being", "initialized", "as", "a", "part", "of", "a", "backup", "operation", ".", "...
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/collection/impl/queue/QueueContainer.java#L119-L132
15,255
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/collection/impl/queue/QueueContainer.java
QueueContainer.txnPollBackupReserve
public void txnPollBackupReserve(long itemId, String transactionId) { QueueItem item = getBackupMap().remove(itemId); if (item != null) { txMap.put(itemId, new TxQueueItem(item).setPollOperation(true).setTransactionId(transactionId)); return; } if (txMap.remove(it...
java
public void txnPollBackupReserve(long itemId, String transactionId) { QueueItem item = getBackupMap().remove(itemId); if (item != null) { txMap.put(itemId, new TxQueueItem(item).setPollOperation(true).setTransactionId(transactionId)); return; } if (txMap.remove(it...
[ "public", "void", "txnPollBackupReserve", "(", "long", "itemId", ",", "String", "transactionId", ")", "{", "QueueItem", "item", "=", "getBackupMap", "(", ")", ".", "remove", "(", "itemId", ")", ";", "if", "(", "item", "!=", "null", ")", "{", "txMap", "."...
Makes a reservation for a poll operation. Should be executed as a part of the prepare phase for a transactional queue poll on the partition backup replica. The ID of the item being polled is determined by the partition owner. @param itemId the ID of the reserved item to be polled @param transactionId the transa...
[ "Makes", "a", "reservation", "for", "a", "poll", "operation", ".", "Should", "be", "executed", "as", "a", "part", "of", "the", "prepare", "phase", "for", "a", "transactional", "queue", "poll", "on", "the", "partition", "backup", "replica", ".", "The", "ID"...
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/collection/impl/queue/QueueContainer.java#L216-L225
15,256
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/collection/impl/queue/QueueContainer.java
QueueContainer.offer
public long offer(Data data) { QueueItem item = new QueueItem(this, nextId(), null); if (store.isEnabled()) { try { store.store(item.getItemId(), data); } catch (Exception e) { throw new HazelcastException(e); } } if (!s...
java
public long offer(Data data) { QueueItem item = new QueueItem(this, nextId(), null); if (store.isEnabled()) { try { store.store(item.getItemId(), data); } catch (Exception e) { throw new HazelcastException(e); } } if (!s...
[ "public", "long", "offer", "(", "Data", "data", ")", "{", "QueueItem", "item", "=", "new", "QueueItem", "(", "this", ",", "nextId", "(", ")", ",", "null", ")", ";", "if", "(", "store", ".", "isEnabled", "(", ")", ")", "{", "try", "{", "store", "....
TX Methods Ends
[ "TX", "Methods", "Ends" ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/collection/impl/queue/QueueContainer.java#L438-L453
15,257
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/collection/impl/queue/QueueContainer.java
QueueContainer.offerBackup
public void offerBackup(Data data, long itemId) { QueueItem item = new QueueItem(this, itemId, null); if (!store.isEnabled() || store.getMemoryLimit() > getItemQueue().size()) { item.setData(data); } getBackupMap().put(itemId, item); }
java
public void offerBackup(Data data, long itemId) { QueueItem item = new QueueItem(this, itemId, null); if (!store.isEnabled() || store.getMemoryLimit() > getItemQueue().size()) { item.setData(data); } getBackupMap().put(itemId, item); }
[ "public", "void", "offerBackup", "(", "Data", "data", ",", "long", "itemId", ")", "{", "QueueItem", "item", "=", "new", "QueueItem", "(", "this", ",", "itemId", ",", "null", ")", ";", "if", "(", "!", "store", ".", "isEnabled", "(", ")", "||", "store"...
Offers the item to the backup map. If the memory limit has been achieved the item data will not be kept in-memory. Executed on the backup replica @param data the item data @param itemId the item ID as determined by the primary replica
[ "Offers", "the", "item", "to", "the", "backup", "map", ".", "If", "the", "memory", "limit", "has", "been", "achieved", "the", "item", "data", "will", "not", "be", "kept", "in", "-", "memory", ".", "Executed", "on", "the", "backup", "replica" ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/collection/impl/queue/QueueContainer.java#L463-L469
15,258
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/collection/impl/queue/QueueContainer.java
QueueContainer.addAllBackup
public void addAllBackup(Map<Long, Data> dataMap) { for (Map.Entry<Long, Data> entry : dataMap.entrySet()) { QueueItem item = new QueueItem(this, entry.getKey(), null); if (!store.isEnabled() || store.getMemoryLimit() > getItemQueue().size()) { item.setData(entry.getValue...
java
public void addAllBackup(Map<Long, Data> dataMap) { for (Map.Entry<Long, Data> entry : dataMap.entrySet()) { QueueItem item = new QueueItem(this, entry.getKey(), null); if (!store.isEnabled() || store.getMemoryLimit() > getItemQueue().size()) { item.setData(entry.getValue...
[ "public", "void", "addAllBackup", "(", "Map", "<", "Long", ",", "Data", ">", "dataMap", ")", "{", "for", "(", "Map", ".", "Entry", "<", "Long", ",", "Data", ">", "entry", ":", "dataMap", ".", "entrySet", "(", ")", ")", "{", "QueueItem", "item", "="...
Offers the items to the backup map in bulk. If the memory limit has been achieved the item data will not be kept in-memory. Executed on the backup replica @param dataMap the map from item ID to queue item @see #offerBackup(Data, long)
[ "Offers", "the", "items", "to", "the", "backup", "map", "in", "bulk", ".", "If", "the", "memory", "limit", "has", "been", "achieved", "the", "item", "data", "will", "not", "be", "kept", "in", "-", "memory", ".", "Executed", "on", "the", "backup", "repl...
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/collection/impl/queue/QueueContainer.java#L512-L520
15,259
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/collection/impl/queue/QueueContainer.java
QueueContainer.pollBackup
public void pollBackup(long itemId) { QueueItem item = getBackupMap().remove(itemId); if (item != null) { // for stats age(item, Clock.currentTimeMillis()); } }
java
public void pollBackup(long itemId) { QueueItem item = getBackupMap().remove(itemId); if (item != null) { // for stats age(item, Clock.currentTimeMillis()); } }
[ "public", "void", "pollBackup", "(", "long", "itemId", ")", "{", "QueueItem", "item", "=", "getBackupMap", "(", ")", ".", "remove", "(", "itemId", ")", ";", "if", "(", "item", "!=", "null", ")", "{", "// for stats", "age", "(", "item", ",", "Clock", ...
Polls an item on the backup replica. The item ID is predetermined when executing the poll operation on the partition owner. Executed on the backup replica @param itemId the item ID as determined by the primary replica
[ "Polls", "an", "item", "on", "the", "backup", "replica", ".", "The", "item", "ID", "is", "predetermined", "when", "executing", "the", "poll", "operation", "on", "the", "partition", "owner", ".", "Executed", "on", "the", "backup", "replica" ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/collection/impl/queue/QueueContainer.java#L574-L580
15,260
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/collection/impl/queue/QueueContainer.java
QueueContainer.remove
public long remove(Data data) { Iterator<QueueItem> iterator = getItemQueue().iterator(); while (iterator.hasNext()) { QueueItem item = iterator.next(); if (data.equals(item.getData())) { if (store.isEnabled()) { try { s...
java
public long remove(Data data) { Iterator<QueueItem> iterator = getItemQueue().iterator(); while (iterator.hasNext()) { QueueItem item = iterator.next(); if (data.equals(item.getData())) { if (store.isEnabled()) { try { s...
[ "public", "long", "remove", "(", "Data", "data", ")", "{", "Iterator", "<", "QueueItem", ">", "iterator", "=", "getItemQueue", "(", ")", ".", "iterator", "(", ")", ";", "while", "(", "iterator", ".", "hasNext", "(", ")", ")", "{", "QueueItem", "item", ...
iterates all items, checks equality with data This method does not trigger store load.
[ "iterates", "all", "items", "checks", "equality", "with", "data", "This", "method", "does", "not", "trigger", "store", "load", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/collection/impl/queue/QueueContainer.java#L688-L708
15,261
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/collection/impl/queue/QueueContainer.java
QueueContainer.contains
public boolean contains(Collection<Data> dataSet) { for (Data data : dataSet) { boolean contains = false; for (QueueItem item : getItemQueue()) { if (item.getData() != null && item.getData().equals(data)) { contains = true; break; ...
java
public boolean contains(Collection<Data> dataSet) { for (Data data : dataSet) { boolean contains = false; for (QueueItem item : getItemQueue()) { if (item.getData() != null && item.getData().equals(data)) { contains = true; break; ...
[ "public", "boolean", "contains", "(", "Collection", "<", "Data", ">", "dataSet", ")", "{", "for", "(", "Data", "data", ":", "dataSet", ")", "{", "boolean", "contains", "=", "false", ";", "for", "(", "QueueItem", "item", ":", "getItemQueue", "(", ")", "...
Checks if the queue contains all items in the dataSet. This method does not trigger store load. @param dataSet the items which should be stored in the queue @return true if the queue contains all items, false otherwise
[ "Checks", "if", "the", "queue", "contains", "all", "items", "in", "the", "dataSet", ".", "This", "method", "does", "not", "trigger", "store", "load", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/collection/impl/queue/QueueContainer.java#L726-L740
15,262
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/collection/impl/queue/QueueContainer.java
QueueContainer.getAsDataList
public List<Data> getAsDataList() { List<Data> dataList = new ArrayList<Data>(getItemQueue().size()); for (QueueItem item : getItemQueue()) { if (store.isEnabled() && item.getData() == null) { try { load(item); } catch (Exception e) { ...
java
public List<Data> getAsDataList() { List<Data> dataList = new ArrayList<Data>(getItemQueue().size()); for (QueueItem item : getItemQueue()) { if (store.isEnabled() && item.getData() == null) { try { load(item); } catch (Exception e) { ...
[ "public", "List", "<", "Data", ">", "getAsDataList", "(", ")", "{", "List", "<", "Data", ">", "dataList", "=", "new", "ArrayList", "<", "Data", ">", "(", "getItemQueue", "(", ")", ".", "size", "(", ")", ")", ";", "for", "(", "QueueItem", "item", ":...
Returns data in the queue. This method triggers store load. @return the item data in the queue.
[ "Returns", "data", "in", "the", "queue", ".", "This", "method", "triggers", "store", "load", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/collection/impl/queue/QueueContainer.java#L747-L760
15,263
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/collection/impl/queue/QueueContainer.java
QueueContainer.getItemQueue
public Deque<QueueItem> getItemQueue() { if (itemQueue == null) { itemQueue = new LinkedList<QueueItem>(); if (backupMap != null && !backupMap.isEmpty()) { List<QueueItem> values = new ArrayList<QueueItem>(backupMap.values()); Collections.sort(values); ...
java
public Deque<QueueItem> getItemQueue() { if (itemQueue == null) { itemQueue = new LinkedList<QueueItem>(); if (backupMap != null && !backupMap.isEmpty()) { List<QueueItem> values = new ArrayList<QueueItem>(backupMap.values()); Collections.sort(values); ...
[ "public", "Deque", "<", "QueueItem", ">", "getItemQueue", "(", ")", "{", "if", "(", "itemQueue", "==", "null", ")", "{", "itemQueue", "=", "new", "LinkedList", "<", "QueueItem", ">", "(", ")", ";", "if", "(", "backupMap", "!=", "null", "&&", "!", "ba...
Returns the item queue on the partition owner. This method will also move the items from the backup map if this member has been promoted from a backup replica to the partition owner and clear the backup map. @return the item queue
[ "Returns", "the", "item", "queue", "on", "the", "partition", "owner", ".", "This", "method", "will", "also", "move", "the", "items", "from", "the", "backup", "map", "if", "this", "member", "has", "been", "promoted", "from", "a", "backup", "replica", "to", ...
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/collection/impl/queue/QueueContainer.java#L894-L917
15,264
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/collection/impl/queue/QueueContainer.java
QueueContainer.getBackupMap
public Map<Long, QueueItem> getBackupMap() { if (backupMap == null) { if (itemQueue != null) { backupMap = createHashMap(itemQueue.size()); for (QueueItem item : itemQueue) { backupMap.put(item.getItemId(), item); } ...
java
public Map<Long, QueueItem> getBackupMap() { if (backupMap == null) { if (itemQueue != null) { backupMap = createHashMap(itemQueue.size()); for (QueueItem item : itemQueue) { backupMap.put(item.getItemId(), item); } ...
[ "public", "Map", "<", "Long", ",", "QueueItem", ">", "getBackupMap", "(", ")", "{", "if", "(", "backupMap", "==", "null", ")", "{", "if", "(", "itemQueue", "!=", "null", ")", "{", "backupMap", "=", "createHashMap", "(", "itemQueue", ".", "size", "(", ...
Return the map containing queue items when this instance is a backup replica. The map contains both items that are parts of different transactions and items which have already been committed to the queue. @return backup replica map from item ID to queue item
[ "Return", "the", "map", "containing", "queue", "items", "when", "this", "instance", "is", "a", "backup", "replica", ".", "The", "map", "contains", "both", "items", "that", "are", "parts", "of", "different", "transactions", "and", "items", "which", "have", "a...
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/collection/impl/queue/QueueContainer.java#L928-L942
15,265
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/collection/impl/txncollection/CollectionTransactionLogRecord.java
CollectionTransactionLogRecord.createItemIdArray
protected long[] createItemIdArray() { int size = operationList.size(); long[] itemIds = new long[size]; for (int i = 0; i < size; i++) { CollectionTxnOperation operation = (CollectionTxnOperation) operationList.get(i); itemIds[i] = CollectionTxnUtil.getItemId(operation);...
java
protected long[] createItemIdArray() { int size = operationList.size(); long[] itemIds = new long[size]; for (int i = 0; i < size; i++) { CollectionTxnOperation operation = (CollectionTxnOperation) operationList.get(i); itemIds[i] = CollectionTxnUtil.getItemId(operation);...
[ "protected", "long", "[", "]", "createItemIdArray", "(", ")", "{", "int", "size", "=", "operationList", ".", "size", "(", ")", ";", "long", "[", "]", "itemIds", "=", "new", "long", "[", "size", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i"...
Creates an array of IDs for all operations in this transaction log. The ID is negative if the operation is a remove operation. @return an array of IDs for all operations in this transaction log
[ "Creates", "an", "array", "of", "IDs", "for", "all", "operations", "in", "this", "transaction", "log", ".", "The", "ID", "is", "negative", "if", "the", "operation", "is", "a", "remove", "operation", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/collection/impl/txncollection/CollectionTransactionLogRecord.java#L108-L116
15,266
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/ringbuffer/impl/operations/ReplicationOperation.java
ReplicationOperation.getRingbufferConfig
private RingbufferConfig getRingbufferConfig(RingbufferService service, ObjectNamespace ns) { final String serviceName = ns.getServiceName(); if (RingbufferService.SERVICE_NAME.equals(serviceName)) { return service.getRingbufferConfig(ns.getObjectName()); } else if (MapService.SERVIC...
java
private RingbufferConfig getRingbufferConfig(RingbufferService service, ObjectNamespace ns) { final String serviceName = ns.getServiceName(); if (RingbufferService.SERVICE_NAME.equals(serviceName)) { return service.getRingbufferConfig(ns.getObjectName()); } else if (MapService.SERVIC...
[ "private", "RingbufferConfig", "getRingbufferConfig", "(", "RingbufferService", "service", ",", "ObjectNamespace", "ns", ")", "{", "final", "String", "serviceName", "=", "ns", ".", "getServiceName", "(", ")", ";", "if", "(", "RingbufferService", ".", "SERVICE_NAME",...
Returns the ringbuffer config for the provided namespace. The namespace provides information whether the requested ringbuffer is a ringbuffer that the user is directly interacting with through a ringbuffer proxy or if this is a backing ringbuffer for an event journal. If a ringbuffer configuration for an event journal ...
[ "Returns", "the", "ringbuffer", "config", "for", "the", "provided", "namespace", ".", "The", "namespace", "provides", "information", "whether", "the", "requested", "ringbuffer", "is", "a", "ringbuffer", "that", "the", "user", "is", "directly", "interacting", "with...
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/ringbuffer/impl/operations/ReplicationOperation.java#L82-L99
15,267
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/internal/nearcache/impl/invalidation/RepairingHandler.java
RepairingHandler.handle
public void handle(Data key, String sourceUuid, UUID partitionUuid, long sequence) { // apply invalidation if it's not originated by local member/client (because local // Near Caches are invalidated immediately there is no need to invalidate them twice) if (!localUuid.equals(sourceUuid)) { ...
java
public void handle(Data key, String sourceUuid, UUID partitionUuid, long sequence) { // apply invalidation if it's not originated by local member/client (because local // Near Caches are invalidated immediately there is no need to invalidate them twice) if (!localUuid.equals(sourceUuid)) { ...
[ "public", "void", "handle", "(", "Data", "key", ",", "String", "sourceUuid", ",", "UUID", "partitionUuid", ",", "long", "sequence", ")", "{", "// apply invalidation if it's not originated by local member/client (because local", "// Near Caches are invalidated immediately there is...
Handles a single invalidation
[ "Handles", "a", "single", "invalidation" ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/nearcache/impl/invalidation/RepairingHandler.java#L82-L97
15,268
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/internal/nearcache/impl/invalidation/RepairingHandler.java
RepairingHandler.handle
public void handle(Collection<Data> keys, Collection<String> sourceUuids, Collection<UUID> partitionUuids, Collection<Long> sequences) { Iterator<Data> keyIterator = keys.iterator(); Iterator<Long> sequenceIterator = sequences.iterator(); Iterator<UUID> partitionUuidIterat...
java
public void handle(Collection<Data> keys, Collection<String> sourceUuids, Collection<UUID> partitionUuids, Collection<Long> sequences) { Iterator<Data> keyIterator = keys.iterator(); Iterator<Long> sequenceIterator = sequences.iterator(); Iterator<UUID> partitionUuidIterat...
[ "public", "void", "handle", "(", "Collection", "<", "Data", ">", "keys", ",", "Collection", "<", "String", ">", "sourceUuids", ",", "Collection", "<", "UUID", ">", "partitionUuids", ",", "Collection", "<", "Long", ">", "sequences", ")", "{", "Iterator", "<...
Handles batch invalidations
[ "Handles", "batch", "invalidations" ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/nearcache/impl/invalidation/RepairingHandler.java#L111-L122
15,269
hazelcast/hazelcast
hazelcast-client/src/main/java/com/hazelcast/client/impl/clientside/ClientExceptionFactory.java
ClientExceptionFactory.register
@SuppressWarnings("WeakerAccess") public void register(int errorCode, Class clazz, ExceptionFactory exceptionFactory) { if (intToFactory.containsKey(errorCode)) { throw new HazelcastException("Code " + errorCode + " already used"); } if (!clazz.equals(exceptionFactory.createExce...
java
@SuppressWarnings("WeakerAccess") public void register(int errorCode, Class clazz, ExceptionFactory exceptionFactory) { if (intToFactory.containsKey(errorCode)) { throw new HazelcastException("Code " + errorCode + " already used"); } if (!clazz.equals(exceptionFactory.createExce...
[ "@", "SuppressWarnings", "(", "\"WeakerAccess\"", ")", "public", "void", "register", "(", "int", "errorCode", ",", "Class", "clazz", ",", "ExceptionFactory", "exceptionFactory", ")", "{", "if", "(", "intToFactory", ".", "containsKey", "(", "errorCode", ")", ")",...
method is used by Jet
[ "method", "is", "used", "by", "Jet" ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast-client/src/main/java/com/hazelcast/client/impl/clientside/ClientExceptionFactory.java#L812-L823
15,270
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/map/impl/eviction/MapClearExpiredRecordsTask.java
MapClearExpiredRecordsTask.notHaveAnyExpirableRecord
@Override protected boolean notHaveAnyExpirableRecord(PartitionContainer partitionContainer) { boolean notExist = true; final ConcurrentMap<String, RecordStore> maps = partitionContainer.getMaps(); for (RecordStore store : maps.values()) { if (store.isExpirable()) { ...
java
@Override protected boolean notHaveAnyExpirableRecord(PartitionContainer partitionContainer) { boolean notExist = true; final ConcurrentMap<String, RecordStore> maps = partitionContainer.getMaps(); for (RecordStore store : maps.values()) { if (store.isExpirable()) { ...
[ "@", "Override", "protected", "boolean", "notHaveAnyExpirableRecord", "(", "PartitionContainer", "partitionContainer", ")", "{", "boolean", "notExist", "=", "true", ";", "final", "ConcurrentMap", "<", "String", ",", "RecordStore", ">", "maps", "=", "partitionContainer...
Here we check if that partition has any expirable record or not, if no expirable record exists in that partition no need to fire an expiration operation. @param partitionContainer corresponding partition container. @return <code>true</code> if no expirable record in that partition <code>false</code> otherwise.
[ "Here", "we", "check", "if", "that", "partition", "has", "any", "expirable", "record", "or", "not", "if", "no", "expirable", "record", "exists", "in", "that", "partition", "no", "need", "to", "fire", "an", "expiration", "operation", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/map/impl/eviction/MapClearExpiredRecordsTask.java#L213-L224
15,271
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/config/RestApiConfig.java
RestApiConfig.enableGroups
public RestApiConfig enableGroups(RestEndpointGroup... endpointGroups) { if (endpointGroups != null) { enabledGroups.addAll(Arrays.asList(endpointGroups)); } return this; }
java
public RestApiConfig enableGroups(RestEndpointGroup... endpointGroups) { if (endpointGroups != null) { enabledGroups.addAll(Arrays.asList(endpointGroups)); } return this; }
[ "public", "RestApiConfig", "enableGroups", "(", "RestEndpointGroup", "...", "endpointGroups", ")", "{", "if", "(", "endpointGroups", "!=", "null", ")", "{", "enabledGroups", ".", "addAll", "(", "Arrays", ".", "asList", "(", "endpointGroups", ")", ")", ";", "}"...
Enables provided REST endpoint groups. It doesn't replace already enabled groups.
[ "Enables", "provided", "REST", "endpoint", "groups", ".", "It", "doesn", "t", "replace", "already", "enabled", "groups", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/config/RestApiConfig.java#L57-L62
15,272
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/config/RestApiConfig.java
RestApiConfig.disableGroups
public RestApiConfig disableGroups(RestEndpointGroup... endpointGroups) { if (endpointGroups != null) { enabledGroups.removeAll(Arrays.asList(endpointGroups)); } return this; }
java
public RestApiConfig disableGroups(RestEndpointGroup... endpointGroups) { if (endpointGroups != null) { enabledGroups.removeAll(Arrays.asList(endpointGroups)); } return this; }
[ "public", "RestApiConfig", "disableGroups", "(", "RestEndpointGroup", "...", "endpointGroups", ")", "{", "if", "(", "endpointGroups", "!=", "null", ")", "{", "enabledGroups", ".", "removeAll", "(", "Arrays", ".", "asList", "(", "endpointGroups", ")", ")", ";", ...
Disables provided REST endpoint groups.
[ "Disables", "provided", "REST", "endpoint", "groups", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/config/RestApiConfig.java#L75-L80
15,273
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/crdt/CRDTMigrationTask.java
CRDTMigrationTask.getLocalMemberListIndex
private int getLocalMemberListIndex() { final Collection<Member> dataMembers = nodeEngine.getClusterService().getMembers(DATA_MEMBER_SELECTOR); int index = -1; for (Member dataMember : dataMembers) { index++; if (dataMember.equals(nodeEngine.getLocalMember())) { ...
java
private int getLocalMemberListIndex() { final Collection<Member> dataMembers = nodeEngine.getClusterService().getMembers(DATA_MEMBER_SELECTOR); int index = -1; for (Member dataMember : dataMembers) { index++; if (dataMember.equals(nodeEngine.getLocalMember())) { ...
[ "private", "int", "getLocalMemberListIndex", "(", ")", "{", "final", "Collection", "<", "Member", ">", "dataMembers", "=", "nodeEngine", ".", "getClusterService", "(", ")", ".", "getMembers", "(", "DATA_MEMBER_SELECTOR", ")", ";", "int", "index", "=", "-", "1"...
Returns the index of the local member in the membership list containing only data members.
[ "Returns", "the", "index", "of", "the", "local", "member", "in", "the", "membership", "list", "containing", "only", "data", "members", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/crdt/CRDTMigrationTask.java#L124-L134
15,274
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/internal/json/JsonArray.java
JsonArray.add
public JsonArray add(JsonValue value) { if (value == null) { throw new NullPointerException("value is null"); } values.add(value); return this; }
java
public JsonArray add(JsonValue value) { if (value == null) { throw new NullPointerException("value is null"); } values.add(value); return this; }
[ "public", "JsonArray", "add", "(", "JsonValue", "value", ")", "{", "if", "(", "value", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "\"value is null\"", ")", ";", "}", "values", ".", "add", "(", "value", ")", ";", "return", "this"...
Appends the specified JSON value to the end of this array. @param value the JsonValue to add to the array, must not be <code>null</code> @return the array itself, to enable method chaining
[ "Appends", "the", "specified", "JSON", "value", "to", "the", "end", "of", "this", "array", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/json/JsonArray.java#L238-L244
15,275
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/internal/json/JsonArray.java
JsonArray.set
public JsonArray set(int index, JsonValue value) { if (value == null) { throw new NullPointerException("value is null"); } values.set(index, value); return this; }
java
public JsonArray set(int index, JsonValue value) { if (value == null) { throw new NullPointerException("value is null"); } values.set(index, value); return this; }
[ "public", "JsonArray", "set", "(", "int", "index", ",", "JsonValue", "value", ")", "{", "if", "(", "value", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "\"value is null\"", ")", ";", "}", "values", ".", "set", "(", "index", ",", ...
Replaces the element at the specified position in this array with the specified JSON value. @param index the index of the array element to replace @param value the value to be stored at the specified array position, must not be <code>null</code> @return the array itself, to enable method chaining @throws IndexOutOfBou...
[ "Replaces", "the", "element", "at", "the", "specified", "position", "in", "this", "array", "with", "the", "specified", "JSON", "value", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/json/JsonArray.java#L366-L372
15,276
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/internal/json/JsonArray.java
JsonArray.iterator
public Iterator<JsonValue> iterator() { final Iterator<JsonValue> iterator = values.iterator(); return new Iterator<JsonValue>() { public boolean hasNext() { return iterator.hasNext(); } public JsonValue next() { return iterator.next(); } public void remove() { ...
java
public Iterator<JsonValue> iterator() { final Iterator<JsonValue> iterator = values.iterator(); return new Iterator<JsonValue>() { public boolean hasNext() { return iterator.hasNext(); } public JsonValue next() { return iterator.next(); } public void remove() { ...
[ "public", "Iterator", "<", "JsonValue", ">", "iterator", "(", ")", "{", "final", "Iterator", "<", "JsonValue", ">", "iterator", "=", "values", ".", "iterator", "(", ")", ";", "return", "new", "Iterator", "<", "JsonValue", ">", "(", ")", "{", "public", ...
Returns an iterator over the values of this array in document order. The returned iterator cannot be used to modify this array. @return an iterator over the values of this array
[ "Returns", "an", "iterator", "over", "the", "values", "of", "this", "array", "in", "document", "order", ".", "The", "returned", "iterator", "cannot", "be", "used", "to", "modify", "this", "array", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/json/JsonArray.java#L438-L454
15,277
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/client/impl/protocol/util/BufferBuilder.java
BufferBuilder.append
public BufferBuilder append(ClientProtocolBuffer srcBuffer, int srcOffset, int length) { ensureCapacity(length); srcBuffer.getBytes(srcOffset, protocolBuffer.byteArray(), position, length); position += length; return this; }
java
public BufferBuilder append(ClientProtocolBuffer srcBuffer, int srcOffset, int length) { ensureCapacity(length); srcBuffer.getBytes(srcOffset, protocolBuffer.byteArray(), position, length); position += length; return this; }
[ "public", "BufferBuilder", "append", "(", "ClientProtocolBuffer", "srcBuffer", ",", "int", "srcOffset", ",", "int", "length", ")", "{", "ensureCapacity", "(", "length", ")", ";", "srcBuffer", ".", "getBytes", "(", "srcOffset", ",", "protocolBuffer", ".", "byteAr...
Append a source buffer to the end of the internal buffer, resizing the internal buffer as required. @param srcBuffer from which to copy. @param srcOffset in the source buffer from which to copy. @param length in bytes to copy from the source buffer. @return the builder for fluent API usage.
[ "Append", "a", "source", "buffer", "to", "the", "end", "of", "the", "internal", "buffer", "resizing", "the", "internal", "buffer", "as", "required", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/client/impl/protocol/util/BufferBuilder.java#L95-L102
15,278
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/cp/internal/raft/impl/log/RaftLog.java
RaftLog.appendEntries
public void appendEntries(LogEntry... newEntries) { int lastTerm = lastLogOrSnapshotTerm(); long lastIndex = lastLogOrSnapshotIndex(); if (!checkAvailableCapacity(newEntries.length)) { throw new IllegalStateException("Not enough capacity! Capacity: " + logs.getCapacity() ...
java
public void appendEntries(LogEntry... newEntries) { int lastTerm = lastLogOrSnapshotTerm(); long lastIndex = lastLogOrSnapshotIndex(); if (!checkAvailableCapacity(newEntries.length)) { throw new IllegalStateException("Not enough capacity! Capacity: " + logs.getCapacity() ...
[ "public", "void", "appendEntries", "(", "LogEntry", "...", "newEntries", ")", "{", "int", "lastTerm", "=", "lastLogOrSnapshotTerm", "(", ")", ";", "long", "lastIndex", "=", "lastLogOrSnapshotIndex", "(", ")", ";", "if", "(", "!", "checkAvailableCapacity", "(", ...
Appends new entries to the Raft log. @throws IllegalArgumentException If an entry is appended with a lower term than the last term in the log or if an entry is appended with an index not equal to {@code index == lastIndex + 1}.
[ "Appends", "new", "entries", "to", "the", "Raft", "log", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/cp/internal/raft/impl/log/RaftLog.java#L172-L194
15,279
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/internal/json/JsonReducedValueParser.java
JsonReducedValueParser.parse
public JsonValue parse(Reader reader, int buffersize) throws IOException { if (reader == null) { throw new NullPointerException("reader is null"); } if (buffersize <= 0) { throw new IllegalArgumentException("buffersize is zero or negative"); } this.reader ...
java
public JsonValue parse(Reader reader, int buffersize) throws IOException { if (reader == null) { throw new NullPointerException("reader is null"); } if (buffersize <= 0) { throw new IllegalArgumentException("buffersize is zero or negative"); } this.reader ...
[ "public", "JsonValue", "parse", "(", "Reader", "reader", ",", "int", "buffersize", ")", "throws", "IOException", "{", "if", "(", "reader", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "\"reader is null\"", ")", ";", "}", "if", "(", ...
Reads a single value from the given reader and parses it as JsonValue. The input must be pointing to the beginning of a JsonLiteral, not JsonArray or JsonObject. @param reader the reader to read the input from @param buffersize the size of the input buffer in chars @throws IOException if an I/O error occurs in ...
[ "Reads", "a", "single", "value", "from", "the", "given", "reader", "and", "parses", "it", "as", "JsonValue", ".", "The", "input", "must", "be", "pointing", "to", "the", "beginning", "of", "a", "JsonLiteral", "not", "JsonArray", "or", "JsonObject", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/json/JsonReducedValueParser.java#L78-L96
15,280
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/util/ThreadUtil.java
ThreadUtil.getThreadId
public static long getThreadId() { final Long threadId = THREAD_LOCAL.get(); if (threadId != null) { return threadId; } return Thread.currentThread().getId(); }
java
public static long getThreadId() { final Long threadId = THREAD_LOCAL.get(); if (threadId != null) { return threadId; } return Thread.currentThread().getId(); }
[ "public", "static", "long", "getThreadId", "(", ")", "{", "final", "Long", "threadId", "=", "THREAD_LOCAL", ".", "get", "(", ")", ";", "if", "(", "threadId", "!=", "null", ")", "{", "return", "threadId", ";", "}", "return", "Thread", ".", "currentThread"...
Get the thread ID. @return the thread ID
[ "Get", "the", "thread", "ID", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/util/ThreadUtil.java#L36-L42
15,281
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/util/ThreadUtil.java
ThreadUtil.createThreadName
public static String createThreadName(String hzName, String name) { checkNotNull(name, "name can't be null"); return "hz." + hzName + "." + name; }
java
public static String createThreadName(String hzName, String name) { checkNotNull(name, "name can't be null"); return "hz." + hzName + "." + name; }
[ "public", "static", "String", "createThreadName", "(", "String", "hzName", ",", "String", "name", ")", "{", "checkNotNull", "(", "name", ",", "\"name can't be null\"", ")", ";", "return", "\"hz.\"", "+", "hzName", "+", "\".\"", "+", "name", ";", "}" ]
Creates the threadname with prefix and notation. @param hzName the name of the hazelcast instance @param name the basic name of the thread @return the threadname . @throws java.lang.NullPointerException if name is null.
[ "Creates", "the", "threadname", "with", "prefix", "and", "notation", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/util/ThreadUtil.java#L69-L72
15,282
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/cache/impl/DeferredValue.java
DeferredValue.get
public V get(SerializationService serializationService) { if (!valueExists) { // it's ok to deserialize twice in case of race assert serializationService != null; value = serializationService.toObject(serializedValue); valueExists = true; } return ...
java
public V get(SerializationService serializationService) { if (!valueExists) { // it's ok to deserialize twice in case of race assert serializationService != null; value = serializationService.toObject(serializedValue); valueExists = true; } return ...
[ "public", "V", "get", "(", "SerializationService", "serializationService", ")", "{", "if", "(", "!", "valueExists", ")", "{", "// it's ok to deserialize twice in case of race", "assert", "serializationService", "!=", "null", ";", "value", "=", "serializationService", "....
get-or-deserialize-and-get
[ "get", "-", "or", "-", "deserialize", "-", "and", "-", "get" ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/cache/impl/DeferredValue.java#L55-L63
15,283
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/cache/impl/DeferredValue.java
DeferredValue.shallowCopy
public DeferredValue<V> shallowCopy() { if (this == NULL_VALUE) { return NULL_VALUE; } DeferredValue<V> copy = new DeferredValue<V>(); if (serializedValueExists) { copy.serializedValueExists = true; copy.serializedValue = serializedValue; } ...
java
public DeferredValue<V> shallowCopy() { if (this == NULL_VALUE) { return NULL_VALUE; } DeferredValue<V> copy = new DeferredValue<V>(); if (serializedValueExists) { copy.serializedValueExists = true; copy.serializedValue = serializedValue; } ...
[ "public", "DeferredValue", "<", "V", ">", "shallowCopy", "(", ")", "{", "if", "(", "this", "==", "NULL_VALUE", ")", "{", "return", "NULL_VALUE", ";", "}", "DeferredValue", "<", "V", ">", "copy", "=", "new", "DeferredValue", "<", "V", ">", "(", ")", "...
returns a new DeferredValue representing the same value as this
[ "returns", "a", "new", "DeferredValue", "representing", "the", "same", "value", "as", "this" ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/cache/impl/DeferredValue.java#L75-L89
15,284
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/internal/cluster/impl/MembershipManager.java
MembershipManager.updateMembers
void updateMembers(MembersView membersView) { MemberMap currentMemberMap = memberMapRef.get(); Collection<MemberImpl> addedMembers = new LinkedList<>(); Collection<MemberImpl> removedMembers = new LinkedList<>(); ClusterHeartbeatManager clusterHeartbeatManager = clusterService.getCluste...
java
void updateMembers(MembersView membersView) { MemberMap currentMemberMap = memberMapRef.get(); Collection<MemberImpl> addedMembers = new LinkedList<>(); Collection<MemberImpl> removedMembers = new LinkedList<>(); ClusterHeartbeatManager clusterHeartbeatManager = clusterService.getCluste...
[ "void", "updateMembers", "(", "MembersView", "membersView", ")", "{", "MemberMap", "currentMemberMap", "=", "memberMapRef", ".", "get", "(", ")", ";", "Collection", "<", "MemberImpl", ">", "addedMembers", "=", "new", "LinkedList", "<>", "(", ")", ";", "Collect...
handles both new and left members
[ "handles", "both", "new", "and", "left", "members" ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/cluster/impl/MembershipManager.java#L283-L344
15,285
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/config/replacer/AbstractPbeReplacer.java
AbstractPbeReplacer.decrypt
protected String decrypt(String encryptedStr) throws Exception { String[] split = encryptedStr.split(":"); checkTrue(split.length == 3, "Wrong format of the encrypted variable (" + encryptedStr + ")"); byte[] salt = Base64.getDecoder().decode(split[0].getBytes(UTF8_CHARSET)); checkTrue(s...
java
protected String decrypt(String encryptedStr) throws Exception { String[] split = encryptedStr.split(":"); checkTrue(split.length == 3, "Wrong format of the encrypted variable (" + encryptedStr + ")"); byte[] salt = Base64.getDecoder().decode(split[0].getBytes(UTF8_CHARSET)); checkTrue(s...
[ "protected", "String", "decrypt", "(", "String", "encryptedStr", ")", "throws", "Exception", "{", "String", "[", "]", "split", "=", "encryptedStr", ".", "split", "(", "\":\"", ")", ";", "checkTrue", "(", "split", ".", "length", "==", "3", ",", "\"Wrong for...
Decrypts given encrypted variable. @param encryptedStr @return
[ "Decrypts", "given", "encrypted", "variable", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/config/replacer/AbstractPbeReplacer.java#L139-L147
15,286
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/spi/impl/operationservice/impl/OperationServiceImpl.java
OperationServiceImpl.shutdownInvocations
public void shutdownInvocations() { logger.finest("Shutting down invocations"); invocationRegistry.shutdown(); invocationMonitor.shutdown(); inboundResponseHandlerSupplier.shutdown(); try { invocationMonitor.awaitTermination(TERMINATION_TIMEOUT_MILLIS); } ca...
java
public void shutdownInvocations() { logger.finest("Shutting down invocations"); invocationRegistry.shutdown(); invocationMonitor.shutdown(); inboundResponseHandlerSupplier.shutdown(); try { invocationMonitor.awaitTermination(TERMINATION_TIMEOUT_MILLIS); } ca...
[ "public", "void", "shutdownInvocations", "(", ")", "{", "logger", ".", "finest", "(", "\"Shutting down invocations\"", ")", ";", "invocationRegistry", ".", "shutdown", "(", ")", ";", "invocationMonitor", ".", "shutdown", "(", ")", ";", "inboundResponseHandlerSupplie...
Shuts down invocation infrastructure. New invocation requests will be rejected after shutdown and all pending invocations will be notified with a failure response.
[ "Shuts", "down", "invocation", "infrastructure", ".", "New", "invocation", "requests", "will", "be", "rejected", "after", "shutdown", "and", "all", "pending", "invocations", "will", "be", "notified", "with", "a", "failure", "response", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/spi/impl/operationservice/impl/OperationServiceImpl.java#L500-L513
15,287
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/query/impl/Indexes.java
Indexes.markPartitionAsIndexed
public static void markPartitionAsIndexed(int partitionId, InternalIndex[] indexes) { for (InternalIndex index : indexes) { index.markPartitionAsIndexed(partitionId); } }
java
public static void markPartitionAsIndexed(int partitionId, InternalIndex[] indexes) { for (InternalIndex index : indexes) { index.markPartitionAsIndexed(partitionId); } }
[ "public", "static", "void", "markPartitionAsIndexed", "(", "int", "partitionId", ",", "InternalIndex", "[", "]", "indexes", ")", "{", "for", "(", "InternalIndex", "index", ":", "indexes", ")", "{", "index", ".", "markPartitionAsIndexed", "(", "partitionId", ")",...
Marks the given partition as indexed by the given indexes. @param partitionId the ID of the partition to mark as indexed. @param indexes the indexes by which the given partition is indexed.
[ "Marks", "the", "given", "partition", "as", "indexed", "by", "the", "given", "indexes", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/query/impl/Indexes.java#L81-L85
15,288
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/query/impl/Indexes.java
Indexes.markPartitionAsUnindexed
public static void markPartitionAsUnindexed(int partitionId, InternalIndex[] indexes) { for (InternalIndex index : indexes) { index.markPartitionAsUnindexed(partitionId); } }
java
public static void markPartitionAsUnindexed(int partitionId, InternalIndex[] indexes) { for (InternalIndex index : indexes) { index.markPartitionAsUnindexed(partitionId); } }
[ "public", "static", "void", "markPartitionAsUnindexed", "(", "int", "partitionId", ",", "InternalIndex", "[", "]", "indexes", ")", "{", "for", "(", "InternalIndex", "index", ":", "indexes", ")", "{", "index", ".", "markPartitionAsUnindexed", "(", "partitionId", ...
Marks the given partition as unindexed by the given indexes. @param partitionId the ID of the partition to mark as unindexed. @param indexes the indexes by which the given partition is unindexed.
[ "Marks", "the", "given", "partition", "as", "unindexed", "by", "the", "given", "indexes", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/query/impl/Indexes.java#L93-L97
15,289
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/query/impl/Indexes.java
Indexes.destroyIndexes
public void destroyIndexes() { InternalIndex[] indexesSnapshot = getIndexes(); indexes = EMPTY_INDEXES; compositeIndexes = EMPTY_INDEXES; indexesByName.clear(); attributeIndexRegistry.clear(); converterCache.clear(); for (InternalIndex index : indexesSnapshot) {...
java
public void destroyIndexes() { InternalIndex[] indexesSnapshot = getIndexes(); indexes = EMPTY_INDEXES; compositeIndexes = EMPTY_INDEXES; indexesByName.clear(); attributeIndexRegistry.clear(); converterCache.clear(); for (InternalIndex index : indexesSnapshot) {...
[ "public", "void", "destroyIndexes", "(", ")", "{", "InternalIndex", "[", "]", "indexesSnapshot", "=", "getIndexes", "(", ")", ";", "indexes", "=", "EMPTY_INDEXES", ";", "compositeIndexes", "=", "EMPTY_INDEXES", ";", "indexesByName", ".", "clear", "(", ")", ";"...
Destroys and then removes all the indexes from this indexes instance.
[ "Destroys", "and", "then", "removes", "all", "the", "indexes", "from", "this", "indexes", "instance", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/query/impl/Indexes.java#L175-L187
15,290
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/query/impl/Indexes.java
Indexes.putEntry
public void putEntry(QueryableEntry queryableEntry, Object oldValue, Index.OperationSource operationSource) { InternalIndex[] indexes = getIndexes(); for (InternalIndex index : indexes) { index.putEntry(queryableEntry, oldValue, operationSource); } }
java
public void putEntry(QueryableEntry queryableEntry, Object oldValue, Index.OperationSource operationSource) { InternalIndex[] indexes = getIndexes(); for (InternalIndex index : indexes) { index.putEntry(queryableEntry, oldValue, operationSource); } }
[ "public", "void", "putEntry", "(", "QueryableEntry", "queryableEntry", ",", "Object", "oldValue", ",", "Index", ".", "OperationSource", "operationSource", ")", "{", "InternalIndex", "[", "]", "indexes", "=", "getIndexes", "(", ")", ";", "for", "(", "InternalInde...
Inserts a new queryable entry into this indexes instance or updates the existing one. @param queryableEntry the queryable entry to insert or update. @param oldValue the old entry value to update, {@code null} if inserting the new entry. @param operationSource the operation source.
[ "Inserts", "a", "new", "queryable", "entry", "into", "this", "indexes", "instance", "or", "updates", "the", "existing", "one", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/query/impl/Indexes.java#L217-L222
15,291
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/query/impl/Indexes.java
Indexes.removeEntry
public void removeEntry(Data key, Object value, Index.OperationSource operationSource) { InternalIndex[] indexes = getIndexes(); for (InternalIndex index : indexes) { index.removeEntry(key, value, operationSource); } }
java
public void removeEntry(Data key, Object value, Index.OperationSource operationSource) { InternalIndex[] indexes = getIndexes(); for (InternalIndex index : indexes) { index.removeEntry(key, value, operationSource); } }
[ "public", "void", "removeEntry", "(", "Data", "key", ",", "Object", "value", ",", "Index", ".", "OperationSource", "operationSource", ")", "{", "InternalIndex", "[", "]", "indexes", "=", "getIndexes", "(", ")", ";", "for", "(", "InternalIndex", "index", ":",...
Removes the entry from this indexes instance identified by the given key and value. @param key the key if the entry to remove. @param value the value of the entry to remove. @param operationSource the operation source.
[ "Removes", "the", "entry", "from", "this", "indexes", "instance", "identified", "by", "the", "given", "key", "and", "value", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/query/impl/Indexes.java#L232-L237
15,292
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/query/impl/Indexes.java
Indexes.query
@SuppressWarnings("unchecked") public Set<QueryableEntry> query(Predicate predicate) { stats.incrementQueryCount(); if (!haveAtLeastOneIndex() || !(predicate instanceof IndexAwarePredicate)) { return null; } IndexAwarePredicate indexAwarePredicate = (IndexAwarePredicate...
java
@SuppressWarnings("unchecked") public Set<QueryableEntry> query(Predicate predicate) { stats.incrementQueryCount(); if (!haveAtLeastOneIndex() || !(predicate instanceof IndexAwarePredicate)) { return null; } IndexAwarePredicate indexAwarePredicate = (IndexAwarePredicate...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "Set", "<", "QueryableEntry", ">", "query", "(", "Predicate", "predicate", ")", "{", "stats", ".", "incrementQueryCount", "(", ")", ";", "if", "(", "!", "haveAtLeastOneIndex", "(", ")", "||", "!",...
Performs a query on this indexes instance using the given predicate. @param predicate the predicate to evaluate. @return the produced result set or {@code null} if the query can't be performed using the indexes known to this indexes instance.
[ "Performs", "a", "query", "on", "this", "indexes", "instance", "using", "the", "given", "predicate", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/query/impl/Indexes.java#L270-L291
15,293
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/internal/partition/operation/BaseMigrationOperation.java
BaseMigrationOperation.verifyNodeStarted
private void verifyNodeStarted() { NodeEngineImpl nodeEngine = (NodeEngineImpl) getNodeEngine(); nodeStartCompleted = nodeEngine.getNode().getNodeExtension().isStartCompleted(); if (!nodeStartCompleted) { throw new IllegalStateException("Migration operation is received before startup...
java
private void verifyNodeStarted() { NodeEngineImpl nodeEngine = (NodeEngineImpl) getNodeEngine(); nodeStartCompleted = nodeEngine.getNode().getNodeExtension().isStartCompleted(); if (!nodeStartCompleted) { throw new IllegalStateException("Migration operation is received before startup...
[ "private", "void", "verifyNodeStarted", "(", ")", "{", "NodeEngineImpl", "nodeEngine", "=", "(", "NodeEngineImpl", ")", "getNodeEngine", "(", ")", ";", "nodeStartCompleted", "=", "nodeEngine", ".", "getNode", "(", ")", ".", "getNodeExtension", "(", ")", ".", "...
Verifies that the node startup is completed.
[ "Verifies", "that", "the", "node", "startup", "is", "completed", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/partition/operation/BaseMigrationOperation.java#L98-L105
15,294
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/internal/partition/operation/BaseMigrationOperation.java
BaseMigrationOperation.verifyPartitionStateVersion
private void verifyPartitionStateVersion() { InternalPartitionService partitionService = getService(); int localPartitionStateVersion = partitionService.getPartitionStateVersion(); if (partitionStateVersion != localPartitionStateVersion) { if (getNodeEngine().getThisAddress().equals(...
java
private void verifyPartitionStateVersion() { InternalPartitionService partitionService = getService(); int localPartitionStateVersion = partitionService.getPartitionStateVersion(); if (partitionStateVersion != localPartitionStateVersion) { if (getNodeEngine().getThisAddress().equals(...
[ "private", "void", "verifyPartitionStateVersion", "(", ")", "{", "InternalPartitionService", "partitionService", "=", "getService", "(", ")", ";", "int", "localPartitionStateVersion", "=", "partitionService", ".", "getPartitionStateVersion", "(", ")", ";", "if", "(", ...
Verifies that the sent partition state version matches the local version or this node is master.
[ "Verifies", "that", "the", "sent", "partition", "state", "version", "matches", "the", "local", "version", "or", "this", "node", "is", "master", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/partition/operation/BaseMigrationOperation.java#L118-L129
15,295
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/internal/partition/operation/BaseMigrationOperation.java
BaseMigrationOperation.verifyMaster
final void verifyMaster() { NodeEngine nodeEngine = getNodeEngine(); Address masterAddress = nodeEngine.getMasterAddress(); if (!migrationInfo.getMaster().equals(masterAddress)) { throw new IllegalStateException("Migration initiator is not master node! => " + toString()); } ...
java
final void verifyMaster() { NodeEngine nodeEngine = getNodeEngine(); Address masterAddress = nodeEngine.getMasterAddress(); if (!migrationInfo.getMaster().equals(masterAddress)) { throw new IllegalStateException("Migration initiator is not master node! => " + toString()); } ...
[ "final", "void", "verifyMaster", "(", ")", "{", "NodeEngine", "nodeEngine", "=", "getNodeEngine", "(", ")", ";", "Address", "masterAddress", "=", "nodeEngine", ".", "getMasterAddress", "(", ")", ";", "if", "(", "!", "migrationInfo", ".", "getMaster", "(", ")...
Verifies that the local master is equal to the migration master.
[ "Verifies", "that", "the", "local", "master", "is", "equal", "to", "the", "migration", "master", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/partition/operation/BaseMigrationOperation.java#L132-L143
15,296
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/internal/partition/operation/BaseMigrationOperation.java
BaseMigrationOperation.verifyMigrationParticipant
private void verifyMigrationParticipant() { Member localMember = getNodeEngine().getLocalMember(); if (getMigrationParticipantType() == MigrationParticipant.SOURCE) { if (migrationInfo.getSourceCurrentReplicaIndex() == 0 && !migrationInfo.getSource().isIdentical(localMemb...
java
private void verifyMigrationParticipant() { Member localMember = getNodeEngine().getLocalMember(); if (getMigrationParticipantType() == MigrationParticipant.SOURCE) { if (migrationInfo.getSourceCurrentReplicaIndex() == 0 && !migrationInfo.getSource().isIdentical(localMemb...
[ "private", "void", "verifyMigrationParticipant", "(", ")", "{", "Member", "localMember", "=", "getNodeEngine", "(", ")", ".", "getLocalMember", "(", ")", ";", "if", "(", "getMigrationParticipantType", "(", ")", "==", "MigrationParticipant", ".", "SOURCE", ")", "...
Checks if the local member matches the migration source or destination if this node is the migration source or destination.
[ "Checks", "if", "the", "local", "member", "matches", "the", "migration", "source", "or", "destination", "if", "this", "node", "is", "the", "migration", "source", "or", "destination", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/partition/operation/BaseMigrationOperation.java#L149-L165
15,297
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/internal/partition/operation/BaseMigrationOperation.java
BaseMigrationOperation.verifyPartitionOwner
private void verifyPartitionOwner() { InternalPartition partition = getPartition(); PartitionReplica owner = partition.getOwnerReplicaOrNull(); if (owner == null) { throw new RetryableHazelcastException("Cannot migrate at the moment! Owner of the partition is null => " ...
java
private void verifyPartitionOwner() { InternalPartition partition = getPartition(); PartitionReplica owner = partition.getOwnerReplicaOrNull(); if (owner == null) { throw new RetryableHazelcastException("Cannot migrate at the moment! Owner of the partition is null => " ...
[ "private", "void", "verifyPartitionOwner", "(", ")", "{", "InternalPartition", "partition", "=", "getPartition", "(", ")", ";", "PartitionReplica", "owner", "=", "partition", ".", "getOwnerReplicaOrNull", "(", ")", ";", "if", "(", "owner", "==", "null", ")", "...
Verifies that this node is the owner of the partition.
[ "Verifies", "that", "this", "node", "is", "the", "owner", "of", "the", "partition", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/partition/operation/BaseMigrationOperation.java#L168-L179
15,298
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/internal/partition/operation/BaseMigrationOperation.java
BaseMigrationOperation.verifyExistingDestination
final void verifyExistingDestination() { PartitionReplica destination = migrationInfo.getDestination(); Member target = getNodeEngine().getClusterService().getMember(destination.address(), destination.uuid()); if (target == null) { throw new TargetNotMemberException("Destination of m...
java
final void verifyExistingDestination() { PartitionReplica destination = migrationInfo.getDestination(); Member target = getNodeEngine().getClusterService().getMember(destination.address(), destination.uuid()); if (target == null) { throw new TargetNotMemberException("Destination of m...
[ "final", "void", "verifyExistingDestination", "(", ")", "{", "PartitionReplica", "destination", "=", "migrationInfo", ".", "getDestination", "(", ")", ";", "Member", "target", "=", "getNodeEngine", "(", ")", ".", "getClusterService", "(", ")", ".", "getMember", ...
Verifies that the destination is a cluster member.
[ "Verifies", "that", "the", "destination", "is", "a", "cluster", "member", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/partition/operation/BaseMigrationOperation.java#L182-L188
15,299
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/internal/partition/operation/BaseMigrationOperation.java
BaseMigrationOperation.verifyClusterState
private void verifyClusterState() { NodeEngineImpl nodeEngine = (NodeEngineImpl) getNodeEngine(); ClusterState clusterState = nodeEngine.getClusterService().getClusterState(); if (!clusterState.isMigrationAllowed()) { throw new IllegalStateException("Cluster state does not allow migr...
java
private void verifyClusterState() { NodeEngineImpl nodeEngine = (NodeEngineImpl) getNodeEngine(); ClusterState clusterState = nodeEngine.getClusterService().getClusterState(); if (!clusterState.isMigrationAllowed()) { throw new IllegalStateException("Cluster state does not allow migr...
[ "private", "void", "verifyClusterState", "(", ")", "{", "NodeEngineImpl", "nodeEngine", "=", "(", "NodeEngineImpl", ")", "getNodeEngine", "(", ")", ";", "ClusterState", "clusterState", "=", "nodeEngine", ".", "getClusterService", "(", ")", ".", "getClusterState", ...
Verifies that the cluster is active.
[ "Verifies", "that", "the", "cluster", "is", "active", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/partition/operation/BaseMigrationOperation.java#L192-L198