id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
160,900
voldemort/voldemort
src/java/voldemort/tools/admin/AdminParserUtils.java
AdminParserUtils.checkRequired
public static void checkRequired(OptionSet options, String opt) throws VoldemortException { List<String> opts = Lists.newArrayList(); opts.add(opt); checkRequired(options, opts); }
java
public static void checkRequired(OptionSet options, String opt) throws VoldemortException { List<String> opts = Lists.newArrayList(); opts.add(opt); checkRequired(options, opts); }
[ "public", "static", "void", "checkRequired", "(", "OptionSet", "options", ",", "String", "opt", ")", "throws", "VoldemortException", "{", "List", "<", "String", ">", "opts", "=", "Lists", ".", "newArrayList", "(", ")", ";", "opts", ".", "add", "(", "opt", ...
Checks if the required option exists. @param options OptionSet to checked @param opt Required option to check @throws VoldemortException
[ "Checks", "if", "the", "required", "option", "exists", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/admin/AdminParserUtils.java#L312-L316
160,901
voldemort/voldemort
src/java/voldemort/tools/admin/AdminParserUtils.java
AdminParserUtils.checkRequired
public static void checkRequired(OptionSet options, String opt1, String opt2) throws VoldemortException { List<String> opts = Lists.newArrayList(); opts.add(opt1); opts.add(opt2); checkRequired(options, opts); }
java
public static void checkRequired(OptionSet options, String opt1, String opt2) throws VoldemortException { List<String> opts = Lists.newArrayList(); opts.add(opt1); opts.add(opt2); checkRequired(options, opts); }
[ "public", "static", "void", "checkRequired", "(", "OptionSet", "options", ",", "String", "opt1", ",", "String", "opt2", ")", "throws", "VoldemortException", "{", "List", "<", "String", ">", "opts", "=", "Lists", ".", "newArrayList", "(", ")", ";", "opts", ...
Checks if there's exactly one option that exists among all possible opts. @param options OptionSet to checked @param opt1 Possible required option to check @param opt2 Possible required option to check @throws VoldemortException
[ "Checks", "if", "there", "s", "exactly", "one", "option", "that", "exists", "among", "all", "possible", "opts", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/admin/AdminParserUtils.java#L326-L332
160,902
voldemort/voldemort
src/java/voldemort/tools/admin/AdminParserUtils.java
AdminParserUtils.checkRequired
public static void checkRequired(OptionSet options, List<String> opts) throws VoldemortException { List<String> optCopy = Lists.newArrayList(); for(String opt: opts) { if(options.has(opt)) { optCopy.add(opt); } } if(optCopy.size() < 1) ...
java
public static void checkRequired(OptionSet options, List<String> opts) throws VoldemortException { List<String> optCopy = Lists.newArrayList(); for(String opt: opts) { if(options.has(opt)) { optCopy.add(opt); } } if(optCopy.size() < 1) ...
[ "public", "static", "void", "checkRequired", "(", "OptionSet", "options", ",", "List", "<", "String", ">", "opts", ")", "throws", "VoldemortException", "{", "List", "<", "String", ">", "optCopy", "=", "Lists", ".", "newArrayList", "(", ")", ";", "for", "("...
Checks if there's exactly one option that exists among all opts. @param options OptionSet to checked @param opts List of options to be checked @throws VoldemortException
[ "Checks", "if", "there", "s", "exactly", "one", "option", "that", "exists", "among", "all", "opts", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/admin/AdminParserUtils.java#L359-L381
160,903
voldemort/voldemort
src/java/voldemort/rest/coordinator/RestCoordinatorRequestHandler.java
RestCoordinatorRequestHandler.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 'StoreClient' 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 ...
[ "Constructs", "a", "valid", "request", "and", "passes", "it", "on", "to", "the", "next", "handler", ".", "It", "also", "creates", "the", "StoreClient", "object", "corresponding", "to", "the", "store", "name", "specified", "in", "the", "REST", "request", "." ...
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/coordinator/RestCoordinatorRequestHandler.java#L39-L72
160,904
voldemort/voldemort
src/java/voldemort/rest/RestDeleteErrorHandler.java
RestDeleteErrorHandler.handleExceptions
@Override public void handleExceptions(MessageEvent messageEvent, Exception exception) { if(exception instanceof InvalidMetadataException) { logger.error("Exception when deleting. The requested key does not exist in this partition", exception); writeErrorRes...
java
@Override public void handleExceptions(MessageEvent messageEvent, Exception exception) { if(exception instanceof InvalidMetadataException) { logger.error("Exception when deleting. The requested key does not exist in this partition", exception); writeErrorRes...
[ "@", "Override", "public", "void", "handleExceptions", "(", "MessageEvent", "messageEvent", ",", "Exception", "exception", ")", "{", "if", "(", "exception", "instanceof", "InvalidMetadataException", ")", "{", "logger", ".", "error", "(", "\"Exception when deleting. Th...
Handle exceptions thrown by the storage. Exceptions specific to DELETE go here. Pass other exceptions to the parent class. TODO REST-Server Add a new exception for this condition - server busy with pending requests. queue is full
[ "Handle", "exceptions", "thrown", "by", "the", "storage", ".", "Exceptions", "specific", "to", "DELETE", "go", "here", ".", "Pass", "other", "exceptions", "to", "the", "parent", "class", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/RestDeleteErrorHandler.java#L22-L55
160,905
voldemort/voldemort
src/java/voldemort/store/stats/StoreStats.java
StoreStats.recordPutTimeAndSize
public void recordPutTimeAndSize(long timeNS, long valueSize, long keySize) { recordTime(Tracked.PUT, timeNS, 0, valueSize, keySize, 0); }
java
public void recordPutTimeAndSize(long timeNS, long valueSize, long keySize) { recordTime(Tracked.PUT, timeNS, 0, valueSize, keySize, 0); }
[ "public", "void", "recordPutTimeAndSize", "(", "long", "timeNS", ",", "long", "valueSize", ",", "long", "keySize", ")", "{", "recordTime", "(", "Tracked", ".", "PUT", ",", "timeNS", ",", "0", ",", "valueSize", ",", "keySize", ",", "0", ")", ";", "}" ]
Record the duration of a put operation, along with the size of the values returned.
[ "Record", "the", "duration", "of", "a", "put", "operation", "along", "with", "the", "size", "of", "the", "values", "returned", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/stats/StoreStats.java#L104-L106
160,906
voldemort/voldemort
src/java/voldemort/store/stats/StoreStats.java
StoreStats.recordGetAllTime
public void recordGetAllTime(long timeNS, int requested, int returned, long totalValueBytes, long totalKeyBytes) { recordTime(Tracked.GET_ALL, timeNS, ...
java
public void recordGetAllTime(long timeNS, int requested, int returned, long totalValueBytes, long totalKeyBytes) { recordTime(Tracked.GET_ALL, timeNS, ...
[ "public", "void", "recordGetAllTime", "(", "long", "timeNS", ",", "int", "requested", ",", "int", "returned", ",", "long", "totalValueBytes", ",", "long", "totalKeyBytes", ")", "{", "recordTime", "(", "Tracked", ".", "GET_ALL", ",", "timeNS", ",", "requested",...
Record the duration of a get_all operation, along with how many values were requested, how may were actually returned and the size of the values returned.
[ "Record", "the", "duration", "of", "a", "get_all", "operation", "along", "with", "how", "many", "values", "were", "requested", "how", "may", "were", "actually", "returned", "and", "the", "size", "of", "the", "values", "returned", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/stats/StoreStats.java#L130-L141
160,907
voldemort/voldemort
src/java/voldemort/store/stats/StoreStats.java
StoreStats.recordTime
private void recordTime(Tracked op, long timeNS, long numEmptyResponses, long valueSize, long keySize, long getAllAggregateRequests) { counters.get(op).addRequest(timeNS, ...
java
private void recordTime(Tracked op, long timeNS, long numEmptyResponses, long valueSize, long keySize, long getAllAggregateRequests) { counters.get(op).addRequest(timeNS, ...
[ "private", "void", "recordTime", "(", "Tracked", "op", ",", "long", "timeNS", ",", "long", "numEmptyResponses", ",", "long", "valueSize", ",", "long", "keySize", ",", "long", "getAllAggregateRequests", ")", "{", "counters", ".", "get", "(", "op", ")", ".", ...
Method to service public recording APIs @param op Operation being tracked @param timeNS Duration of operation @param numEmptyResponses Number of empty responses being sent back, i.e.: requested keys for which there were no values (GET and GET_ALL only) @param valueSize Size in bytes of the value @param keySize Size in...
[ "Method", "to", "service", "public", "recording", "APIs" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/stats/StoreStats.java#L154-L169
160,908
voldemort/voldemort
contrib/hadoop-store-builder/src/java/voldemort/store/readonly/mr/utils/VoldemortUtils.java
VoldemortUtils.getCommaSeparatedStringValues
public static List<String> getCommaSeparatedStringValues(String paramValue, String type) { List<String> commaSeparatedProps = Lists.newArrayList(); for(String url: Utils.COMMA_SEP.split(paramValue.trim())) if(url.trim().length() > 0) commaSeparatedProps.add(url); if(...
java
public static List<String> getCommaSeparatedStringValues(String paramValue, String type) { List<String> commaSeparatedProps = Lists.newArrayList(); for(String url: Utils.COMMA_SEP.split(paramValue.trim())) if(url.trim().length() > 0) commaSeparatedProps.add(url); if(...
[ "public", "static", "List", "<", "String", ">", "getCommaSeparatedStringValues", "(", "String", "paramValue", ",", "String", "type", ")", "{", "List", "<", "String", ">", "commaSeparatedProps", "=", "Lists", ".", "newArrayList", "(", ")", ";", "for", "(", "S...
Given the comma separated list of properties as a string, splits it multiple strings @param paramValue Concatenated string @param type Type of parameter ( to throw exception ) @return List of string properties
[ "Given", "the", "comma", "separated", "list", "of", "properties", "as", "a", "string", "splits", "it", "multiple", "strings" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/contrib/hadoop-store-builder/src/java/voldemort/store/readonly/mr/utils/VoldemortUtils.java#L47-L57
160,909
voldemort/voldemort
src/java/voldemort/rest/coordinator/CoordinatorProxyService.java
CoordinatorProxyService.initializeFatClient
private synchronized void initializeFatClient(String storeName, Properties storeClientProps) { // updates the coordinator metadata with recent stores and cluster xml updateCoordinatorMetadataWithLatestState(); logger.info("Creating a Fat client for store: " + storeName); SocketStoreClie...
java
private synchronized void initializeFatClient(String storeName, Properties storeClientProps) { // updates the coordinator metadata with recent stores and cluster xml updateCoordinatorMetadataWithLatestState(); logger.info("Creating a Fat client for store: " + storeName); SocketStoreClie...
[ "private", "synchronized", "void", "initializeFatClient", "(", "String", "storeName", ",", "Properties", "storeClientProps", ")", "{", "// updates the coordinator metadata with recent stores and cluster xml", "updateCoordinatorMetadataWithLatestState", "(", ")", ";", "logger", "....
Initialize the fat client for the given store. 1. Updates the coordinatorMetadata 2.Gets the new store configs from the config file 3.Creates a new @SocketStoreClientFactory 4. Subsequently caches the @StoreClient obtained from the factory. This is synchronized because if Coordinator Admin is already doing some chan...
[ "Initialize", "the", "fat", "client", "for", "the", "given", "store", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/coordinator/CoordinatorProxyService.java#L104-L122
160,910
voldemort/voldemort
src/java/voldemort/client/rebalance/RebalanceBatchPlanProgressBar.java
RebalanceBatchPlanProgressBar.completeTask
synchronized public void completeTask(int taskId, int partitionStoresMigrated) { tasksInFlight.remove(taskId); numTasksCompleted++; numPartitionStoresMigrated += partitionStoresMigrated; updateProgressBar(); }
java
synchronized public void completeTask(int taskId, int partitionStoresMigrated) { tasksInFlight.remove(taskId); numTasksCompleted++; numPartitionStoresMigrated += partitionStoresMigrated; updateProgressBar(); }
[ "synchronized", "public", "void", "completeTask", "(", "int", "taskId", ",", "int", "partitionStoresMigrated", ")", "{", "tasksInFlight", ".", "remove", "(", "taskId", ")", ";", "numTasksCompleted", "++", ";", "numPartitionStoresMigrated", "+=", "partitionStoresMigrat...
Called whenever a rebalance task completes. This means one task is done and some number of partition stores have been migrated. @param taskId @param partitionStoresMigrated Number of partition stores moved by this completed task.
[ "Called", "whenever", "a", "rebalance", "task", "completes", ".", "This", "means", "one", "task", "is", "done", "and", "some", "number", "of", "partition", "stores", "have", "been", "migrated", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/client/rebalance/RebalanceBatchPlanProgressBar.java#L82-L89
160,911
voldemort/voldemort
src/java/voldemort/client/rebalance/RebalanceBatchPlanProgressBar.java
RebalanceBatchPlanProgressBar.getPrettyProgressBar
synchronized public String getPrettyProgressBar() { StringBuilder sb = new StringBuilder(); double taskRate = numTasksCompleted / (double) totalTaskCount; double partitionStoreRate = numPartitionStoresMigrated / (double) totalPartitionStoreCount; long deltaTimeMs = System.currentTimeMi...
java
synchronized public String getPrettyProgressBar() { StringBuilder sb = new StringBuilder(); double taskRate = numTasksCompleted / (double) totalTaskCount; double partitionStoreRate = numPartitionStoresMigrated / (double) totalPartitionStoreCount; long deltaTimeMs = System.currentTimeMi...
[ "synchronized", "public", "String", "getPrettyProgressBar", "(", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "double", "taskRate", "=", "numTasksCompleted", "/", "(", "double", ")", "totalTaskCount", ";", "double", "partitionStoreR...
Construct a pretty string documenting progress for this batch plan thus far. @return pretty string documenting progress
[ "Construct", "a", "pretty", "string", "documenting", "progress", "for", "this", "batch", "plan", "thus", "far", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/client/rebalance/RebalanceBatchPlanProgressBar.java#L97-L145
160,912
voldemort/voldemort
src/java/voldemort/server/protocol/admin/FetchStreamRequestHandler.java
FetchStreamRequestHandler.progressInfoMessage
protected void progressInfoMessage(final String tag) { if(logger.isInfoEnabled()) { long totalTimeS = (System.currentTimeMillis() - startTimeMs) / Time.MS_PER_SECOND; logger.info(tag + " : scanned " + scanned + " and fetched " + fetched + " for store '" + storage...
java
protected void progressInfoMessage(final String tag) { if(logger.isInfoEnabled()) { long totalTimeS = (System.currentTimeMillis() - startTimeMs) / Time.MS_PER_SECOND; logger.info(tag + " : scanned " + scanned + " and fetched " + fetched + " for store '" + storage...
[ "protected", "void", "progressInfoMessage", "(", "final", "String", "tag", ")", "{", "if", "(", "logger", ".", "isInfoEnabled", "(", ")", ")", "{", "long", "totalTimeS", "=", "(", "System", ".", "currentTimeMillis", "(", ")", "-", "startTimeMs", ")", "/", ...
Progress info message @param tag Message that precedes progress info. Indicate 'keys' or 'entries'.
[ "Progress", "info", "message" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/server/protocol/admin/FetchStreamRequestHandler.java#L175-L183
160,913
voldemort/voldemort
src/java/voldemort/server/protocol/admin/FetchStreamRequestHandler.java
FetchStreamRequestHandler.sendMessage
protected void sendMessage(DataOutputStream outputStream, Message message) throws IOException { long startNs = System.nanoTime(); ProtoUtils.writeMessage(outputStream, message); if(streamStats != null) { streamStats.reportNetworkTime(operation, ...
java
protected void sendMessage(DataOutputStream outputStream, Message message) throws IOException { long startNs = System.nanoTime(); ProtoUtils.writeMessage(outputStream, message); if(streamStats != null) { streamStats.reportNetworkTime(operation, ...
[ "protected", "void", "sendMessage", "(", "DataOutputStream", "outputStream", ",", "Message", "message", ")", "throws", "IOException", "{", "long", "startNs", "=", "System", ".", "nanoTime", "(", ")", ";", "ProtoUtils", ".", "writeMessage", "(", "outputStream", "...
Helper method to send message on outputStream and account for network time stats. @param outputStream @param message @throws IOException
[ "Helper", "method", "to", "send", "message", "on", "outputStream", "and", "account", "for", "network", "time", "stats", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/server/protocol/admin/FetchStreamRequestHandler.java#L206-L213
160,914
voldemort/voldemort
src/java/voldemort/server/protocol/admin/FetchStreamRequestHandler.java
FetchStreamRequestHandler.reportStorageOpTime
protected void reportStorageOpTime(long startNs) { if(streamStats != null) { streamStats.reportStreamingScan(operation); streamStats.reportStorageTime(operation, Utils.elapsedTimeNs(startNs, System.nanoTime())); } }
java
protected void reportStorageOpTime(long startNs) { if(streamStats != null) { streamStats.reportStreamingScan(operation); streamStats.reportStorageTime(operation, Utils.elapsedTimeNs(startNs, System.nanoTime())); } }
[ "protected", "void", "reportStorageOpTime", "(", "long", "startNs", ")", "{", "if", "(", "streamStats", "!=", "null", ")", "{", "streamStats", ".", "reportStreamingScan", "(", "operation", ")", ";", "streamStats", ".", "reportStorageTime", "(", "operation", ",",...
Helper method to track storage operations & time via StreamingStats. @param startNs
[ "Helper", "method", "to", "track", "storage", "operations", "&", "time", "via", "StreamingStats", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/server/protocol/admin/FetchStreamRequestHandler.java#L220-L226
160,915
voldemort/voldemort
src/java/voldemort/server/socket/SocketServer.java
SocketServer.awaitStartupCompletion
public void awaitStartupCompletion() { try { Object obj = startedStatusQueue.take(); if(obj instanceof Throwable) throw new VoldemortException((Throwable) obj); } catch(InterruptedException e) { // this is okay, if we are interrupted we can stop waitin...
java
public void awaitStartupCompletion() { try { Object obj = startedStatusQueue.take(); if(obj instanceof Throwable) throw new VoldemortException((Throwable) obj); } catch(InterruptedException e) { // this is okay, if we are interrupted we can stop waitin...
[ "public", "void", "awaitStartupCompletion", "(", ")", "{", "try", "{", "Object", "obj", "=", "startedStatusQueue", ".", "take", "(", ")", ";", "if", "(", "obj", "instanceof", "Throwable", ")", "throw", "new", "VoldemortException", "(", "(", "Throwable", ")",...
Blocks until the server has started successfully or an exception is thrown. @throws VoldemortException if a problem occurs during start-up wrapping the original exception.
[ "Blocks", "until", "the", "server", "has", "started", "successfully", "or", "an", "exception", "is", "thrown", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/server/socket/SocketServer.java#L258-L266
160,916
voldemort/voldemort
src/java/voldemort/client/protocol/admin/StreamingClient.java
StreamingClient.streamingSlopPut
protected synchronized void streamingSlopPut(ByteArray key, Versioned<byte[]> value, String storeName, int failedNodeId) throws IOException { Slop slop = new Slop(s...
java
protected synchronized void streamingSlopPut(ByteArray key, Versioned<byte[]> value, String storeName, int failedNodeId) throws IOException { Slop slop = new Slop(s...
[ "protected", "synchronized", "void", "streamingSlopPut", "(", "ByteArray", "key", ",", "Versioned", "<", "byte", "[", "]", ">", "value", ",", "String", "storeName", ",", "int", "failedNodeId", ")", "throws", "IOException", "{", "Slop", "slop", "=", "new", "S...
This is a method to stream slops to "slop" store when a node is detected faulty in a streaming session @param key -- original key @param value -- original value @param storeName -- the store for which we are registering the slop @param failedNodeId -- the faulty node ID for which we register a slop @throws IOException
[ "This", "is", "a", "method", "to", "stream", "slops", "to", "slop", "store", "when", "a", "node", "is", "detected", "faulty", "in", "a", "streaming", "session" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/client/protocol/admin/StreamingClient.java#L141-L192
160,917
voldemort/voldemort
src/java/voldemort/client/protocol/admin/StreamingClient.java
StreamingClient.synchronousInvokeCallback
@SuppressWarnings("rawtypes") private void synchronousInvokeCallback(Callable call) { Future future = streamingSlopResults.submit(call); try { future.get(); } catch(InterruptedException e1) { logger.error("Callback failed", e1); throw new VoldemortExce...
java
@SuppressWarnings("rawtypes") private void synchronousInvokeCallback(Callable call) { Future future = streamingSlopResults.submit(call); try { future.get(); } catch(InterruptedException e1) { logger.error("Callback failed", e1); throw new VoldemortExce...
[ "@", "SuppressWarnings", "(", "\"rawtypes\"", ")", "private", "void", "synchronousInvokeCallback", "(", "Callable", "call", ")", "{", "Future", "future", "=", "streamingSlopResults", ".", "submit", "(", "call", ")", ";", "try", "{", "future", ".", "get", "(", ...
Helper method to synchronously invoke a callback @param call
[ "Helper", "method", "to", "synchronously", "invoke", "a", "callback" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/client/protocol/admin/StreamingClient.java#L224-L243
160,918
voldemort/voldemort
contrib/hadoop-store-builder/src/java/voldemort/store/readonly/hooks/http/HttpHookRunnable.java
HttpHookRunnable.handleResponse
protected void handleResponse(int responseCode, InputStream inputStream) { BufferedReader rd = null; try { // Buffer the result into a string rd = new BufferedReader(new InputStreamReader(inputStream)); StringBuilder sb = new StringBuilder(); String line; ...
java
protected void handleResponse(int responseCode, InputStream inputStream) { BufferedReader rd = null; try { // Buffer the result into a string rd = new BufferedReader(new InputStreamReader(inputStream)); StringBuilder sb = new StringBuilder(); String line; ...
[ "protected", "void", "handleResponse", "(", "int", "responseCode", ",", "InputStream", "inputStream", ")", "{", "BufferedReader", "rd", "=", "null", ";", "try", "{", "// Buffer the result into a string", "rd", "=", "new", "BufferedReader", "(", "new", "InputStreamRe...
Can be overridden if you want to replace or supplement the debug handling for responses. @param responseCode @param inputStream
[ "Can", "be", "overridden", "if", "you", "want", "to", "replace", "or", "supplement", "the", "debug", "handling", "for", "responses", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/contrib/hadoop-store-builder/src/java/voldemort/store/readonly/hooks/http/HttpHookRunnable.java#L92-L114
160,919
voldemort/voldemort
src/java/voldemort/client/protocol/admin/BaseStreamingClient.java
BaseStreamingClient.addStoreToSession
@SuppressWarnings({ "unchecked", "rawtypes" }) protected void addStoreToSession(String store) { Exception initializationException = null; storeNames.add(store); for(Node node: nodesToStream) { SocketDestination destination = null; SocketAndStreams sands = null; ...
java
@SuppressWarnings({ "unchecked", "rawtypes" }) protected void addStoreToSession(String store) { Exception initializationException = null; storeNames.add(store); for(Node node: nodesToStream) { SocketDestination destination = null; SocketAndStreams sands = null; ...
[ "@", "SuppressWarnings", "(", "{", "\"unchecked\"", ",", "\"rawtypes\"", "}", ")", "protected", "void", "addStoreToSession", "(", "String", "store", ")", "{", "Exception", "initializationException", "=", "null", ";", "storeNames", ".", "add", "(", "store", ")", ...
Add another store destination to an existing streaming session @param store the name of the store to stream to
[ "Add", "another", "store", "destination", "to", "an", "existing", "streaming", "session" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/client/protocol/admin/BaseStreamingClient.java#L366-L437
160,920
voldemort/voldemort
src/java/voldemort/client/protocol/admin/BaseStreamingClient.java
BaseStreamingClient.removeStoreFromSession
@SuppressWarnings({}) public synchronized void removeStoreFromSession(List<String> storeNameToRemove) { logger.info("closing the Streaming session for a few stores"); commitToVoldemort(storeNameToRemove); cleanupSessions(storeNameToRemove); }
java
@SuppressWarnings({}) public synchronized void removeStoreFromSession(List<String> storeNameToRemove) { logger.info("closing the Streaming session for a few stores"); commitToVoldemort(storeNameToRemove); cleanupSessions(storeNameToRemove); }
[ "@", "SuppressWarnings", "(", "{", "}", ")", "public", "synchronized", "void", "removeStoreFromSession", "(", "List", "<", "String", ">", "storeNameToRemove", ")", "{", "logger", ".", "info", "(", "\"closing the Streaming session for a few stores\"", ")", ";", "comm...
Remove a list of stores from the session First commit all entries for these stores and then cleanup resources @param storeNameToRemove List of stores to be removed from the current streaming session
[ "Remove", "a", "list", "of", "stores", "from", "the", "session" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/client/protocol/admin/BaseStreamingClient.java#L464-L472
160,921
voldemort/voldemort
src/java/voldemort/client/protocol/admin/BaseStreamingClient.java
BaseStreamingClient.blacklistNode
@SuppressWarnings({ "rawtypes", "unchecked" }) public void blacklistNode(int nodeId) { Collection<Node> nodesInCluster = adminClient.getAdminClientCluster().getNodes(); if(blackListedNodes == null) { blackListedNodes = new ArrayList(); } blackListedNodes.add(nodeId); ...
java
@SuppressWarnings({ "rawtypes", "unchecked" }) public void blacklistNode(int nodeId) { Collection<Node> nodesInCluster = adminClient.getAdminClientCluster().getNodes(); if(blackListedNodes == null) { blackListedNodes = new ArrayList(); } blackListedNodes.add(nodeId); ...
[ "@", "SuppressWarnings", "(", "{", "\"rawtypes\"", ",", "\"unchecked\"", "}", ")", "public", "void", "blacklistNode", "(", "int", "nodeId", ")", "{", "Collection", "<", "Node", ">", "nodesInCluster", "=", "adminClient", ".", "getAdminClientCluster", "(", ")", ...
mark a node as blacklisted @param nodeId Integer node id of the node to be blacklisted
[ "mark", "a", "node", "as", "blacklisted" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/client/protocol/admin/BaseStreamingClient.java#L608-L637
160,922
voldemort/voldemort
src/java/voldemort/client/protocol/admin/BaseStreamingClient.java
BaseStreamingClient.commitToVoldemort
@SuppressWarnings({ "unchecked", "rawtypes", "unused" }) private void commitToVoldemort(List<String> storeNamesToCommit) { if(logger.isDebugEnabled()) { logger.debug("Trying to commit to Voldemort"); } boolean hasError = false; if(nodesToStream == null || nodesToStream....
java
@SuppressWarnings({ "unchecked", "rawtypes", "unused" }) private void commitToVoldemort(List<String> storeNamesToCommit) { if(logger.isDebugEnabled()) { logger.debug("Trying to commit to Voldemort"); } boolean hasError = false; if(nodesToStream == null || nodesToStream....
[ "@", "SuppressWarnings", "(", "{", "\"unchecked\"", ",", "\"rawtypes\"", ",", "\"unused\"", "}", ")", "private", "void", "commitToVoldemort", "(", "List", "<", "String", ">", "storeNamesToCommit", ")", "{", "if", "(", "logger", ".", "isDebugEnabled", "(", ")",...
Flush the network buffer and write all entries to the serve. then wait for an ack from the server. This is a blocking call. It is invoked on every Commit batch size of entries, It is also called on the close session call @param storeNamesToCommit List of stores to be flushed and committed
[ "Flush", "the", "network", "buffer", "and", "write", "all", "entries", "to", "the", "serve", ".", "then", "wait", "for", "an", "ack", "from", "the", "server", ".", "This", "is", "a", "blocking", "call", ".", "It", "is", "invoked", "on", "every", "Commi...
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/client/protocol/admin/BaseStreamingClient.java#L648-L733
160,923
voldemort/voldemort
src/java/voldemort/client/protocol/admin/BaseStreamingClient.java
BaseStreamingClient.cleanupSessions
@SuppressWarnings({ "rawtypes", "unchecked" }) private void cleanupSessions(List<String> storeNamesToCleanUp) { logger.info("Performing cleanup"); for(String store: storeNamesToCleanUp) { for(Node node: nodesToStream) { try { SocketAndStreams sands =...
java
@SuppressWarnings({ "rawtypes", "unchecked" }) private void cleanupSessions(List<String> storeNamesToCleanUp) { logger.info("Performing cleanup"); for(String store: storeNamesToCleanUp) { for(Node node: nodesToStream) { try { SocketAndStreams sands =...
[ "@", "SuppressWarnings", "(", "{", "\"rawtypes\"", ",", "\"unchecked\"", "}", ")", "private", "void", "cleanupSessions", "(", "List", "<", "String", ">", "storeNamesToCleanUp", ")", "{", "logger", ".", "info", "(", "\"Performing cleanup\"", ")", ";", "for", "(...
Helper method to Close all open socket connections and checkin back to the pool @param storeNamesToCleanUp List of stores to be cleanedup from the current streaming session
[ "Helper", "method", "to", "Close", "all", "open", "socket", "connections", "and", "checkin", "back", "to", "the", "pool" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/client/protocol/admin/BaseStreamingClient.java#L787-L810
160,924
voldemort/voldemort
src/java/voldemort/store/InsufficientOperationalNodesException.java
InsufficientOperationalNodesException.stripNodeIds
private static List<Integer> stripNodeIds(List<Node> nodeList) { List<Integer> nodeidList = new ArrayList<Integer>(); if(nodeList != null) { for(Node node: nodeList) { nodeidList.add(node.getId()); } } return nodeidList; }
java
private static List<Integer> stripNodeIds(List<Node> nodeList) { List<Integer> nodeidList = new ArrayList<Integer>(); if(nodeList != null) { for(Node node: nodeList) { nodeidList.add(node.getId()); } } return nodeidList; }
[ "private", "static", "List", "<", "Integer", ">", "stripNodeIds", "(", "List", "<", "Node", ">", "nodeList", ")", "{", "List", "<", "Integer", ">", "nodeidList", "=", "new", "ArrayList", "<", "Integer", ">", "(", ")", ";", "if", "(", "nodeList", "!=", ...
Helper method to get a list of node ids. @param nodeList
[ "Helper", "method", "to", "get", "a", "list", "of", "node", "ids", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/InsufficientOperationalNodesException.java#L80-L88
160,925
voldemort/voldemort
src/java/voldemort/store/InsufficientOperationalNodesException.java
InsufficientOperationalNodesException.difference
private static List<Node> difference(List<Node> listA, List<Node> listB) { if(listA != null && listB != null) listA.removeAll(listB); return listA; }
java
private static List<Node> difference(List<Node> listA, List<Node> listB) { if(listA != null && listB != null) listA.removeAll(listB); return listA; }
[ "private", "static", "List", "<", "Node", ">", "difference", "(", "List", "<", "Node", ">", "listA", ",", "List", "<", "Node", ">", "listB", ")", "{", "if", "(", "listA", "!=", "null", "&&", "listB", "!=", "null", ")", "listA", ".", "removeAll", "(...
Computes A-B @param listA @param listB @return
[ "Computes", "A", "-", "B" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/InsufficientOperationalNodesException.java#L97-L101
160,926
voldemort/voldemort
src/java/voldemort/serialization/avro/versioned/SchemaEvolutionValidator.java
SchemaEvolutionValidator.main
public static void main(String[] args) { if(args.length != 2) { System.out.println("Usage: SchemaEvolutionValidator pathToOldSchema pathToNewSchema"); return; } Schema oldSchema; Schema newSchema; try { oldSchema = Schema.parse(new File(args[...
java
public static void main(String[] args) { if(args.length != 2) { System.out.println("Usage: SchemaEvolutionValidator pathToOldSchema pathToNewSchema"); return; } Schema oldSchema; Schema newSchema; try { oldSchema = Schema.parse(new File(args[...
[ "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "{", "if", "(", "args", ".", "length", "!=", "2", ")", "{", "System", ".", "out", ".", "println", "(", "\"Usage: SchemaEvolutionValidator pathToOldSchema pathToNewSchema\"", ")", ";", ...
This main method provides an easy command line tool to compare two schemas.
[ "This", "main", "method", "provides", "an", "easy", "command", "line", "tool", "to", "compare", "two", "schemas", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/serialization/avro/versioned/SchemaEvolutionValidator.java#L51-L105
160,927
voldemort/voldemort
src/java/voldemort/serialization/avro/versioned/SchemaEvolutionValidator.java
SchemaEvolutionValidator.validateAllAvroSchemas
public static void validateAllAvroSchemas(SerializerDefinition avroSerDef) { Map<Integer, String> schemaVersions = avroSerDef.getAllSchemaInfoVersions(); if(schemaVersions.size() < 1) { throw new VoldemortException("No schema specified"); } for(Map.Entry<Integer, String> entr...
java
public static void validateAllAvroSchemas(SerializerDefinition avroSerDef) { Map<Integer, String> schemaVersions = avroSerDef.getAllSchemaInfoVersions(); if(schemaVersions.size() < 1) { throw new VoldemortException("No schema specified"); } for(Map.Entry<Integer, String> entr...
[ "public", "static", "void", "validateAllAvroSchemas", "(", "SerializerDefinition", "avroSerDef", ")", "{", "Map", "<", "Integer", ",", "String", ">", "schemaVersions", "=", "avroSerDef", ".", "getAllSchemaInfoVersions", "(", ")", ";", "if", "(", "schemaVersions", ...
Given an AVRO serializer definition, validates if all the avro schemas are valid i.e parseable. @param avroSerDef
[ "Given", "an", "AVRO", "serializer", "definition", "validates", "if", "all", "the", "avro", "schemas", "are", "valid", "i", ".", "e", "parseable", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/serialization/avro/versioned/SchemaEvolutionValidator.java#L826-L842
160,928
voldemort/voldemort
contrib/hadoop-store-builder/src/java/voldemort/store/readonly/mr/AbstractStoreBuilderConfigurable.java
AbstractStoreBuilderConfigurable.getPartition
public int getPartition(byte[] key, byte[] value, int numReduceTasks) { try { /** * {@link partitionId} is the Voldemort primary partition that this * record belongs to. */ int partitionId = By...
java
public int getPartition(byte[] key, byte[] value, int numReduceTasks) { try { /** * {@link partitionId} is the Voldemort primary partition that this * record belongs to. */ int partitionId = By...
[ "public", "int", "getPartition", "(", "byte", "[", "]", "key", ",", "byte", "[", "]", "value", ",", "int", "numReduceTasks", ")", "{", "try", "{", "/**\n * {@link partitionId} is the Voldemort primary partition that this\n * record belongs to.\n ...
This function computes which reduce task to shuffle a record to.
[ "This", "function", "computes", "which", "reduce", "task", "to", "shuffle", "a", "record", "to", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/contrib/hadoop-store-builder/src/java/voldemort/store/readonly/mr/AbstractStoreBuilderConfigurable.java#L114-L188
160,929
voldemort/voldemort
contrib/hadoop-store-builder/src/java/voldemort/store/readonly/disk/HadoopStoreWriter.java
HadoopStoreWriter.initFileStreams
@NotThreadsafe private void initFileStreams(int chunkId) { /** * {@link Set#add(Object)} returns false if the element already existed in the set. * This ensures we initialize the resources for each chunk only once. */ if (chunksHandled.add(chunkId)) { try { ...
java
@NotThreadsafe private void initFileStreams(int chunkId) { /** * {@link Set#add(Object)} returns false if the element already existed in the set. * This ensures we initialize the resources for each chunk only once. */ if (chunksHandled.add(chunkId)) { try { ...
[ "@", "NotThreadsafe", "private", "void", "initFileStreams", "(", "int", "chunkId", ")", "{", "/**\n * {@link Set#add(Object)} returns false if the element already existed in the set.\n * This ensures we initialize the resources for each chunk only once.\n */", "if", "...
The MapReduce framework should operate sequentially, so thread safety shouldn't be a problem.
[ "The", "MapReduce", "framework", "should", "operate", "sequentially", "so", "thread", "safety", "shouldn", "t", "be", "a", "problem", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/contrib/hadoop-store-builder/src/java/voldemort/store/readonly/disk/HadoopStoreWriter.java#L155-L204
160,930
voldemort/voldemort
src/java/voldemort/rest/RestGetRequestValidator.java
RestGetRequestValidator.parseAndValidateRequest
@Override public boolean parseAndValidateRequest() { if(!super.parseAndValidateRequest()) { return false; } isGetVersionRequest = hasGetVersionRequestHeader(); if(isGetVersionRequest && this.parsedKeys.size() > 1) { RestErrorHandler.writeErrorResponse(messageE...
java
@Override public boolean parseAndValidateRequest() { if(!super.parseAndValidateRequest()) { return false; } isGetVersionRequest = hasGetVersionRequestHeader(); if(isGetVersionRequest && this.parsedKeys.size() > 1) { RestErrorHandler.writeErrorResponse(messageE...
[ "@", "Override", "public", "boolean", "parseAndValidateRequest", "(", ")", "{", "if", "(", "!", "super", ".", "parseAndValidateRequest", "(", ")", ")", "{", "return", "false", ";", "}", "isGetVersionRequest", "=", "hasGetVersionRequestHeader", "(", ")", ";", "...
Validations specific to GET and GET ALL
[ "Validations", "specific", "to", "GET", "and", "GET", "ALL" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/RestGetRequestValidator.java#L31-L44
160,931
voldemort/voldemort
contrib/hadoop-store-builder/src/java/voldemort/store/readonly/mr/utils/HadoopUtils.java
HadoopUtils.getMetadataFromSequenceFile
public static Map<String, String> getMetadataFromSequenceFile(FileSystem fs, Path path) { try { Configuration conf = new Configuration(); conf.setInt("io.file.buffer.size", 4096); SequenceFile.Reader reader = new SequenceFile.Reader(fs, path, new Configuration()); ...
java
public static Map<String, String> getMetadataFromSequenceFile(FileSystem fs, Path path) { try { Configuration conf = new Configuration(); conf.setInt("io.file.buffer.size", 4096); SequenceFile.Reader reader = new SequenceFile.Reader(fs, path, new Configuration()); ...
[ "public", "static", "Map", "<", "String", ",", "String", ">", "getMetadataFromSequenceFile", "(", "FileSystem", "fs", ",", "Path", "path", ")", "{", "try", "{", "Configuration", "conf", "=", "new", "Configuration", "(", ")", ";", "conf", ".", "setInt", "("...
Read the metadata from a hadoop SequenceFile @param fs The filesystem to read from @param path The file to read from @return The metadata from this file
[ "Read", "the", "metadata", "from", "a", "hadoop", "SequenceFile" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/contrib/hadoop-store-builder/src/java/voldemort/store/readonly/mr/utils/HadoopUtils.java#L79-L95
160,932
voldemort/voldemort
src/java/voldemort/store/bdb/BdbNativeBackup.java
BdbNativeBackup.recordBackupSet
private void recordBackupSet(File backupDir) throws IOException { String[] filesInEnv = env.getHome().list(); SimpleDateFormat format = new SimpleDateFormat("yyyy_MM_dd_kk_mm_ss"); String recordFileName = "backupset-" + format.format(new Date()); File recordFile = new File(backupDir, rec...
java
private void recordBackupSet(File backupDir) throws IOException { String[] filesInEnv = env.getHome().list(); SimpleDateFormat format = new SimpleDateFormat("yyyy_MM_dd_kk_mm_ss"); String recordFileName = "backupset-" + format.format(new Date()); File recordFile = new File(backupDir, rec...
[ "private", "void", "recordBackupSet", "(", "File", "backupDir", ")", "throws", "IOException", "{", "String", "[", "]", "filesInEnv", "=", "env", ".", "getHome", "(", ")", ".", "list", "(", ")", ";", "SimpleDateFormat", "format", "=", "new", "SimpleDateFormat...
Records the list of backedup files into a text file @param filesInEnv @param backupDir
[ "Records", "the", "list", "of", "backedup", "files", "into", "a", "text", "file" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/bdb/BdbNativeBackup.java#L184-L202
160,933
voldemort/voldemort
src/java/voldemort/store/bdb/BdbNativeBackup.java
BdbNativeBackup.cleanStaleFiles
private void cleanStaleFiles(File backupDir, AsyncOperationStatus status) { String[] filesInEnv = env.getHome().list(); String[] filesInBackupDir = backupDir.list(); if(filesInEnv != null && filesInBackupDir != null) { HashSet<String> envFileSet = new HashSet<String>(); f...
java
private void cleanStaleFiles(File backupDir, AsyncOperationStatus status) { String[] filesInEnv = env.getHome().list(); String[] filesInBackupDir = backupDir.list(); if(filesInEnv != null && filesInBackupDir != null) { HashSet<String> envFileSet = new HashSet<String>(); f...
[ "private", "void", "cleanStaleFiles", "(", "File", "backupDir", ",", "AsyncOperationStatus", "status", ")", "{", "String", "[", "]", "filesInEnv", "=", "env", ".", "getHome", "(", ")", ".", "list", "(", ")", ";", "String", "[", "]", "filesInBackupDir", "="...
For recovery from the latest consistent snapshot, we should clean up the old files from the previous backup set, else we will fill the disk with useless log files @param backupDir
[ "For", "recovery", "from", "the", "latest", "consistent", "snapshot", "we", "should", "clean", "up", "the", "old", "files", "from", "the", "previous", "backup", "set", "else", "we", "will", "fill", "the", "disk", "with", "useless", "log", "files" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/bdb/BdbNativeBackup.java#L211-L227
160,934
voldemort/voldemort
src/java/voldemort/store/bdb/BdbNativeBackup.java
BdbNativeBackup.verifiedCopyFile
private void verifiedCopyFile(File sourceFile, File destFile) throws IOException { if(!destFile.exists()) { destFile.createNewFile(); } FileInputStream source = null; FileOutputStream destination = null; LogVerificationInputStream verifyStream = null; try { ...
java
private void verifiedCopyFile(File sourceFile, File destFile) throws IOException { if(!destFile.exists()) { destFile.createNewFile(); } FileInputStream source = null; FileOutputStream destination = null; LogVerificationInputStream verifyStream = null; try { ...
[ "private", "void", "verifiedCopyFile", "(", "File", "sourceFile", ",", "File", "destFile", ")", "throws", "IOException", "{", "if", "(", "!", "destFile", ".", "exists", "(", ")", ")", "{", "destFile", ".", "createNewFile", "(", ")", ";", "}", "FileInputStr...
Copies the jdb log files, with additional verification of the checksums. @param sourceFile @param destFile @throws IOException
[ "Copies", "the", "jdb", "log", "files", "with", "additional", "verification", "of", "the", "checksums", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/bdb/BdbNativeBackup.java#L264-L295
160,935
voldemort/voldemort
src/java/voldemort/routing/ZoneRoutingStrategy.java
ZoneRoutingStrategy.getReplicatingPartitionList
@Override public List<Integer> getReplicatingPartitionList(int index) { List<Node> preferenceNodesList = new ArrayList<Node>(getNumReplicas()); List<Integer> replicationPartitionsList = new ArrayList<Integer>(getNumReplicas()); // Copy Zone based Replication Factor HashMap<Integer, ...
java
@Override public List<Integer> getReplicatingPartitionList(int index) { List<Node> preferenceNodesList = new ArrayList<Node>(getNumReplicas()); List<Integer> replicationPartitionsList = new ArrayList<Integer>(getNumReplicas()); // Copy Zone based Replication Factor HashMap<Integer, ...
[ "@", "Override", "public", "List", "<", "Integer", ">", "getReplicatingPartitionList", "(", "int", "index", ")", "{", "List", "<", "Node", ">", "preferenceNodesList", "=", "new", "ArrayList", "<", "Node", ">", "(", "getNumReplicas", "(", ")", ")", ";", "Li...
Get the replication partitions list for the given partition. @param index Partition id for which we are generating the preference list @return The List of partitionId where this partition is replicated.
[ "Get", "the", "replication", "partitions", "list", "for", "the", "given", "partition", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/routing/ZoneRoutingStrategy.java#L57-L98
160,936
voldemort/voldemort
src/java/voldemort/routing/ZoneRoutingStrategy.java
ZoneRoutingStrategy.checkZoneRequirement
private boolean checkZoneRequirement(HashMap<Integer, Integer> requiredRepFactor, int zoneId) { if(requiredRepFactor.containsKey(zoneId)) { if(requiredRepFactor.get(zoneId) == 0) { return false; } else { requiredRepFactor.put(zoneId, requiredRepFactor.get(...
java
private boolean checkZoneRequirement(HashMap<Integer, Integer> requiredRepFactor, int zoneId) { if(requiredRepFactor.containsKey(zoneId)) { if(requiredRepFactor.get(zoneId) == 0) { return false; } else { requiredRepFactor.put(zoneId, requiredRepFactor.get(...
[ "private", "boolean", "checkZoneRequirement", "(", "HashMap", "<", "Integer", ",", "Integer", ">", "requiredRepFactor", ",", "int", "zoneId", ")", "{", "if", "(", "requiredRepFactor", ".", "containsKey", "(", "zoneId", ")", ")", "{", "if", "(", "requiredRepFac...
Check if we still need more nodes from the given zone and reduce the zoneReplicationFactor count accordingly. @param requiredRepFactor @param zoneId @return
[ "Check", "if", "we", "still", "need", "more", "nodes", "from", "the", "given", "zone", "and", "reduce", "the", "zoneReplicationFactor", "count", "accordingly", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/routing/ZoneRoutingStrategy.java#L108-L119
160,937
voldemort/voldemort
contrib/restclient/src/java/voldemort/restclient/admin/CoordinatorAdminUtils.java
CoordinatorAdminUtils.acceptsUrlMultiple
public static void acceptsUrlMultiple(OptionParser parser) { parser.acceptsAll(Arrays.asList(OPT_U, OPT_URL), "coordinator bootstrap urls") .withRequiredArg() .describedAs("url-list") .withValuesSeparatedBy(',') .ofType(String.class); }
java
public static void acceptsUrlMultiple(OptionParser parser) { parser.acceptsAll(Arrays.asList(OPT_U, OPT_URL), "coordinator bootstrap urls") .withRequiredArg() .describedAs("url-list") .withValuesSeparatedBy(',') .ofType(String.class); }
[ "public", "static", "void", "acceptsUrlMultiple", "(", "OptionParser", "parser", ")", "{", "parser", ".", "acceptsAll", "(", "Arrays", ".", "asList", "(", "OPT_U", ",", "OPT_URL", ")", ",", "\"coordinator bootstrap urls\"", ")", ".", "withRequiredArg", "(", ")",...
Adds OPT_U | OPT_URL option to OptionParser, with multiple arguments. @param parser OptionParser to be modified @param required Tells if this option is required or optional
[ "Adds", "OPT_U", "|", "OPT_URL", "option", "to", "OptionParser", "with", "multiple", "arguments", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/contrib/restclient/src/java/voldemort/restclient/admin/CoordinatorAdminUtils.java#L69-L75
160,938
voldemort/voldemort
contrib/restclient/src/java/voldemort/restclient/admin/CoordinatorAdminUtils.java
CoordinatorAdminUtils.copyArrayCutFirst
public static String[] copyArrayCutFirst(String[] arr) { if(arr.length > 1) { String[] arrCopy = new String[arr.length - 1]; System.arraycopy(arr, 1, arrCopy, 0, arrCopy.length); return arrCopy; } else { return new String[0]; } }
java
public static String[] copyArrayCutFirst(String[] arr) { if(arr.length > 1) { String[] arrCopy = new String[arr.length - 1]; System.arraycopy(arr, 1, arrCopy, 0, arrCopy.length); return arrCopy; } else { return new String[0]; } }
[ "public", "static", "String", "[", "]", "copyArrayCutFirst", "(", "String", "[", "]", "arr", ")", "{", "if", "(", "arr", ".", "length", ">", "1", ")", "{", "String", "[", "]", "arrCopy", "=", "new", "String", "[", "arr", ".", "length", "-", "1", ...
Utility function that copies a string array except for the first element @param arr Original array of strings @return Copied array of strings
[ "Utility", "function", "that", "copies", "a", "string", "array", "except", "for", "the", "first", "element" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/contrib/restclient/src/java/voldemort/restclient/admin/CoordinatorAdminUtils.java#L240-L248
160,939
voldemort/voldemort
contrib/restclient/src/java/voldemort/restclient/admin/CoordinatorAdminUtils.java
CoordinatorAdminUtils.copyArrayAddFirst
public static String[] copyArrayAddFirst(String[] arr, String add) { String[] arrCopy = new String[arr.length + 1]; arrCopy[0] = add; System.arraycopy(arr, 0, arrCopy, 1, arr.length); return arrCopy; }
java
public static String[] copyArrayAddFirst(String[] arr, String add) { String[] arrCopy = new String[arr.length + 1]; arrCopy[0] = add; System.arraycopy(arr, 0, arrCopy, 1, arr.length); return arrCopy; }
[ "public", "static", "String", "[", "]", "copyArrayAddFirst", "(", "String", "[", "]", "arr", ",", "String", "add", ")", "{", "String", "[", "]", "arrCopy", "=", "new", "String", "[", "arr", ".", "length", "+", "1", "]", ";", "arrCopy", "[", "0", "]...
Utility function that copies a string array and add another string to first @param arr Original array of strings @param add @return Copied array of strings
[ "Utility", "function", "that", "copies", "a", "string", "array", "and", "add", "another", "string", "to", "first" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/contrib/restclient/src/java/voldemort/restclient/admin/CoordinatorAdminUtils.java#L258-L263
160,940
voldemort/voldemort
src/java/voldemort/store/metadata/MetadataStore.java
MetadataStore.put
@SuppressWarnings("unchecked") public void put(String key, Versioned<Object> value) { // acquire write lock writeLock.lock(); try { if(this.storeNames.contains(key) || key.equals(STORES_KEY)) { // Check for backwards compatibility List<StoreDefin...
java
@SuppressWarnings("unchecked") public void put(String key, Versioned<Object> value) { // acquire write lock writeLock.lock(); try { if(this.storeNames.contains(key) || key.equals(STORES_KEY)) { // Check for backwards compatibility List<StoreDefin...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "void", "put", "(", "String", "key", ",", "Versioned", "<", "Object", ">", "value", ")", "{", "// acquire write lock", "writeLock", ".", "lock", "(", ")", ";", "try", "{", "if", "(", "this", "...
helper function to convert strings to bytes as needed. @param key @param value
[ "helper", "function", "to", "convert", "strings", "to", "bytes", "as", "needed", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/metadata/MetadataStore.java#L323-L396
160,941
voldemort/voldemort
src/java/voldemort/store/metadata/MetadataStore.java
MetadataStore.updateStoreDefinitions
@SuppressWarnings("unchecked") public void updateStoreDefinitions(Versioned<byte[]> valueBytes) { // acquire write lock writeLock.lock(); try { Versioned<String> value = new Versioned<String>(ByteUtils.getString(valueBytes.getValue(), ...
java
@SuppressWarnings("unchecked") public void updateStoreDefinitions(Versioned<byte[]> valueBytes) { // acquire write lock writeLock.lock(); try { Versioned<String> value = new Versioned<String>(ByteUtils.getString(valueBytes.getValue(), ...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "void", "updateStoreDefinitions", "(", "Versioned", "<", "byte", "[", "]", ">", "valueBytes", ")", "{", "// acquire write lock", "writeLock", ".", "lock", "(", ")", ";", "try", "{", "Versioned", "<"...
Function to update store definitions. Unlike the put method, this function does not delete any existing state. It only updates the state of the stores specified in the given stores.xml @param valueBytes specifies the bytes of the stores.xml containing updates for the specified stores
[ "Function", "to", "update", "store", "definitions", ".", "Unlike", "the", "put", "method", "this", "function", "does", "not", "delete", "any", "existing", "state", ".", "It", "only", "updates", "the", "state", "of", "the", "stores", "specified", "in", "the",...
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/metadata/MetadataStore.java#L406-L450
160,942
voldemort/voldemort
src/java/voldemort/store/metadata/MetadataStore.java
MetadataStore.put
@Override public void put(ByteArray keyBytes, Versioned<byte[]> valueBytes, byte[] transforms) throws VoldemortException { // acquire write lock writeLock.lock(); try { String key = ByteUtils.getString(keyBytes.get(), "UTF-8"); Versioned<String> value = ne...
java
@Override public void put(ByteArray keyBytes, Versioned<byte[]> valueBytes, byte[] transforms) throws VoldemortException { // acquire write lock writeLock.lock(); try { String key = ByteUtils.getString(keyBytes.get(), "UTF-8"); Versioned<String> value = ne...
[ "@", "Override", "public", "void", "put", "(", "ByteArray", "keyBytes", ",", "Versioned", "<", "byte", "[", "]", ">", "valueBytes", ",", "byte", "[", "]", "transforms", ")", "throws", "VoldemortException", "{", "// acquire write lock", "writeLock", ".", "lock"...
A write through put to inner-store. @param keyBytes : keyName strings serialized as bytes eg. 'cluster.xml' @param valueBytes : versioned byte[] eg. UTF bytes for cluster xml definitions @throws VoldemortException
[ "A", "write", "through", "put", "to", "inner", "-", "store", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/metadata/MetadataStore.java#L484-L501
160,943
voldemort/voldemort
src/java/voldemort/store/metadata/MetadataStore.java
MetadataStore.makeStoreDefinitionMap
private HashMap<String, StoreDefinition> makeStoreDefinitionMap(List<StoreDefinition> storeDefs) { HashMap<String, StoreDefinition> storeDefMap = new HashMap<String, StoreDefinition>(); for(StoreDefinition storeDef: storeDefs) storeDefMap.put(storeDef.getName(), storeDef); return sto...
java
private HashMap<String, StoreDefinition> makeStoreDefinitionMap(List<StoreDefinition> storeDefs) { HashMap<String, StoreDefinition> storeDefMap = new HashMap<String, StoreDefinition>(); for(StoreDefinition storeDef: storeDefs) storeDefMap.put(storeDef.getName(), storeDef); return sto...
[ "private", "HashMap", "<", "String", ",", "StoreDefinition", ">", "makeStoreDefinitionMap", "(", "List", "<", "StoreDefinition", ">", "storeDefs", ")", "{", "HashMap", "<", "String", ",", "StoreDefinition", ">", "storeDefMap", "=", "new", "HashMap", "<", "String...
Returns the list of store defs as a map @param storeDefs @return
[ "Returns", "the", "list", "of", "store", "defs", "as", "a", "map" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/metadata/MetadataStore.java#L828-L833
160,944
voldemort/voldemort
src/java/voldemort/store/metadata/MetadataStore.java
MetadataStore.updateRoutingStrategies
private void updateRoutingStrategies(Cluster cluster, List<StoreDefinition> storeDefs) { // acquire write lock writeLock.lock(); try { VectorClock clock = new VectorClock(); if(metadataCache.containsKey(ROUTING_STRATEGY_KEY)) clock = (VectorClock) metadata...
java
private void updateRoutingStrategies(Cluster cluster, List<StoreDefinition> storeDefs) { // acquire write lock writeLock.lock(); try { VectorClock clock = new VectorClock(); if(metadataCache.containsKey(ROUTING_STRATEGY_KEY)) clock = (VectorClock) metadata...
[ "private", "void", "updateRoutingStrategies", "(", "Cluster", "cluster", ",", "List", "<", "StoreDefinition", ">", "storeDefs", ")", "{", "// acquire write lock", "writeLock", ".", "lock", "(", ")", ";", "try", "{", "VectorClock", "clock", "=", "new", "VectorClo...
Changes to cluster OR store definition metadata results in routing strategies changing. These changes need to be propagated to all the listeners. @param cluster The updated cluster metadata @param storeDefs The updated list of store definition
[ "Changes", "to", "cluster", "OR", "store", "definition", "metadata", "results", "in", "routing", "strategies", "changing", ".", "These", "changes", "need", "to", "be", "propagated", "to", "all", "the", "listeners", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/metadata/MetadataStore.java#L843-L878
160,945
voldemort/voldemort
src/java/voldemort/store/metadata/MetadataStore.java
MetadataStore.addRebalancingState
public void addRebalancingState(final RebalanceTaskInfo stealInfo) { // acquire write lock writeLock.lock(); try { // Move into rebalancing state if(ByteUtils.getString(get(SERVER_STATE_KEY, null).get(0).getValue(), "UTF-8") .compareTo(VoldemortSta...
java
public void addRebalancingState(final RebalanceTaskInfo stealInfo) { // acquire write lock writeLock.lock(); try { // Move into rebalancing state if(ByteUtils.getString(get(SERVER_STATE_KEY, null).get(0).getValue(), "UTF-8") .compareTo(VoldemortSta...
[ "public", "void", "addRebalancingState", "(", "final", "RebalanceTaskInfo", "stealInfo", ")", "{", "// acquire write lock", "writeLock", ".", "lock", "(", ")", ";", "try", "{", "// Move into rebalancing state", "if", "(", "ByteUtils", ".", "getString", "(", "get", ...
Add the steal information to the rebalancer state @param stealInfo The steal information to add
[ "Add", "the", "steal", "information", "to", "the", "rebalancer", "state" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/metadata/MetadataStore.java#L896-L921
160,946
voldemort/voldemort
src/java/voldemort/store/metadata/MetadataStore.java
MetadataStore.deleteRebalancingState
public void deleteRebalancingState(RebalanceTaskInfo stealInfo) { // acquire write lock writeLock.lock(); try { RebalancerState rebalancerState = getRebalancerState(); if(!rebalancerState.remove(stealInfo)) throw new IllegalArgumentException("Couldn't fin...
java
public void deleteRebalancingState(RebalanceTaskInfo stealInfo) { // acquire write lock writeLock.lock(); try { RebalancerState rebalancerState = getRebalancerState(); if(!rebalancerState.remove(stealInfo)) throw new IllegalArgumentException("Couldn't fin...
[ "public", "void", "deleteRebalancingState", "(", "RebalanceTaskInfo", "stealInfo", ")", "{", "// acquire write lock", "writeLock", ".", "lock", "(", ")", ";", "try", "{", "RebalancerState", "rebalancerState", "=", "getRebalancerState", "(", ")", ";", "if", "(", "!...
Delete the partition steal information from the rebalancer state @param stealInfo The steal information to delete
[ "Delete", "the", "partition", "steal", "information", "from", "the", "rebalancer", "state" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/metadata/MetadataStore.java#L928-L948
160,947
voldemort/voldemort
src/java/voldemort/store/metadata/MetadataStore.java
MetadataStore.setOfflineState
public void setOfflineState(boolean setToOffline) { // acquire write lock writeLock.lock(); try { String currentState = ByteUtils.getString(get(SERVER_STATE_KEY, null).get(0).getValue(), "UTF-8"); if(setToOffline) { ...
java
public void setOfflineState(boolean setToOffline) { // acquire write lock writeLock.lock(); try { String currentState = ByteUtils.getString(get(SERVER_STATE_KEY, null).get(0).getValue(), "UTF-8"); if(setToOffline) { ...
[ "public", "void", "setOfflineState", "(", "boolean", "setToOffline", ")", "{", "// acquire write lock", "writeLock", ".", "lock", "(", ")", ";", "try", "{", "String", "currentState", "=", "ByteUtils", ".", "getString", "(", "get", "(", "SERVER_STATE_KEY", ",", ...
change server state between OFFLINE_SERVER and NORMAL_SERVER @param setToOffline True if set to OFFLINE_SERVER
[ "change", "server", "state", "between", "OFFLINE_SERVER", "and", "NORMAL_SERVER" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/metadata/MetadataStore.java#L955-L1005
160,948
voldemort/voldemort
src/java/voldemort/store/metadata/MetadataStore.java
MetadataStore.addStoreDefinition
public void addStoreDefinition(StoreDefinition storeDef) { // acquire write lock writeLock.lock(); try { // Check if store already exists if(this.storeNames.contains(storeDef.getName())) { throw new VoldemortException("Store already exists !"); ...
java
public void addStoreDefinition(StoreDefinition storeDef) { // acquire write lock writeLock.lock(); try { // Check if store already exists if(this.storeNames.contains(storeDef.getName())) { throw new VoldemortException("Store already exists !"); ...
[ "public", "void", "addStoreDefinition", "(", "StoreDefinition", "storeDef", ")", "{", "// acquire write lock", "writeLock", ".", "lock", "(", ")", ";", "try", "{", "// Check if store already exists", "if", "(", "this", ".", "storeNames", ".", "contains", "(", "sto...
Function to add a new Store to the Metadata store. This involves 1. Create a new entry in the ConfigurationStorageEngine for STORES. 2. Update the metadata cache. 3. Re-create the 'stores.xml' key @param storeDef defines the new store to be created
[ "Function", "to", "add", "a", "new", "Store", "to", "the", "Metadata", "store", ".", "This", "involves" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/metadata/MetadataStore.java#L1018-L1049
160,949
voldemort/voldemort
src/java/voldemort/store/metadata/MetadataStore.java
MetadataStore.deleteStoreDefinition
public void deleteStoreDefinition(String storeName) { // acquire write lock writeLock.lock(); try { // Check if store exists if(!this.storeNames.contains(storeName)) { throw new VoldemortException("Requested store to be deleted does not exist !"); ...
java
public void deleteStoreDefinition(String storeName) { // acquire write lock writeLock.lock(); try { // Check if store exists if(!this.storeNames.contains(storeName)) { throw new VoldemortException("Requested store to be deleted does not exist !"); ...
[ "public", "void", "deleteStoreDefinition", "(", "String", "storeName", ")", "{", "// acquire write lock", "writeLock", ".", "lock", "(", ")", ";", "try", "{", "// Check if store exists", "if", "(", "!", "this", ".", "storeNames", ".", "contains", "(", "storeName...
Function to delete the specified store from Metadata store. This involves 1. Remove entry from the ConfigurationStorageEngine for STORES. 2. Update the metadata cache. 3. Re-create the 'stores.xml' key @param storeName specifies name of the store to be deleted.
[ "Function", "to", "delete", "the", "specified", "store", "from", "Metadata", "store", ".", "This", "involves" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/metadata/MetadataStore.java#L1062-L1087
160,950
voldemort/voldemort
src/java/voldemort/store/metadata/MetadataStore.java
MetadataStore.isValidStore
public boolean isValidStore(String name) { readLock.lock(); try { if(this.storeNames.contains(name)) { return true; } return false; } finally { readLock.unlock(); } }
java
public boolean isValidStore(String name) { readLock.lock(); try { if(this.storeNames.contains(name)) { return true; } return false; } finally { readLock.unlock(); } }
[ "public", "boolean", "isValidStore", "(", "String", "name", ")", "{", "readLock", ".", "lock", "(", ")", ";", "try", "{", "if", "(", "this", ".", "storeNames", ".", "contains", "(", "name", ")", ")", "{", "return", "true", ";", "}", "return", "false"...
Utility function to validate if the given store name exists in the store name list managed by MetadataStore. This is used by the Admin service for validation before serving a get-metadata request. @param name Name of the store to validate @return True if the store name exists in the 'storeNames' list. False otherwise.
[ "Utility", "function", "to", "validate", "if", "the", "given", "store", "name", "exists", "in", "the", "store", "name", "list", "managed", "by", "MetadataStore", ".", "This", "is", "used", "by", "the", "Admin", "service", "for", "validation", "before", "serv...
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/metadata/MetadataStore.java#L1142-L1152
160,951
voldemort/voldemort
src/java/voldemort/store/metadata/MetadataStore.java
MetadataStore.init
private void init() { logger.info("metadata init()."); writeLock.lock(); try { // Required keys initCache(CLUSTER_KEY); // If stores definition storage engine is not null, initialize metadata // Add the mapping from key to the storage engine used if(this...
java
private void init() { logger.info("metadata init()."); writeLock.lock(); try { // Required keys initCache(CLUSTER_KEY); // If stores definition storage engine is not null, initialize metadata // Add the mapping from key to the storage engine used if(this...
[ "private", "void", "init", "(", ")", "{", "logger", ".", "info", "(", "\"metadata init().\"", ")", ";", "writeLock", ".", "lock", "(", ")", ";", "try", "{", "// Required keys", "initCache", "(", "CLUSTER_KEY", ")", ";", "// If stores definition storage engine is...
Initializes the metadataCache for MetadataStore
[ "Initializes", "the", "metadataCache", "for", "MetadataStore" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/metadata/MetadataStore.java#L1188-L1222
160,952
voldemort/voldemort
src/java/voldemort/store/metadata/MetadataStore.java
MetadataStore.initStoreDefinitions
private void initStoreDefinitions(Version storesXmlVersion) { if(this.storeDefinitionsStorageEngine == null) { throw new VoldemortException("The store definitions directory is empty"); } String allStoreDefinitions = "<stores>"; Version finalStoresXmlVersion = null; i...
java
private void initStoreDefinitions(Version storesXmlVersion) { if(this.storeDefinitionsStorageEngine == null) { throw new VoldemortException("The store definitions directory is empty"); } String allStoreDefinitions = "<stores>"; Version finalStoresXmlVersion = null; i...
[ "private", "void", "initStoreDefinitions", "(", "Version", "storesXmlVersion", ")", "{", "if", "(", "this", ".", "storeDefinitionsStorageEngine", "==", "null", ")", "{", "throw", "new", "VoldemortException", "(", "\"The store definitions directory is empty\"", ")", ";",...
Function to go through all the store definitions contained in the STORES directory and 1. Update metadata cache. 2. Update STORES_KEY by stitching together all these keys. 3. Update 'storeNames' list. This method is not thread safe. It is expected that the caller of this method will correctly handle concurrency iss...
[ "Function", "to", "go", "through", "all", "the", "store", "definitions", "contained", "in", "the", "STORES", "directory", "and" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/metadata/MetadataStore.java#L1239-L1305
160,953
voldemort/voldemort
src/java/voldemort/store/metadata/MetadataStore.java
MetadataStore.resetStoreDefinitions
private void resetStoreDefinitions(Set<String> storeNamesToDelete) { // Clear entries in the metadata cache for(String storeName: storeNamesToDelete) { this.metadataCache.remove(storeName); this.storeDefinitionsStorageEngine.delete(storeName, null); this.storeNames.re...
java
private void resetStoreDefinitions(Set<String> storeNamesToDelete) { // Clear entries in the metadata cache for(String storeName: storeNamesToDelete) { this.metadataCache.remove(storeName); this.storeDefinitionsStorageEngine.delete(storeName, null); this.storeNames.re...
[ "private", "void", "resetStoreDefinitions", "(", "Set", "<", "String", ">", "storeNamesToDelete", ")", "{", "// Clear entries in the metadata cache", "for", "(", "String", "storeName", ":", "storeNamesToDelete", ")", "{", "this", ".", "metadataCache", ".", "remove", ...
Function to clear all the metadata related to the given store definitions. This is needed when a put on 'stores.xml' is called, thus replacing the existing state. This method is not thread safe. It is expected that the caller of this method will handle concurrency related issues. @param storeNamesToDelete
[ "Function", "to", "clear", "all", "the", "metadata", "related", "to", "the", "given", "store", "definitions", ".", "This", "is", "needed", "when", "a", "put", "on", "stores", ".", "xml", "is", "called", "thus", "replacing", "the", "existing", "state", "." ...
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/metadata/MetadataStore.java#L1317-L1324
160,954
voldemort/voldemort
src/java/voldemort/store/metadata/MetadataStore.java
MetadataStore.initSystemCache
private synchronized void initSystemCache() { List<StoreDefinition> value = storeMapper.readStoreList(new StringReader(SystemStoreConstants.SYSTEM_STORE_SCHEMA)); metadataCache.put(SYSTEM_STORES_KEY, new Versioned<Object>(value)); }
java
private synchronized void initSystemCache() { List<StoreDefinition> value = storeMapper.readStoreList(new StringReader(SystemStoreConstants.SYSTEM_STORE_SCHEMA)); metadataCache.put(SYSTEM_STORES_KEY, new Versioned<Object>(value)); }
[ "private", "synchronized", "void", "initSystemCache", "(", ")", "{", "List", "<", "StoreDefinition", ">", "value", "=", "storeMapper", ".", "readStoreList", "(", "new", "StringReader", "(", "SystemStoreConstants", ".", "SYSTEM_STORE_SCHEMA", ")", ")", ";", "metada...
Initialize the metadata cache with system store list
[ "Initialize", "the", "metadata", "cache", "with", "system", "store", "list" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/metadata/MetadataStore.java#L1331-L1334
160,955
voldemort/voldemort
src/java/voldemort/rest/coordinator/DynamicTimeoutStoreClient.java
DynamicTimeoutStoreClient.getWithCustomTimeout
public List<Versioned<V>> getWithCustomTimeout(CompositeVoldemortRequest<K, V> requestWrapper) { validateTimeout(requestWrapper.getRoutingTimeoutInMs()); for(int attempts = 0; attempts < this.metadataRefreshAttempts; attempts++) { try { long startTimeInMs = System.currentTime...
java
public List<Versioned<V>> getWithCustomTimeout(CompositeVoldemortRequest<K, V> requestWrapper) { validateTimeout(requestWrapper.getRoutingTimeoutInMs()); for(int attempts = 0; attempts < this.metadataRefreshAttempts; attempts++) { try { long startTimeInMs = System.currentTime...
[ "public", "List", "<", "Versioned", "<", "V", ">", ">", "getWithCustomTimeout", "(", "CompositeVoldemortRequest", "<", "K", ",", "V", ">", "requestWrapper", ")", "{", "validateTimeout", "(", "requestWrapper", ".", "getRoutingTimeoutInMs", "(", ")", ")", ";", "...
Performs a get operation with the specified composite request object @param requestWrapper A composite request object containing the key (and / or default value) and timeout. @return The Versioned value corresponding to the key
[ "Performs", "a", "get", "operation", "with", "the", "specified", "composite", "request", "object" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/coordinator/DynamicTimeoutStoreClient.java#L99-L135
160,956
voldemort/voldemort
src/java/voldemort/rest/coordinator/DynamicTimeoutStoreClient.java
DynamicTimeoutStoreClient.putWithCustomTimeout
public Version putWithCustomTimeout(CompositeVoldemortRequest<K, V> requestWrapper) { validateTimeout(requestWrapper.getRoutingTimeoutInMs()); List<Versioned<V>> versionedValues; long startTime = System.currentTimeMillis(); String keyHexString = ""; if(logger.isDebugEnabled()) { ...
java
public Version putWithCustomTimeout(CompositeVoldemortRequest<K, V> requestWrapper) { validateTimeout(requestWrapper.getRoutingTimeoutInMs()); List<Versioned<V>> versionedValues; long startTime = System.currentTimeMillis(); String keyHexString = ""; if(logger.isDebugEnabled()) { ...
[ "public", "Version", "putWithCustomTimeout", "(", "CompositeVoldemortRequest", "<", "K", ",", "V", ">", "requestWrapper", ")", "{", "validateTimeout", "(", "requestWrapper", ".", "getRoutingTimeoutInMs", "(", ")", ")", ";", "List", "<", "Versioned", "<", "V", ">...
Performs a put operation with the specified composite request object @param requestWrapper A composite request object containing the key and value @return Version of the value for the successful put
[ "Performs", "a", "put", "operation", "with", "the", "specified", "composite", "request", "object" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/coordinator/DynamicTimeoutStoreClient.java#L144-L187
160,957
voldemort/voldemort
src/java/voldemort/rest/coordinator/DynamicTimeoutStoreClient.java
DynamicTimeoutStoreClient.putVersionedWithCustomTimeout
public Version putVersionedWithCustomTimeout(CompositeVoldemortRequest<K, V> requestWrapper) throws ObsoleteVersionException { validateTimeout(requestWrapper.getRoutingTimeoutInMs()); for(int attempts = 0; attempts < this.metadataRefreshAttempts; attempts++) { try { ...
java
public Version putVersionedWithCustomTimeout(CompositeVoldemortRequest<K, V> requestWrapper) throws ObsoleteVersionException { validateTimeout(requestWrapper.getRoutingTimeoutInMs()); for(int attempts = 0; attempts < this.metadataRefreshAttempts; attempts++) { try { ...
[ "public", "Version", "putVersionedWithCustomTimeout", "(", "CompositeVoldemortRequest", "<", "K", ",", "V", ">", "requestWrapper", ")", "throws", "ObsoleteVersionException", "{", "validateTimeout", "(", "requestWrapper", ".", "getRoutingTimeoutInMs", "(", ")", ")", ";",...
Performs a Versioned put operation with the specified composite request object @param requestWrapper Composite request object containing the key and the versioned object @return Version of the value for the successful put @throws ObsoleteVersionException
[ "Performs", "a", "Versioned", "put", "operation", "with", "the", "specified", "composite", "request", "object" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/coordinator/DynamicTimeoutStoreClient.java#L198-L231
160,958
voldemort/voldemort
src/java/voldemort/rest/coordinator/DynamicTimeoutStoreClient.java
DynamicTimeoutStoreClient.getAllWithCustomTimeout
public Map<K, List<Versioned<V>>> getAllWithCustomTimeout(CompositeVoldemortRequest<K, V> requestWrapper) { validateTimeout(requestWrapper.getRoutingTimeoutInMs()); Map<K, List<Versioned<V>>> items = null; for(int attempts = 0;; attempts++) { if(attempts >= this.metadataRefreshAttemp...
java
public Map<K, List<Versioned<V>>> getAllWithCustomTimeout(CompositeVoldemortRequest<K, V> requestWrapper) { validateTimeout(requestWrapper.getRoutingTimeoutInMs()); Map<K, List<Versioned<V>>> items = null; for(int attempts = 0;; attempts++) { if(attempts >= this.metadataRefreshAttemp...
[ "public", "Map", "<", "K", ",", "List", "<", "Versioned", "<", "V", ">", ">", ">", "getAllWithCustomTimeout", "(", "CompositeVoldemortRequest", "<", "K", ",", "V", ">", "requestWrapper", ")", "{", "validateTimeout", "(", "requestWrapper", ".", "getRoutingTimeo...
Performs a get all operation with the specified composite request object @param requestWrapper Composite request object containing a reference to the Iterable keys @return Map of the keys to the corresponding versioned values
[ "Performs", "a", "get", "all", "operation", "with", "the", "specified", "composite", "request", "object" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/coordinator/DynamicTimeoutStoreClient.java#L241-L283
160,959
voldemort/voldemort
src/java/voldemort/rest/coordinator/DynamicTimeoutStoreClient.java
DynamicTimeoutStoreClient.deleteWithCustomTimeout
public boolean deleteWithCustomTimeout(CompositeVoldemortRequest<K, V> deleteRequestObject) { List<Versioned<V>> versionedValues; validateTimeout(deleteRequestObject.getRoutingTimeoutInMs()); boolean hasVersion = deleteRequestObject.getVersion() == null ? false : true; String keyHexStri...
java
public boolean deleteWithCustomTimeout(CompositeVoldemortRequest<K, V> deleteRequestObject) { List<Versioned<V>> versionedValues; validateTimeout(deleteRequestObject.getRoutingTimeoutInMs()); boolean hasVersion = deleteRequestObject.getVersion() == null ? false : true; String keyHexStri...
[ "public", "boolean", "deleteWithCustomTimeout", "(", "CompositeVoldemortRequest", "<", "K", ",", "V", ">", "deleteRequestObject", ")", "{", "List", "<", "Versioned", "<", "V", ">>", "versionedValues", ";", "validateTimeout", "(", "deleteRequestObject", ".", "getRout...
Performs a delete operation with the specified composite request object @param deleteRequestObject Composite request object containing the key to delete @return true if delete was successful. False otherwise
[ "Performs", "a", "delete", "operation", "with", "the", "specified", "composite", "request", "object" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/coordinator/DynamicTimeoutStoreClient.java#L292-L358
160,960
voldemort/voldemort
src/java/voldemort/rest/coordinator/DynamicTimeoutStoreClient.java
DynamicTimeoutStoreClient.debugLogStart
private void debugLogStart(String operationType, Long originTimeInMS, Long requestReceivedTimeInMs, String keyString) { long durationInMs = requestReceivedTimeInMs - originTimeInMS; logger.debug("Received a new ...
java
private void debugLogStart(String operationType, Long originTimeInMS, Long requestReceivedTimeInMs, String keyString) { long durationInMs = requestReceivedTimeInMs - originTimeInMS; logger.debug("Received a new ...
[ "private", "void", "debugLogStart", "(", "String", "operationType", ",", "Long", "originTimeInMS", ",", "Long", "requestReceivedTimeInMs", ",", "String", "keyString", ")", "{", "long", "durationInMs", "=", "requestReceivedTimeInMs", "-", "originTimeInMS", ";", "logger...
Traces the duration between origin time in the http Request and time just before being processed by the fat client @param operationType @param originTimeInMS - origin time in the Http Request @param requestReceivedTimeInMs - System Time in ms @param keyString
[ "Traces", "the", "duration", "between", "origin", "time", "in", "the", "http", "Request", "and", "time", "just", "before", "being", "processed", "by", "the", "fat", "client" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/coordinator/DynamicTimeoutStoreClient.java#L385-L397
160,961
voldemort/voldemort
src/java/voldemort/rest/coordinator/DynamicTimeoutStoreClient.java
DynamicTimeoutStoreClient.debugLogEnd
private void debugLogEnd(String operationType, Long OriginTimeInMs, Long RequestStartTimeInMs, Long ResponseReceivedTimeInMs, String keyString, int numVectorClockEntries) { ...
java
private void debugLogEnd(String operationType, Long OriginTimeInMs, Long RequestStartTimeInMs, Long ResponseReceivedTimeInMs, String keyString, int numVectorClockEntries) { ...
[ "private", "void", "debugLogEnd", "(", "String", "operationType", ",", "Long", "OriginTimeInMs", ",", "Long", "RequestStartTimeInMs", ",", "Long", "ResponseReceivedTimeInMs", ",", "String", "keyString", ",", "int", "numVectorClockEntries", ")", "{", "long", "durationI...
Traces the time taken just by the fat client inside Coordinator to process this request @param operationType @param OriginTimeInMs - Original request time in Http Request @param RequestStartTimeInMs - Time recorded just before fat client started processing @param ResponseReceivedTimeInMs - Time when Response was rece...
[ "Traces", "the", "time", "taken", "just", "by", "the", "fat", "client", "inside", "Coordinator", "to", "process", "this", "request" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/coordinator/DynamicTimeoutStoreClient.java#L415-L438
160,962
voldemort/voldemort
src/java/voldemort/utils/UpdateClusterUtils.java
UpdateClusterUtils.updateNode
public static Node updateNode(Node node, List<Integer> partitionsList) { return new Node(node.getId(), node.getHost(), node.getHttpPort(), node.getSocketPort(), node.getAdminPort(), node.getZo...
java
public static Node updateNode(Node node, List<Integer> partitionsList) { return new Node(node.getId(), node.getHost(), node.getHttpPort(), node.getSocketPort(), node.getAdminPort(), node.getZo...
[ "public", "static", "Node", "updateNode", "(", "Node", "node", ",", "List", "<", "Integer", ">", "partitionsList", ")", "{", "return", "new", "Node", "(", "node", ".", "getId", "(", ")", ",", "node", ".", "getHost", "(", ")", ",", "node", ".", "getHt...
Creates a replica of the node with the new partitions list @param node The node whose replica we are creating @param partitionsList The new partitions list @return Replica of node with new partitions list
[ "Creates", "a", "replica", "of", "the", "node", "with", "the", "new", "partitions", "list" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/UpdateClusterUtils.java#L50-L58
160,963
voldemort/voldemort
src/java/voldemort/utils/UpdateClusterUtils.java
UpdateClusterUtils.addPartitionToNode
public static Node addPartitionToNode(final Node node, Integer donatedPartition) { return UpdateClusterUtils.addPartitionsToNode(node, Sets.newHashSet(donatedPartition)); }
java
public static Node addPartitionToNode(final Node node, Integer donatedPartition) { return UpdateClusterUtils.addPartitionsToNode(node, Sets.newHashSet(donatedPartition)); }
[ "public", "static", "Node", "addPartitionToNode", "(", "final", "Node", "node", ",", "Integer", "donatedPartition", ")", "{", "return", "UpdateClusterUtils", ".", "addPartitionsToNode", "(", "node", ",", "Sets", ".", "newHashSet", "(", "donatedPartition", ")", ")"...
Add a partition to the node provided @param node The node to which we'll add the partition @param donatedPartition The partition to add @return The new node with the new partition
[ "Add", "a", "partition", "to", "the", "node", "provided" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/UpdateClusterUtils.java#L67-L69
160,964
voldemort/voldemort
src/java/voldemort/utils/UpdateClusterUtils.java
UpdateClusterUtils.removePartitionFromNode
public static Node removePartitionFromNode(final Node node, Integer donatedPartition) { return UpdateClusterUtils.removePartitionsFromNode(node, Sets.newHashSet(donatedPartition)); }
java
public static Node removePartitionFromNode(final Node node, Integer donatedPartition) { return UpdateClusterUtils.removePartitionsFromNode(node, Sets.newHashSet(donatedPartition)); }
[ "public", "static", "Node", "removePartitionFromNode", "(", "final", "Node", "node", ",", "Integer", "donatedPartition", ")", "{", "return", "UpdateClusterUtils", ".", "removePartitionsFromNode", "(", "node", ",", "Sets", ".", "newHashSet", "(", "donatedPartition", ...
Remove a partition from the node provided @param node The node from which we're removing the partition @param donatedPartition The partitions to remove @return The new node without the partition
[ "Remove", "a", "partition", "from", "the", "node", "provided" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/UpdateClusterUtils.java#L78-L80
160,965
voldemort/voldemort
src/java/voldemort/utils/UpdateClusterUtils.java
UpdateClusterUtils.addPartitionsToNode
public static Node addPartitionsToNode(final Node node, final Set<Integer> donatedPartitions) { List<Integer> deepCopy = new ArrayList<Integer>(node.getPartitionIds()); deepCopy.addAll(donatedPartitions); Collections.sort(deepCopy); return updateNode(node, deepCopy); }
java
public static Node addPartitionsToNode(final Node node, final Set<Integer> donatedPartitions) { List<Integer> deepCopy = new ArrayList<Integer>(node.getPartitionIds()); deepCopy.addAll(donatedPartitions); Collections.sort(deepCopy); return updateNode(node, deepCopy); }
[ "public", "static", "Node", "addPartitionsToNode", "(", "final", "Node", "node", ",", "final", "Set", "<", "Integer", ">", "donatedPartitions", ")", "{", "List", "<", "Integer", ">", "deepCopy", "=", "new", "ArrayList", "<", "Integer", ">", "(", "node", "....
Add the set of partitions to the node provided @param node The node to which we'll add the partitions @param donatedPartitions The list of partitions to add @return The new node with the new partitions
[ "Add", "the", "set", "of", "partitions", "to", "the", "node", "provided" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/UpdateClusterUtils.java#L89-L94
160,966
voldemort/voldemort
src/java/voldemort/utils/UpdateClusterUtils.java
UpdateClusterUtils.removePartitionsFromNode
public static Node removePartitionsFromNode(final Node node, final Set<Integer> donatedPartitions) { List<Integer> deepCopy = new ArrayList<Integer>(node.getPartitionIds()); deepCopy.removeAll(donatedPartitions); return updateNode(node, deepCopy); ...
java
public static Node removePartitionsFromNode(final Node node, final Set<Integer> donatedPartitions) { List<Integer> deepCopy = new ArrayList<Integer>(node.getPartitionIds()); deepCopy.removeAll(donatedPartitions); return updateNode(node, deepCopy); ...
[ "public", "static", "Node", "removePartitionsFromNode", "(", "final", "Node", "node", ",", "final", "Set", "<", "Integer", ">", "donatedPartitions", ")", "{", "List", "<", "Integer", ">", "deepCopy", "=", "new", "ArrayList", "<", "Integer", ">", "(", "node",...
Remove the set of partitions from the node provided @param node The node from which we're removing the partitions @param donatedPartitions The list of partitions to remove @return The new node without the partitions
[ "Remove", "the", "set", "of", "partitions", "from", "the", "node", "provided" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/UpdateClusterUtils.java#L103-L108
160,967
voldemort/voldemort
src/java/voldemort/utils/UpdateClusterUtils.java
UpdateClusterUtils.createUpdatedCluster
public static Cluster createUpdatedCluster(Cluster currentCluster, int stealerNodeId, List<Integer> donatedPartitions) { Cluster updatedCluster = Cluster.cloneCluster(currentCluster); // Go over every donated p...
java
public static Cluster createUpdatedCluster(Cluster currentCluster, int stealerNodeId, List<Integer> donatedPartitions) { Cluster updatedCluster = Cluster.cloneCluster(currentCluster); // Go over every donated p...
[ "public", "static", "Cluster", "createUpdatedCluster", "(", "Cluster", "currentCluster", ",", "int", "stealerNodeId", ",", "List", "<", "Integer", ">", "donatedPartitions", ")", "{", "Cluster", "updatedCluster", "=", "Cluster", ".", "cloneCluster", "(", "currentClus...
Updates the existing cluster such that we remove partitions mentioned from the stealer node and add them to the donor node @param currentCluster Existing cluster metadata. Both stealer and donor node should already exist in this metadata @param stealerNodeId Id of node for which we are stealing the partitions @param d...
[ "Updates", "the", "existing", "cluster", "such", "that", "we", "remove", "partitions", "mentioned", "from", "the", "stealer", "node", "and", "add", "them", "to", "the", "donor", "node" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/UpdateClusterUtils.java#L143-L170
160,968
voldemort/voldemort
src/java/voldemort/utils/DirectoryIterator.java
DirectoryIterator.main
public static void main(String[] args) { DirectoryIterator iter = new DirectoryIterator(args); while(iter.hasNext()) System.out.println(iter.next().getAbsolutePath()); }
java
public static void main(String[] args) { DirectoryIterator iter = new DirectoryIterator(args); while(iter.hasNext()) System.out.println(iter.next().getAbsolutePath()); }
[ "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "{", "DirectoryIterator", "iter", "=", "new", "DirectoryIterator", "(", "args", ")", ";", "while", "(", "iter", ".", "hasNext", "(", ")", ")", "System", ".", "out", ".", "println...
Command line method to walk the directories provided on the command line and print out their contents @param args Directory names
[ "Command", "line", "method", "to", "walk", "the", "directories", "provided", "on", "the", "command", "line", "and", "print", "out", "their", "contents" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/DirectoryIterator.java#L55-L59
160,969
voldemort/voldemort
src/java/voldemort/routing/StoreRoutingPlan.java
StoreRoutingPlan.verifyClusterStoreDefinition
private void verifyClusterStoreDefinition() { if(SystemStoreConstants.isSystemStore(storeDefinition.getName())) { // TODO: Once "todo" in StorageService.initSystemStores is complete, // this early return can be removed and verification can be enabled // for system stores. ...
java
private void verifyClusterStoreDefinition() { if(SystemStoreConstants.isSystemStore(storeDefinition.getName())) { // TODO: Once "todo" in StorageService.initSystemStores is complete, // this early return can be removed and verification can be enabled // for system stores. ...
[ "private", "void", "verifyClusterStoreDefinition", "(", ")", "{", "if", "(", "SystemStoreConstants", ".", "isSystemStore", "(", "storeDefinition", ".", "getName", "(", ")", ")", ")", "{", "// TODO: Once \"todo\" in StorageService.initSystemStores is complete,", "// this ear...
Verify that cluster is congruent to store def wrt zones.
[ "Verify", "that", "cluster", "is", "congruent", "to", "store", "def", "wrt", "zones", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/routing/StoreRoutingPlan.java#L126-L165
160,970
voldemort/voldemort
src/java/voldemort/routing/StoreRoutingPlan.java
StoreRoutingPlan.getNodesPartitionIdForKey
public Integer getNodesPartitionIdForKey(int nodeId, final byte[] key) { // this is all the partitions the key replicates to. List<Integer> partitionIds = getReplicatingPartitionList(key); for(Integer partitionId: partitionIds) { // check which of the replicating partitions belongs t...
java
public Integer getNodesPartitionIdForKey(int nodeId, final byte[] key) { // this is all the partitions the key replicates to. List<Integer> partitionIds = getReplicatingPartitionList(key); for(Integer partitionId: partitionIds) { // check which of the replicating partitions belongs t...
[ "public", "Integer", "getNodesPartitionIdForKey", "(", "int", "nodeId", ",", "final", "byte", "[", "]", "key", ")", "{", "// this is all the partitions the key replicates to.", "List", "<", "Integer", ">", "partitionIds", "=", "getReplicatingPartitionList", "(", "key", ...
Determines the partition ID that replicates the key on the given node. @param nodeId of the node @param key to look up. @return partitionId if found, otherwise null.
[ "Determines", "the", "partition", "ID", "that", "replicates", "the", "key", "on", "the", "given", "node", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/routing/StoreRoutingPlan.java#L214-L225
160,971
voldemort/voldemort
src/java/voldemort/routing/StoreRoutingPlan.java
StoreRoutingPlan.getNodeIdListForPartitionIdList
private List<Integer> getNodeIdListForPartitionIdList(List<Integer> partitionIds) throws VoldemortException { List<Integer> nodeIds = new ArrayList<Integer>(partitionIds.size()); for(Integer partitionId: partitionIds) { int nodeId = getNodeIdForPartitionId(partitionId); ...
java
private List<Integer> getNodeIdListForPartitionIdList(List<Integer> partitionIds) throws VoldemortException { List<Integer> nodeIds = new ArrayList<Integer>(partitionIds.size()); for(Integer partitionId: partitionIds) { int nodeId = getNodeIdForPartitionId(partitionId); ...
[ "private", "List", "<", "Integer", ">", "getNodeIdListForPartitionIdList", "(", "List", "<", "Integer", ">", "partitionIds", ")", "throws", "VoldemortException", "{", "List", "<", "Integer", ">", "nodeIds", "=", "new", "ArrayList", "<", "Integer", ">", "(", "p...
Converts from partitionId to nodeId. The list of partition IDs, partitionIds, is expected to be a "replicating partition list", i.e., the mapping from partition ID to node ID should be one to one. @param partitionIds List of partition IDs for which to find the Node ID for the Node that owns the partition. @return List...
[ "Converts", "from", "partitionId", "to", "nodeId", ".", "The", "list", "of", "partition", "IDs", "partitionIds", "is", "expected", "to", "be", "a", "replicating", "partition", "list", "i", ".", "e", ".", "the", "mapping", "from", "partition", "ID", "to", "...
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/routing/StoreRoutingPlan.java#L238-L250
160,972
voldemort/voldemort
src/java/voldemort/routing/StoreRoutingPlan.java
StoreRoutingPlan.checkKeyBelongsToNode
public boolean checkKeyBelongsToNode(byte[] key, int nodeId) { List<Integer> nodePartitions = cluster.getNodeById(nodeId).getPartitionIds(); List<Integer> replicatingPartitions = getReplicatingPartitionList(key); // remove all partitions from the list, except those that belong to the // ...
java
public boolean checkKeyBelongsToNode(byte[] key, int nodeId) { List<Integer> nodePartitions = cluster.getNodeById(nodeId).getPartitionIds(); List<Integer> replicatingPartitions = getReplicatingPartitionList(key); // remove all partitions from the list, except those that belong to the // ...
[ "public", "boolean", "checkKeyBelongsToNode", "(", "byte", "[", "]", "key", ",", "int", "nodeId", ")", "{", "List", "<", "Integer", ">", "nodePartitions", "=", "cluster", ".", "getNodeById", "(", "nodeId", ")", ".", "getPartitionIds", "(", ")", ";", "List"...
Determines if the key replicates to the given node @param key @param nodeId @return true if the key belongs to the node as some replica
[ "Determines", "if", "the", "key", "replicates", "to", "the", "given", "node" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/routing/StoreRoutingPlan.java#L360-L367
160,973
voldemort/voldemort
src/java/voldemort/routing/StoreRoutingPlan.java
StoreRoutingPlan.checkKeyBelongsToPartition
public static List<Integer> checkKeyBelongsToPartition(byte[] key, Set<Pair<Integer, HashMap<Integer, List<Integer>>>> stealerNodeToMappingTuples, Cluster cluster, ...
java
public static List<Integer> checkKeyBelongsToPartition(byte[] key, Set<Pair<Integer, HashMap<Integer, List<Integer>>>> stealerNodeToMappingTuples, Cluster cluster, ...
[ "public", "static", "List", "<", "Integer", ">", "checkKeyBelongsToPartition", "(", "byte", "[", "]", "key", ",", "Set", "<", "Pair", "<", "Integer", ",", "HashMap", "<", "Integer", ",", "List", "<", "Integer", ">", ">", ">", ">", "stealerNodeToMappingTupl...
Given a key and a list of steal infos give back a list of stealer node ids which will steal this. @param key Byte array of key @param stealerNodeToMappingTuples Pairs of stealer node id to their corresponding [ partition - replica ] tuples @param cluster Cluster metadata @param storeDef Store definitions @return List ...
[ "Given", "a", "key", "and", "a", "list", "of", "steal", "infos", "give", "back", "a", "list", "of", "stealer", "node", "ids", "which", "will", "steal", "this", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/routing/StoreRoutingPlan.java#L448-L466
160,974
voldemort/voldemort
src/java/voldemort/utils/EventThrottler.java
EventThrottler.maybeThrottle
public synchronized void maybeThrottle(int eventsSeen) { if (maxRatePerSecond > 0) { long now = time.milliseconds(); try { rateSensor.record(eventsSeen, now); } catch (QuotaViolationException e) { // If we're over quota, we calculate how long t...
java
public synchronized void maybeThrottle(int eventsSeen) { if (maxRatePerSecond > 0) { long now = time.milliseconds(); try { rateSensor.record(eventsSeen, now); } catch (QuotaViolationException e) { // If we're over quota, we calculate how long t...
[ "public", "synchronized", "void", "maybeThrottle", "(", "int", "eventsSeen", ")", "{", "if", "(", "maxRatePerSecond", ">", "0", ")", "{", "long", "now", "=", "time", ".", "milliseconds", "(", ")", ";", "try", "{", "rateSensor", ".", "record", "(", "event...
Sleeps if necessary to slow down the caller. @param eventsSeen Number of events seen since last invocation. Basis for determining whether its necessary to sleep.
[ "Sleeps", "if", "necessary", "to", "slow", "down", "the", "caller", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/EventThrottler.java#L136-L170
160,975
voldemort/voldemort
src/java/voldemort/store/routed/ReadRepairer.java
ReadRepairer.getRepairs
public List<NodeValue<K, V>> getRepairs(List<NodeValue<K, V>> nodeValues) { int size = nodeValues.size(); if(size <= 1) return Collections.emptyList(); Map<K, List<NodeValue<K, V>>> keyToNodeValues = Maps.newHashMap(); for(NodeValue<K, V> nodeValue: nodeValues) { ...
java
public List<NodeValue<K, V>> getRepairs(List<NodeValue<K, V>> nodeValues) { int size = nodeValues.size(); if(size <= 1) return Collections.emptyList(); Map<K, List<NodeValue<K, V>>> keyToNodeValues = Maps.newHashMap(); for(NodeValue<K, V> nodeValue: nodeValues) { ...
[ "public", "List", "<", "NodeValue", "<", "K", ",", "V", ">", ">", "getRepairs", "(", "List", "<", "NodeValue", "<", "K", ",", "V", ">", ">", "nodeValues", ")", "{", "int", "size", "=", "nodeValues", ".", "size", "(", ")", ";", "if", "(", "size", ...
Compute the repair set from the given values and nodes @param nodeValues The value found on each node @return A set of repairs to perform
[ "Compute", "the", "repair", "set", "from", "the", "given", "values", "and", "nodes" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/routed/ReadRepairer.java#L59-L78
160,976
voldemort/voldemort
src/java/voldemort/versioning/VectorClockUtils.java
VectorClockUtils.resolveVersions
public static List<Versioned<byte[]>> resolveVersions(List<Versioned<byte[]>> values) { List<Versioned<byte[]>> resolvedVersions = new ArrayList<Versioned<byte[]>>(values.size()); // Go over all the values and determine whether the version is // acceptable for(Versioned<byte[]> value: va...
java
public static List<Versioned<byte[]>> resolveVersions(List<Versioned<byte[]>> values) { List<Versioned<byte[]>> resolvedVersions = new ArrayList<Versioned<byte[]>>(values.size()); // Go over all the values and determine whether the version is // acceptable for(Versioned<byte[]> value: va...
[ "public", "static", "List", "<", "Versioned", "<", "byte", "[", "]", ">", ">", "resolveVersions", "(", "List", "<", "Versioned", "<", "byte", "[", "]", ">", ">", "values", ")", "{", "List", "<", "Versioned", "<", "byte", "[", "]", ">", ">", "resolv...
Given a set of versions, constructs a resolved list of versions based on the compare function above @param values @return list of values after resolution
[ "Given", "a", "set", "of", "versions", "constructs", "a", "resolved", "list", "of", "versions", "based", "on", "the", "compare", "function", "above" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/versioning/VectorClockUtils.java#L102-L127
160,977
voldemort/voldemort
src/java/voldemort/versioning/VectorClockUtils.java
VectorClockUtils.makeClock
public static VectorClock makeClock(Set<Integer> serverIds, long clockValue, long timestamp) { List<ClockEntry> clockEntries = new ArrayList<ClockEntry>(serverIds.size()); for(Integer serverId: serverIds) { clockEntries.add(new ClockEntry(serverId.shortValue(), clockValue)); } ...
java
public static VectorClock makeClock(Set<Integer> serverIds, long clockValue, long timestamp) { List<ClockEntry> clockEntries = new ArrayList<ClockEntry>(serverIds.size()); for(Integer serverId: serverIds) { clockEntries.add(new ClockEntry(serverId.shortValue(), clockValue)); } ...
[ "public", "static", "VectorClock", "makeClock", "(", "Set", "<", "Integer", ">", "serverIds", ",", "long", "clockValue", ",", "long", "timestamp", ")", "{", "List", "<", "ClockEntry", ">", "clockEntries", "=", "new", "ArrayList", "<", "ClockEntry", ">", "(",...
Generates a vector clock with the provided values @param serverIds servers in the clock @param clockValue value of the clock for each server entry @param timestamp ts value to be set for the clock @return
[ "Generates", "a", "vector", "clock", "with", "the", "provided", "values" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/versioning/VectorClockUtils.java#L137-L143
160,978
voldemort/voldemort
src/java/voldemort/server/protocol/admin/AdminServiceRequestHandler.java
AdminServiceRequestHandler.swapStore
private String swapStore(String storeName, String directory) throws VoldemortException { ReadOnlyStorageEngine store = getReadOnlyStorageEngine(metadataStore, storeRepository, storeName...
java
private String swapStore(String storeName, String directory) throws VoldemortException { ReadOnlyStorageEngine store = getReadOnlyStorageEngine(metadataStore, storeRepository, storeName...
[ "private", "String", "swapStore", "(", "String", "storeName", ",", "String", "directory", ")", "throws", "VoldemortException", "{", "ReadOnlyStorageEngine", "store", "=", "getReadOnlyStorageEngine", "(", "metadataStore", ",", "storeRepository", ",", "storeName", ")", ...
Given a read-only store name and a directory, swaps it in while returning the directory path being swapped out @param storeName The name of the read-only store @param directory The directory being swapped in @return The directory path which was swapped out @throws VoldemortException
[ "Given", "a", "read", "-", "only", "store", "name", "and", "a", "directory", "swaps", "it", "in", "while", "returning", "the", "directory", "path", "being", "swapped", "out" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/server/protocol/admin/AdminServiceRequestHandler.java#L996-L1015
160,979
voldemort/voldemort
src/java/voldemort/server/protocol/admin/AdminServiceRequestHandler.java
AdminServiceRequestHandler.isCompleteRequest
@Override public boolean isCompleteRequest(ByteBuffer buffer) { DataInputStream inputStream = new DataInputStream(new ByteBufferBackedInputStream(buffer)); try { int dataSize = inputStream.readInt(); if(logger.isTraceEnabled()) logger.trace("In isCompleteReq...
java
@Override public boolean isCompleteRequest(ByteBuffer buffer) { DataInputStream inputStream = new DataInputStream(new ByteBufferBackedInputStream(buffer)); try { int dataSize = inputStream.readInt(); if(logger.isTraceEnabled()) logger.trace("In isCompleteReq...
[ "@", "Override", "public", "boolean", "isCompleteRequest", "(", "ByteBuffer", "buffer", ")", "{", "DataInputStream", "inputStream", "=", "new", "DataInputStream", "(", "new", "ByteBufferBackedInputStream", "(", "buffer", ")", ")", ";", "try", "{", "int", "dataSize...
This method is used by non-blocking code to determine if the give buffer represents a complete request. Because the non-blocking code can by definition not just block waiting for more data, it's possible to get partial reads, and this identifies that case. @param buffer Buffer to check; the buffer is reset to position...
[ "This", "method", "is", "used", "by", "non", "-", "blocking", "code", "to", "determine", "if", "the", "give", "buffer", "represents", "a", "complete", "request", ".", "Because", "the", "non", "-", "blocking", "code", "can", "by", "definition", "not", "just...
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/server/protocol/admin/AdminServiceRequestHandler.java#L1720-L1749
160,980
voldemort/voldemort
src/java/voldemort/store/routed/PipelineRoutedStats.java
PipelineRoutedStats.unregisterJmxIfRequired
public synchronized void unregisterJmxIfRequired() { referenceCount--; if (isRegistered == true && referenceCount <= 0) { JmxUtils.unregisterMbean(this.jmxObjectName); isRegistered = false; } }
java
public synchronized void unregisterJmxIfRequired() { referenceCount--; if (isRegistered == true && referenceCount <= 0) { JmxUtils.unregisterMbean(this.jmxObjectName); isRegistered = false; } }
[ "public", "synchronized", "void", "unregisterJmxIfRequired", "(", ")", "{", "referenceCount", "--", ";", "if", "(", "isRegistered", "==", "true", "&&", "referenceCount", "<=", "0", ")", "{", "JmxUtils", ".", "unregisterMbean", "(", "this", ".", "jmxObjectName", ...
Last caller of this method will unregister the Mbean. All callers decrement the counter.
[ "Last", "caller", "of", "this", "method", "will", "unregister", "the", "Mbean", ".", "All", "callers", "decrement", "the", "counter", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/routed/PipelineRoutedStats.java#L148-L154
160,981
voldemort/voldemort
src/java/voldemort/utils/ByteUtils.java
ByteUtils.toBinaryString
public static String toBinaryString(byte[] bytes) { StringBuilder buffer = new StringBuilder(); for(byte b: bytes) { String bin = Integer.toBinaryString(0xFF & b); bin = bin.substring(0, Math.min(bin.length(), 8)); for(int j = 0; j < 8 - bin.length(); j++) { ...
java
public static String toBinaryString(byte[] bytes) { StringBuilder buffer = new StringBuilder(); for(byte b: bytes) { String bin = Integer.toBinaryString(0xFF & b); bin = bin.substring(0, Math.min(bin.length(), 8)); for(int j = 0; j < 8 - bin.length(); j++) { ...
[ "public", "static", "String", "toBinaryString", "(", "byte", "[", "]", "bytes", ")", "{", "StringBuilder", "buffer", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "byte", "b", ":", "bytes", ")", "{", "String", "bin", "=", "Integer", ".", "toB...
Translate the given byte array into a string of 1s and 0s @param bytes The bytes to translate @return The string
[ "Translate", "the", "given", "byte", "array", "into", "a", "string", "of", "1s", "and", "0s" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/ByteUtils.java#L93-L106
160,982
voldemort/voldemort
src/java/voldemort/utils/ByteUtils.java
ByteUtils.copy
public static byte[] copy(byte[] array, int from, int to) { if(to - from < 0) { return new byte[0]; } else { byte[] a = new byte[to - from]; System.arraycopy(array, from, a, 0, to - from); return a; } }
java
public static byte[] copy(byte[] array, int from, int to) { if(to - from < 0) { return new byte[0]; } else { byte[] a = new byte[to - from]; System.arraycopy(array, from, a, 0, to - from); return a; } }
[ "public", "static", "byte", "[", "]", "copy", "(", "byte", "[", "]", "array", ",", "int", "from", ",", "int", "to", ")", "{", "if", "(", "to", "-", "from", "<", "0", ")", "{", "return", "new", "byte", "[", "0", "]", ";", "}", "else", "{", "...
Copy the specified bytes into a new array @param array The array to copy from @param from The index in the array to begin copying from @param to The least index not copied @return A new byte[] containing the copied bytes
[ "Copy", "the", "specified", "bytes", "into", "a", "new", "array" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/ByteUtils.java#L140-L148
160,983
voldemort/voldemort
src/java/voldemort/utils/ByteUtils.java
ByteUtils.readInt
public static int readInt(byte[] bytes, int offset) { return (((bytes[offset + 0] & 0xff) << 24) | ((bytes[offset + 1] & 0xff) << 16) | ((bytes[offset + 2] & 0xff) << 8) | (bytes[offset + 3] & 0xff)); }
java
public static int readInt(byte[] bytes, int offset) { return (((bytes[offset + 0] & 0xff) << 24) | ((bytes[offset + 1] & 0xff) << 16) | ((bytes[offset + 2] & 0xff) << 8) | (bytes[offset + 3] & 0xff)); }
[ "public", "static", "int", "readInt", "(", "byte", "[", "]", "bytes", ",", "int", "offset", ")", "{", "return", "(", "(", "(", "bytes", "[", "offset", "+", "0", "]", "&", "0xff", ")", "<<", "24", ")", "|", "(", "(", "bytes", "[", "offset", "+",...
Read an int from the byte array starting at the given offset @param bytes The byte array to read from @param offset The offset to start reading at @return The int read
[ "Read", "an", "int", "from", "the", "byte", "array", "starting", "at", "the", "given", "offset" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/ByteUtils.java#L179-L182
160,984
voldemort/voldemort
src/java/voldemort/utils/ByteUtils.java
ByteUtils.readUnsignedInt
public static long readUnsignedInt(byte[] bytes, int offset) { return (((bytes[offset + 0] & 0xffL) << 24) | ((bytes[offset + 1] & 0xffL) << 16) | ((bytes[offset + 2] & 0xffL) << 8) | (bytes[offset + 3] & 0xffL)); }
java
public static long readUnsignedInt(byte[] bytes, int offset) { return (((bytes[offset + 0] & 0xffL) << 24) | ((bytes[offset + 1] & 0xffL) << 16) | ((bytes[offset + 2] & 0xffL) << 8) | (bytes[offset + 3] & 0xffL)); }
[ "public", "static", "long", "readUnsignedInt", "(", "byte", "[", "]", "bytes", ",", "int", "offset", ")", "{", "return", "(", "(", "(", "bytes", "[", "offset", "+", "0", "]", "&", "0xff", "L", ")", "<<", "24", ")", "|", "(", "(", "bytes", "[", ...
Read an unsigned integer from the given byte array @param bytes The bytes to read from @param offset The offset to begin reading at @return The integer as a long
[ "Read", "an", "unsigned", "integer", "from", "the", "given", "byte", "array" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/ByteUtils.java#L191-L194
160,985
voldemort/voldemort
src/java/voldemort/utils/ByteUtils.java
ByteUtils.readBytes
public static long readBytes(byte[] bytes, int offset, int numBytes) { int shift = 0; long value = 0; for(int i = offset + numBytes - 1; i >= offset; i--) { value |= (bytes[i] & 0xFFL) << shift; shift += 8; } return value; }
java
public static long readBytes(byte[] bytes, int offset, int numBytes) { int shift = 0; long value = 0; for(int i = offset + numBytes - 1; i >= offset; i--) { value |= (bytes[i] & 0xFFL) << shift; shift += 8; } return value; }
[ "public", "static", "long", "readBytes", "(", "byte", "[", "]", "bytes", ",", "int", "offset", ",", "int", "numBytes", ")", "{", "int", "shift", "=", "0", ";", "long", "value", "=", "0", ";", "for", "(", "int", "i", "=", "offset", "+", "numBytes", ...
Read the given number of bytes into a long @param bytes The byte array to read from @param offset The offset at which to begin reading @param numBytes The number of bytes to read @return The long value read
[ "Read", "the", "given", "number", "of", "bytes", "into", "a", "long" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/ByteUtils.java#L221-L229
160,986
voldemort/voldemort
src/java/voldemort/utils/ByteUtils.java
ByteUtils.writeShort
public static void writeShort(byte[] bytes, short value, int offset) { bytes[offset] = (byte) (0xFF & (value >> 8)); bytes[offset + 1] = (byte) (0xFF & value); }
java
public static void writeShort(byte[] bytes, short value, int offset) { bytes[offset] = (byte) (0xFF & (value >> 8)); bytes[offset + 1] = (byte) (0xFF & value); }
[ "public", "static", "void", "writeShort", "(", "byte", "[", "]", "bytes", ",", "short", "value", ",", "int", "offset", ")", "{", "bytes", "[", "offset", "]", "=", "(", "byte", ")", "(", "0xFF", "&", "(", "value", ">>", "8", ")", ")", ";", "bytes"...
Write a short to the byte array starting at the given offset @param bytes The byte array @param value The short to write @param offset The offset to begin writing at
[ "Write", "a", "short", "to", "the", "byte", "array", "starting", "at", "the", "given", "offset" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/ByteUtils.java#L238-L241
160,987
voldemort/voldemort
src/java/voldemort/utils/ByteUtils.java
ByteUtils.writeUnsignedShort
public static void writeUnsignedShort(byte[] bytes, int value, int offset) { bytes[offset] = (byte) (0xFF & (value >> 8)); bytes[offset + 1] = (byte) (0xFF & value); }
java
public static void writeUnsignedShort(byte[] bytes, int value, int offset) { bytes[offset] = (byte) (0xFF & (value >> 8)); bytes[offset + 1] = (byte) (0xFF & value); }
[ "public", "static", "void", "writeUnsignedShort", "(", "byte", "[", "]", "bytes", ",", "int", "value", ",", "int", "offset", ")", "{", "bytes", "[", "offset", "]", "=", "(", "byte", ")", "(", "0xFF", "&", "(", "value", ">>", "8", ")", ")", ";", "...
Write an unsigned short to the byte array starting at the given offset @param bytes The byte array @param value The short to write @param offset The offset to begin writing at
[ "Write", "an", "unsigned", "short", "to", "the", "byte", "array", "starting", "at", "the", "given", "offset" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/ByteUtils.java#L250-L253
160,988
voldemort/voldemort
src/java/voldemort/utils/ByteUtils.java
ByteUtils.writeInt
public static void writeInt(byte[] bytes, int value, int offset) { bytes[offset] = (byte) (0xFF & (value >> 24)); bytes[offset + 1] = (byte) (0xFF & (value >> 16)); bytes[offset + 2] = (byte) (0xFF & (value >> 8)); bytes[offset + 3] = (byte) (0xFF & value); }
java
public static void writeInt(byte[] bytes, int value, int offset) { bytes[offset] = (byte) (0xFF & (value >> 24)); bytes[offset + 1] = (byte) (0xFF & (value >> 16)); bytes[offset + 2] = (byte) (0xFF & (value >> 8)); bytes[offset + 3] = (byte) (0xFF & value); }
[ "public", "static", "void", "writeInt", "(", "byte", "[", "]", "bytes", ",", "int", "value", ",", "int", "offset", ")", "{", "bytes", "[", "offset", "]", "=", "(", "byte", ")", "(", "0xFF", "&", "(", "value", ">>", "24", ")", ")", ";", "bytes", ...
Write an int to the byte array starting at the given offset @param bytes The byte array @param value The int to write @param offset The offset to begin writing at
[ "Write", "an", "int", "to", "the", "byte", "array", "starting", "at", "the", "given", "offset" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/ByteUtils.java#L262-L267
160,989
voldemort/voldemort
src/java/voldemort/utils/ByteUtils.java
ByteUtils.writeBytes
public static void writeBytes(byte[] bytes, long value, int offset, int numBytes) { int shift = 0; for(int i = offset + numBytes - 1; i >= offset; i--) { bytes[i] = (byte) (0xFF & (value >> shift)); shift += 8; } }
java
public static void writeBytes(byte[] bytes, long value, int offset, int numBytes) { int shift = 0; for(int i = offset + numBytes - 1; i >= offset; i--) { bytes[i] = (byte) (0xFF & (value >> shift)); shift += 8; } }
[ "public", "static", "void", "writeBytes", "(", "byte", "[", "]", "bytes", ",", "long", "value", ",", "int", "offset", ",", "int", "numBytes", ")", "{", "int", "shift", "=", "0", ";", "for", "(", "int", "i", "=", "offset", "+", "numBytes", "-", "1",...
Write the given number of bytes out to the array @param bytes The array to write to @param value The value to write from @param offset the offset into the array @param numBytes The number of bytes to write
[ "Write", "the", "given", "number", "of", "bytes", "out", "to", "the", "array" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/ByteUtils.java#L295-L301
160,990
voldemort/voldemort
src/java/voldemort/utils/ByteUtils.java
ByteUtils.numberOfBytesRequired
public static byte numberOfBytesRequired(long number) { if(number < 0) number = -number; for(byte i = 1; i <= SIZE_OF_LONG; i++) if(number < (1L << (8 * i))) return i; throw new IllegalStateException("Should never happen."); }
java
public static byte numberOfBytesRequired(long number) { if(number < 0) number = -number; for(byte i = 1; i <= SIZE_OF_LONG; i++) if(number < (1L << (8 * i))) return i; throw new IllegalStateException("Should never happen."); }
[ "public", "static", "byte", "numberOfBytesRequired", "(", "long", "number", ")", "{", "if", "(", "number", "<", "0", ")", "number", "=", "-", "number", ";", "for", "(", "byte", "i", "=", "1", ";", "i", "<=", "SIZE_OF_LONG", ";", "i", "++", ")", "if...
The number of bytes required to hold the given number @param number The number being checked. @return The required number of bytes (must be 8 or less)
[ "The", "number", "of", "bytes", "required", "to", "hold", "the", "given", "number" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/ByteUtils.java#L309-L316
160,991
voldemort/voldemort
src/java/voldemort/utils/ByteUtils.java
ByteUtils.read
public static void read(InputStream stream, byte[] buffer) throws IOException { int read = 0; while(read < buffer.length) { int newlyRead = stream.read(buffer, read, buffer.length - read); if(newlyRead == -1) throw new EOFException("Attempt to read " + buffer.leng...
java
public static void read(InputStream stream, byte[] buffer) throws IOException { int read = 0; while(read < buffer.length) { int newlyRead = stream.read(buffer, read, buffer.length - read); if(newlyRead == -1) throw new EOFException("Attempt to read " + buffer.leng...
[ "public", "static", "void", "read", "(", "InputStream", "stream", ",", "byte", "[", "]", "buffer", ")", "throws", "IOException", "{", "int", "read", "=", "0", ";", "while", "(", "read", "<", "buffer", ".", "length", ")", "{", "int", "newlyRead", "=", ...
Read exactly buffer.length bytes from the stream into the buffer @param stream The stream to read from @param buffer The buffer to read into
[ "Read", "exactly", "buffer", ".", "length", "bytes", "from", "the", "stream", "into", "the", "buffer" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/ByteUtils.java#L366-L375
160,992
voldemort/voldemort
src/java/voldemort/utils/ByteUtils.java
ByteUtils.getBytes
public static byte[] getBytes(String string, String encoding) { try { return string.getBytes(encoding); } catch(UnsupportedEncodingException e) { throw new IllegalArgumentException(encoding + " is not a known encoding name.", e); } }
java
public static byte[] getBytes(String string, String encoding) { try { return string.getBytes(encoding); } catch(UnsupportedEncodingException e) { throw new IllegalArgumentException(encoding + " is not a known encoding name.", e); } }
[ "public", "static", "byte", "[", "]", "getBytes", "(", "String", "string", ",", "String", "encoding", ")", "{", "try", "{", "return", "string", ".", "getBytes", "(", "encoding", ")", ";", "}", "catch", "(", "UnsupportedEncodingException", "e", ")", "{", ...
Translate the string to bytes using the given encoding @param string The string to translate @param encoding The encoding to use @return The bytes that make up the string
[ "Translate", "the", "string", "to", "bytes", "using", "the", "given", "encoding" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/ByteUtils.java#L384-L390
160,993
voldemort/voldemort
src/java/voldemort/utils/ByteUtils.java
ByteUtils.getString
public static String getString(byte[] bytes, String encoding) { try { return new String(bytes, encoding); } catch(UnsupportedEncodingException e) { throw new IllegalArgumentException(encoding + " is not a known encoding name.", e); } }
java
public static String getString(byte[] bytes, String encoding) { try { return new String(bytes, encoding); } catch(UnsupportedEncodingException e) { throw new IllegalArgumentException(encoding + " is not a known encoding name.", e); } }
[ "public", "static", "String", "getString", "(", "byte", "[", "]", "bytes", ",", "String", "encoding", ")", "{", "try", "{", "return", "new", "String", "(", "bytes", ",", "encoding", ")", ";", "}", "catch", "(", "UnsupportedEncodingException", "e", ")", "...
Create a string from bytes using the given encoding @param bytes The bytes to create a string from @param encoding The encoding of the string @return The created string
[ "Create", "a", "string", "from", "bytes", "using", "the", "given", "encoding" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/ByteUtils.java#L399-L405
160,994
voldemort/voldemort
src/java/voldemort/store/stats/RequestCounter.java
RequestCounter.addRequest
public void addRequest(long timeNS, long numEmptyResponses, long valueBytes, long keyBytes, long getAllAggregatedCount) { // timing instrumentation (trace only) long startTimeNs = 0; if(lo...
java
public void addRequest(long timeNS, long numEmptyResponses, long valueBytes, long keyBytes, long getAllAggregatedCount) { // timing instrumentation (trace only) long startTimeNs = 0; if(lo...
[ "public", "void", "addRequest", "(", "long", "timeNS", ",", "long", "numEmptyResponses", ",", "long", "valueBytes", ",", "long", "keyBytes", ",", "long", "getAllAggregatedCount", ")", "{", "// timing instrumentation (trace only)", "long", "startTimeNs", "=", "0", ";...
Detailed request to track additional data about PUT, GET and GET_ALL @param timeNS The time in nanoseconds that the operation took to complete @param numEmptyResponses For GET and GET_ALL, how many keys were no values found @param valueBytes Total number of bytes across all versions of values' bytes @param keyBytes To...
[ "Detailed", "request", "to", "track", "additional", "data", "about", "PUT", "GET", "and", "GET_ALL" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/stats/RequestCounter.java#L268-L291
160,995
voldemort/voldemort
src/java/voldemort/store/routed/Pipeline.java
Pipeline.addEvent
public void addEvent(Event event) { if(event == null) throw new IllegalStateException("event must be non-null"); if(logger.isTraceEnabled()) logger.trace("Adding event " + event); eventQueue.add(event); }
java
public void addEvent(Event event) { if(event == null) throw new IllegalStateException("event must be non-null"); if(logger.isTraceEnabled()) logger.trace("Adding event " + event); eventQueue.add(event); }
[ "public", "void", "addEvent", "(", "Event", "event", ")", "{", "if", "(", "event", "==", "null", ")", "throw", "new", "IllegalStateException", "(", "\"event must be non-null\"", ")", ";", "if", "(", "logger", ".", "isTraceEnabled", "(", ")", ")", "logger", ...
Add an event to the queue. It will be processed in the order received. @param event Event
[ "Add", "an", "event", "to", "the", "queue", ".", "It", "will", "be", "processed", "in", "the", "order", "received", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/routed/Pipeline.java#L141-L149
160,996
voldemort/voldemort
src/java/voldemort/store/routed/Pipeline.java
Pipeline.execute
public void execute() { try { while(true) { Event event = null; try { event = eventQueue.poll(timeout, unit); } catch(InterruptedException e) { throw new InsufficientOperationalNodesException(operation.getSimple...
java
public void execute() { try { while(true) { Event event = null; try { event = eventQueue.poll(timeout, unit); } catch(InterruptedException e) { throw new InsufficientOperationalNodesException(operation.getSimple...
[ "public", "void", "execute", "(", ")", "{", "try", "{", "while", "(", "true", ")", "{", "Event", "event", "=", "null", ";", "try", "{", "event", "=", "eventQueue", ".", "poll", "(", "timeout", ",", "unit", ")", ";", "}", "catch", "(", "InterruptedE...
Process events in the order as they were received. <p/> The overall time to process the events must be within the bounds of the timeout or an {@link InsufficientOperationalNodesException} will be thrown.
[ "Process", "events", "in", "the", "order", "as", "they", "were", "received", "." ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/routed/Pipeline.java#L173-L217
160,997
voldemort/voldemort
src/java/voldemort/utils/JmxUtils.java
JmxUtils.createModelMBean
public static ModelMBean createModelMBean(Object o) { try { ModelMBean mbean = new RequiredModelMBean(); JmxManaged annotation = o.getClass().getAnnotation(JmxManaged.class); String description = annotation == null ? "" : annotation.description(); ModelMBeanInfo i...
java
public static ModelMBean createModelMBean(Object o) { try { ModelMBean mbean = new RequiredModelMBean(); JmxManaged annotation = o.getClass().getAnnotation(JmxManaged.class); String description = annotation == null ? "" : annotation.description(); ModelMBeanInfo i...
[ "public", "static", "ModelMBean", "createModelMBean", "(", "Object", "o", ")", "{", "try", "{", "ModelMBean", "mbean", "=", "new", "RequiredModelMBean", "(", ")", ";", "JmxManaged", "annotation", "=", "o", ".", "getClass", "(", ")", ".", "getAnnotation", "("...
Create a model mbean from an object using the description given in the Jmx annotation if present. Only operations are supported so far, no attributes, constructors, or notifications @param o The object to create an MBean for @return The ModelMBean for the given object
[ "Create", "a", "model", "mbean", "from", "an", "object", "using", "the", "description", "given", "in", "the", "Jmx", "annotation", "if", "present", ".", "Only", "operations", "are", "supported", "so", "far", "no", "attributes", "constructors", "or", "notificat...
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/JmxUtils.java#L81-L103
160,998
voldemort/voldemort
src/java/voldemort/utils/JmxUtils.java
JmxUtils.extractOperationInfo
public static ModelMBeanOperationInfo[] extractOperationInfo(Object object) { ArrayList<ModelMBeanOperationInfo> infos = new ArrayList<ModelMBeanOperationInfo>(); for(Method m: object.getClass().getMethods()) { JmxOperation jmxOperation = m.getAnnotation(JmxOperation.class); JmxG...
java
public static ModelMBeanOperationInfo[] extractOperationInfo(Object object) { ArrayList<ModelMBeanOperationInfo> infos = new ArrayList<ModelMBeanOperationInfo>(); for(Method m: object.getClass().getMethods()) { JmxOperation jmxOperation = m.getAnnotation(JmxOperation.class); JmxG...
[ "public", "static", "ModelMBeanOperationInfo", "[", "]", "extractOperationInfo", "(", "Object", "object", ")", "{", "ArrayList", "<", "ModelMBeanOperationInfo", ">", "infos", "=", "new", "ArrayList", "<", "ModelMBeanOperationInfo", ">", "(", ")", ";", "for", "(", ...
Extract all operations and attributes from the given object that have been annotated with the Jmx annotation. Operations are all methods that are marked with the JmxOperation annotation. @param object The object to process @return An array of operations taken from the object
[ "Extract", "all", "operations", "and", "attributes", "from", "the", "given", "object", "that", "have", "been", "annotated", "with", "the", "Jmx", "annotation", ".", "Operations", "are", "all", "methods", "that", "are", "marked", "with", "the", "JmxOperation", ...
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/JmxUtils.java#L113-L146
160,999
voldemort/voldemort
src/java/voldemort/utils/JmxUtils.java
JmxUtils.extractParameterInfo
public static MBeanParameterInfo[] extractParameterInfo(Method m) { Class<?>[] types = m.getParameterTypes(); Annotation[][] annotations = m.getParameterAnnotations(); MBeanParameterInfo[] params = new MBeanParameterInfo[types.length]; for(int i = 0; i < params.length; i++) { ...
java
public static MBeanParameterInfo[] extractParameterInfo(Method m) { Class<?>[] types = m.getParameterTypes(); Annotation[][] annotations = m.getParameterAnnotations(); MBeanParameterInfo[] params = new MBeanParameterInfo[types.length]; for(int i = 0; i < params.length; i++) { ...
[ "public", "static", "MBeanParameterInfo", "[", "]", "extractParameterInfo", "(", "Method", "m", ")", "{", "Class", "<", "?", ">", "[", "]", "types", "=", "m", ".", "getParameterTypes", "(", ")", ";", "Annotation", "[", "]", "[", "]", "annotations", "=", ...
Extract the parameters from a method using the Jmx annotation if present, or just the raw types otherwise @param m The method to extract parameters from @return An array of parameter infos
[ "Extract", "the", "parameters", "from", "a", "method", "using", "the", "Jmx", "annotation", "if", "present", "or", "just", "the", "raw", "types", "otherwise" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/JmxUtils.java#L207-L229