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
partition
stringclasses
1 value
voldemort/voldemort
src/java/voldemort/server/niosocket/AsyncRequestHandler.java
AsyncRequestHandler.initRequestHandler
private boolean initRequestHandler(SelectionKey selectionKey) { ByteBuffer inputBuffer = inputStream.getBuffer(); int remaining = inputBuffer.remaining(); // Don't have enough bytes to determine the protocol yet... if(remaining < 3) return true; byte[] protoBytes = ...
java
private boolean initRequestHandler(SelectionKey selectionKey) { ByteBuffer inputBuffer = inputStream.getBuffer(); int remaining = inputBuffer.remaining(); // Don't have enough bytes to determine the protocol yet... if(remaining < 3) return true; byte[] protoBytes = ...
[ "private", "boolean", "initRequestHandler", "(", "SelectionKey", "selectionKey", ")", "{", "ByteBuffer", "inputBuffer", "=", "inputStream", ".", "getBuffer", "(", ")", ";", "int", "remaining", "=", "inputBuffer", ".", "remaining", "(", ")", ";", "// Don't have eno...
Returns true if the request should continue. @return
[ "Returns", "true", "if", "the", "request", "should", "continue", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/server/niosocket/AsyncRequestHandler.java#L401-L440
train
voldemort/voldemort
src/java/voldemort/client/rebalance/QuotaResetter.java
QuotaResetter.rememberAndDisableQuota
public void rememberAndDisableQuota() { for(Integer nodeId: nodeIds) { boolean quotaEnforcement = Boolean.parseBoolean(adminClient.metadataMgmtOps.getRemoteMetadata(nodeId, MetadataStore.QUOTA_E...
java
public void rememberAndDisableQuota() { for(Integer nodeId: nodeIds) { boolean quotaEnforcement = Boolean.parseBoolean(adminClient.metadataMgmtOps.getRemoteMetadata(nodeId, MetadataStore.QUOTA_E...
[ "public", "void", "rememberAndDisableQuota", "(", ")", "{", "for", "(", "Integer", "nodeId", ":", "nodeIds", ")", "{", "boolean", "quotaEnforcement", "=", "Boolean", ".", "parseBoolean", "(", "adminClient", ".", "metadataMgmtOps", ".", "getRemoteMetadata", "(", ...
Before cluster management operations, i.e. remember and disable quota enforcement settings
[ "Before", "cluster", "management", "operations", "i", ".", "e", ".", "remember", "and", "disable", "quota", "enforcement", "settings" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/client/rebalance/QuotaResetter.java#L37-L47
train
voldemort/voldemort
src/java/voldemort/client/rebalance/QuotaResetter.java
QuotaResetter.resetQuotaAndRecoverEnforcement
public void resetQuotaAndRecoverEnforcement() { for(Integer nodeId: nodeIds) { boolean quotaEnforcement = mapNodeToQuotaEnforcingEnabled.get(nodeId); adminClient.metadataMgmtOps.updateRemoteMetadata(Arrays.asList(nodeId), Metad...
java
public void resetQuotaAndRecoverEnforcement() { for(Integer nodeId: nodeIds) { boolean quotaEnforcement = mapNodeToQuotaEnforcingEnabled.get(nodeId); adminClient.metadataMgmtOps.updateRemoteMetadata(Arrays.asList(nodeId), Metad...
[ "public", "void", "resetQuotaAndRecoverEnforcement", "(", ")", "{", "for", "(", "Integer", "nodeId", ":", "nodeIds", ")", "{", "boolean", "quotaEnforcement", "=", "mapNodeToQuotaEnforcingEnabled", ".", "get", "(", "nodeId", ")", ";", "adminClient", ".", "metadataM...
After cluster management operations, i.e. reset quota and recover quota enforcement settings
[ "After", "cluster", "management", "operations", "i", ".", "e", ".", "reset", "quota", "and", "recover", "quota", "enforcement", "settings" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/client/rebalance/QuotaResetter.java#L53-L63
train
voldemort/voldemort
src/java/voldemort/versioning/VectorClock.java
VectorClock.incrementVersion
public void incrementVersion(int node, long time) { if(node < 0 || node > Short.MAX_VALUE) throw new IllegalArgumentException(node + " is outside the acceptable range of node ids."); this.timestamp = time; Long version = versionMap.get...
java
public void incrementVersion(int node, long time) { if(node < 0 || node > Short.MAX_VALUE) throw new IllegalArgumentException(node + " is outside the acceptable range of node ids."); this.timestamp = time; Long version = versionMap.get...
[ "public", "void", "incrementVersion", "(", "int", "node", ",", "long", "time", ")", "{", "if", "(", "node", "<", "0", "||", "node", ">", "Short", ".", "MAX_VALUE", ")", "throw", "new", "IllegalArgumentException", "(", "node", "+", "\" is outside the acceptab...
Increment the version info associated with the given node @param node The node
[ "Increment", "the", "version", "info", "associated", "with", "the", "given", "node" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/versioning/VectorClock.java#L205-L224
train
voldemort/voldemort
src/java/voldemort/versioning/VectorClock.java
VectorClock.incremented
public VectorClock incremented(int nodeId, long time) { VectorClock copyClock = this.clone(); copyClock.incrementVersion(nodeId, time); return copyClock; }
java
public VectorClock incremented(int nodeId, long time) { VectorClock copyClock = this.clone(); copyClock.incrementVersion(nodeId, time); return copyClock; }
[ "public", "VectorClock", "incremented", "(", "int", "nodeId", ",", "long", "time", ")", "{", "VectorClock", "copyClock", "=", "this", ".", "clone", "(", ")", ";", "copyClock", ".", "incrementVersion", "(", "nodeId", ",", "time", ")", ";", "return", "copyCl...
Get new vector clock based on this clock but incremented on index nodeId @param nodeId The id of the node to increment @return A vector clock equal on each element execept that indexed by nodeId
[ "Get", "new", "vector", "clock", "based", "on", "this", "clock", "but", "incremented", "on", "index", "nodeId" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/versioning/VectorClock.java#L233-L237
train
voldemort/voldemort
src/java/voldemort/tools/PartitionBalance.java
PartitionBalance.getNodeIdToPrimaryCount
private Map<Integer, Integer> getNodeIdToPrimaryCount(Cluster cluster) { Map<Integer, Integer> nodeIdToPrimaryCount = Maps.newHashMap(); for(Node node: cluster.getNodes()) { nodeIdToPrimaryCount.put(node.getId(), node.getPartitionIds().size()); } return nodeIdToPrimaryCount;...
java
private Map<Integer, Integer> getNodeIdToPrimaryCount(Cluster cluster) { Map<Integer, Integer> nodeIdToPrimaryCount = Maps.newHashMap(); for(Node node: cluster.getNodes()) { nodeIdToPrimaryCount.put(node.getId(), node.getPartitionIds().size()); } return nodeIdToPrimaryCount;...
[ "private", "Map", "<", "Integer", ",", "Integer", ">", "getNodeIdToPrimaryCount", "(", "Cluster", "cluster", ")", "{", "Map", "<", "Integer", ",", "Integer", ">", "nodeIdToPrimaryCount", "=", "Maps", ".", "newHashMap", "(", ")", ";", "for", "(", "Node", "n...
Go through all nodes and determine how many partition Ids each node hosts. @param cluster @return map of nodeId to number of primary partitions hosted on node.
[ "Go", "through", "all", "nodes", "and", "determine", "how", "many", "partition", "Ids", "each", "node", "hosts", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/PartitionBalance.java#L180-L187
train
voldemort/voldemort
src/java/voldemort/tools/PartitionBalance.java
PartitionBalance.getNodeIdToZonePrimaryCount
private Map<Integer, Integer> getNodeIdToZonePrimaryCount(Cluster cluster, StoreRoutingPlan storeRoutingPlan) { Map<Integer, Integer> nodeIdToZonePrimaryCount = Maps.newHashMap(); for(Integer nodeId: cluster.getNodeIds()) { nodeId...
java
private Map<Integer, Integer> getNodeIdToZonePrimaryCount(Cluster cluster, StoreRoutingPlan storeRoutingPlan) { Map<Integer, Integer> nodeIdToZonePrimaryCount = Maps.newHashMap(); for(Integer nodeId: cluster.getNodeIds()) { nodeId...
[ "private", "Map", "<", "Integer", ",", "Integer", ">", "getNodeIdToZonePrimaryCount", "(", "Cluster", "cluster", ",", "StoreRoutingPlan", "storeRoutingPlan", ")", "{", "Map", "<", "Integer", ",", "Integer", ">", "nodeIdToZonePrimaryCount", "=", "Maps", ".", "newHa...
Go through all partition IDs and determine which node is "first" in the replicating node list for every zone. This determines the number of "zone primaries" each node hosts. @return map of nodeId to number of zone-primaries hosted on node.
[ "Go", "through", "all", "partition", "IDs", "and", "determine", "which", "node", "is", "first", "in", "the", "replicating", "node", "list", "for", "every", "zone", ".", "This", "determines", "the", "number", "of", "zone", "primaries", "each", "node", "hosts"...
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/PartitionBalance.java#L196-L205
train
voldemort/voldemort
src/java/voldemort/tools/PartitionBalance.java
PartitionBalance.getNodeIdToNaryCount
private Map<Integer, Integer> getNodeIdToNaryCount(Cluster cluster, StoreRoutingPlan storeRoutingPlan) { Map<Integer, Integer> nodeIdToNaryCount = Maps.newHashMap(); for(int nodeId: cluster.getNodeIds()) { nodeIdToNaryCount.put(nodeId, ...
java
private Map<Integer, Integer> getNodeIdToNaryCount(Cluster cluster, StoreRoutingPlan storeRoutingPlan) { Map<Integer, Integer> nodeIdToNaryCount = Maps.newHashMap(); for(int nodeId: cluster.getNodeIds()) { nodeIdToNaryCount.put(nodeId, ...
[ "private", "Map", "<", "Integer", ",", "Integer", ">", "getNodeIdToNaryCount", "(", "Cluster", "cluster", ",", "StoreRoutingPlan", "storeRoutingPlan", ")", "{", "Map", "<", "Integer", ",", "Integer", ">", "nodeIdToNaryCount", "=", "Maps", ".", "newHashMap", "(",...
Go through all node IDs and determine which node @param cluster @param storeRoutingPlan @return
[ "Go", "through", "all", "node", "IDs", "and", "determine", "which", "node" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/PartitionBalance.java#L214-L223
train
voldemort/voldemort
src/java/voldemort/tools/PartitionBalance.java
PartitionBalance.dumpZoneNAryDetails
private String dumpZoneNAryDetails(StoreRoutingPlan storeRoutingPlan) { StringBuilder sb = new StringBuilder(); sb.append("\tDetailed Dump (Zone N-Aries):").append(Utils.NEWLINE); for(Node node: storeRoutingPlan.getCluster().getNodes()) { int zoneId = node.getZoneId(); i...
java
private String dumpZoneNAryDetails(StoreRoutingPlan storeRoutingPlan) { StringBuilder sb = new StringBuilder(); sb.append("\tDetailed Dump (Zone N-Aries):").append(Utils.NEWLINE); for(Node node: storeRoutingPlan.getCluster().getNodes()) { int zoneId = node.getZoneId(); i...
[ "private", "String", "dumpZoneNAryDetails", "(", "StoreRoutingPlan", "storeRoutingPlan", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "sb", ".", "append", "(", "\"\\tDetailed Dump (Zone N-Aries):\"", ")", ".", "append", "(", "Utils", ...
Dumps the partition IDs per node in terms of zone n-ary type. @param cluster @param storeRoutingPlan @return pretty printed string of detailed zone n-ary type.
[ "Dumps", "the", "partition", "IDs", "per", "node", "in", "terms", "of", "zone", "n", "-", "ary", "type", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/PartitionBalance.java#L232-L260
train
voldemort/voldemort
src/java/voldemort/tools/PartitionBalance.java
PartitionBalance.summarizeBalance
private Pair<Double, String> summarizeBalance(final Map<Integer, Integer> nodeIdToPartitionCount, String title) { StringBuilder builder = new StringBuilder(); builder.append("\n" + title + "\n"); Map<Integer, ZoneBalanceStats> zoneToBalanceStats = new HashMap<Integer, ZoneBalanceSta...
java
private Pair<Double, String> summarizeBalance(final Map<Integer, Integer> nodeIdToPartitionCount, String title) { StringBuilder builder = new StringBuilder(); builder.append("\n" + title + "\n"); Map<Integer, ZoneBalanceStats> zoneToBalanceStats = new HashMap<Integer, ZoneBalanceSta...
[ "private", "Pair", "<", "Double", ",", "String", ">", "summarizeBalance", "(", "final", "Map", "<", "Integer", ",", "Integer", ">", "nodeIdToPartitionCount", ",", "String", "title", ")", "{", "StringBuilder", "builder", "=", "new", "StringBuilder", "(", ")", ...
Summarizes balance for the given nodeId to PartitionCount. @param nodeIdToPartitionCount @param title for use in pretty string @return Pair: getFirst() is utility value to be minimized, getSecond() is pretty summary string of balance
[ "Summarizes", "balance", "for", "the", "given", "nodeId", "to", "PartitionCount", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/PartitionBalance.java#L398-L430
train
voldemort/voldemort
src/java/voldemort/server/rebalance/async/StealerBasedRebalanceAsyncOperation.java
StealerBasedRebalanceAsyncOperation.rebalanceStore
private void rebalanceStore(String storeName, final AdminClient adminClient, RebalanceTaskInfo stealInfo, boolean isReadOnlyStore) { // Move partitions if (stealInfo.getPartitionIds(storeName) != null && stea...
java
private void rebalanceStore(String storeName, final AdminClient adminClient, RebalanceTaskInfo stealInfo, boolean isReadOnlyStore) { // Move partitions if (stealInfo.getPartitionIds(storeName) != null && stea...
[ "private", "void", "rebalanceStore", "(", "String", "storeName", ",", "final", "AdminClient", "adminClient", ",", "RebalanceTaskInfo", "stealInfo", ",", "boolean", "isReadOnlyStore", ")", "{", "// Move partitions", "if", "(", "stealInfo", ".", "getPartitionIds", "(", ...
Blocking function which completes the migration of one store @param storeName The name of the store @param adminClient Admin client used to initiate the copying of data @param stealInfo The steal information @param isReadOnlyStore Boolean indicating that this is a read-only store
[ "Blocking", "function", "which", "completes", "the", "migration", "of", "one", "store" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/server/rebalance/async/StealerBasedRebalanceAsyncOperation.java#L174-L209
train
voldemort/voldemort
src/java/voldemort/store/stats/ClientSocketStats.java
ClientSocketStats.recordSyncOpTimeNs
public void recordSyncOpTimeNs(SocketDestination dest, long opTimeNs) { if(dest != null) { getOrCreateNodeStats(dest).recordSyncOpTimeNs(null, opTimeNs); recordSyncOpTimeNs(null, opTimeNs); } else { this.syncOpTimeRequestCounter.addRequest(opTimeNs); } }
java
public void recordSyncOpTimeNs(SocketDestination dest, long opTimeNs) { if(dest != null) { getOrCreateNodeStats(dest).recordSyncOpTimeNs(null, opTimeNs); recordSyncOpTimeNs(null, opTimeNs); } else { this.syncOpTimeRequestCounter.addRequest(opTimeNs); } }
[ "public", "void", "recordSyncOpTimeNs", "(", "SocketDestination", "dest", ",", "long", "opTimeNs", ")", "{", "if", "(", "dest", "!=", "null", ")", "{", "getOrCreateNodeStats", "(", "dest", ")", ".", "recordSyncOpTimeNs", "(", "null", ",", "opTimeNs", ")", ";...
Record operation for sync ops time @param dest Destination of the socket to connect to. Will actually record if null. Otherwise will call this on self and corresponding child with this param null. @param opTimeUs The number of us for the op to finish
[ "Record", "operation", "for", "sync", "ops", "time" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/stats/ClientSocketStats.java#L213-L220
train
voldemort/voldemort
src/java/voldemort/store/stats/ClientSocketStats.java
ClientSocketStats.recordAsyncOpTimeNs
public void recordAsyncOpTimeNs(SocketDestination dest, long opTimeNs) { if(dest != null) { getOrCreateNodeStats(dest).recordAsyncOpTimeNs(null, opTimeNs); recordAsyncOpTimeNs(null, opTimeNs); } else { this.asynOpTimeRequestCounter.addRequest(opTimeNs); } ...
java
public void recordAsyncOpTimeNs(SocketDestination dest, long opTimeNs) { if(dest != null) { getOrCreateNodeStats(dest).recordAsyncOpTimeNs(null, opTimeNs); recordAsyncOpTimeNs(null, opTimeNs); } else { this.asynOpTimeRequestCounter.addRequest(opTimeNs); } ...
[ "public", "void", "recordAsyncOpTimeNs", "(", "SocketDestination", "dest", ",", "long", "opTimeNs", ")", "{", "if", "(", "dest", "!=", "null", ")", "{", "getOrCreateNodeStats", "(", "dest", ")", ".", "recordAsyncOpTimeNs", "(", "null", ",", "opTimeNs", ")", ...
Record operation for async ops time @param dest Destination of the socket to connect to. Will actually record if null. Otherwise will call this on self and corresponding child with this param null. @param opTimeUs The number of us for the op to finish
[ "Record", "operation", "for", "async", "ops", "time" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/stats/ClientSocketStats.java#L230-L237
train
voldemort/voldemort
src/java/voldemort/store/stats/ClientSocketStats.java
ClientSocketStats.recordConnectionEstablishmentTimeUs
public void recordConnectionEstablishmentTimeUs(SocketDestination dest, long connEstTimeUs) { if(dest != null) { getOrCreateNodeStats(dest).recordConnectionEstablishmentTimeUs(null, connEstTimeUs); recordConnectionEstablishmentTimeUs(null, connEstTimeUs); } else { thi...
java
public void recordConnectionEstablishmentTimeUs(SocketDestination dest, long connEstTimeUs) { if(dest != null) { getOrCreateNodeStats(dest).recordConnectionEstablishmentTimeUs(null, connEstTimeUs); recordConnectionEstablishmentTimeUs(null, connEstTimeUs); } else { thi...
[ "public", "void", "recordConnectionEstablishmentTimeUs", "(", "SocketDestination", "dest", ",", "long", "connEstTimeUs", ")", "{", "if", "(", "dest", "!=", "null", ")", "{", "getOrCreateNodeStats", "(", "dest", ")", ".", "recordConnectionEstablishmentTimeUs", "(", "...
Record the connection establishment time @param dest Destination of the socket to connect to. Will actually record if null. Otherwise will call this on self and corresponding child with this param null. @param connEstTimeUs The number of us to wait before establishing a connection
[ "Record", "the", "connection", "establishment", "time" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/stats/ClientSocketStats.java#L248-L255
train
voldemort/voldemort
src/java/voldemort/store/stats/ClientSocketStats.java
ClientSocketStats.recordCheckoutTimeUs
public void recordCheckoutTimeUs(SocketDestination dest, long checkoutTimeUs) { if(dest != null) { getOrCreateNodeStats(dest).recordCheckoutTimeUs(null, checkoutTimeUs); recordCheckoutTimeUs(null, checkoutTimeUs); } else { this.checkoutTimeRequestCounter.addRequest(ch...
java
public void recordCheckoutTimeUs(SocketDestination dest, long checkoutTimeUs) { if(dest != null) { getOrCreateNodeStats(dest).recordCheckoutTimeUs(null, checkoutTimeUs); recordCheckoutTimeUs(null, checkoutTimeUs); } else { this.checkoutTimeRequestCounter.addRequest(ch...
[ "public", "void", "recordCheckoutTimeUs", "(", "SocketDestination", "dest", ",", "long", "checkoutTimeUs", ")", "{", "if", "(", "dest", "!=", "null", ")", "{", "getOrCreateNodeStats", "(", "dest", ")", ".", "recordCheckoutTimeUs", "(", "null", ",", "checkoutTime...
Record the checkout wait time in us @param dest Destination of the socket to checkout. Will actually record if null. Otherwise will call this on self and corresponding child with this param null. @param checkoutTimeUs The number of us to wait before getting a socket
[ "Record", "the", "checkout", "wait", "time", "in", "us" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/stats/ClientSocketStats.java#L265-L272
train
voldemort/voldemort
src/java/voldemort/store/stats/ClientSocketStats.java
ClientSocketStats.recordCheckoutQueueLength
public void recordCheckoutQueueLength(SocketDestination dest, int queueLength) { if(dest != null) { getOrCreateNodeStats(dest).recordCheckoutQueueLength(null, queueLength); recordCheckoutQueueLength(null, queueLength); } else { this.checkoutQueueLengthHistogram.insert...
java
public void recordCheckoutQueueLength(SocketDestination dest, int queueLength) { if(dest != null) { getOrCreateNodeStats(dest).recordCheckoutQueueLength(null, queueLength); recordCheckoutQueueLength(null, queueLength); } else { this.checkoutQueueLengthHistogram.insert...
[ "public", "void", "recordCheckoutQueueLength", "(", "SocketDestination", "dest", ",", "int", "queueLength", ")", "{", "if", "(", "dest", "!=", "null", ")", "{", "getOrCreateNodeStats", "(", "dest", ")", ".", "recordCheckoutQueueLength", "(", "null", ",", "queueL...
Record the checkout queue length @param dest Destination of the socket to checkout. Will actually record if null. Otherwise will call this on self and corresponding child with this param null. @param queueLength The number of entries in the "synchronous" checkout queue.
[ "Record", "the", "checkout", "queue", "length" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/stats/ClientSocketStats.java#L283-L291
train
voldemort/voldemort
src/java/voldemort/store/stats/ClientSocketStats.java
ClientSocketStats.recordResourceRequestTimeUs
public void recordResourceRequestTimeUs(SocketDestination dest, long resourceRequestTimeUs) { if(dest != null) { getOrCreateNodeStats(dest).recordResourceRequestTimeUs(null, resourceRequestTimeUs); recordResourceRequestTimeUs(null, resourceRequestTimeUs); } else { thi...
java
public void recordResourceRequestTimeUs(SocketDestination dest, long resourceRequestTimeUs) { if(dest != null) { getOrCreateNodeStats(dest).recordResourceRequestTimeUs(null, resourceRequestTimeUs); recordResourceRequestTimeUs(null, resourceRequestTimeUs); } else { thi...
[ "public", "void", "recordResourceRequestTimeUs", "(", "SocketDestination", "dest", ",", "long", "resourceRequestTimeUs", ")", "{", "if", "(", "dest", "!=", "null", ")", "{", "getOrCreateNodeStats", "(", "dest", ")", ".", "recordResourceRequestTimeUs", "(", "null", ...
Record the resource request wait time in us @param dest Destination of the socket for which the resource was requested. Will actually record if null. Otherwise will call this on self and corresponding child with this param null. @param resourceRequestTimeUs The number of us to wait before getting a socket
[ "Record", "the", "resource", "request", "wait", "time", "in", "us" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/stats/ClientSocketStats.java#L302-L310
train
voldemort/voldemort
src/java/voldemort/store/stats/ClientSocketStats.java
ClientSocketStats.recordResourceRequestQueueLength
public void recordResourceRequestQueueLength(SocketDestination dest, int queueLength) { if(dest != null) { getOrCreateNodeStats(dest).recordResourceRequestQueueLength(null, queueLength); recordResourceRequestQueueLength(null, queueLength); } else { this.resourceReques...
java
public void recordResourceRequestQueueLength(SocketDestination dest, int queueLength) { if(dest != null) { getOrCreateNodeStats(dest).recordResourceRequestQueueLength(null, queueLength); recordResourceRequestQueueLength(null, queueLength); } else { this.resourceReques...
[ "public", "void", "recordResourceRequestQueueLength", "(", "SocketDestination", "dest", ",", "int", "queueLength", ")", "{", "if", "(", "dest", "!=", "null", ")", "{", "getOrCreateNodeStats", "(", "dest", ")", ".", "recordResourceRequestQueueLength", "(", "null", ...
Record the resource request queue length @param dest Destination of the socket for which resource request is enqueued. Will actually record if null. Otherwise will call this on self and corresponding child with this param null. @param queueLength The number of entries in the "asynchronous" resource request queue.
[ "Record", "the", "resource", "request", "queue", "length" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/stats/ClientSocketStats.java#L321-L329
train
voldemort/voldemort
src/java/voldemort/store/stats/ClientSocketStats.java
ClientSocketStats.close
public void close() { Iterator<SocketDestination> it = getStatsMap().keySet().iterator(); while(it.hasNext()) { try { SocketDestination destination = it.next(); JmxUtils.unregisterMbean(JmxUtils.createObjectName(JmxUtils.getPackageName(ClientRequestExecutor.cl...
java
public void close() { Iterator<SocketDestination> it = getStatsMap().keySet().iterator(); while(it.hasNext()) { try { SocketDestination destination = it.next(); JmxUtils.unregisterMbean(JmxUtils.createObjectName(JmxUtils.getPackageName(ClientRequestExecutor.cl...
[ "public", "void", "close", "(", ")", "{", "Iterator", "<", "SocketDestination", ">", "it", "=", "getStatsMap", "(", ")", ".", "keySet", "(", ")", ".", "iterator", "(", ")", ";", "while", "(", "it", ".", "hasNext", "(", ")", ")", "{", "try", "{", ...
Unregister all MBeans
[ "Unregister", "all", "MBeans" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/stats/ClientSocketStats.java#L504-L517
train
voldemort/voldemort
src/java/voldemort/store/socket/SocketStore.java
SocketStore.request
private <T> T request(ClientRequest<T> delegate, String operationName) { long startTimeMs = -1; long startTimeNs = -1; if(logger.isDebugEnabled()) { startTimeMs = System.currentTimeMillis(); } ClientRequestExecutor clientRequestExecutor = pool.checkout(destination); ...
java
private <T> T request(ClientRequest<T> delegate, String operationName) { long startTimeMs = -1; long startTimeNs = -1; if(logger.isDebugEnabled()) { startTimeMs = System.currentTimeMillis(); } ClientRequestExecutor clientRequestExecutor = pool.checkout(destination); ...
[ "private", "<", "T", ">", "T", "request", "(", "ClientRequest", "<", "T", ">", "delegate", ",", "String", "operationName", ")", "{", "long", "startTimeMs", "=", "-", "1", ";", "long", "startTimeNs", "=", "-", "1", ";", "if", "(", "logger", ".", "isDe...
This method handles submitting and then waiting for the request from the server. It uses the ClientRequest API to actually write the request and then read back the response. This implementation will block for a response from the server. @param <T> Return type @param clientRequest ClientRequest implementation used to ...
[ "This", "method", "handles", "submitting", "and", "then", "waiting", "for", "the", "request", "from", "the", "server", ".", "It", "uses", "the", "ClientRequest", "API", "to", "actually", "write", "the", "request", "and", "then", "read", "back", "the", "respo...
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/socket/SocketStore.java#L271-L349
train
voldemort/voldemort
src/java/voldemort/store/socket/SocketStore.java
SocketStore.requestAsync
private <T> void requestAsync(ClientRequest<T> delegate, NonblockingStoreCallback callback, long timeoutMs, String operationName) { pool.submitAsync(this.destination, delegate, callback, timeoutMs, operationNam...
java
private <T> void requestAsync(ClientRequest<T> delegate, NonblockingStoreCallback callback, long timeoutMs, String operationName) { pool.submitAsync(this.destination, delegate, callback, timeoutMs, operationNam...
[ "private", "<", "T", ">", "void", "requestAsync", "(", "ClientRequest", "<", "T", ">", "delegate", ",", "NonblockingStoreCallback", "callback", ",", "long", "timeoutMs", ",", "String", "operationName", ")", "{", "pool", ".", "submitAsync", "(", "this", ".", ...
This method handles submitting and then waiting for the request from the server. It uses the ClientRequest API to actually write the request and then read back the response. This implementation will not block for a response from the server. @param <T> Return type @param clientRequest ClientRequest implementation used...
[ "This", "method", "handles", "submitting", "and", "then", "waiting", "for", "the", "request", "from", "the", "server", ".", "It", "uses", "the", "ClientRequest", "API", "to", "actually", "write", "the", "request", "and", "then", "read", "back", "the", "respo...
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/socket/SocketStore.java#L366-L371
train
voldemort/voldemort
src/java/voldemort/store/stats/StreamingStats.java
StreamingStats.getAvgFetchKeysNetworkTimeMs
@JmxGetter(name = "avgFetchKeysNetworkTimeMs", description = "average time spent on network, for fetch keys") public double getAvgFetchKeysNetworkTimeMs() { return networkTimeCounterMap.get(Operation.FETCH_KEYS).getAvgEventValue() / Time.NS_PER_MS; }
java
@JmxGetter(name = "avgFetchKeysNetworkTimeMs", description = "average time spent on network, for fetch keys") public double getAvgFetchKeysNetworkTimeMs() { return networkTimeCounterMap.get(Operation.FETCH_KEYS).getAvgEventValue() / Time.NS_PER_MS; }
[ "@", "JmxGetter", "(", "name", "=", "\"avgFetchKeysNetworkTimeMs\"", ",", "description", "=", "\"average time spent on network, for fetch keys\"", ")", "public", "double", "getAvgFetchKeysNetworkTimeMs", "(", ")", "{", "return", "networkTimeCounterMap", ".", "get", "(", "...
Mbeans for FETCH_KEYS
[ "Mbeans", "for", "FETCH_KEYS" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/stats/StreamingStats.java#L118-L121
train
voldemort/voldemort
src/java/voldemort/store/stats/StreamingStats.java
StreamingStats.getAvgFetchEntriesNetworkTimeMs
@JmxGetter(name = "avgFetchEntriesNetworkTimeMs", description = "average time spent on network, for streaming operations") public double getAvgFetchEntriesNetworkTimeMs() { return networkTimeCounterMap.get(Operation.FETCH_ENTRIES).getAvgEventValue() / Time.NS_PER_MS; }
java
@JmxGetter(name = "avgFetchEntriesNetworkTimeMs", description = "average time spent on network, for streaming operations") public double getAvgFetchEntriesNetworkTimeMs() { return networkTimeCounterMap.get(Operation.FETCH_ENTRIES).getAvgEventValue() / Time.NS_PER_MS; }
[ "@", "JmxGetter", "(", "name", "=", "\"avgFetchEntriesNetworkTimeMs\"", ",", "description", "=", "\"average time spent on network, for streaming operations\"", ")", "public", "double", "getAvgFetchEntriesNetworkTimeMs", "(", ")", "{", "return", "networkTimeCounterMap", ".", "...
Mbeans for FETCH_ENTRIES
[ "Mbeans", "for", "FETCH_ENTRIES" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/stats/StreamingStats.java#L139-L143
train
voldemort/voldemort
src/java/voldemort/store/stats/StreamingStats.java
StreamingStats.getAvgUpdateEntriesNetworkTimeMs
@JmxGetter(name = "avgUpdateEntriesNetworkTimeMs", description = "average time spent on network, for streaming operations") public double getAvgUpdateEntriesNetworkTimeMs() { return networkTimeCounterMap.get(Operation.UPDATE_ENTRIES).getAvgEventValue() / Time.NS_PER_MS; }
java
@JmxGetter(name = "avgUpdateEntriesNetworkTimeMs", description = "average time spent on network, for streaming operations") public double getAvgUpdateEntriesNetworkTimeMs() { return networkTimeCounterMap.get(Operation.UPDATE_ENTRIES).getAvgEventValue() / Time.NS_PER_MS; }
[ "@", "JmxGetter", "(", "name", "=", "\"avgUpdateEntriesNetworkTimeMs\"", ",", "description", "=", "\"average time spent on network, for streaming operations\"", ")", "public", "double", "getAvgUpdateEntriesNetworkTimeMs", "(", ")", "{", "return", "networkTimeCounterMap", ".", ...
Mbeans for UPDATE_ENTRIES
[ "Mbeans", "for", "UPDATE_ENTRIES" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/stats/StreamingStats.java#L168-L172
train
voldemort/voldemort
src/java/voldemort/store/stats/StreamingStats.java
StreamingStats.getAvgSlopUpdateNetworkTimeMs
@JmxGetter(name = "avgSlopUpdateNetworkTimeMs", description = "average time spent on network, for streaming operations") public double getAvgSlopUpdateNetworkTimeMs() { return networkTimeCounterMap.get(Operation.SLOP_UPDATE).getAvgEventValue() / Time.NS_PER_MS; }
java
@JmxGetter(name = "avgSlopUpdateNetworkTimeMs", description = "average time spent on network, for streaming operations") public double getAvgSlopUpdateNetworkTimeMs() { return networkTimeCounterMap.get(Operation.SLOP_UPDATE).getAvgEventValue() / Time.NS_PER_MS; }
[ "@", "JmxGetter", "(", "name", "=", "\"avgSlopUpdateNetworkTimeMs\"", ",", "description", "=", "\"average time spent on network, for streaming operations\"", ")", "public", "double", "getAvgSlopUpdateNetworkTimeMs", "(", ")", "{", "return", "networkTimeCounterMap", ".", "get"...
Mbeans for SLOP_UPDATE
[ "Mbeans", "for", "SLOP_UPDATE" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/stats/StreamingStats.java#L186-L189
train
voldemort/voldemort
src/java/voldemort/serialization/SerializationUtils.java
SerializationUtils.getJavaClassFromSchemaInfo
public static String getJavaClassFromSchemaInfo(String schemaInfo) { final String ONLY_JAVA_CLIENTS_SUPPORTED = "Only Java clients are supported currently, so the format of the schema-info should be: <schema-info>java=foo.Bar</schema-info> where foo.Bar is the fully qualified name of the message."; if(...
java
public static String getJavaClassFromSchemaInfo(String schemaInfo) { final String ONLY_JAVA_CLIENTS_SUPPORTED = "Only Java clients are supported currently, so the format of the schema-info should be: <schema-info>java=foo.Bar</schema-info> where foo.Bar is the fully qualified name of the message."; if(...
[ "public", "static", "String", "getJavaClassFromSchemaInfo", "(", "String", "schemaInfo", ")", "{", "final", "String", "ONLY_JAVA_CLIENTS_SUPPORTED", "=", "\"Only Java clients are supported currently, so the format of the schema-info should be: <schema-info>java=foo.Bar</schema-info> where ...
Extracts the java class name from the schema info @param schemaInfo the schema info, a string like: java=java.lang.String @return the name of the class extracted from the schema info
[ "Extracts", "the", "java", "class", "name", "from", "the", "schema", "info" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/serialization/SerializationUtils.java#L35-L50
train
voldemort/voldemort
src/java/voldemort/utils/StoreDefinitionUtils.java
StoreDefinitionUtils.filterStores
public static List<StoreDefinition> filterStores(List<StoreDefinition> storeDefs, final boolean isReadOnly) { List<StoreDefinition> filteredStores = Lists.newArrayList(); for(StoreDefinition storeDef: storeDefs) { if(storeDef.getType().equ...
java
public static List<StoreDefinition> filterStores(List<StoreDefinition> storeDefs, final boolean isReadOnly) { List<StoreDefinition> filteredStores = Lists.newArrayList(); for(StoreDefinition storeDef: storeDefs) { if(storeDef.getType().equ...
[ "public", "static", "List", "<", "StoreDefinition", ">", "filterStores", "(", "List", "<", "StoreDefinition", ">", "storeDefs", ",", "final", "boolean", "isReadOnly", ")", "{", "List", "<", "StoreDefinition", ">", "filteredStores", "=", "Lists", ".", "newArrayLi...
Given a list of store definitions, filters the list depending on the boolean @param storeDefs Complete list of store definitions @param isReadOnly Boolean indicating whether filter on read-only or not? @return List of filtered store definition
[ "Given", "a", "list", "of", "store", "definitions", "filters", "the", "list", "depending", "on", "the", "boolean" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/StoreDefinitionUtils.java#L57-L66
train
voldemort/voldemort
src/java/voldemort/utils/StoreDefinitionUtils.java
StoreDefinitionUtils.getStoreNames
public static List<String> getStoreNames(List<StoreDefinition> storeDefList) { List<String> storeList = new ArrayList<String>(); for(StoreDefinition def: storeDefList) { storeList.add(def.getName()); } return storeList; }
java
public static List<String> getStoreNames(List<StoreDefinition> storeDefList) { List<String> storeList = new ArrayList<String>(); for(StoreDefinition def: storeDefList) { storeList.add(def.getName()); } return storeList; }
[ "public", "static", "List", "<", "String", ">", "getStoreNames", "(", "List", "<", "StoreDefinition", ">", "storeDefList", ")", "{", "List", "<", "String", ">", "storeList", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "for", "(", "StoreDe...
Given a list of store definitions return a list of store names @param storeDefList The list of store definitions @return Returns a list of store names
[ "Given", "a", "list", "of", "store", "definitions", "return", "a", "list", "of", "store", "names" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/StoreDefinitionUtils.java#L74-L80
train
voldemort/voldemort
src/java/voldemort/utils/StoreDefinitionUtils.java
StoreDefinitionUtils.getStoreNamesSet
public static Set<String> getStoreNamesSet(List<StoreDefinition> storeDefList) { HashSet<String> storeSet = new HashSet<String>(); for(StoreDefinition def: storeDefList) { storeSet.add(def.getName()); } return storeSet; }
java
public static Set<String> getStoreNamesSet(List<StoreDefinition> storeDefList) { HashSet<String> storeSet = new HashSet<String>(); for(StoreDefinition def: storeDefList) { storeSet.add(def.getName()); } return storeSet; }
[ "public", "static", "Set", "<", "String", ">", "getStoreNamesSet", "(", "List", "<", "StoreDefinition", ">", "storeDefList", ")", "{", "HashSet", "<", "String", ">", "storeSet", "=", "new", "HashSet", "<", "String", ">", "(", ")", ";", "for", "(", "Store...
Given a list of store definitions return a set of store names @param storeDefList The list of store definitions @return Returns a set of store names
[ "Given", "a", "list", "of", "store", "definitions", "return", "a", "set", "of", "store", "names" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/StoreDefinitionUtils.java#L88-L94
train
voldemort/voldemort
src/java/voldemort/utils/StoreDefinitionUtils.java
StoreDefinitionUtils.getUniqueStoreDefinitionsWithCounts
public static HashMap<StoreDefinition, Integer> getUniqueStoreDefinitionsWithCounts(List<StoreDefinition> storeDefs) { HashMap<StoreDefinition, Integer> uniqueStoreDefs = Maps.newHashMap(); for(StoreDefinition storeDef: storeDefs) { if(uniqueStoreDefs.isEmpty()) { uniqueStor...
java
public static HashMap<StoreDefinition, Integer> getUniqueStoreDefinitionsWithCounts(List<StoreDefinition> storeDefs) { HashMap<StoreDefinition, Integer> uniqueStoreDefs = Maps.newHashMap(); for(StoreDefinition storeDef: storeDefs) { if(uniqueStoreDefs.isEmpty()) { uniqueStor...
[ "public", "static", "HashMap", "<", "StoreDefinition", ",", "Integer", ">", "getUniqueStoreDefinitionsWithCounts", "(", "List", "<", "StoreDefinition", ">", "storeDefs", ")", "{", "HashMap", "<", "StoreDefinition", ",", "Integer", ">", "uniqueStoreDefs", "=", "Maps"...
Given a list of store definitions, find out and return a map of similar store definitions + count of them @param storeDefs All store definitions @return Map of a unique store definition + counts
[ "Given", "a", "list", "of", "store", "definitions", "find", "out", "and", "return", "a", "map", "of", "similar", "store", "definitions", "+", "count", "of", "them" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/StoreDefinitionUtils.java#L127-L178
train
voldemort/voldemort
src/java/voldemort/utils/StoreDefinitionUtils.java
StoreDefinitionUtils.isAvroSchema
public static boolean isAvroSchema(String serializerName) { if(serializerName.equals(AVRO_GENERIC_VERSIONED_TYPE_NAME) || serializerName.equals(AVRO_GENERIC_TYPE_NAME) || serializerName.equals(AVRO_REFLECTIVE_TYPE_NAME) || serializerName.equals(AVRO_SPECIFIC_TYPE_NAME)) { ...
java
public static boolean isAvroSchema(String serializerName) { if(serializerName.equals(AVRO_GENERIC_VERSIONED_TYPE_NAME) || serializerName.equals(AVRO_GENERIC_TYPE_NAME) || serializerName.equals(AVRO_REFLECTIVE_TYPE_NAME) || serializerName.equals(AVRO_SPECIFIC_TYPE_NAME)) { ...
[ "public", "static", "boolean", "isAvroSchema", "(", "String", "serializerName", ")", "{", "if", "(", "serializerName", ".", "equals", "(", "AVRO_GENERIC_VERSIONED_TYPE_NAME", ")", "||", "serializerName", ".", "equals", "(", "AVRO_GENERIC_TYPE_NAME", ")", "||", "seri...
Determine whether or not a given serializedr is "AVRO" based @param serializerName @return
[ "Determine", "whether", "or", "not", "a", "given", "serializedr", "is", "AVRO", "based" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/StoreDefinitionUtils.java#L186-L195
train
voldemort/voldemort
src/java/voldemort/utils/StoreDefinitionUtils.java
StoreDefinitionUtils.validateIfAvroSchema
private static void validateIfAvroSchema(SerializerDefinition serializerDef) { if(serializerDef.getName().equals(AVRO_GENERIC_VERSIONED_TYPE_NAME) || serializerDef.getName().equals(AVRO_GENERIC_TYPE_NAME)) { SchemaEvolutionValidator.validateAllAvroSchemas(serializerDef); // ch...
java
private static void validateIfAvroSchema(SerializerDefinition serializerDef) { if(serializerDef.getName().equals(AVRO_GENERIC_VERSIONED_TYPE_NAME) || serializerDef.getName().equals(AVRO_GENERIC_TYPE_NAME)) { SchemaEvolutionValidator.validateAllAvroSchemas(serializerDef); // ch...
[ "private", "static", "void", "validateIfAvroSchema", "(", "SerializerDefinition", "serializerDef", ")", "{", "if", "(", "serializerDef", ".", "getName", "(", ")", ".", "equals", "(", "AVRO_GENERIC_VERSIONED_TYPE_NAME", ")", "||", "serializerDef", ".", "getName", "("...
If provided with an AVRO schema, validates it and checks if there are backwards compatible. TODO should probably place some similar checks for other serializer types as well? @param serializerDef
[ "If", "provided", "with", "an", "AVRO", "schema", "validates", "it", "and", "checks", "if", "there", "are", "backwards", "compatible", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/StoreDefinitionUtils.java#L206-L215
train
voldemort/voldemort
src/java/voldemort/store/stats/Histogram.java
Histogram.insert
public synchronized void insert(long data) { resetIfNeeded(); long index = 0; if(data >= this.upperBound) { index = nBuckets - 1; } else if(data < 0) { logger.error(data + " can't be bucketed because it is negative!"); return; } else { ...
java
public synchronized void insert(long data) { resetIfNeeded(); long index = 0; if(data >= this.upperBound) { index = nBuckets - 1; } else if(data < 0) { logger.error(data + " can't be bucketed because it is negative!"); return; } else { ...
[ "public", "synchronized", "void", "insert", "(", "long", "data", ")", "{", "resetIfNeeded", "(", ")", ";", "long", "index", "=", "0", ";", "if", "(", "data", ">=", "this", ".", "upperBound", ")", "{", "index", "=", "nBuckets", "-", "1", ";", "}", "...
Insert a value into the right bucket of the histogram. If the value is larger than any bound, insert into the last bucket. If the value is less than zero, then ignore it. @param data The value to insert into the histogram
[ "Insert", "a", "value", "into", "the", "right", "bucket", "of", "the", "histogram", ".", "If", "the", "value", "is", "larger", "than", "any", "bound", "insert", "into", "the", "last", "bucket", ".", "If", "the", "value", "is", "less", "than", "zero", "...
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/stats/Histogram.java#L101-L121
train
voldemort/voldemort
src/java/voldemort/store/rebalancing/RebootstrappingStore.java
RebootstrappingStore.checkAndAddNodeStore
private void checkAndAddNodeStore() { for(Node node: metadata.getCluster().getNodes()) { if(!routedStore.getInnerStores().containsKey(node.getId())) { if(!storeRepository.hasNodeStore(getName(), node.getId())) { storeRepository.addNodeStore(node.getId(), createNod...
java
private void checkAndAddNodeStore() { for(Node node: metadata.getCluster().getNodes()) { if(!routedStore.getInnerStores().containsKey(node.getId())) { if(!storeRepository.hasNodeStore(getName(), node.getId())) { storeRepository.addNodeStore(node.getId(), createNod...
[ "private", "void", "checkAndAddNodeStore", "(", ")", "{", "for", "(", "Node", "node", ":", "metadata", ".", "getCluster", "(", ")", ".", "getNodes", "(", ")", ")", "{", "if", "(", "!", "routedStore", ".", "getInnerStores", "(", ")", ".", "containsKey", ...
Check that all nodes in the new cluster have a corresponding entry in storeRepository and innerStores. add a NodeStore if not present, is needed as with rebalancing we can add new nodes on the fly.
[ "Check", "that", "all", "nodes", "in", "the", "new", "cluster", "have", "a", "corresponding", "entry", "in", "storeRepository", "and", "innerStores", ".", "add", "a", "NodeStore", "if", "not", "present", "is", "needed", "as", "with", "rebalancing", "we", "ca...
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/rebalancing/RebootstrappingStore.java#L93-L104
train
voldemort/voldemort
src/java/voldemort/utils/pool/ResourcePoolConfig.java
ResourcePoolConfig.setTimeout
public ResourcePoolConfig setTimeout(long timeout, TimeUnit unit) { if(timeout < 0) throw new IllegalArgumentException("The timeout must be a non-negative number."); this.timeoutNs = TimeUnit.NANOSECONDS.convert(timeout, unit); return this; }
java
public ResourcePoolConfig setTimeout(long timeout, TimeUnit unit) { if(timeout < 0) throw new IllegalArgumentException("The timeout must be a non-negative number."); this.timeoutNs = TimeUnit.NANOSECONDS.convert(timeout, unit); return this; }
[ "public", "ResourcePoolConfig", "setTimeout", "(", "long", "timeout", ",", "TimeUnit", "unit", ")", "{", "if", "(", "timeout", "<", "0", ")", "throw", "new", "IllegalArgumentException", "(", "\"The timeout must be a non-negative number.\"", ")", ";", "this", ".", ...
The timeout which we block for when a resource is not available @param timeout The timeout @param unit The units of the timeout
[ "The", "timeout", "which", "we", "block", "for", "when", "a", "resource", "is", "not", "available" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/pool/ResourcePoolConfig.java#L59-L64
train
voldemort/voldemort
contrib/krati/src/java/voldemort/store/krati/KratiStorageEngine.java
KratiStorageEngine.assembleValues
private byte[] assembleValues(List<Versioned<byte[]>> values) throws IOException { ByteArrayOutputStream stream = new ByteArrayOutputStream(); DataOutputStream dataStream = new DataOutputStream(stream); for(Versioned<byte[]> value: values) { byte[] object = value.getValue(); ...
java
private byte[] assembleValues(List<Versioned<byte[]>> values) throws IOException { ByteArrayOutputStream stream = new ByteArrayOutputStream(); DataOutputStream dataStream = new DataOutputStream(stream); for(Versioned<byte[]> value: values) { byte[] object = value.getValue(); ...
[ "private", "byte", "[", "]", "assembleValues", "(", "List", "<", "Versioned", "<", "byte", "[", "]", ">", ">", "values", ")", "throws", "IOException", "{", "ByteArrayOutputStream", "stream", "=", "new", "ByteArrayOutputStream", "(", ")", ";", "DataOutputStream...
Store the versioned values @param values list of versioned bytes @return the list of versioned values rolled into an array of bytes
[ "Store", "the", "versioned", "values" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/contrib/krati/src/java/voldemort/store/krati/KratiStorageEngine.java#L266-L282
train
voldemort/voldemort
contrib/krati/src/java/voldemort/store/krati/KratiStorageEngine.java
KratiStorageEngine.disassembleValues
private List<Versioned<byte[]>> disassembleValues(byte[] values) throws IOException { if(values == null) return new ArrayList<Versioned<byte[]>>(0); List<Versioned<byte[]>> returnList = new ArrayList<Versioned<byte[]>>(); ByteArrayInputStream stream = new ByteArrayInputStream(value...
java
private List<Versioned<byte[]>> disassembleValues(byte[] values) throws IOException { if(values == null) return new ArrayList<Versioned<byte[]>>(0); List<Versioned<byte[]>> returnList = new ArrayList<Versioned<byte[]>>(); ByteArrayInputStream stream = new ByteArrayInputStream(value...
[ "private", "List", "<", "Versioned", "<", "byte", "[", "]", ">", ">", "disassembleValues", "(", "byte", "[", "]", "values", ")", "throws", "IOException", "{", "if", "(", "values", "==", "null", ")", "return", "new", "ArrayList", "<", "Versioned", "<", ...
Splits up value into multiple versioned values @param value @return @throws IOException
[ "Splits", "up", "value", "into", "multiple", "versioned", "values" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/contrib/krati/src/java/voldemort/store/krati/KratiStorageEngine.java#L291-L312
train
voldemort/voldemort
src/java/voldemort/server/protocol/admin/PartitionScanFetchStreamRequestHandler.java
PartitionScanFetchStreamRequestHandler.statusInfoMessage
protected void statusInfoMessage(final String tag) { if(logger.isInfoEnabled()) { logger.info(tag + " : [partition: " + currentPartition + ", partitionFetched: " + currentPartitionFetched + "] for store " + storageEngine.getName()); } }
java
protected void statusInfoMessage(final String tag) { if(logger.isInfoEnabled()) { logger.info(tag + " : [partition: " + currentPartition + ", partitionFetched: " + currentPartitionFetched + "] for store " + storageEngine.getName()); } }
[ "protected", "void", "statusInfoMessage", "(", "final", "String", "tag", ")", "{", "if", "(", "logger", ".", "isInfoEnabled", "(", ")", ")", "{", "logger", ".", "info", "(", "tag", "+", "\" : [partition: \"", "+", "currentPartition", "+", "\", partitionFetched...
Simple info message for status @param tag Message to print out at start of info message
[ "Simple", "info", "message", "for", "status" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/server/protocol/admin/PartitionScanFetchStreamRequestHandler.java#L75-L81
train
voldemort/voldemort
src/java/voldemort/server/scheduler/slop/StreamingSlopPusherJob.java
StreamingSlopPusherJob.slopSize
private int slopSize(Versioned<Slop> slopVersioned) { int nBytes = 0; Slop slop = slopVersioned.getValue(); nBytes += slop.getKey().length(); nBytes += ((VectorClock) slopVersioned.getVersion()).sizeInBytes(); switch(slop.getOperation()) { case PUT: { ...
java
private int slopSize(Versioned<Slop> slopVersioned) { int nBytes = 0; Slop slop = slopVersioned.getValue(); nBytes += slop.getKey().length(); nBytes += ((VectorClock) slopVersioned.getVersion()).sizeInBytes(); switch(slop.getOperation()) { case PUT: { ...
[ "private", "int", "slopSize", "(", "Versioned", "<", "Slop", ">", "slopVersioned", ")", "{", "int", "nBytes", "=", "0", ";", "Slop", "slop", "=", "slopVersioned", ".", "getValue", "(", ")", ";", "nBytes", "+=", "slop", ".", "getKey", "(", ")", ".", "...
Returns the approximate size of slop to help in throttling @param slopVersioned The versioned slop whose size we want @return Size in bytes
[ "Returns", "the", "approximate", "size", "of", "slop", "to", "help", "in", "throttling" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/server/scheduler/slop/StreamingSlopPusherJob.java#L328-L345
train
voldemort/voldemort
contrib/restclient/src/java/voldemort/restclient/RESTClientFactory.java
RESTClientFactory.getStoreClient
@Override public <K, V> StoreClient<K, V> getStoreClient(final String storeName, final InconsistencyResolver<Versioned<V>> resolver) { // wrap it in LazyStoreClient here so any direct calls to this method // returns a lazy client return new ...
java
@Override public <K, V> StoreClient<K, V> getStoreClient(final String storeName, final InconsistencyResolver<Versioned<V>> resolver) { // wrap it in LazyStoreClient here so any direct calls to this method // returns a lazy client return new ...
[ "@", "Override", "public", "<", "K", ",", "V", ">", "StoreClient", "<", "K", ",", "V", ">", "getStoreClient", "(", "final", "String", "storeName", ",", "final", "InconsistencyResolver", "<", "Versioned", "<", "V", ">", ">", "resolver", ")", "{", "// wrap...
Creates a REST client used to perform Voldemort operations against the Coordinator @param storeName Name of the store to perform the operations on @param resolver Custom resolver as specified by the application @return
[ "Creates", "a", "REST", "client", "used", "to", "perform", "Voldemort", "operations", "against", "the", "Coordinator" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/contrib/restclient/src/java/voldemort/restclient/RESTClientFactory.java#L105-L118
train
voldemort/voldemort
src/java/voldemort/routing/ConsistentRoutingStrategy.java
ConsistentRoutingStrategy.abs
private static int abs(int a) { if(a >= 0) return a; else if(a != Integer.MIN_VALUE) return -a; return Integer.MAX_VALUE; }
java
private static int abs(int a) { if(a >= 0) return a; else if(a != Integer.MIN_VALUE) return -a; return Integer.MAX_VALUE; }
[ "private", "static", "int", "abs", "(", "int", "a", ")", "{", "if", "(", "a", ">=", "0", ")", "return", "a", ";", "else", "if", "(", "a", "!=", "Integer", ".", "MIN_VALUE", ")", "return", "-", "a", ";", "return", "Integer", ".", "MAX_VALUE", ";",...
A modified version of abs that always returns a non-negative value. Math.abs returns Integer.MIN_VALUE if a == Integer.MIN_VALUE and this method returns Integer.MAX_VALUE in that case.
[ "A", "modified", "version", "of", "abs", "that", "always", "returns", "a", "non", "-", "negative", "value", ".", "Math", ".", "abs", "returns", "Integer", ".", "MIN_VALUE", "if", "a", "==", "Integer", ".", "MIN_VALUE", "and", "this", "method", "returns", ...
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/routing/ConsistentRoutingStrategy.java#L106-L112
train
voldemort/voldemort
src/java/voldemort/routing/ConsistentRoutingStrategy.java
ConsistentRoutingStrategy.getMasterPartition
@Override public Integer getMasterPartition(byte[] key) { return abs(hash.hash(key)) % (Math.max(1, this.partitionToNode.length)); }
java
@Override public Integer getMasterPartition(byte[] key) { return abs(hash.hash(key)) % (Math.max(1, this.partitionToNode.length)); }
[ "@", "Override", "public", "Integer", "getMasterPartition", "(", "byte", "[", "]", "key", ")", "{", "return", "abs", "(", "hash", ".", "hash", "(", "key", ")", ")", "%", "(", "Math", ".", "max", "(", "1", ",", "this", ".", "partitionToNode", ".", "...
Obtain the master partition for a given key @param key @return master partition id
[ "Obtain", "the", "master", "partition", "for", "a", "given", "key" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/routing/ConsistentRoutingStrategy.java#L170-L173
train
voldemort/voldemort
src/java/voldemort/server/scheduler/slop/SlopPusherJob.java
SlopPusherJob.isSlopDead
protected boolean isSlopDead(Cluster cluster, Set<String> storeNames, Slop slop) { // destination node , no longer exists if(!cluster.getNodeIds().contains(slop.getNodeId())) { return true; } // destination store, no longer exists if(!storeNames.contains(slop.getStor...
java
protected boolean isSlopDead(Cluster cluster, Set<String> storeNames, Slop slop) { // destination node , no longer exists if(!cluster.getNodeIds().contains(slop.getNodeId())) { return true; } // destination store, no longer exists if(!storeNames.contains(slop.getStor...
[ "protected", "boolean", "isSlopDead", "(", "Cluster", "cluster", ",", "Set", "<", "String", ">", "storeNames", ",", "Slop", "slop", ")", "{", "// destination node , no longer exists", "if", "(", "!", "cluster", ".", "getNodeIds", "(", ")", ".", "contains", "("...
A slop is dead if the destination node or the store does not exist anymore on the cluster. @param slop @return
[ "A", "slop", "is", "dead", "if", "the", "destination", "node", "or", "the", "store", "does", "not", "exist", "anymore", "on", "the", "cluster", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/server/scheduler/slop/SlopPusherJob.java#L52-L65
train
voldemort/voldemort
src/java/voldemort/server/scheduler/slop/SlopPusherJob.java
SlopPusherJob.handleDeadSlop
protected void handleDeadSlop(SlopStorageEngine slopStorageEngine, Pair<ByteArray, Versioned<Slop>> keyAndVal) { Versioned<Slop> versioned = keyAndVal.getSecond(); // If configured to delete the dead slop if(voldemortConfig.getAutoPurgeDeadSlops()) { ...
java
protected void handleDeadSlop(SlopStorageEngine slopStorageEngine, Pair<ByteArray, Versioned<Slop>> keyAndVal) { Versioned<Slop> versioned = keyAndVal.getSecond(); // If configured to delete the dead slop if(voldemortConfig.getAutoPurgeDeadSlops()) { ...
[ "protected", "void", "handleDeadSlop", "(", "SlopStorageEngine", "slopStorageEngine", ",", "Pair", "<", "ByteArray", ",", "Versioned", "<", "Slop", ">", ">", "keyAndVal", ")", "{", "Versioned", "<", "Slop", ">", "versioned", "=", "keyAndVal", ".", "getSecond", ...
Handle slop for nodes that are no longer part of the cluster. It may not always be the case. For example, shrinking a zone or deleting a store.
[ "Handle", "slop", "for", "nodes", "that", "are", "no", "longer", "part", "of", "the", "cluster", ".", "It", "may", "not", "always", "be", "the", "case", ".", "For", "example", "shrinking", "a", "zone", "or", "deleting", "a", "store", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/server/scheduler/slop/SlopPusherJob.java#L71-L87
train
voldemort/voldemort
src/java/voldemort/store/socket/clientrequest/ClientRequestExecutorFactory.java
ClientRequestExecutorFactory.destroy
@Override public void destroy(SocketDestination dest, ClientRequestExecutor clientRequestExecutor) throws Exception { clientRequestExecutor.close(); int numDestroyed = destroyed.incrementAndGet(); if(stats != null) { stats.incrementCount(dest, ClientSocketStats.Tracke...
java
@Override public void destroy(SocketDestination dest, ClientRequestExecutor clientRequestExecutor) throws Exception { clientRequestExecutor.close(); int numDestroyed = destroyed.incrementAndGet(); if(stats != null) { stats.incrementCount(dest, ClientSocketStats.Tracke...
[ "@", "Override", "public", "void", "destroy", "(", "SocketDestination", "dest", ",", "ClientRequestExecutor", "clientRequestExecutor", ")", "throws", "Exception", "{", "clientRequestExecutor", ".", "close", "(", ")", ";", "int", "numDestroyed", "=", "destroyed", "."...
Close the ClientRequestExecutor.
[ "Close", "the", "ClientRequestExecutor", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/socket/clientrequest/ClientRequestExecutorFactory.java#L120-L132
train
voldemort/voldemort
src/java/voldemort/rest/coordinator/config/ClientConfigUtil.java
ClientConfigUtil.readSingleClientConfigAvro
@SuppressWarnings("unchecked") public static Properties readSingleClientConfigAvro(String configAvro) { Properties props = new Properties(); try { JsonDecoder decoder = new JsonDecoder(CLIENT_CONFIG_AVRO_SCHEMA, configAvro); GenericDatumReader<Object> datumReader = new Generi...
java
@SuppressWarnings("unchecked") public static Properties readSingleClientConfigAvro(String configAvro) { Properties props = new Properties(); try { JsonDecoder decoder = new JsonDecoder(CLIENT_CONFIG_AVRO_SCHEMA, configAvro); GenericDatumReader<Object> datumReader = new Generi...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "Properties", "readSingleClientConfigAvro", "(", "String", "configAvro", ")", "{", "Properties", "props", "=", "new", "Properties", "(", ")", ";", "try", "{", "JsonDecoder", "decoder", "=", ...
Parses a string that contains single fat client config string in avro format @param configAvro Input string of avro format, that contains config for multiple stores @return Properties of single fat client config
[ "Parses", "a", "string", "that", "contains", "single", "fat", "client", "config", "string", "in", "avro", "format" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/coordinator/config/ClientConfigUtil.java#L34-L48
train
voldemort/voldemort
src/java/voldemort/rest/coordinator/config/ClientConfigUtil.java
ClientConfigUtil.readMultipleClientConfigAvro
@SuppressWarnings("unchecked") public static Map<String, Properties> readMultipleClientConfigAvro(String configAvro) { Map<String, Properties> mapStoreToProps = Maps.newHashMap(); try { JsonDecoder decoder = new JsonDecoder(CLIENT_CONFIGS_AVRO_SCHEMA, configAvro); GenericDatu...
java
@SuppressWarnings("unchecked") public static Map<String, Properties> readMultipleClientConfigAvro(String configAvro) { Map<String, Properties> mapStoreToProps = Maps.newHashMap(); try { JsonDecoder decoder = new JsonDecoder(CLIENT_CONFIGS_AVRO_SCHEMA, configAvro); GenericDatu...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "Map", "<", "String", ",", "Properties", ">", "readMultipleClientConfigAvro", "(", "String", "configAvro", ")", "{", "Map", "<", "String", ",", "Properties", ">", "mapStoreToProps", "=", "Ma...
Parses a string that contains multiple fat client configs in avro format @param configAvro Input string of avro format, that contains config for multiple stores @return Map of store names to store config properties
[ "Parses", "a", "string", "that", "contains", "multiple", "fat", "client", "configs", "in", "avro", "format" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/coordinator/config/ClientConfigUtil.java#L57-L85
train
voldemort/voldemort
src/java/voldemort/rest/coordinator/config/ClientConfigUtil.java
ClientConfigUtil.writeSingleClientConfigAvro
public static String writeSingleClientConfigAvro(Properties props) { // TODO: Use a dedicated json lib. We shouldn't be manually manipulating json... String avroConfig = ""; Boolean firstProp = true; for(String key: props.stringPropertyNames()) { if(firstProp) { ...
java
public static String writeSingleClientConfigAvro(Properties props) { // TODO: Use a dedicated json lib. We shouldn't be manually manipulating json... String avroConfig = ""; Boolean firstProp = true; for(String key: props.stringPropertyNames()) { if(firstProp) { ...
[ "public", "static", "String", "writeSingleClientConfigAvro", "(", "Properties", "props", ")", "{", "// TODO: Use a dedicated json lib. We shouldn't be manually manipulating json...", "String", "avroConfig", "=", "\"\"", ";", "Boolean", "firstProp", "=", "true", ";", "for", ...
Assembles an avro format string of single store config from store properties @param props Store properties @return String in avro format that contains single store configs
[ "Assembles", "an", "avro", "format", "string", "of", "single", "store", "config", "from", "store", "properties" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/coordinator/config/ClientConfigUtil.java#L94-L111
train
voldemort/voldemort
src/java/voldemort/rest/coordinator/config/ClientConfigUtil.java
ClientConfigUtil.writeMultipleClientConfigAvro
public static String writeMultipleClientConfigAvro(Map<String, Properties> mapStoreToProps) { // TODO: Use a dedicated json lib. We shouldn't be manually manipulating json... String avroConfig = ""; Boolean firstStore = true; for(String storeName: mapStoreToProps.keySet()) { ...
java
public static String writeMultipleClientConfigAvro(Map<String, Properties> mapStoreToProps) { // TODO: Use a dedicated json lib. We shouldn't be manually manipulating json... String avroConfig = ""; Boolean firstStore = true; for(String storeName: mapStoreToProps.keySet()) { ...
[ "public", "static", "String", "writeMultipleClientConfigAvro", "(", "Map", "<", "String", ",", "Properties", ">", "mapStoreToProps", ")", "{", "// TODO: Use a dedicated json lib. We shouldn't be manually manipulating json...", "String", "avroConfig", "=", "\"\"", ";", "Boolea...
Assembles an avro format string that contains multiple fat client configs from map of store to properties @param mapStoreToProps A map of store names to their properties @return Avro string that contains multiple store configs
[ "Assembles", "an", "avro", "format", "string", "that", "contains", "multiple", "fat", "client", "configs", "from", "map", "of", "store", "to", "properties" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/coordinator/config/ClientConfigUtil.java#L120-L136
train
voldemort/voldemort
src/java/voldemort/rest/coordinator/config/ClientConfigUtil.java
ClientConfigUtil.compareSingleClientConfigAvro
public static Boolean compareSingleClientConfigAvro(String configAvro1, String configAvro2) { Properties props1 = readSingleClientConfigAvro(configAvro1); Properties props2 = readSingleClientConfigAvro(configAvro2); if(props1.equals(props2)) { return true; } else { ...
java
public static Boolean compareSingleClientConfigAvro(String configAvro1, String configAvro2) { Properties props1 = readSingleClientConfigAvro(configAvro1); Properties props2 = readSingleClientConfigAvro(configAvro2); if(props1.equals(props2)) { return true; } else { ...
[ "public", "static", "Boolean", "compareSingleClientConfigAvro", "(", "String", "configAvro1", ",", "String", "configAvro2", ")", "{", "Properties", "props1", "=", "readSingleClientConfigAvro", "(", "configAvro1", ")", ";", "Properties", "props2", "=", "readSingleClientC...
Compares two avro strings which contains single store configs @param configAvro1 @param configAvro2 @return true if two config avro strings have same content
[ "Compares", "two", "avro", "strings", "which", "contains", "single", "store", "configs" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/coordinator/config/ClientConfigUtil.java#L145-L153
train
voldemort/voldemort
src/java/voldemort/rest/coordinator/config/ClientConfigUtil.java
ClientConfigUtil.compareMultipleClientConfigAvro
public static Boolean compareMultipleClientConfigAvro(String configAvro1, String configAvro2) { Map<String, Properties> mapStoreToProps1 = readMultipleClientConfigAvro(configAvro1); Map<String, Properties> mapStoreToProps2 = readMultipleClientConfigAvro(configAvro2); Set<String> keySet1 = mapSto...
java
public static Boolean compareMultipleClientConfigAvro(String configAvro1, String configAvro2) { Map<String, Properties> mapStoreToProps1 = readMultipleClientConfigAvro(configAvro1); Map<String, Properties> mapStoreToProps2 = readMultipleClientConfigAvro(configAvro2); Set<String> keySet1 = mapSto...
[ "public", "static", "Boolean", "compareMultipleClientConfigAvro", "(", "String", "configAvro1", ",", "String", "configAvro2", ")", "{", "Map", "<", "String", ",", "Properties", ">", "mapStoreToProps1", "=", "readMultipleClientConfigAvro", "(", "configAvro1", ")", ";",...
Compares two avro strings which contains multiple store configs @param configAvro1 @param configAvro2 @return true if two config avro strings have same content
[ "Compares", "two", "avro", "strings", "which", "contains", "multiple", "store", "configs" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/coordinator/config/ClientConfigUtil.java#L162-L178
train
voldemort/voldemort
src/java/voldemort/tools/admin/command/AdminCommandAsyncJob.java
AdminCommandAsyncJob.printHelp
public static void printHelp(PrintStream stream) { stream.println(); stream.println("Voldemort Admin Tool Async-Job Commands"); stream.println("---------------------------------------"); stream.println("list Get async job list from nodes."); stream.println("stop Stop async jo...
java
public static void printHelp(PrintStream stream) { stream.println(); stream.println("Voldemort Admin Tool Async-Job Commands"); stream.println("---------------------------------------"); stream.println("list Get async job list from nodes."); stream.println("stop Stop async jo...
[ "public", "static", "void", "printHelp", "(", "PrintStream", "stream", ")", "{", "stream", ".", "println", "(", ")", ";", "stream", ".", "println", "(", "\"Voldemort Admin Tool Async-Job Commands\"", ")", ";", "stream", ".", "println", "(", "\"--------------------...
Prints command-line help menu.
[ "Prints", "command", "-", "line", "help", "menu", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/admin/command/AdminCommandAsyncJob.java#L59-L69
train
voldemort/voldemort
src/java/voldemort/store/bdb/BdbStorageConfiguration.java
BdbStorageConfiguration.removeStorageEngine
@Override public void removeStorageEngine(StorageEngine<ByteArray, byte[], byte[]> engine) { String storeName = engine.getName(); BdbStorageEngine bdbEngine = (BdbStorageEngine) engine; synchronized(lock) { // Only cleanup the environment if it is per store. We cannot ...
java
@Override public void removeStorageEngine(StorageEngine<ByteArray, byte[], byte[]> engine) { String storeName = engine.getName(); BdbStorageEngine bdbEngine = (BdbStorageEngine) engine; synchronized(lock) { // Only cleanup the environment if it is per store. We cannot ...
[ "@", "Override", "public", "void", "removeStorageEngine", "(", "StorageEngine", "<", "ByteArray", ",", "byte", "[", "]", ",", "byte", "[", "]", ">", "engine", ")", "{", "String", "storeName", "=", "engine", ".", "getName", "(", ")", ";", "BdbStorageEngine"...
Clean up the environment object for the given storage engine
[ "Clean", "up", "the", "environment", "object", "for", "the", "given", "storage", "engine" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/bdb/BdbStorageConfiguration.java#L215-L275
train
voldemort/voldemort
src/java/voldemort/store/bdb/BdbStorageConfiguration.java
BdbStorageConfiguration.cleanLogs
@JmxOperation(description = "Forcefully invoke the log cleaning") public void cleanLogs() { synchronized(lock) { try { for(Environment environment: environments.values()) { environment.cleanLog(); } } catch(DatabaseException e) { ...
java
@JmxOperation(description = "Forcefully invoke the log cleaning") public void cleanLogs() { synchronized(lock) { try { for(Environment environment: environments.values()) { environment.cleanLog(); } } catch(DatabaseException e) { ...
[ "@", "JmxOperation", "(", "description", "=", "\"Forcefully invoke the log cleaning\"", ")", "public", "void", "cleanLogs", "(", ")", "{", "synchronized", "(", "lock", ")", "{", "try", "{", "for", "(", "Environment", "environment", ":", "environments", ".", "val...
Forceful cleanup the logs
[ "Forceful", "cleanup", "the", "logs" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/bdb/BdbStorageConfiguration.java#L417-L428
train
voldemort/voldemort
src/java/voldemort/store/bdb/BdbStorageConfiguration.java
BdbStorageConfiguration.update
public void update(StoreDefinition storeDef) { if(!useOneEnvPerStore) throw new VoldemortException("Memory foot print can be set only when using different environments per store"); String storeName = storeDef.getName(); Environment environment = environments.get(storeName); ...
java
public void update(StoreDefinition storeDef) { if(!useOneEnvPerStore) throw new VoldemortException("Memory foot print can be set only when using different environments per store"); String storeName = storeDef.getName(); Environment environment = environments.get(storeName); ...
[ "public", "void", "update", "(", "StoreDefinition", "storeDef", ")", "{", "if", "(", "!", "useOneEnvPerStore", ")", "throw", "new", "VoldemortException", "(", "\"Memory foot print can be set only when using different environments per store\"", ")", ";", "String", "storeName...
Detect what has changed in the store definition and rewire BDB environments accordingly. @param storeDef updated store definition
[ "Detect", "what", "has", "changed", "in", "the", "store", "definition", "and", "rewire", "BDB", "environments", "accordingly", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/bdb/BdbStorageConfiguration.java#L467-L504
train
voldemort/voldemort
src/java/voldemort/tools/Repartitioner.java
Repartitioner.getBalancedNumberOfPrimaryPartitionsPerNode
public static HashMap<Integer, List<Integer>> getBalancedNumberOfPrimaryPartitionsPerNode(final Cluster nextCandidateCluster, Map<Integer, Integer> targetPartitionsPerZone) { HashMap<Integer, List<Integer>> numPartitionsPerNode = Maps.newHashMa...
java
public static HashMap<Integer, List<Integer>> getBalancedNumberOfPrimaryPartitionsPerNode(final Cluster nextCandidateCluster, Map<Integer, Integer> targetPartitionsPerZone) { HashMap<Integer, List<Integer>> numPartitionsPerNode = Maps.newHashMa...
[ "public", "static", "HashMap", "<", "Integer", ",", "List", "<", "Integer", ">", ">", "getBalancedNumberOfPrimaryPartitionsPerNode", "(", "final", "Cluster", "nextCandidateCluster", ",", "Map", "<", "Integer", ",", "Integer", ">", "targetPartitionsPerZone", ")", "{"...
Determines how many primary partitions each node within each zone should have. The list of integers returned per zone is the same length as the number of nodes in that zone. @param nextCandidateCluster @param targetPartitionsPerZone @return A map of zoneId to list of target number of partitions per node within zone.
[ "Determines", "how", "many", "primary", "partitions", "each", "node", "within", "each", "zone", "should", "have", ".", "The", "list", "of", "integers", "returned", "per", "zone", "is", "the", "same", "length", "as", "the", "number", "of", "nodes", "in", "t...
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/Repartitioner.java#L255-L265
train
voldemort/voldemort
src/java/voldemort/tools/Repartitioner.java
Repartitioner.getDonorsAndStealersForBalance
public static Pair<HashMap<Node, Integer>, HashMap<Node, Integer>> getDonorsAndStealersForBalance(final Cluster nextCandidateCluster, Map<Integer, List<Integer>> numPartitionsPerNodePerZone) { HashMap<Node, Integer> donorNodes = Maps.newHashMap(); H...
java
public static Pair<HashMap<Node, Integer>, HashMap<Node, Integer>> getDonorsAndStealersForBalance(final Cluster nextCandidateCluster, Map<Integer, List<Integer>> numPartitionsPerNodePerZone) { HashMap<Node, Integer> donorNodes = Maps.newHashMap(); H...
[ "public", "static", "Pair", "<", "HashMap", "<", "Node", ",", "Integer", ">", ",", "HashMap", "<", "Node", ",", "Integer", ">", ">", "getDonorsAndStealersForBalance", "(", "final", "Cluster", "nextCandidateCluster", ",", "Map", "<", "Integer", ",", "List", "...
Assign target number of partitions per node to specific node IDs. Then, separates Nodes into donorNodes and stealerNodes based on whether the node needs to donate or steal primary partitions. @param nextCandidateCluster @param numPartitionsPerNodePerZone @return a Pair. First element is donorNodes, second element is s...
[ "Assign", "target", "number", "of", "partitions", "per", "node", "to", "specific", "node", "IDs", ".", "Then", "separates", "Nodes", "into", "donorNodes", "and", "stealerNodes", "based", "on", "whether", "the", "node", "needs", "to", "donate", "or", "steal", ...
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/Repartitioner.java#L279-L317
train
voldemort/voldemort
src/java/voldemort/tools/Repartitioner.java
Repartitioner.repeatedlyBalanceContiguousPartitionsPerZone
public static Cluster repeatedlyBalanceContiguousPartitionsPerZone(final Cluster nextCandidateCluster, final int maxContiguousPartitionsPerZone) { System.out.println("Looping to evenly balance partitions across zones while limiting contiguous ...
java
public static Cluster repeatedlyBalanceContiguousPartitionsPerZone(final Cluster nextCandidateCluster, final int maxContiguousPartitionsPerZone) { System.out.println("Looping to evenly balance partitions across zones while limiting contiguous ...
[ "public", "static", "Cluster", "repeatedlyBalanceContiguousPartitionsPerZone", "(", "final", "Cluster", "nextCandidateCluster", ",", "final", "int", "maxContiguousPartitionsPerZone", ")", "{", "System", ".", "out", ".", "println", "(", "\"Looping to evenly balance partitions ...
Loops over cluster and repeatedly tries to break up contiguous runs of partitions. After each phase of breaking up contiguous partitions, random partitions are selected to move between zones to balance the number of partitions in each zone. The second phase may re-introduce contiguous partition runs in another zone. Th...
[ "Loops", "over", "cluster", "and", "repeatedly", "tries", "to", "break", "up", "contiguous", "runs", "of", "partitions", ".", "After", "each", "phase", "of", "breaking", "up", "contiguous", "partitions", "random", "partitions", "are", "selected", "to", "move", ...
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/Repartitioner.java#L454-L475
train
voldemort/voldemort
src/java/voldemort/tools/Repartitioner.java
Repartitioner.balanceContiguousPartitionsPerZone
public static Cluster balanceContiguousPartitionsPerZone(final Cluster nextCandidateCluster, final int maxContiguousPartitionsPerZone) { System.out.println("Balance number of contiguous partitions within a zone."); System.out.println("numPartiti...
java
public static Cluster balanceContiguousPartitionsPerZone(final Cluster nextCandidateCluster, final int maxContiguousPartitionsPerZone) { System.out.println("Balance number of contiguous partitions within a zone."); System.out.println("numPartiti...
[ "public", "static", "Cluster", "balanceContiguousPartitionsPerZone", "(", "final", "Cluster", "nextCandidateCluster", ",", "final", "int", "maxContiguousPartitionsPerZone", ")", "{", "System", ".", "out", ".", "println", "(", "\"Balance number of contiguous partitions within ...
Ensures that no more than maxContiguousPartitionsPerZone partitions are contiguous within a single zone. Moves the necessary partitions to break up contiguous runs from each zone to some other random zone/node. There is some chance that such random moves could result in contiguous partitions in other zones. @param ne...
[ "Ensures", "that", "no", "more", "than", "maxContiguousPartitionsPerZone", "partitions", "are", "contiguous", "within", "a", "single", "zone", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/Repartitioner.java#L489-L557
train
voldemort/voldemort
src/java/voldemort/tools/Repartitioner.java
Repartitioner.swapPartitions
public static Cluster swapPartitions(final Cluster nextCandidateCluster, final int nodeIdA, final int partitionIdA, final int nodeIdB, final int partitionId...
java
public static Cluster swapPartitions(final Cluster nextCandidateCluster, final int nodeIdA, final int partitionIdA, final int nodeIdB, final int partitionId...
[ "public", "static", "Cluster", "swapPartitions", "(", "final", "Cluster", "nextCandidateCluster", ",", "final", "int", "nodeIdA", ",", "final", "int", "partitionIdA", ",", "final", "int", "nodeIdB", ",", "final", "int", "partitionIdB", ")", "{", "Cluster", "retu...
Swaps two specified partitions. Pair-wase partition swapping may be more prone to local minima than larger perturbations. Could consider "swapping" a list of <nodeId/partitionId>. This would allow a few nodes to be identified (random # btw 2-5?) and then "swapped" (shuffled? rotated?). @return modified cluster metada...
[ "Swaps", "two", "specified", "partitions", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/Repartitioner.java#L569-L585
train
voldemort/voldemort
src/java/voldemort/tools/Repartitioner.java
Repartitioner.swapRandomPartitionsWithinZone
public static Cluster swapRandomPartitionsWithinZone(final Cluster nextCandidateCluster, final int zoneId) { Cluster returnCluster = Cluster.cloneCluster(nextCandidateCluster); Random r = new Random(); List<Integer> nodeIdsInZone = new Ar...
java
public static Cluster swapRandomPartitionsWithinZone(final Cluster nextCandidateCluster, final int zoneId) { Cluster returnCluster = Cluster.cloneCluster(nextCandidateCluster); Random r = new Random(); List<Integer> nodeIdsInZone = new Ar...
[ "public", "static", "Cluster", "swapRandomPartitionsWithinZone", "(", "final", "Cluster", "nextCandidateCluster", ",", "final", "int", "zoneId", ")", "{", "Cluster", "returnCluster", "=", "Cluster", ".", "cloneCluster", "(", "nextCandidateCluster", ")", ";", "Random",...
Within a single zone, swaps one random partition on one random node with another random partition on different random node. @param nextCandidateCluster @param zoneId Zone ID within which to shuffle partitions @return updated cluster
[ "Within", "a", "single", "zone", "swaps", "one", "random", "partition", "on", "one", "random", "node", "with", "another", "random", "partition", "on", "different", "random", "node", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/Repartitioner.java#L595-L640
train
voldemort/voldemort
src/java/voldemort/tools/Repartitioner.java
Repartitioner.randomShufflePartitions
public static Cluster randomShufflePartitions(final Cluster nextCandidateCluster, final int randomSwapAttempts, final int randomSwapSuccesses, final List<Integer> randomS...
java
public static Cluster randomShufflePartitions(final Cluster nextCandidateCluster, final int randomSwapAttempts, final int randomSwapSuccesses, final List<Integer> randomS...
[ "public", "static", "Cluster", "randomShufflePartitions", "(", "final", "Cluster", "nextCandidateCluster", ",", "final", "int", "randomSwapAttempts", ",", "final", "int", "randomSwapSuccesses", ",", "final", "List", "<", "Integer", ">", "randomSwapZoneIds", ",", "List...
Randomly shuffle partitions between nodes within every zone. @param nextCandidateCluster cluster object. @param randomSwapAttempts See RebalanceCLI. @param randomSwapSuccesses See RebalanceCLI. @param randomSwapZoneIds The set of zoneIds to consider. Each zone is done independently. @param storeDefs List of store defi...
[ "Randomly", "shuffle", "partitions", "between", "nodes", "within", "every", "zone", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/Repartitioner.java#L705-L754
train
voldemort/voldemort
src/java/voldemort/tools/Repartitioner.java
Repartitioner.swapGreedyRandomPartitions
public static Cluster swapGreedyRandomPartitions(final Cluster nextCandidateCluster, final List<Integer> nodeIds, final int greedySwapMaxPartitionsPerNode, final...
java
public static Cluster swapGreedyRandomPartitions(final Cluster nextCandidateCluster, final List<Integer> nodeIds, final int greedySwapMaxPartitionsPerNode, final...
[ "public", "static", "Cluster", "swapGreedyRandomPartitions", "(", "final", "Cluster", "nextCandidateCluster", ",", "final", "List", "<", "Integer", ">", "nodeIds", ",", "final", "int", "greedySwapMaxPartitionsPerNode", ",", "final", "int", "greedySwapMaxPartitionsPerZone"...
For each node in specified zones, tries swapping some minimum number of random partitions per node with some minimum number of random partitions from other specified nodes. Chooses the best swap in each iteration. Large values of the greedSwapMaxPartitions... arguments make this method equivalent to comparing every pos...
[ "For", "each", "node", "in", "specified", "zones", "tries", "swapping", "some", "minimum", "number", "of", "random", "partitions", "per", "node", "with", "some", "minimum", "number", "of", "random", "partitions", "from", "other", "specified", "nodes", ".", "Ch...
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/Repartitioner.java#L776-L840
train
voldemort/voldemort
src/java/voldemort/tools/Repartitioner.java
Repartitioner.greedyShufflePartitions
public static Cluster greedyShufflePartitions(final Cluster nextCandidateCluster, final int greedyAttempts, final int greedySwapMaxPartitionsPerNode, final int greedySwap...
java
public static Cluster greedyShufflePartitions(final Cluster nextCandidateCluster, final int greedyAttempts, final int greedySwapMaxPartitionsPerNode, final int greedySwap...
[ "public", "static", "Cluster", "greedyShufflePartitions", "(", "final", "Cluster", "nextCandidateCluster", ",", "final", "int", "greedyAttempts", ",", "final", "int", "greedySwapMaxPartitionsPerNode", ",", "final", "int", "greedySwapMaxPartitionsPerZone", ",", "List", "<"...
Within a single zone, tries swapping some minimum number of random partitions per node with some minimum number of random partitions from other nodes within the zone. Chooses the best swap in each iteration. Large values of the greedSwapMaxPartitions... arguments make this method equivalent to comparing every possible ...
[ "Within", "a", "single", "zone", "tries", "swapping", "some", "minimum", "number", "of", "random", "partitions", "per", "node", "with", "some", "minimum", "number", "of", "random", "partitions", "from", "other", "nodes", "within", "the", "zone", ".", "Chooses"...
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/Repartitioner.java#L862-L907
train
voldemort/voldemort
src/java/voldemort/rest/server/RestService.java
RestService.stopInner
@Override protected void stopInner() { /* * TODO REST-Server Need to handle inflight operations. What happens to * the existing async operations when a channel.close() is issued in * Netty? */ if(this.nettyServerChannel != null) { this.nettyServerChann...
java
@Override protected void stopInner() { /* * TODO REST-Server Need to handle inflight operations. What happens to * the existing async operations when a channel.close() is issued in * Netty? */ if(this.nettyServerChannel != null) { this.nettyServerChann...
[ "@", "Override", "protected", "void", "stopInner", "(", ")", "{", "/*\n * TODO REST-Server Need to handle inflight operations. What happens to\n * the existing async operations when a channel.close() is issued in\n * Netty?\n */", "if", "(", "this", ".", "ne...
Closes the Netty Channel and releases all resources
[ "Closes", "the", "Netty", "Channel", "and", "releases", "all", "resources" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/server/RestService.java#L84-L99
train
voldemort/voldemort
src/java/voldemort/rest/server/RestServerRequestHandler.java
RestServerRequestHandler.parseZoneId
protected int parseZoneId() { int result = -1; String zoneIdStr = this.request.getHeader(RestMessageHeaders.X_VOLD_ZONE_ID); if(zoneIdStr != null) { try { int zoneId = Integer.parseInt(zoneIdStr); if(zoneId < 0) { logger.error("Zone...
java
protected int parseZoneId() { int result = -1; String zoneIdStr = this.request.getHeader(RestMessageHeaders.X_VOLD_ZONE_ID); if(zoneIdStr != null) { try { int zoneId = Integer.parseInt(zoneIdStr); if(zoneId < 0) { logger.error("Zone...
[ "protected", "int", "parseZoneId", "(", ")", "{", "int", "result", "=", "-", "1", ";", "String", "zoneIdStr", "=", "this", ".", "request", ".", "getHeader", "(", "RestMessageHeaders", ".", "X_VOLD_ZONE_ID", ")", ";", "if", "(", "zoneIdStr", "!=", "null", ...
Retrieve and validate the zone id value from the REST request. "X-VOLD-Zone-Id" is the zone id header. @return valid zone id or -1 if there is no/invalid zone id
[ "Retrieve", "and", "validate", "the", "zone", "id", "value", "from", "the", "REST", "request", ".", "X", "-", "VOLD", "-", "Zone", "-", "Id", "is", "the", "zone", "id", "header", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/server/RestServerRequestHandler.java#L82-L100
train
voldemort/voldemort
src/java/voldemort/rest/server/RestServerRequestHandler.java
RestServerRequestHandler.registerRequest
@Override protected void registerRequest(RestRequestValidator requestValidator, ChannelHandlerContext ctx, MessageEvent messageEvent) { // At this point we know the request is valid and we have a // error handler. So we construct ...
java
@Override protected void registerRequest(RestRequestValidator requestValidator, ChannelHandlerContext ctx, MessageEvent messageEvent) { // At this point we know the request is valid and we have a // error handler. So we construct ...
[ "@", "Override", "protected", "void", "registerRequest", "(", "RestRequestValidator", "requestValidator", ",", "ChannelHandlerContext", "ctx", ",", "MessageEvent", "messageEvent", ")", "{", "// At this point we know the request is valid and we have a", "// error handler. So we cons...
Constructs a valid request and passes it on to the next handler. It also creates the 'Store' object corresponding to the store name specified in the REST request. @param requestValidator The Validator object used to construct the request object @param ctx Context of the Netty channel @param messageEvent Message Event ...
[ "Constructs", "a", "valid", "request", "and", "passes", "it", "on", "to", "the", "next", "handler", ".", "It", "also", "creates", "the", "Store", "object", "corresponding", "to", "the", "store", "name", "specified", "in", "the", "REST", "request", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/server/RestServerRequestHandler.java#L112-L152
train
voldemort/voldemort
src/java/voldemort/client/rebalance/RebalanceController.java
RebalanceController.getCurrentClusterState
private Pair<Cluster, List<StoreDefinition>> getCurrentClusterState() { // Retrieve the latest cluster metadata from the existing nodes Versioned<Cluster> currentVersionedCluster = adminClient.rebalanceOps.getLatestCluster(Utils.nodeListToNodeIdList(Lists.newArrayList(adminClient.getAdminClientCluster(...
java
private Pair<Cluster, List<StoreDefinition>> getCurrentClusterState() { // Retrieve the latest cluster metadata from the existing nodes Versioned<Cluster> currentVersionedCluster = adminClient.rebalanceOps.getLatestCluster(Utils.nodeListToNodeIdList(Lists.newArrayList(adminClient.getAdminClientCluster(...
[ "private", "Pair", "<", "Cluster", ",", "List", "<", "StoreDefinition", ">", ">", "getCurrentClusterState", "(", ")", "{", "// Retrieve the latest cluster metadata from the existing nodes", "Versioned", "<", "Cluster", ">", "currentVersionedCluster", "=", "adminClient", "...
Probe the existing cluster to retrieve the current cluster xml and stores xml. @return Pair of Cluster and List<StoreDefinition> from current cluster.
[ "Probe", "the", "existing", "cluster", "to", "retrieve", "the", "current", "cluster", "xml", "and", "stores", "xml", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/client/rebalance/RebalanceController.java#L82-L90
train
voldemort/voldemort
src/java/voldemort/client/rebalance/RebalanceController.java
RebalanceController.executePlan
private void executePlan(RebalancePlan rebalancePlan) { logger.info("Starting to execute rebalance Plan!"); int batchCount = 0; int partitionStoreCount = 0; long totalTimeMs = 0; List<RebalanceBatchPlan> entirePlan = rebalancePlan.getPlan(); int numBatches = entirePlan....
java
private void executePlan(RebalancePlan rebalancePlan) { logger.info("Starting to execute rebalance Plan!"); int batchCount = 0; int partitionStoreCount = 0; long totalTimeMs = 0; List<RebalanceBatchPlan> entirePlan = rebalancePlan.getPlan(); int numBatches = entirePlan....
[ "private", "void", "executePlan", "(", "RebalancePlan", "rebalancePlan", ")", "{", "logger", ".", "info", "(", "\"Starting to execute rebalance Plan!\"", ")", ";", "int", "batchCount", "=", "0", ";", "int", "partitionStoreCount", "=", "0", ";", "long", "totalTimeM...
Executes the rebalance plan. Does so batch-by-batch. Between each batch, status is dumped to logger.info. @param rebalancePlan
[ "Executes", "the", "rebalance", "plan", ".", "Does", "so", "batch", "-", "by", "-", "batch", ".", "Between", "each", "batch", "status", "is", "dumped", "to", "logger", ".", "info", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/client/rebalance/RebalanceController.java#L192-L224
train
voldemort/voldemort
src/java/voldemort/client/rebalance/RebalanceController.java
RebalanceController.batchStatusLog
private void batchStatusLog(int batchCount, int numBatches, int partitionStoreCount, int numPartitionStores, long totalTimeMs) { // Calculate the estimated end time and pretty print st...
java
private void batchStatusLog(int batchCount, int numBatches, int partitionStoreCount, int numPartitionStores, long totalTimeMs) { // Calculate the estimated end time and pretty print st...
[ "private", "void", "batchStatusLog", "(", "int", "batchCount", ",", "int", "numBatches", ",", "int", "partitionStoreCount", ",", "int", "numPartitionStores", ",", "long", "totalTimeMs", ")", "{", "// Calculate the estimated end time and pretty print stats", "double", "rat...
Pretty print a progress update after each batch complete. @param batchCount current batch @param numBatches total number of batches @param partitionStoreCount partition stores migrated @param numPartitionStores total number of partition stores to migrate @param totalTimeMs total time, in milliseconds, of execution thu...
[ "Pretty", "print", "a", "progress", "update", "after", "each", "batch", "complete", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/client/rebalance/RebalanceController.java#L235-L270
train
voldemort/voldemort
src/java/voldemort/client/rebalance/RebalanceController.java
RebalanceController.executeBatch
private void executeBatch(int batchId, final RebalanceBatchPlan batchPlan) { final Cluster batchCurrentCluster = batchPlan.getCurrentCluster(); final List<StoreDefinition> batchCurrentStoreDefs = batchPlan.getCurrentStoreDefs(); final Cluster batchFinalCluster = batchPlan.getFinalCluster(); ...
java
private void executeBatch(int batchId, final RebalanceBatchPlan batchPlan) { final Cluster batchCurrentCluster = batchPlan.getCurrentCluster(); final List<StoreDefinition> batchCurrentStoreDefs = batchPlan.getCurrentStoreDefs(); final Cluster batchFinalCluster = batchPlan.getFinalCluster(); ...
[ "private", "void", "executeBatch", "(", "int", "batchId", ",", "final", "RebalanceBatchPlan", "batchPlan", ")", "{", "final", "Cluster", "batchCurrentCluster", "=", "batchPlan", ".", "getCurrentCluster", "(", ")", ";", "final", "List", "<", "StoreDefinition", ">",...
Executes a batch plan. @param batchId Used as the ID of the batch plan. This allows related tasks on client- & server-side to pretty print messages in a manner that debugging can track specific batch plans across the cluster. @param batchPlan The batch plan...
[ "Executes", "a", "batch", "plan", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/client/rebalance/RebalanceController.java#L281-L390
train
voldemort/voldemort
src/java/voldemort/client/rebalance/RebalanceController.java
RebalanceController.proxyPause
private void proxyPause() { logger.info("Pausing after cluster state has changed to allow proxy bridges to be established. " + "Will start rebalancing work on servers in " + proxyPauseSec + " seconds."); try { Thread.sleep(TimeUnit....
java
private void proxyPause() { logger.info("Pausing after cluster state has changed to allow proxy bridges to be established. " + "Will start rebalancing work on servers in " + proxyPauseSec + " seconds."); try { Thread.sleep(TimeUnit....
[ "private", "void", "proxyPause", "(", ")", "{", "logger", ".", "info", "(", "\"Pausing after cluster state has changed to allow proxy bridges to be established. \"", "+", "\"Will start rebalancing work on servers in \"", "+", "proxyPauseSec", "+", "\" seconds.\"", ")", ";", "tr...
Pause between cluster change in metadata and starting server rebalancing work.
[ "Pause", "between", "cluster", "change", "in", "metadata", "and", "starting", "server", "rebalancing", "work", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/client/rebalance/RebalanceController.java#L396-L406
train
voldemort/voldemort
src/java/voldemort/client/rebalance/RebalanceController.java
RebalanceController.executeSubBatch
private void executeSubBatch(final int batchId, RebalanceBatchPlanProgressBar progressBar, final Cluster batchRollbackCluster, final List<StoreDefinition> batchRollbackStoreDefs, final List<Rebala...
java
private void executeSubBatch(final int batchId, RebalanceBatchPlanProgressBar progressBar, final Cluster batchRollbackCluster, final List<StoreDefinition> batchRollbackStoreDefs, final List<Rebala...
[ "private", "void", "executeSubBatch", "(", "final", "int", "batchId", ",", "RebalanceBatchPlanProgressBar", "progressBar", ",", "final", "Cluster", "batchRollbackCluster", ",", "final", "List", "<", "StoreDefinition", ">", "batchRollbackStoreDefs", ",", "final", "List",...
The smallest granularity of rebalancing where-in we move partitions for a sub-set of stores. Finally at the end of the movement, the node is removed out of rebalance state <br> Also any errors + rollback procedures are performed at this level itself. <pre> | Case | hasRO | hasRW | finishedRO | Action | | 0 | t | t |...
[ "The", "smallest", "granularity", "of", "rebalancing", "where", "-", "in", "we", "move", "partitions", "for", "a", "sub", "-", "set", "of", "stores", ".", "Finally", "at", "the", "end", "of", "the", "movement", "the", "node", "is", "removed", "out", "of"...
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/client/rebalance/RebalanceController.java#L563-L679
train
voldemort/voldemort
src/java/voldemort/utils/ConsistencyCheck.java
ConsistencyCheck.determineConsistency
public static ConsistencyLevel determineConsistency(Map<Value, Set<ClusterNode>> versionNodeSetMap, int replicationFactor) { boolean fullyConsistent = true; Value latestVersion = null; for (Map.Entry<Value, Set<ClusterNode>> versionNodeSetEntry : versionNodeSetMap.entrySet()) { ...
java
public static ConsistencyLevel determineConsistency(Map<Value, Set<ClusterNode>> versionNodeSetMap, int replicationFactor) { boolean fullyConsistent = true; Value latestVersion = null; for (Map.Entry<Value, Set<ClusterNode>> versionNodeSetEntry : versionNodeSetMap.entrySet()) { ...
[ "public", "static", "ConsistencyLevel", "determineConsistency", "(", "Map", "<", "Value", ",", "Set", "<", "ClusterNode", ">", ">", "versionNodeSetMap", ",", "int", "replicationFactor", ")", "{", "boolean", "fullyConsistent", "=", "true", ";", "Value", "latestVers...
Determine the consistency level of a key @param versionNodeSetMap A map that maps version to set of PrefixNodes @param replicationFactor Total replication factor for the set of clusters @return ConsistencyLevel Enum
[ "Determine", "the", "consistency", "level", "of", "a", "key" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/ConsistencyCheck.java#L654-L678
train
voldemort/voldemort
src/java/voldemort/utils/ConsistencyCheck.java
ConsistencyCheck.cleanIneligibleKeys
public static void cleanIneligibleKeys(Map<ByteArray, Map<Value, Set<ClusterNode>>> keyVersionNodeSetMap, int requiredWrite) { Set<ByteArray> keysToDelete = new HashSet<ByteArray>(); for (Map.Entry<ByteArray, Map<Value, Set<ClusterNode>>> entry : keyVersionNodeSetMap.entrySet()) { ...
java
public static void cleanIneligibleKeys(Map<ByteArray, Map<Value, Set<ClusterNode>>> keyVersionNodeSetMap, int requiredWrite) { Set<ByteArray> keysToDelete = new HashSet<ByteArray>(); for (Map.Entry<ByteArray, Map<Value, Set<ClusterNode>>> entry : keyVersionNodeSetMap.entrySet()) { ...
[ "public", "static", "void", "cleanIneligibleKeys", "(", "Map", "<", "ByteArray", ",", "Map", "<", "Value", ",", "Set", "<", "ClusterNode", ">", ">", ">", "keyVersionNodeSetMap", ",", "int", "requiredWrite", ")", "{", "Set", "<", "ByteArray", ">", "keysToDele...
Determine if a key version is invalid by comparing the version's existence and required writes configuration @param keyVersionNodeSetMap A map that contains keys mapping to a map that maps versions to set of PrefixNodes @param requiredWrite Required Write configuration
[ "Determine", "if", "a", "key", "version", "is", "invalid", "by", "comparing", "the", "version", "s", "existence", "and", "required", "writes", "configuration" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/ConsistencyCheck.java#L689-L717
train
voldemort/voldemort
src/java/voldemort/utils/ConsistencyCheck.java
ConsistencyCheck.keyVersionToString
public static String keyVersionToString(ByteArray key, Map<Value, Set<ClusterNode>> versionMap, String storeName, Integer partitionId) { StringBuilder record = new StringBuilder(); for (Map.Entry<Value, Set<ClusterNode>> versionSet : versionMap.entrySet()) { ...
java
public static String keyVersionToString(ByteArray key, Map<Value, Set<ClusterNode>> versionMap, String storeName, Integer partitionId) { StringBuilder record = new StringBuilder(); for (Map.Entry<Value, Set<ClusterNode>> versionSet : versionMap.entrySet()) { ...
[ "public", "static", "String", "keyVersionToString", "(", "ByteArray", "key", ",", "Map", "<", "Value", ",", "Set", "<", "ClusterNode", ">", ">", "versionMap", ",", "String", "storeName", ",", "Integer", "partitionId", ")", "{", "StringBuilder", "record", "=", ...
Convert a key-version-nodeSet information to string @param key The key @param versionMap mapping versions to set of PrefixNodes @param storeName store's name @param partitionId partition scanned @return a string that describe the information passed in
[ "Convert", "a", "key", "-", "version", "-", "nodeSet", "information", "to", "string" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/ConsistencyCheck.java#L815-L832
train
voldemort/voldemort
src/java/voldemort/rest/GetMetadataResponseSender.java
GetMetadataResponseSender.sendResponse
@Override public void sendResponse(StoreStats performanceStats, boolean isFromLocalZone, long startTimeInMs) throws Exception { ChannelBuffer responseContent = ChannelBuffers.dynamicBuffer(this.responseValue.length); responseContent.writeByt...
java
@Override public void sendResponse(StoreStats performanceStats, boolean isFromLocalZone, long startTimeInMs) throws Exception { ChannelBuffer responseContent = ChannelBuffers.dynamicBuffer(this.responseValue.length); responseContent.writeByt...
[ "@", "Override", "public", "void", "sendResponse", "(", "StoreStats", "performanceStats", ",", "boolean", "isFromLocalZone", ",", "long", "startTimeInMs", ")", "throws", "Exception", "{", "ChannelBuffer", "responseContent", "=", "ChannelBuffers", ".", "dynamicBuffer", ...
Sends a normal HTTP response containing the serialization information in a XML format
[ "Sends", "a", "normal", "HTTP", "response", "containing", "the", "serialization", "information", "in", "a", "XML", "format" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/GetMetadataResponseSender.java#L33-L62
train
voldemort/voldemort
src/java/voldemort/cluster/failuredetector/FailureDetectorConfig.java
FailureDetectorConfig.setCluster
public FailureDetectorConfig setCluster(Cluster cluster) { Utils.notNull(cluster); this.cluster = cluster; /* * FIXME: this is the hacky way to refresh the admin connection * verifier, but it'll just work. The clean way to do so is to have a * centralized metadata mana...
java
public FailureDetectorConfig setCluster(Cluster cluster) { Utils.notNull(cluster); this.cluster = cluster; /* * FIXME: this is the hacky way to refresh the admin connection * verifier, but it'll just work. The clean way to do so is to have a * centralized metadata mana...
[ "public", "FailureDetectorConfig", "setCluster", "(", "Cluster", "cluster", ")", "{", "Utils", ".", "notNull", "(", "cluster", ")", ";", "this", ".", "cluster", "=", "cluster", ";", "/*\n * FIXME: this is the hacky way to refresh the admin connection\n * ver...
Look at the comments on cluster variable to see why this is problematic
[ "Look", "at", "the", "comments", "on", "cluster", "variable", "to", "see", "why", "this", "is", "problematic" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/cluster/failuredetector/FailureDetectorConfig.java#L576-L589
train
voldemort/voldemort
src/java/voldemort/cluster/failuredetector/FailureDetectorConfig.java
FailureDetectorConfig.setNodes
@Deprecated public synchronized FailureDetectorConfig setNodes(Collection<Node> nodes) { Utils.notNull(nodes); this.nodes = new HashSet<Node>(nodes); return this; }
java
@Deprecated public synchronized FailureDetectorConfig setNodes(Collection<Node> nodes) { Utils.notNull(nodes); this.nodes = new HashSet<Node>(nodes); return this; }
[ "@", "Deprecated", "public", "synchronized", "FailureDetectorConfig", "setNodes", "(", "Collection", "<", "Node", ">", "nodes", ")", "{", "Utils", ".", "notNull", "(", "nodes", ")", ";", "this", ".", "nodes", "=", "new", "HashSet", "<", "Node", ">", "(", ...
Assigns a list of nodes in the cluster represented by this failure detector configuration. @param nodes Collection of Node instances, usually determined from the Cluster; must be non-null
[ "Assigns", "a", "list", "of", "nodes", "in", "the", "cluster", "represented", "by", "this", "failure", "detector", "configuration", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/cluster/failuredetector/FailureDetectorConfig.java#L611-L616
train
voldemort/voldemort
src/java/voldemort/cluster/Cluster.java
Cluster.hasNodeWithId
public boolean hasNodeWithId(int nodeId) { Node node = nodesById.get(nodeId); if(node == null) { return false; } return true; }
java
public boolean hasNodeWithId(int nodeId) { Node node = nodesById.get(nodeId); if(node == null) { return false; } return true; }
[ "public", "boolean", "hasNodeWithId", "(", "int", "nodeId", ")", "{", "Node", "node", "=", "nodesById", ".", "get", "(", "nodeId", ")", ";", "if", "(", "node", "==", "null", ")", "{", "return", "false", ";", "}", "return", "true", ";", "}" ]
Given a cluster and a node id checks if the node exists @param nodeId The node id to search for @return True if cluster contains the node id, else false
[ "Given", "a", "cluster", "and", "a", "node", "id", "checks", "if", "the", "node", "exists" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/cluster/Cluster.java#L264-L270
train
voldemort/voldemort
src/java/voldemort/cluster/Cluster.java
Cluster.cloneCluster
public static Cluster cloneCluster(Cluster cluster) { // Could add a better .clone() implementation that clones the derived // data structures. The constructor invoked by this clone implementation // can be slow for large numbers of partitions. Probably faster to copy // all the maps and...
java
public static Cluster cloneCluster(Cluster cluster) { // Could add a better .clone() implementation that clones the derived // data structures. The constructor invoked by this clone implementation // can be slow for large numbers of partitions. Probably faster to copy // all the maps and...
[ "public", "static", "Cluster", "cloneCluster", "(", "Cluster", "cluster", ")", "{", "// Could add a better .clone() implementation that clones the derived", "// data structures. The constructor invoked by this clone implementation", "// can be slow for large numbers of partitions. Probably fas...
Clones the cluster by constructing a new one with same name, partition layout, and nodes. @param cluster @return clone of Cluster cluster.
[ "Clones", "the", "cluster", "by", "constructing", "a", "new", "one", "with", "same", "name", "partition", "layout", "and", "nodes", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/cluster/Cluster.java#L322-L335
train
voldemort/voldemort
src/java/voldemort/client/protocol/admin/AdminClientPool.java
AdminClientPool.checkout
public AdminClient checkout() { if (isClosed.get()) { throw new IllegalStateException("Pool is closing"); } AdminClient client; // Try to get one from the Cache. while ((client = clientCache.poll()) != null) { if (!client.isClusterModified()) { ...
java
public AdminClient checkout() { if (isClosed.get()) { throw new IllegalStateException("Pool is closing"); } AdminClient client; // Try to get one from the Cache. while ((client = clientCache.poll()) != null) { if (!client.isClusterModified()) { ...
[ "public", "AdminClient", "checkout", "(", ")", "{", "if", "(", "isClosed", ".", "get", "(", ")", ")", "{", "throw", "new", "IllegalStateException", "(", "\"Pool is closing\"", ")", ";", "}", "AdminClient", "client", ";", "// Try to get one from the Cache.", "whi...
get an AdminClient from the cache if exists, if not create new one and return it. This method is non-blocking. All AdminClient returned from checkout, once after the completion of usage must be returned to the pool by calling checkin. If not, there will be leak of AdminClients (connections, threads and file handles). ...
[ "get", "an", "AdminClient", "from", "the", "cache", "if", "exists", "if", "not", "create", "new", "one", "and", "return", "it", ".", "This", "method", "is", "non", "-", "blocking", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/client/protocol/admin/AdminClientPool.java#L82-L101
train
voldemort/voldemort
src/java/voldemort/client/protocol/admin/AdminClientPool.java
AdminClientPool.checkin
public void checkin(AdminClient client) { if (isClosed.get()) { throw new IllegalStateException("Pool is closing"); } if (client == null) { throw new IllegalArgumentException("client is null"); } boolean isCheckedIn = clientCache.offer(client); ...
java
public void checkin(AdminClient client) { if (isClosed.get()) { throw new IllegalStateException("Pool is closing"); } if (client == null) { throw new IllegalArgumentException("client is null"); } boolean isCheckedIn = clientCache.offer(client); ...
[ "public", "void", "checkin", "(", "AdminClient", "client", ")", "{", "if", "(", "isClosed", ".", "get", "(", ")", ")", "{", "throw", "new", "IllegalStateException", "(", "\"Pool is closing\"", ")", ";", "}", "if", "(", "client", "==", "null", ")", "{", ...
submit the adminClient after usage is completed. Behavior is undefined, if checkin is called with objects not retrieved from checkout. @param client AdminClient retrieved from checkout
[ "submit", "the", "adminClient", "after", "usage", "is", "completed", ".", "Behavior", "is", "undefined", "if", "checkin", "is", "called", "with", "objects", "not", "retrieved", "from", "checkout", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/client/protocol/admin/AdminClientPool.java#L110-L125
train
voldemort/voldemort
src/java/voldemort/client/protocol/admin/AdminClientPool.java
AdminClientPool.close
public void close() { boolean isPreviouslyClosed = isClosed.getAndSet(true); if (isPreviouslyClosed) { return; } AdminClient client; while ((client = clientCache.poll()) != null) { client.close(); } }
java
public void close() { boolean isPreviouslyClosed = isClosed.getAndSet(true); if (isPreviouslyClosed) { return; } AdminClient client; while ((client = clientCache.poll()) != null) { client.close(); } }
[ "public", "void", "close", "(", ")", "{", "boolean", "isPreviouslyClosed", "=", "isClosed", ".", "getAndSet", "(", "true", ")", ";", "if", "(", "isPreviouslyClosed", ")", "{", "return", ";", "}", "AdminClient", "client", ";", "while", "(", "(", "client", ...
close the AdminPool, if no long required. After closed, all public methods will throw IllegalStateException
[ "close", "the", "AdminPool", "if", "no", "long", "required", ".", "After", "closed", "all", "public", "methods", "will", "throw", "IllegalStateException" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/client/protocol/admin/AdminClientPool.java#L131-L141
train
voldemort/voldemort
src/java/voldemort/utils/PartitionBalanceUtils.java
PartitionBalanceUtils.compressedListOfPartitionsInZone
public static String compressedListOfPartitionsInZone(final Cluster cluster, int zoneId) { Map<Integer, Integer> idToRunLength = PartitionBalanceUtils.getMapOfContiguousPartitions(cluster, zoneId); StringBu...
java
public static String compressedListOfPartitionsInZone(final Cluster cluster, int zoneId) { Map<Integer, Integer> idToRunLength = PartitionBalanceUtils.getMapOfContiguousPartitions(cluster, zoneId); StringBu...
[ "public", "static", "String", "compressedListOfPartitionsInZone", "(", "final", "Cluster", "cluster", ",", "int", "zoneId", ")", "{", "Map", "<", "Integer", ",", "Integer", ">", "idToRunLength", "=", "PartitionBalanceUtils", ".", "getMapOfContiguousPartitions", "(", ...
Compress contiguous partitions into format "e-i" instead of "e, f, g, h, i". This helps illustrate contiguous partitions within a zone. @param cluster @param zoneId @return pretty string of partitions per zone
[ "Compress", "contiguous", "partitions", "into", "format", "e", "-", "i", "instead", "of", "e", "f", "g", "h", "i", ".", "This", "helps", "illustrate", "contiguous", "partitions", "within", "a", "zone", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/PartitionBalanceUtils.java#L54-L81
train
voldemort/voldemort
src/java/voldemort/utils/PartitionBalanceUtils.java
PartitionBalanceUtils.getMapOfContiguousPartitions
public static Map<Integer, Integer> getMapOfContiguousPartitions(final Cluster cluster, int zoneId) { List<Integer> partitionIds = new ArrayList<Integer>(cluster.getPartitionIdsInZone(zoneId)); Map<Integer, Integer> partitionIdToRunLen...
java
public static Map<Integer, Integer> getMapOfContiguousPartitions(final Cluster cluster, int zoneId) { List<Integer> partitionIds = new ArrayList<Integer>(cluster.getPartitionIdsInZone(zoneId)); Map<Integer, Integer> partitionIdToRunLen...
[ "public", "static", "Map", "<", "Integer", ",", "Integer", ">", "getMapOfContiguousPartitions", "(", "final", "Cluster", "cluster", ",", "int", "zoneId", ")", "{", "List", "<", "Integer", ">", "partitionIds", "=", "new", "ArrayList", "<", "Integer", ">", "("...
Determines run length for each 'initial' partition ID. Note that a contiguous run may "wrap around" the end of the ring. @param cluster @param zoneId @return map of initial partition Id to length of contiguous run of partition IDs within the same zone..
[ "Determines", "run", "length", "for", "each", "initial", "partition", "ID", ".", "Note", "that", "a", "contiguous", "run", "may", "wrap", "around", "the", "end", "of", "the", "ring", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/PartitionBalanceUtils.java#L92-L129
train
voldemort/voldemort
src/java/voldemort/utils/PartitionBalanceUtils.java
PartitionBalanceUtils.getMapOfContiguousPartitionRunLengths
public static Map<Integer, Integer> getMapOfContiguousPartitionRunLengths(final Cluster cluster, int zoneId) { Map<Integer, Integer> idToRunLength = getMapOfContiguousPartitions(cluster, zoneId); Map<Integer, Integer> runLengthToCount = Maps.newHashMap(); if(idToRunLength.isEmpty())...
java
public static Map<Integer, Integer> getMapOfContiguousPartitionRunLengths(final Cluster cluster, int zoneId) { Map<Integer, Integer> idToRunLength = getMapOfContiguousPartitions(cluster, zoneId); Map<Integer, Integer> runLengthToCount = Maps.newHashMap(); if(idToRunLength.isEmpty())...
[ "public", "static", "Map", "<", "Integer", ",", "Integer", ">", "getMapOfContiguousPartitionRunLengths", "(", "final", "Cluster", "cluster", ",", "int", "zoneId", ")", "{", "Map", "<", "Integer", ",", "Integer", ">", "idToRunLength", "=", "getMapOfContiguousPartit...
Determines a histogram of contiguous runs of partitions within a zone. I.e., for each run length of contiguous partitions, how many such runs are there. Does not correctly address "wrap around" of partition IDs (i.e., the fact that partition ID 0 is "next" to partition ID 'max') @param cluster @param zoneId @return m...
[ "Determines", "a", "histogram", "of", "contiguous", "runs", "of", "partitions", "within", "a", "zone", ".", "I", ".", "e", ".", "for", "each", "run", "length", "of", "contiguous", "partitions", "how", "many", "such", "runs", "are", "there", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/PartitionBalanceUtils.java#L144-L161
train
voldemort/voldemort
src/java/voldemort/utils/PartitionBalanceUtils.java
PartitionBalanceUtils.getPrettyMapOfContiguousPartitionRunLengths
public static String getPrettyMapOfContiguousPartitionRunLengths(final Cluster cluster, int zoneId) { Map<Integer, Integer> runLengthToCount = getMapOfContiguousPartitionRunLengths(cluster, ...
java
public static String getPrettyMapOfContiguousPartitionRunLengths(final Cluster cluster, int zoneId) { Map<Integer, Integer> runLengthToCount = getMapOfContiguousPartitionRunLengths(cluster, ...
[ "public", "static", "String", "getPrettyMapOfContiguousPartitionRunLengths", "(", "final", "Cluster", "cluster", ",", "int", "zoneId", ")", "{", "Map", "<", "Integer", ",", "Integer", ">", "runLengthToCount", "=", "getMapOfContiguousPartitionRunLengths", "(", "cluster",...
Pretty prints the output of getMapOfContiguousPartitionRunLengths @param cluster @param zoneId @return pretty string of contiguous run lengths
[ "Pretty", "prints", "the", "output", "of", "getMapOfContiguousPartitionRunLengths" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/PartitionBalanceUtils.java#L170-L187
train
voldemort/voldemort
src/java/voldemort/utils/PartitionBalanceUtils.java
PartitionBalanceUtils.getHotPartitionsDueToContiguity
public static String getHotPartitionsDueToContiguity(final Cluster cluster, int hotContiguityCutoff) { StringBuilder sb = new StringBuilder(); for(int zoneId: cluster.getZoneIds()) { Map<Integer, Integer> idToRunLength = getMapOfConti...
java
public static String getHotPartitionsDueToContiguity(final Cluster cluster, int hotContiguityCutoff) { StringBuilder sb = new StringBuilder(); for(int zoneId: cluster.getZoneIds()) { Map<Integer, Integer> idToRunLength = getMapOfConti...
[ "public", "static", "String", "getHotPartitionsDueToContiguity", "(", "final", "Cluster", "cluster", ",", "int", "hotContiguityCutoff", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "int", "zoneId", ":", "cluster", ".",...
Returns a pretty printed string of nodes that host specific "hot" partitions, where hot is defined as following a contiguous run of partitions of some length in another zone. @param cluster The cluster to analyze @param hotContiguityCutoff cutoff below which a contiguous run is not hot. @return pretty string of hot pa...
[ "Returns", "a", "pretty", "printed", "string", "of", "nodes", "that", "host", "specific", "hot", "partitions", "where", "hot", "is", "defined", "as", "following", "a", "contiguous", "run", "of", "partitions", "of", "some", "length", "in", "another", "zone", ...
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/PartitionBalanceUtils.java#L199-L220
train
voldemort/voldemort
src/java/voldemort/utils/PartitionBalanceUtils.java
PartitionBalanceUtils.analyzeInvalidMetadataRate
public static String analyzeInvalidMetadataRate(final Cluster currentCluster, List<StoreDefinition> currentStoreDefs, final Cluster finalCluster, List<StoreDefiniti...
java
public static String analyzeInvalidMetadataRate(final Cluster currentCluster, List<StoreDefinition> currentStoreDefs, final Cluster finalCluster, List<StoreDefiniti...
[ "public", "static", "String", "analyzeInvalidMetadataRate", "(", "final", "Cluster", "currentCluster", ",", "List", "<", "StoreDefinition", ">", "currentStoreDefs", ",", "final", "Cluster", "finalCluster", ",", "List", "<", "StoreDefinition", ">", "finalStoreDefs", ")...
Compares current cluster with final cluster. Uses pertinent store defs for each cluster to determine if a node that hosts a zone-primary in the current cluster will no longer host any zone-nary in the final cluster. This check is the precondition for a server returning an invalid metadata exception to a client on a nor...
[ "Compares", "current", "cluster", "with", "final", "cluster", ".", "Uses", "pertinent", "store", "defs", "for", "each", "cluster", "to", "determine", "if", "a", "node", "that", "hosts", "a", "zone", "-", "primary", "in", "the", "current", "cluster", "will", ...
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/PartitionBalanceUtils.java#L320-L369
train
voldemort/voldemort
src/java/voldemort/utils/pool/QueuedKeyedResourcePool.java
QueuedKeyedResourcePool.create
public static <K, V> QueuedKeyedResourcePool<K, V> create(ResourceFactory<K, V> factory, ResourcePoolConfig config) { return new QueuedKeyedResourcePool<K, V>(factory, config); }
java
public static <K, V> QueuedKeyedResourcePool<K, V> create(ResourceFactory<K, V> factory, ResourcePoolConfig config) { return new QueuedKeyedResourcePool<K, V>(factory, config); }
[ "public", "static", "<", "K", ",", "V", ">", "QueuedKeyedResourcePool", "<", "K", ",", "V", ">", "create", "(", "ResourceFactory", "<", "K", ",", "V", ">", "factory", ",", "ResourcePoolConfig", "config", ")", "{", "return", "new", "QueuedKeyedResourcePool", ...
Create a new queued pool with key type K, request type R, and value type V. @param factory The factory that creates objects @param config The pool config @return The created pool
[ "Create", "a", "new", "queued", "pool", "with", "key", "type", "K", "request", "type", "R", "and", "value", "type", "V", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/pool/QueuedKeyedResourcePool.java#L67-L70
train
voldemort/voldemort
src/java/voldemort/utils/pool/QueuedKeyedResourcePool.java
QueuedKeyedResourcePool.create
public static <K, V> QueuedKeyedResourcePool<K, V> create(ResourceFactory<K, V> factory) { return create(factory, new ResourcePoolConfig()); }
java
public static <K, V> QueuedKeyedResourcePool<K, V> create(ResourceFactory<K, V> factory) { return create(factory, new ResourcePoolConfig()); }
[ "public", "static", "<", "K", ",", "V", ">", "QueuedKeyedResourcePool", "<", "K", ",", "V", ">", "create", "(", "ResourceFactory", "<", "K", ",", "V", ">", "factory", ")", "{", "return", "create", "(", "factory", ",", "new", "ResourcePoolConfig", "(", ...
Create a new queued pool using the defaults for key of type K, request of type R, and value of Type V. @param factory The factory that creates objects @return The created pool
[ "Create", "a", "new", "queued", "pool", "using", "the", "defaults", "for", "key", "of", "type", "K", "request", "of", "type", "R", "and", "value", "of", "Type", "V", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/pool/QueuedKeyedResourcePool.java#L79-L81
train
voldemort/voldemort
src/java/voldemort/utils/pool/QueuedKeyedResourcePool.java
QueuedKeyedResourcePool.internalNonBlockingGet
public V internalNonBlockingGet(K key) throws Exception { Pool<V> resourcePool = getResourcePoolForKey(key); return attemptNonBlockingCheckout(key, resourcePool); }
java
public V internalNonBlockingGet(K key) throws Exception { Pool<V> resourcePool = getResourcePoolForKey(key); return attemptNonBlockingCheckout(key, resourcePool); }
[ "public", "V", "internalNonBlockingGet", "(", "K", "key", ")", "throws", "Exception", "{", "Pool", "<", "V", ">", "resourcePool", "=", "getResourcePoolForKey", "(", "key", ")", ";", "return", "attemptNonBlockingCheckout", "(", "key", ",", "resourcePool", ")", ...
Used only for unit testing. Please do not use this method in other ways. @param key @return @throws Exception
[ "Used", "only", "for", "unit", "testing", ".", "Please", "do", "not", "use", "this", "method", "in", "other", "ways", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/pool/QueuedKeyedResourcePool.java#L131-L134
train
voldemort/voldemort
src/java/voldemort/utils/pool/QueuedKeyedResourcePool.java
QueuedKeyedResourcePool.getNextUnexpiredResourceRequest
private AsyncResourceRequest<V> getNextUnexpiredResourceRequest(Queue<AsyncResourceRequest<V>> requestQueue) { AsyncResourceRequest<V> resourceRequest = requestQueue.poll(); while(resourceRequest != null) { if(resourceRequest.getDeadlineNs() < System.nanoTime()) { resourceReq...
java
private AsyncResourceRequest<V> getNextUnexpiredResourceRequest(Queue<AsyncResourceRequest<V>> requestQueue) { AsyncResourceRequest<V> resourceRequest = requestQueue.poll(); while(resourceRequest != null) { if(resourceRequest.getDeadlineNs() < System.nanoTime()) { resourceReq...
[ "private", "AsyncResourceRequest", "<", "V", ">", "getNextUnexpiredResourceRequest", "(", "Queue", "<", "AsyncResourceRequest", "<", "V", ">", ">", "requestQueue", ")", "{", "AsyncResourceRequest", "<", "V", ">", "resourceRequest", "=", "requestQueue", ".", "poll", ...
Pops resource requests off the queue until queue is empty or an unexpired resource request is found. Invokes .handleTimeout on all expired resource requests popped off the queue. @return null or a valid ResourceRequest
[ "Pops", "resource", "requests", "off", "the", "queue", "until", "queue", "is", "empty", "or", "an", "unexpired", "resource", "request", "is", "found", ".", "Invokes", ".", "handleTimeout", "on", "all", "expired", "resource", "requests", "popped", "off", "the",...
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/pool/QueuedKeyedResourcePool.java#L143-L154
train
voldemort/voldemort
src/java/voldemort/utils/pool/QueuedKeyedResourcePool.java
QueuedKeyedResourcePool.processQueue
private boolean processQueue(K key) { Queue<AsyncResourceRequest<V>> requestQueue = getRequestQueueForKey(key); if(requestQueue.isEmpty()) { return false; } // Attempt to get a resource. Pool<V> resourcePool = getResourcePoolForKey(key); V resource = null; ...
java
private boolean processQueue(K key) { Queue<AsyncResourceRequest<V>> requestQueue = getRequestQueueForKey(key); if(requestQueue.isEmpty()) { return false; } // Attempt to get a resource. Pool<V> resourcePool = getResourcePoolForKey(key); V resource = null; ...
[ "private", "boolean", "processQueue", "(", "K", "key", ")", "{", "Queue", "<", "AsyncResourceRequest", "<", "V", ">>", "requestQueue", "=", "getRequestQueueForKey", "(", "key", ")", ";", "if", "(", "requestQueue", ".", "isEmpty", "(", ")", ")", "{", "retur...
Attempts to checkout a resource so that one queued request can be serviced. @param key The key for which to process the requestQueue @return true iff an item was processed from the Queue.
[ "Attempts", "to", "checkout", "a", "resource", "so", "that", "one", "queued", "request", "can", "be", "serviced", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/pool/QueuedKeyedResourcePool.java#L163-L214
train
voldemort/voldemort
src/java/voldemort/utils/pool/QueuedKeyedResourcePool.java
QueuedKeyedResourcePool.checkin
@Override public void checkin(K key, V resource) { super.checkin(key, resource); // NB: Blocking checkout calls for synchronous requests get the resource // checked in above before processQueueLoop() attempts checkout below. // There is therefore a risk that asynchronous requests wil...
java
@Override public void checkin(K key, V resource) { super.checkin(key, resource); // NB: Blocking checkout calls for synchronous requests get the resource // checked in above before processQueueLoop() attempts checkout below. // There is therefore a risk that asynchronous requests wil...
[ "@", "Override", "public", "void", "checkin", "(", "K", "key", ",", "V", "resource", ")", "{", "super", ".", "checkin", "(", "key", ",", "resource", ")", ";", "// NB: Blocking checkout calls for synchronous requests get the resource", "// checked in above before process...
Check the given resource back into the pool @param key The key for the resource @param resource The resource
[ "Check", "the", "given", "resource", "back", "into", "the", "pool" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/pool/QueuedKeyedResourcePool.java#L248-L255
train
voldemort/voldemort
src/java/voldemort/utils/pool/QueuedKeyedResourcePool.java
QueuedKeyedResourcePool.destroyRequest
protected void destroyRequest(AsyncResourceRequest<V> resourceRequest) { if(resourceRequest != null) { try { // To hand control back to the owner of the // AsyncResourceRequest, treat "destroy" as an exception since // there is no resource to pass into...
java
protected void destroyRequest(AsyncResourceRequest<V> resourceRequest) { if(resourceRequest != null) { try { // To hand control back to the owner of the // AsyncResourceRequest, treat "destroy" as an exception since // there is no resource to pass into...
[ "protected", "void", "destroyRequest", "(", "AsyncResourceRequest", "<", "V", ">", "resourceRequest", ")", "{", "if", "(", "resourceRequest", "!=", "null", ")", "{", "try", "{", "// To hand control back to the owner of the", "// AsyncResourceRequest, treat \"destroy\" as an...
A safe wrapper to destroy the given resource request.
[ "A", "safe", "wrapper", "to", "destroy", "the", "given", "resource", "request", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/pool/QueuedKeyedResourcePool.java#L260-L273
train
voldemort/voldemort
src/java/voldemort/utils/pool/QueuedKeyedResourcePool.java
QueuedKeyedResourcePool.destroyRequestQueue
private void destroyRequestQueue(Queue<AsyncResourceRequest<V>> requestQueue) { if(requestQueue != null) { AsyncResourceRequest<V> resourceRequest = requestQueue.poll(); while(resourceRequest != null) { destroyRequest(resourceRequest); resourceRequest = re...
java
private void destroyRequestQueue(Queue<AsyncResourceRequest<V>> requestQueue) { if(requestQueue != null) { AsyncResourceRequest<V> resourceRequest = requestQueue.poll(); while(resourceRequest != null) { destroyRequest(resourceRequest); resourceRequest = re...
[ "private", "void", "destroyRequestQueue", "(", "Queue", "<", "AsyncResourceRequest", "<", "V", ">", ">", "requestQueue", ")", "{", "if", "(", "requestQueue", "!=", "null", ")", "{", "AsyncResourceRequest", "<", "V", ">", "resourceRequest", "=", "requestQueue", ...
Destroys all resource requests in requestQueue. @param requestQueue The queue for which all resource requests are to be destroyed.
[ "Destroys", "all", "resource", "requests", "in", "requestQueue", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/pool/QueuedKeyedResourcePool.java#L281-L289
train
voldemort/voldemort
src/java/voldemort/utils/pool/QueuedKeyedResourcePool.java
QueuedKeyedResourcePool.getRegisteredResourceRequestCount
public int getRegisteredResourceRequestCount(K key) { if(requestQueueMap.containsKey(key)) { Queue<AsyncResourceRequest<V>> requestQueue = getRequestQueueForExistingKey(key); // FYI: .size() is not constant time in the next call. ;) if(requestQueue != null) { ...
java
public int getRegisteredResourceRequestCount(K key) { if(requestQueueMap.containsKey(key)) { Queue<AsyncResourceRequest<V>> requestQueue = getRequestQueueForExistingKey(key); // FYI: .size() is not constant time in the next call. ;) if(requestQueue != null) { ...
[ "public", "int", "getRegisteredResourceRequestCount", "(", "K", "key", ")", "{", "if", "(", "requestQueueMap", ".", "containsKey", "(", "key", ")", ")", "{", "Queue", "<", "AsyncResourceRequest", "<", "V", ">>", "requestQueue", "=", "getRequestQueueForExistingKey"...
Count the number of queued resource requests for a specific pool. @param key The key @return The count of queued resource requests. Returns 0 if no queue exists for given key.
[ "Count", "the", "number", "of", "queued", "resource", "requests", "for", "a", "specific", "pool", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/pool/QueuedKeyedResourcePool.java#L355-L364
train
voldemort/voldemort
src/java/voldemort/utils/pool/QueuedKeyedResourcePool.java
QueuedKeyedResourcePool.getRegisteredResourceRequestCount
public int getRegisteredResourceRequestCount() { int count = 0; for(Entry<K, Queue<AsyncResourceRequest<V>>> entry: this.requestQueueMap.entrySet()) { // FYI: .size() is not constant time in the next call. ;) count += entry.getValue().size(); } return count; }
java
public int getRegisteredResourceRequestCount() { int count = 0; for(Entry<K, Queue<AsyncResourceRequest<V>>> entry: this.requestQueueMap.entrySet()) { // FYI: .size() is not constant time in the next call. ;) count += entry.getValue().size(); } return count; }
[ "public", "int", "getRegisteredResourceRequestCount", "(", ")", "{", "int", "count", "=", "0", ";", "for", "(", "Entry", "<", "K", ",", "Queue", "<", "AsyncResourceRequest", "<", "V", ">", ">", ">", "entry", ":", "this", ".", "requestQueueMap", ".", "ent...
Count the total number of queued resource requests for all queues. The result is "approximate" in the face of concurrency since individual queues can change size during the aggregate count. @return The (approximate) aggregate count of queued resource requests.
[ "Count", "the", "total", "number", "of", "queued", "resource", "requests", "for", "all", "queues", ".", "The", "result", "is", "approximate", "in", "the", "face", "of", "concurrency", "since", "individual", "queues", "can", "change", "size", "during", "the", ...
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/pool/QueuedKeyedResourcePool.java#L373-L380
train