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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
161,100 | voldemort/voldemort | src/java/voldemort/rest/coordinator/config/ClientConfigUtil.java | ClientConfigUtil.compareSingleClientConfigAvro | public static Boolean compareSingleClientConfigAvro(String configAvro1, String configAvro2) {
Properties props1 = readSingleClientConfigAvro(configAvro1);
Properties props2 = readSingleClientConfigAvro(configAvro2);
if(props1.equals(props2)) {
return true;
} else {
... | java | public static Boolean compareSingleClientConfigAvro(String configAvro1, String configAvro2) {
Properties props1 = readSingleClientConfigAvro(configAvro1);
Properties props2 = readSingleClientConfigAvro(configAvro2);
if(props1.equals(props2)) {
return true;
} else {
... | [
"public",
"static",
"Boolean",
"compareSingleClientConfigAvro",
"(",
"String",
"configAvro1",
",",
"String",
"configAvro2",
")",
"{",
"Properties",
"props1",
"=",
"readSingleClientConfigAvro",
"(",
"configAvro1",
")",
";",
"Properties",
"props2",
"=",
"readSingleClientC... | Compares two avro strings which contains single store configs
@param configAvro1
@param configAvro2
@return true if two config avro strings have same content | [
"Compares",
"two",
"avro",
"strings",
"which",
"contains",
"single",
"store",
"configs"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/coordinator/config/ClientConfigUtil.java#L145-L153 |
161,101 | voldemort/voldemort | src/java/voldemort/rest/coordinator/config/ClientConfigUtil.java | ClientConfigUtil.compareMultipleClientConfigAvro | public static Boolean compareMultipleClientConfigAvro(String configAvro1, String configAvro2) {
Map<String, Properties> mapStoreToProps1 = readMultipleClientConfigAvro(configAvro1);
Map<String, Properties> mapStoreToProps2 = readMultipleClientConfigAvro(configAvro2);
Set<String> keySet1 = mapSto... | java | public static Boolean compareMultipleClientConfigAvro(String configAvro1, String configAvro2) {
Map<String, Properties> mapStoreToProps1 = readMultipleClientConfigAvro(configAvro1);
Map<String, Properties> mapStoreToProps2 = readMultipleClientConfigAvro(configAvro2);
Set<String> keySet1 = mapSto... | [
"public",
"static",
"Boolean",
"compareMultipleClientConfigAvro",
"(",
"String",
"configAvro1",
",",
"String",
"configAvro2",
")",
"{",
"Map",
"<",
"String",
",",
"Properties",
">",
"mapStoreToProps1",
"=",
"readMultipleClientConfigAvro",
"(",
"configAvro1",
")",
";",... | Compares two avro strings which contains multiple store configs
@param configAvro1
@param configAvro2
@return true if two config avro strings have same content | [
"Compares",
"two",
"avro",
"strings",
"which",
"contains",
"multiple",
"store",
"configs"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/coordinator/config/ClientConfigUtil.java#L162-L178 |
161,102 | voldemort/voldemort | src/java/voldemort/tools/admin/command/AdminCommandAsyncJob.java | AdminCommandAsyncJob.printHelp | public static void printHelp(PrintStream stream) {
stream.println();
stream.println("Voldemort Admin Tool Async-Job Commands");
stream.println("---------------------------------------");
stream.println("list Get async job list from nodes.");
stream.println("stop Stop async jo... | java | public static void printHelp(PrintStream stream) {
stream.println();
stream.println("Voldemort Admin Tool Async-Job Commands");
stream.println("---------------------------------------");
stream.println("list Get async job list from nodes.");
stream.println("stop Stop async jo... | [
"public",
"static",
"void",
"printHelp",
"(",
"PrintStream",
"stream",
")",
"{",
"stream",
".",
"println",
"(",
")",
";",
"stream",
".",
"println",
"(",
"\"Voldemort Admin Tool Async-Job Commands\"",
")",
";",
"stream",
".",
"println",
"(",
"\"--------------------... | Prints command-line help menu. | [
"Prints",
"command",
"-",
"line",
"help",
"menu",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/admin/command/AdminCommandAsyncJob.java#L59-L69 |
161,103 | voldemort/voldemort | src/java/voldemort/store/bdb/BdbStorageConfiguration.java | BdbStorageConfiguration.removeStorageEngine | @Override
public void removeStorageEngine(StorageEngine<ByteArray, byte[], byte[]> engine) {
String storeName = engine.getName();
BdbStorageEngine bdbEngine = (BdbStorageEngine) engine;
synchronized(lock) {
// Only cleanup the environment if it is per store. We cannot
... | java | @Override
public void removeStorageEngine(StorageEngine<ByteArray, byte[], byte[]> engine) {
String storeName = engine.getName();
BdbStorageEngine bdbEngine = (BdbStorageEngine) engine;
synchronized(lock) {
// Only cleanup the environment if it is per store. We cannot
... | [
"@",
"Override",
"public",
"void",
"removeStorageEngine",
"(",
"StorageEngine",
"<",
"ByteArray",
",",
"byte",
"[",
"]",
",",
"byte",
"[",
"]",
">",
"engine",
")",
"{",
"String",
"storeName",
"=",
"engine",
".",
"getName",
"(",
")",
";",
"BdbStorageEngine"... | Clean up the environment object for the given storage engine | [
"Clean",
"up",
"the",
"environment",
"object",
"for",
"the",
"given",
"storage",
"engine"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/bdb/BdbStorageConfiguration.java#L215-L275 |
161,104 | voldemort/voldemort | src/java/voldemort/store/bdb/BdbStorageConfiguration.java | BdbStorageConfiguration.cleanLogs | @JmxOperation(description = "Forcefully invoke the log cleaning")
public void cleanLogs() {
synchronized(lock) {
try {
for(Environment environment: environments.values()) {
environment.cleanLog();
}
} catch(DatabaseException e) {
... | java | @JmxOperation(description = "Forcefully invoke the log cleaning")
public void cleanLogs() {
synchronized(lock) {
try {
for(Environment environment: environments.values()) {
environment.cleanLog();
}
} catch(DatabaseException e) {
... | [
"@",
"JmxOperation",
"(",
"description",
"=",
"\"Forcefully invoke the log cleaning\"",
")",
"public",
"void",
"cleanLogs",
"(",
")",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"try",
"{",
"for",
"(",
"Environment",
"environment",
":",
"environments",
".",
"val... | Forceful cleanup the logs | [
"Forceful",
"cleanup",
"the",
"logs"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/bdb/BdbStorageConfiguration.java#L417-L428 |
161,105 | voldemort/voldemort | src/java/voldemort/store/bdb/BdbStorageConfiguration.java | BdbStorageConfiguration.update | public void update(StoreDefinition storeDef) {
if(!useOneEnvPerStore)
throw new VoldemortException("Memory foot print can be set only when using different environments per store");
String storeName = storeDef.getName();
Environment environment = environments.get(storeName);
... | java | public void update(StoreDefinition storeDef) {
if(!useOneEnvPerStore)
throw new VoldemortException("Memory foot print can be set only when using different environments per store");
String storeName = storeDef.getName();
Environment environment = environments.get(storeName);
... | [
"public",
"void",
"update",
"(",
"StoreDefinition",
"storeDef",
")",
"{",
"if",
"(",
"!",
"useOneEnvPerStore",
")",
"throw",
"new",
"VoldemortException",
"(",
"\"Memory foot print can be set only when using different environments per store\"",
")",
";",
"String",
"storeName... | Detect what has changed in the store definition and rewire BDB
environments accordingly.
@param storeDef updated store definition | [
"Detect",
"what",
"has",
"changed",
"in",
"the",
"store",
"definition",
"and",
"rewire",
"BDB",
"environments",
"accordingly",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/bdb/BdbStorageConfiguration.java#L467-L504 |
161,106 | voldemort/voldemort | src/java/voldemort/tools/Repartitioner.java | Repartitioner.getBalancedNumberOfPrimaryPartitionsPerNode | public static HashMap<Integer, List<Integer>>
getBalancedNumberOfPrimaryPartitionsPerNode(final Cluster nextCandidateCluster,
Map<Integer, Integer> targetPartitionsPerZone) {
HashMap<Integer, List<Integer>> numPartitionsPerNode = Maps.newHashMa... | java | public static HashMap<Integer, List<Integer>>
getBalancedNumberOfPrimaryPartitionsPerNode(final Cluster nextCandidateCluster,
Map<Integer, Integer> targetPartitionsPerZone) {
HashMap<Integer, List<Integer>> numPartitionsPerNode = Maps.newHashMa... | [
"public",
"static",
"HashMap",
"<",
"Integer",
",",
"List",
"<",
"Integer",
">",
">",
"getBalancedNumberOfPrimaryPartitionsPerNode",
"(",
"final",
"Cluster",
"nextCandidateCluster",
",",
"Map",
"<",
"Integer",
",",
"Integer",
">",
"targetPartitionsPerZone",
")",
"{"... | Determines how many primary partitions each node within each zone should
have. The list of integers returned per zone is the same length as the
number of nodes in that zone.
@param nextCandidateCluster
@param targetPartitionsPerZone
@return A map of zoneId to list of target number of partitions per node
within zone. | [
"Determines",
"how",
"many",
"primary",
"partitions",
"each",
"node",
"within",
"each",
"zone",
"should",
"have",
".",
"The",
"list",
"of",
"integers",
"returned",
"per",
"zone",
"is",
"the",
"same",
"length",
"as",
"the",
"number",
"of",
"nodes",
"in",
"t... | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/Repartitioner.java#L255-L265 |
161,107 | voldemort/voldemort | src/java/voldemort/tools/Repartitioner.java | Repartitioner.getDonorsAndStealersForBalance | public static Pair<HashMap<Node, Integer>, HashMap<Node, Integer>>
getDonorsAndStealersForBalance(final Cluster nextCandidateCluster,
Map<Integer, List<Integer>> numPartitionsPerNodePerZone) {
HashMap<Node, Integer> donorNodes = Maps.newHashMap();
H... | java | public static Pair<HashMap<Node, Integer>, HashMap<Node, Integer>>
getDonorsAndStealersForBalance(final Cluster nextCandidateCluster,
Map<Integer, List<Integer>> numPartitionsPerNodePerZone) {
HashMap<Node, Integer> donorNodes = Maps.newHashMap();
H... | [
"public",
"static",
"Pair",
"<",
"HashMap",
"<",
"Node",
",",
"Integer",
">",
",",
"HashMap",
"<",
"Node",
",",
"Integer",
">",
">",
"getDonorsAndStealersForBalance",
"(",
"final",
"Cluster",
"nextCandidateCluster",
",",
"Map",
"<",
"Integer",
",",
"List",
"... | Assign target number of partitions per node to specific node IDs. Then,
separates Nodes into donorNodes and stealerNodes based on whether the
node needs to donate or steal primary partitions.
@param nextCandidateCluster
@param numPartitionsPerNodePerZone
@return a Pair. First element is donorNodes, second element is
s... | [
"Assign",
"target",
"number",
"of",
"partitions",
"per",
"node",
"to",
"specific",
"node",
"IDs",
".",
"Then",
"separates",
"Nodes",
"into",
"donorNodes",
"and",
"stealerNodes",
"based",
"on",
"whether",
"the",
"node",
"needs",
"to",
"donate",
"or",
"steal",
... | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/Repartitioner.java#L279-L317 |
161,108 | voldemort/voldemort | src/java/voldemort/tools/Repartitioner.java | Repartitioner.repeatedlyBalanceContiguousPartitionsPerZone | public static Cluster
repeatedlyBalanceContiguousPartitionsPerZone(final Cluster nextCandidateCluster,
final int maxContiguousPartitionsPerZone) {
System.out.println("Looping to evenly balance partitions across zones while limiting contiguous ... | java | public static Cluster
repeatedlyBalanceContiguousPartitionsPerZone(final Cluster nextCandidateCluster,
final int maxContiguousPartitionsPerZone) {
System.out.println("Looping to evenly balance partitions across zones while limiting contiguous ... | [
"public",
"static",
"Cluster",
"repeatedlyBalanceContiguousPartitionsPerZone",
"(",
"final",
"Cluster",
"nextCandidateCluster",
",",
"final",
"int",
"maxContiguousPartitionsPerZone",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"Looping to evenly balance partitions ... | Loops over cluster and repeatedly tries to break up contiguous runs of
partitions. After each phase of breaking up contiguous partitions, random
partitions are selected to move between zones to balance the number of
partitions in each zone. The second phase may re-introduce contiguous
partition runs in another zone. Th... | [
"Loops",
"over",
"cluster",
"and",
"repeatedly",
"tries",
"to",
"break",
"up",
"contiguous",
"runs",
"of",
"partitions",
".",
"After",
"each",
"phase",
"of",
"breaking",
"up",
"contiguous",
"partitions",
"random",
"partitions",
"are",
"selected",
"to",
"move",
... | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/Repartitioner.java#L454-L475 |
161,109 | voldemort/voldemort | src/java/voldemort/tools/Repartitioner.java | Repartitioner.balanceContiguousPartitionsPerZone | public static Cluster
balanceContiguousPartitionsPerZone(final Cluster nextCandidateCluster,
final int maxContiguousPartitionsPerZone) {
System.out.println("Balance number of contiguous partitions within a zone.");
System.out.println("numPartiti... | java | public static Cluster
balanceContiguousPartitionsPerZone(final Cluster nextCandidateCluster,
final int maxContiguousPartitionsPerZone) {
System.out.println("Balance number of contiguous partitions within a zone.");
System.out.println("numPartiti... | [
"public",
"static",
"Cluster",
"balanceContiguousPartitionsPerZone",
"(",
"final",
"Cluster",
"nextCandidateCluster",
",",
"final",
"int",
"maxContiguousPartitionsPerZone",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"Balance number of contiguous partitions within ... | Ensures that no more than maxContiguousPartitionsPerZone partitions are
contiguous within a single zone.
Moves the necessary partitions to break up contiguous runs from each zone
to some other random zone/node. There is some chance that such random
moves could result in contiguous partitions in other zones.
@param ne... | [
"Ensures",
"that",
"no",
"more",
"than",
"maxContiguousPartitionsPerZone",
"partitions",
"are",
"contiguous",
"within",
"a",
"single",
"zone",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/Repartitioner.java#L489-L557 |
161,110 | voldemort/voldemort | src/java/voldemort/tools/Repartitioner.java | Repartitioner.swapPartitions | public static Cluster swapPartitions(final Cluster nextCandidateCluster,
final int nodeIdA,
final int partitionIdA,
final int nodeIdB,
final int partitionId... | java | public static Cluster swapPartitions(final Cluster nextCandidateCluster,
final int nodeIdA,
final int partitionIdA,
final int nodeIdB,
final int partitionId... | [
"public",
"static",
"Cluster",
"swapPartitions",
"(",
"final",
"Cluster",
"nextCandidateCluster",
",",
"final",
"int",
"nodeIdA",
",",
"final",
"int",
"partitionIdA",
",",
"final",
"int",
"nodeIdB",
",",
"final",
"int",
"partitionIdB",
")",
"{",
"Cluster",
"retu... | Swaps two specified partitions.
Pair-wase partition swapping may be more prone to local minima than
larger perturbations. Could consider "swapping" a list of
<nodeId/partitionId>. This would allow a few nodes to be identified
(random # btw 2-5?) and then "swapped" (shuffled? rotated?).
@return modified cluster metada... | [
"Swaps",
"two",
"specified",
"partitions",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/Repartitioner.java#L569-L585 |
161,111 | voldemort/voldemort | src/java/voldemort/tools/Repartitioner.java | Repartitioner.swapRandomPartitionsWithinZone | public static Cluster swapRandomPartitionsWithinZone(final Cluster nextCandidateCluster,
final int zoneId) {
Cluster returnCluster = Cluster.cloneCluster(nextCandidateCluster);
Random r = new Random();
List<Integer> nodeIdsInZone = new Ar... | java | public static Cluster swapRandomPartitionsWithinZone(final Cluster nextCandidateCluster,
final int zoneId) {
Cluster returnCluster = Cluster.cloneCluster(nextCandidateCluster);
Random r = new Random();
List<Integer> nodeIdsInZone = new Ar... | [
"public",
"static",
"Cluster",
"swapRandomPartitionsWithinZone",
"(",
"final",
"Cluster",
"nextCandidateCluster",
",",
"final",
"int",
"zoneId",
")",
"{",
"Cluster",
"returnCluster",
"=",
"Cluster",
".",
"cloneCluster",
"(",
"nextCandidateCluster",
")",
";",
"Random",... | Within a single zone, swaps one random partition on one random node with
another random partition on different random node.
@param nextCandidateCluster
@param zoneId Zone ID within which to shuffle partitions
@return updated cluster | [
"Within",
"a",
"single",
"zone",
"swaps",
"one",
"random",
"partition",
"on",
"one",
"random",
"node",
"with",
"another",
"random",
"partition",
"on",
"different",
"random",
"node",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/Repartitioner.java#L595-L640 |
161,112 | voldemort/voldemort | src/java/voldemort/tools/Repartitioner.java | Repartitioner.randomShufflePartitions | public static Cluster randomShufflePartitions(final Cluster nextCandidateCluster,
final int randomSwapAttempts,
final int randomSwapSuccesses,
final List<Integer> randomS... | java | public static Cluster randomShufflePartitions(final Cluster nextCandidateCluster,
final int randomSwapAttempts,
final int randomSwapSuccesses,
final List<Integer> randomS... | [
"public",
"static",
"Cluster",
"randomShufflePartitions",
"(",
"final",
"Cluster",
"nextCandidateCluster",
",",
"final",
"int",
"randomSwapAttempts",
",",
"final",
"int",
"randomSwapSuccesses",
",",
"final",
"List",
"<",
"Integer",
">",
"randomSwapZoneIds",
",",
"List... | Randomly shuffle partitions between nodes within every zone.
@param nextCandidateCluster cluster object.
@param randomSwapAttempts See RebalanceCLI.
@param randomSwapSuccesses See RebalanceCLI.
@param randomSwapZoneIds The set of zoneIds to consider. Each zone is done
independently.
@param storeDefs List of store defi... | [
"Randomly",
"shuffle",
"partitions",
"between",
"nodes",
"within",
"every",
"zone",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/Repartitioner.java#L705-L754 |
161,113 | voldemort/voldemort | src/java/voldemort/tools/Repartitioner.java | Repartitioner.swapGreedyRandomPartitions | public static Cluster swapGreedyRandomPartitions(final Cluster nextCandidateCluster,
final List<Integer> nodeIds,
final int greedySwapMaxPartitionsPerNode,
final... | java | public static Cluster swapGreedyRandomPartitions(final Cluster nextCandidateCluster,
final List<Integer> nodeIds,
final int greedySwapMaxPartitionsPerNode,
final... | [
"public",
"static",
"Cluster",
"swapGreedyRandomPartitions",
"(",
"final",
"Cluster",
"nextCandidateCluster",
",",
"final",
"List",
"<",
"Integer",
">",
"nodeIds",
",",
"final",
"int",
"greedySwapMaxPartitionsPerNode",
",",
"final",
"int",
"greedySwapMaxPartitionsPerZone"... | For each node in specified zones, tries swapping some minimum number of
random partitions per node with some minimum number of random partitions
from other specified nodes. Chooses the best swap in each iteration.
Large values of the greedSwapMaxPartitions... arguments make this method
equivalent to comparing every pos... | [
"For",
"each",
"node",
"in",
"specified",
"zones",
"tries",
"swapping",
"some",
"minimum",
"number",
"of",
"random",
"partitions",
"per",
"node",
"with",
"some",
"minimum",
"number",
"of",
"random",
"partitions",
"from",
"other",
"specified",
"nodes",
".",
"Ch... | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/Repartitioner.java#L776-L840 |
161,114 | voldemort/voldemort | src/java/voldemort/tools/Repartitioner.java | Repartitioner.greedyShufflePartitions | public static Cluster greedyShufflePartitions(final Cluster nextCandidateCluster,
final int greedyAttempts,
final int greedySwapMaxPartitionsPerNode,
final int greedySwap... | java | public static Cluster greedyShufflePartitions(final Cluster nextCandidateCluster,
final int greedyAttempts,
final int greedySwapMaxPartitionsPerNode,
final int greedySwap... | [
"public",
"static",
"Cluster",
"greedyShufflePartitions",
"(",
"final",
"Cluster",
"nextCandidateCluster",
",",
"final",
"int",
"greedyAttempts",
",",
"final",
"int",
"greedySwapMaxPartitionsPerNode",
",",
"final",
"int",
"greedySwapMaxPartitionsPerZone",
",",
"List",
"<"... | Within a single zone, tries swapping some minimum number of random
partitions per node with some minimum number of random partitions from
other nodes within the zone. Chooses the best swap in each iteration.
Large values of the greedSwapMaxPartitions... arguments make this method
equivalent to comparing every possible ... | [
"Within",
"a",
"single",
"zone",
"tries",
"swapping",
"some",
"minimum",
"number",
"of",
"random",
"partitions",
"per",
"node",
"with",
"some",
"minimum",
"number",
"of",
"random",
"partitions",
"from",
"other",
"nodes",
"within",
"the",
"zone",
".",
"Chooses"... | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/Repartitioner.java#L862-L907 |
161,115 | voldemort/voldemort | src/java/voldemort/rest/server/RestService.java | RestService.stopInner | @Override
protected void stopInner() {
/*
* TODO REST-Server Need to handle inflight operations. What happens to
* the existing async operations when a channel.close() is issued in
* Netty?
*/
if(this.nettyServerChannel != null) {
this.nettyServerChann... | java | @Override
protected void stopInner() {
/*
* TODO REST-Server Need to handle inflight operations. What happens to
* the existing async operations when a channel.close() is issued in
* Netty?
*/
if(this.nettyServerChannel != null) {
this.nettyServerChann... | [
"@",
"Override",
"protected",
"void",
"stopInner",
"(",
")",
"{",
"/*\n * TODO REST-Server Need to handle inflight operations. What happens to\n * the existing async operations when a channel.close() is issued in\n * Netty?\n */",
"if",
"(",
"this",
".",
"ne... | Closes the Netty Channel and releases all resources | [
"Closes",
"the",
"Netty",
"Channel",
"and",
"releases",
"all",
"resources"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/server/RestService.java#L84-L99 |
161,116 | voldemort/voldemort | src/java/voldemort/rest/server/RestServerRequestHandler.java | RestServerRequestHandler.parseZoneId | protected int parseZoneId() {
int result = -1;
String zoneIdStr = this.request.getHeader(RestMessageHeaders.X_VOLD_ZONE_ID);
if(zoneIdStr != null) {
try {
int zoneId = Integer.parseInt(zoneIdStr);
if(zoneId < 0) {
logger.error("Zone... | java | protected int parseZoneId() {
int result = -1;
String zoneIdStr = this.request.getHeader(RestMessageHeaders.X_VOLD_ZONE_ID);
if(zoneIdStr != null) {
try {
int zoneId = Integer.parseInt(zoneIdStr);
if(zoneId < 0) {
logger.error("Zone... | [
"protected",
"int",
"parseZoneId",
"(",
")",
"{",
"int",
"result",
"=",
"-",
"1",
";",
"String",
"zoneIdStr",
"=",
"this",
".",
"request",
".",
"getHeader",
"(",
"RestMessageHeaders",
".",
"X_VOLD_ZONE_ID",
")",
";",
"if",
"(",
"zoneIdStr",
"!=",
"null",
... | Retrieve and validate the zone id value from the REST request.
"X-VOLD-Zone-Id" is the zone id header.
@return valid zone id or -1 if there is no/invalid zone id | [
"Retrieve",
"and",
"validate",
"the",
"zone",
"id",
"value",
"from",
"the",
"REST",
"request",
".",
"X",
"-",
"VOLD",
"-",
"Zone",
"-",
"Id",
"is",
"the",
"zone",
"id",
"header",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/server/RestServerRequestHandler.java#L82-L100 |
161,117 | voldemort/voldemort | src/java/voldemort/rest/server/RestServerRequestHandler.java | RestServerRequestHandler.registerRequest | @Override
protected void registerRequest(RestRequestValidator requestValidator,
ChannelHandlerContext ctx,
MessageEvent messageEvent) {
// At this point we know the request is valid and we have a
// error handler. So we construct ... | java | @Override
protected void registerRequest(RestRequestValidator requestValidator,
ChannelHandlerContext ctx,
MessageEvent messageEvent) {
// At this point we know the request is valid and we have a
// error handler. So we construct ... | [
"@",
"Override",
"protected",
"void",
"registerRequest",
"(",
"RestRequestValidator",
"requestValidator",
",",
"ChannelHandlerContext",
"ctx",
",",
"MessageEvent",
"messageEvent",
")",
"{",
"// At this point we know the request is valid and we have a",
"// error handler. So we cons... | Constructs a valid request and passes it on to the next handler. It also
creates the 'Store' object corresponding to the store name specified in
the REST request.
@param requestValidator The Validator object used to construct the
request object
@param ctx Context of the Netty channel
@param messageEvent Message Event ... | [
"Constructs",
"a",
"valid",
"request",
"and",
"passes",
"it",
"on",
"to",
"the",
"next",
"handler",
".",
"It",
"also",
"creates",
"the",
"Store",
"object",
"corresponding",
"to",
"the",
"store",
"name",
"specified",
"in",
"the",
"REST",
"request",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/server/RestServerRequestHandler.java#L112-L152 |
161,118 | voldemort/voldemort | src/java/voldemort/client/rebalance/RebalanceController.java | RebalanceController.getCurrentClusterState | private Pair<Cluster, List<StoreDefinition>> getCurrentClusterState() {
// Retrieve the latest cluster metadata from the existing nodes
Versioned<Cluster> currentVersionedCluster = adminClient.rebalanceOps.getLatestCluster(Utils.nodeListToNodeIdList(Lists.newArrayList(adminClient.getAdminClientCluster(... | java | private Pair<Cluster, List<StoreDefinition>> getCurrentClusterState() {
// Retrieve the latest cluster metadata from the existing nodes
Versioned<Cluster> currentVersionedCluster = adminClient.rebalanceOps.getLatestCluster(Utils.nodeListToNodeIdList(Lists.newArrayList(adminClient.getAdminClientCluster(... | [
"private",
"Pair",
"<",
"Cluster",
",",
"List",
"<",
"StoreDefinition",
">",
">",
"getCurrentClusterState",
"(",
")",
"{",
"// Retrieve the latest cluster metadata from the existing nodes",
"Versioned",
"<",
"Cluster",
">",
"currentVersionedCluster",
"=",
"adminClient",
"... | Probe the existing cluster to retrieve the current cluster xml and stores
xml.
@return Pair of Cluster and List<StoreDefinition> from current cluster. | [
"Probe",
"the",
"existing",
"cluster",
"to",
"retrieve",
"the",
"current",
"cluster",
"xml",
"and",
"stores",
"xml",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/client/rebalance/RebalanceController.java#L82-L90 |
161,119 | voldemort/voldemort | src/java/voldemort/client/rebalance/RebalanceController.java | RebalanceController.executePlan | private void executePlan(RebalancePlan rebalancePlan) {
logger.info("Starting to execute rebalance Plan!");
int batchCount = 0;
int partitionStoreCount = 0;
long totalTimeMs = 0;
List<RebalanceBatchPlan> entirePlan = rebalancePlan.getPlan();
int numBatches = entirePlan.... | java | private void executePlan(RebalancePlan rebalancePlan) {
logger.info("Starting to execute rebalance Plan!");
int batchCount = 0;
int partitionStoreCount = 0;
long totalTimeMs = 0;
List<RebalanceBatchPlan> entirePlan = rebalancePlan.getPlan();
int numBatches = entirePlan.... | [
"private",
"void",
"executePlan",
"(",
"RebalancePlan",
"rebalancePlan",
")",
"{",
"logger",
".",
"info",
"(",
"\"Starting to execute rebalance Plan!\"",
")",
";",
"int",
"batchCount",
"=",
"0",
";",
"int",
"partitionStoreCount",
"=",
"0",
";",
"long",
"totalTimeM... | Executes the rebalance plan. Does so batch-by-batch. Between each batch,
status is dumped to logger.info.
@param rebalancePlan | [
"Executes",
"the",
"rebalance",
"plan",
".",
"Does",
"so",
"batch",
"-",
"by",
"-",
"batch",
".",
"Between",
"each",
"batch",
"status",
"is",
"dumped",
"to",
"logger",
".",
"info",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/client/rebalance/RebalanceController.java#L192-L224 |
161,120 | voldemort/voldemort | src/java/voldemort/client/rebalance/RebalanceController.java | RebalanceController.batchStatusLog | private void batchStatusLog(int batchCount,
int numBatches,
int partitionStoreCount,
int numPartitionStores,
long totalTimeMs) {
// Calculate the estimated end time and pretty print st... | java | private void batchStatusLog(int batchCount,
int numBatches,
int partitionStoreCount,
int numPartitionStores,
long totalTimeMs) {
// Calculate the estimated end time and pretty print st... | [
"private",
"void",
"batchStatusLog",
"(",
"int",
"batchCount",
",",
"int",
"numBatches",
",",
"int",
"partitionStoreCount",
",",
"int",
"numPartitionStores",
",",
"long",
"totalTimeMs",
")",
"{",
"// Calculate the estimated end time and pretty print stats",
"double",
"rat... | Pretty print a progress update after each batch complete.
@param batchCount current batch
@param numBatches total number of batches
@param partitionStoreCount partition stores migrated
@param numPartitionStores total number of partition stores to migrate
@param totalTimeMs total time, in milliseconds, of execution thu... | [
"Pretty",
"print",
"a",
"progress",
"update",
"after",
"each",
"batch",
"complete",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/client/rebalance/RebalanceController.java#L235-L270 |
161,121 | voldemort/voldemort | src/java/voldemort/client/rebalance/RebalanceController.java | RebalanceController.executeBatch | private void executeBatch(int batchId, final RebalanceBatchPlan batchPlan) {
final Cluster batchCurrentCluster = batchPlan.getCurrentCluster();
final List<StoreDefinition> batchCurrentStoreDefs = batchPlan.getCurrentStoreDefs();
final Cluster batchFinalCluster = batchPlan.getFinalCluster();
... | java | private void executeBatch(int batchId, final RebalanceBatchPlan batchPlan) {
final Cluster batchCurrentCluster = batchPlan.getCurrentCluster();
final List<StoreDefinition> batchCurrentStoreDefs = batchPlan.getCurrentStoreDefs();
final Cluster batchFinalCluster = batchPlan.getFinalCluster();
... | [
"private",
"void",
"executeBatch",
"(",
"int",
"batchId",
",",
"final",
"RebalanceBatchPlan",
"batchPlan",
")",
"{",
"final",
"Cluster",
"batchCurrentCluster",
"=",
"batchPlan",
".",
"getCurrentCluster",
"(",
")",
";",
"final",
"List",
"<",
"StoreDefinition",
">",... | Executes a batch plan.
@param batchId Used as the ID of the batch plan. This allows related
tasks on client- & server-side to pretty print messages in a
manner that debugging can track specific batch plans across the
cluster.
@param batchPlan The batch plan... | [
"Executes",
"a",
"batch",
"plan",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/client/rebalance/RebalanceController.java#L281-L390 |
161,122 | voldemort/voldemort | src/java/voldemort/client/rebalance/RebalanceController.java | RebalanceController.proxyPause | private void proxyPause() {
logger.info("Pausing after cluster state has changed to allow proxy bridges to be established. "
+ "Will start rebalancing work on servers in "
+ proxyPauseSec
+ " seconds.");
try {
Thread.sleep(TimeUnit.... | java | private void proxyPause() {
logger.info("Pausing after cluster state has changed to allow proxy bridges to be established. "
+ "Will start rebalancing work on servers in "
+ proxyPauseSec
+ " seconds.");
try {
Thread.sleep(TimeUnit.... | [
"private",
"void",
"proxyPause",
"(",
")",
"{",
"logger",
".",
"info",
"(",
"\"Pausing after cluster state has changed to allow proxy bridges to be established. \"",
"+",
"\"Will start rebalancing work on servers in \"",
"+",
"proxyPauseSec",
"+",
"\" seconds.\"",
")",
";",
"tr... | Pause between cluster change in metadata and starting server rebalancing
work. | [
"Pause",
"between",
"cluster",
"change",
"in",
"metadata",
"and",
"starting",
"server",
"rebalancing",
"work",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/client/rebalance/RebalanceController.java#L396-L406 |
161,123 | voldemort/voldemort | src/java/voldemort/client/rebalance/RebalanceController.java | RebalanceController.executeSubBatch | private void
executeSubBatch(final int batchId,
RebalanceBatchPlanProgressBar progressBar,
final Cluster batchRollbackCluster,
final List<StoreDefinition> batchRollbackStoreDefs,
final List<Rebala... | java | private void
executeSubBatch(final int batchId,
RebalanceBatchPlanProgressBar progressBar,
final Cluster batchRollbackCluster,
final List<StoreDefinition> batchRollbackStoreDefs,
final List<Rebala... | [
"private",
"void",
"executeSubBatch",
"(",
"final",
"int",
"batchId",
",",
"RebalanceBatchPlanProgressBar",
"progressBar",
",",
"final",
"Cluster",
"batchRollbackCluster",
",",
"final",
"List",
"<",
"StoreDefinition",
">",
"batchRollbackStoreDefs",
",",
"final",
"List",... | The smallest granularity of rebalancing where-in we move partitions for a
sub-set of stores. Finally at the end of the movement, the node is
removed out of rebalance state
<br>
Also any errors + rollback procedures are performed at this level itself.
<pre>
| Case | hasRO | hasRW | finishedRO | Action |
| 0 | t | t |... | [
"The",
"smallest",
"granularity",
"of",
"rebalancing",
"where",
"-",
"in",
"we",
"move",
"partitions",
"for",
"a",
"sub",
"-",
"set",
"of",
"stores",
".",
"Finally",
"at",
"the",
"end",
"of",
"the",
"movement",
"the",
"node",
"is",
"removed",
"out",
"of"... | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/client/rebalance/RebalanceController.java#L563-L679 |
161,124 | voldemort/voldemort | src/java/voldemort/utils/ConsistencyCheck.java | ConsistencyCheck.determineConsistency | public static ConsistencyLevel determineConsistency(Map<Value, Set<ClusterNode>> versionNodeSetMap,
int replicationFactor) {
boolean fullyConsistent = true;
Value latestVersion = null;
for (Map.Entry<Value, Set<ClusterNode>> versionNodeSetEntry : versionNodeSetMap.entrySet()) {
... | java | public static ConsistencyLevel determineConsistency(Map<Value, Set<ClusterNode>> versionNodeSetMap,
int replicationFactor) {
boolean fullyConsistent = true;
Value latestVersion = null;
for (Map.Entry<Value, Set<ClusterNode>> versionNodeSetEntry : versionNodeSetMap.entrySet()) {
... | [
"public",
"static",
"ConsistencyLevel",
"determineConsistency",
"(",
"Map",
"<",
"Value",
",",
"Set",
"<",
"ClusterNode",
">",
">",
"versionNodeSetMap",
",",
"int",
"replicationFactor",
")",
"{",
"boolean",
"fullyConsistent",
"=",
"true",
";",
"Value",
"latestVers... | Determine the consistency level of a key
@param versionNodeSetMap A map that maps version to set of PrefixNodes
@param replicationFactor Total replication factor for the set of clusters
@return ConsistencyLevel Enum | [
"Determine",
"the",
"consistency",
"level",
"of",
"a",
"key"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/ConsistencyCheck.java#L654-L678 |
161,125 | voldemort/voldemort | src/java/voldemort/utils/ConsistencyCheck.java | ConsistencyCheck.cleanIneligibleKeys | public static void cleanIneligibleKeys(Map<ByteArray, Map<Value, Set<ClusterNode>>> keyVersionNodeSetMap,
int requiredWrite) {
Set<ByteArray> keysToDelete = new HashSet<ByteArray>();
for (Map.Entry<ByteArray, Map<Value, Set<ClusterNode>>> entry : keyVersionNodeSetMap.entrySet()) {
... | java | public static void cleanIneligibleKeys(Map<ByteArray, Map<Value, Set<ClusterNode>>> keyVersionNodeSetMap,
int requiredWrite) {
Set<ByteArray> keysToDelete = new HashSet<ByteArray>();
for (Map.Entry<ByteArray, Map<Value, Set<ClusterNode>>> entry : keyVersionNodeSetMap.entrySet()) {
... | [
"public",
"static",
"void",
"cleanIneligibleKeys",
"(",
"Map",
"<",
"ByteArray",
",",
"Map",
"<",
"Value",
",",
"Set",
"<",
"ClusterNode",
">",
">",
">",
"keyVersionNodeSetMap",
",",
"int",
"requiredWrite",
")",
"{",
"Set",
"<",
"ByteArray",
">",
"keysToDele... | Determine if a key version is invalid by comparing the version's
existence and required writes configuration
@param keyVersionNodeSetMap A map that contains keys mapping to a map
that maps versions to set of PrefixNodes
@param requiredWrite Required Write configuration | [
"Determine",
"if",
"a",
"key",
"version",
"is",
"invalid",
"by",
"comparing",
"the",
"version",
"s",
"existence",
"and",
"required",
"writes",
"configuration"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/ConsistencyCheck.java#L689-L717 |
161,126 | voldemort/voldemort | src/java/voldemort/utils/ConsistencyCheck.java | ConsistencyCheck.keyVersionToString | public static String keyVersionToString(ByteArray key,
Map<Value, Set<ClusterNode>> versionMap,
String storeName,
Integer partitionId) {
StringBuilder record = new StringBuilder();
for (Map.Entry<Value, Set<ClusterNode>> versionSet : versionMap.entrySet()) {
... | java | public static String keyVersionToString(ByteArray key,
Map<Value, Set<ClusterNode>> versionMap,
String storeName,
Integer partitionId) {
StringBuilder record = new StringBuilder();
for (Map.Entry<Value, Set<ClusterNode>> versionSet : versionMap.entrySet()) {
... | [
"public",
"static",
"String",
"keyVersionToString",
"(",
"ByteArray",
"key",
",",
"Map",
"<",
"Value",
",",
"Set",
"<",
"ClusterNode",
">",
">",
"versionMap",
",",
"String",
"storeName",
",",
"Integer",
"partitionId",
")",
"{",
"StringBuilder",
"record",
"=",
... | Convert a key-version-nodeSet information to string
@param key The key
@param versionMap mapping versions to set of PrefixNodes
@param storeName store's name
@param partitionId partition scanned
@return a string that describe the information passed in | [
"Convert",
"a",
"key",
"-",
"version",
"-",
"nodeSet",
"information",
"to",
"string"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/ConsistencyCheck.java#L815-L832 |
161,127 | voldemort/voldemort | src/java/voldemort/rest/GetMetadataResponseSender.java | GetMetadataResponseSender.sendResponse | @Override
public void sendResponse(StoreStats performanceStats,
boolean isFromLocalZone,
long startTimeInMs) throws Exception {
ChannelBuffer responseContent = ChannelBuffers.dynamicBuffer(this.responseValue.length);
responseContent.writeByt... | java | @Override
public void sendResponse(StoreStats performanceStats,
boolean isFromLocalZone,
long startTimeInMs) throws Exception {
ChannelBuffer responseContent = ChannelBuffers.dynamicBuffer(this.responseValue.length);
responseContent.writeByt... | [
"@",
"Override",
"public",
"void",
"sendResponse",
"(",
"StoreStats",
"performanceStats",
",",
"boolean",
"isFromLocalZone",
",",
"long",
"startTimeInMs",
")",
"throws",
"Exception",
"{",
"ChannelBuffer",
"responseContent",
"=",
"ChannelBuffers",
".",
"dynamicBuffer",
... | Sends a normal HTTP response containing the serialization information in
a XML format | [
"Sends",
"a",
"normal",
"HTTP",
"response",
"containing",
"the",
"serialization",
"information",
"in",
"a",
"XML",
"format"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/GetMetadataResponseSender.java#L33-L62 |
161,128 | voldemort/voldemort | src/java/voldemort/cluster/failuredetector/FailureDetectorConfig.java | FailureDetectorConfig.setCluster | public FailureDetectorConfig setCluster(Cluster cluster) {
Utils.notNull(cluster);
this.cluster = cluster;
/*
* FIXME: this is the hacky way to refresh the admin connection
* verifier, but it'll just work. The clean way to do so is to have a
* centralized metadata mana... | java | public FailureDetectorConfig setCluster(Cluster cluster) {
Utils.notNull(cluster);
this.cluster = cluster;
/*
* FIXME: this is the hacky way to refresh the admin connection
* verifier, but it'll just work. The clean way to do so is to have a
* centralized metadata mana... | [
"public",
"FailureDetectorConfig",
"setCluster",
"(",
"Cluster",
"cluster",
")",
"{",
"Utils",
".",
"notNull",
"(",
"cluster",
")",
";",
"this",
".",
"cluster",
"=",
"cluster",
";",
"/*\n * FIXME: this is the hacky way to refresh the admin connection\n * ver... | Look at the comments on cluster variable to see why this is problematic | [
"Look",
"at",
"the",
"comments",
"on",
"cluster",
"variable",
"to",
"see",
"why",
"this",
"is",
"problematic"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/cluster/failuredetector/FailureDetectorConfig.java#L576-L589 |
161,129 | voldemort/voldemort | src/java/voldemort/cluster/failuredetector/FailureDetectorConfig.java | FailureDetectorConfig.setNodes | @Deprecated
public synchronized FailureDetectorConfig setNodes(Collection<Node> nodes) {
Utils.notNull(nodes);
this.nodes = new HashSet<Node>(nodes);
return this;
} | java | @Deprecated
public synchronized FailureDetectorConfig setNodes(Collection<Node> nodes) {
Utils.notNull(nodes);
this.nodes = new HashSet<Node>(nodes);
return this;
} | [
"@",
"Deprecated",
"public",
"synchronized",
"FailureDetectorConfig",
"setNodes",
"(",
"Collection",
"<",
"Node",
">",
"nodes",
")",
"{",
"Utils",
".",
"notNull",
"(",
"nodes",
")",
";",
"this",
".",
"nodes",
"=",
"new",
"HashSet",
"<",
"Node",
">",
"(",
... | Assigns a list of nodes in the cluster represented by this failure
detector configuration.
@param nodes Collection of Node instances, usually determined from the
Cluster; must be non-null | [
"Assigns",
"a",
"list",
"of",
"nodes",
"in",
"the",
"cluster",
"represented",
"by",
"this",
"failure",
"detector",
"configuration",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/cluster/failuredetector/FailureDetectorConfig.java#L611-L616 |
161,130 | voldemort/voldemort | src/java/voldemort/cluster/Cluster.java | Cluster.hasNodeWithId | public boolean hasNodeWithId(int nodeId) {
Node node = nodesById.get(nodeId);
if(node == null) {
return false;
}
return true;
} | java | public boolean hasNodeWithId(int nodeId) {
Node node = nodesById.get(nodeId);
if(node == null) {
return false;
}
return true;
} | [
"public",
"boolean",
"hasNodeWithId",
"(",
"int",
"nodeId",
")",
"{",
"Node",
"node",
"=",
"nodesById",
".",
"get",
"(",
"nodeId",
")",
";",
"if",
"(",
"node",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"return",
"true",
";",
"}"
] | Given a cluster and a node id checks if the node exists
@param nodeId The node id to search for
@return True if cluster contains the node id, else false | [
"Given",
"a",
"cluster",
"and",
"a",
"node",
"id",
"checks",
"if",
"the",
"node",
"exists"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/cluster/Cluster.java#L264-L270 |
161,131 | voldemort/voldemort | src/java/voldemort/cluster/Cluster.java | Cluster.cloneCluster | public static Cluster cloneCluster(Cluster cluster) {
// Could add a better .clone() implementation that clones the derived
// data structures. The constructor invoked by this clone implementation
// can be slow for large numbers of partitions. Probably faster to copy
// all the maps and... | java | public static Cluster cloneCluster(Cluster cluster) {
// Could add a better .clone() implementation that clones the derived
// data structures. The constructor invoked by this clone implementation
// can be slow for large numbers of partitions. Probably faster to copy
// all the maps and... | [
"public",
"static",
"Cluster",
"cloneCluster",
"(",
"Cluster",
"cluster",
")",
"{",
"// Could add a better .clone() implementation that clones the derived",
"// data structures. The constructor invoked by this clone implementation",
"// can be slow for large numbers of partitions. Probably fas... | Clones the cluster by constructing a new one with same name, partition
layout, and nodes.
@param cluster
@return clone of Cluster cluster. | [
"Clones",
"the",
"cluster",
"by",
"constructing",
"a",
"new",
"one",
"with",
"same",
"name",
"partition",
"layout",
"and",
"nodes",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/cluster/Cluster.java#L322-L335 |
161,132 | voldemort/voldemort | src/java/voldemort/client/protocol/admin/AdminClientPool.java | AdminClientPool.checkout | public AdminClient checkout() {
if (isClosed.get()) {
throw new IllegalStateException("Pool is closing");
}
AdminClient client;
// Try to get one from the Cache.
while ((client = clientCache.poll()) != null) {
if (!client.isClusterModified()) {
... | java | public AdminClient checkout() {
if (isClosed.get()) {
throw new IllegalStateException("Pool is closing");
}
AdminClient client;
// Try to get one from the Cache.
while ((client = clientCache.poll()) != null) {
if (!client.isClusterModified()) {
... | [
"public",
"AdminClient",
"checkout",
"(",
")",
"{",
"if",
"(",
"isClosed",
".",
"get",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Pool is closing\"",
")",
";",
"}",
"AdminClient",
"client",
";",
"// Try to get one from the Cache.",
"whi... | get an AdminClient from the cache if exists, if not create new one
and return it. This method is non-blocking.
All AdminClient returned from checkout, once after the completion of
usage must be returned to the pool by calling checkin. If not,
there will be leak of AdminClients (connections, threads and file handles).
... | [
"get",
"an",
"AdminClient",
"from",
"the",
"cache",
"if",
"exists",
"if",
"not",
"create",
"new",
"one",
"and",
"return",
"it",
".",
"This",
"method",
"is",
"non",
"-",
"blocking",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/client/protocol/admin/AdminClientPool.java#L82-L101 |
161,133 | voldemort/voldemort | src/java/voldemort/client/protocol/admin/AdminClientPool.java | AdminClientPool.checkin | public void checkin(AdminClient client) {
if (isClosed.get()) {
throw new IllegalStateException("Pool is closing");
}
if (client == null) {
throw new IllegalArgumentException("client is null");
}
boolean isCheckedIn = clientCache.offer(client);
... | java | public void checkin(AdminClient client) {
if (isClosed.get()) {
throw new IllegalStateException("Pool is closing");
}
if (client == null) {
throw new IllegalArgumentException("client is null");
}
boolean isCheckedIn = clientCache.offer(client);
... | [
"public",
"void",
"checkin",
"(",
"AdminClient",
"client",
")",
"{",
"if",
"(",
"isClosed",
".",
"get",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Pool is closing\"",
")",
";",
"}",
"if",
"(",
"client",
"==",
"null",
")",
"{",
... | submit the adminClient after usage is completed.
Behavior is undefined, if checkin is called with objects not retrieved
from checkout.
@param client AdminClient retrieved from checkout | [
"submit",
"the",
"adminClient",
"after",
"usage",
"is",
"completed",
".",
"Behavior",
"is",
"undefined",
"if",
"checkin",
"is",
"called",
"with",
"objects",
"not",
"retrieved",
"from",
"checkout",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/client/protocol/admin/AdminClientPool.java#L110-L125 |
161,134 | voldemort/voldemort | src/java/voldemort/client/protocol/admin/AdminClientPool.java | AdminClientPool.close | public void close() {
boolean isPreviouslyClosed = isClosed.getAndSet(true);
if (isPreviouslyClosed) {
return;
}
AdminClient client;
while ((client = clientCache.poll()) != null) {
client.close();
}
} | java | public void close() {
boolean isPreviouslyClosed = isClosed.getAndSet(true);
if (isPreviouslyClosed) {
return;
}
AdminClient client;
while ((client = clientCache.poll()) != null) {
client.close();
}
} | [
"public",
"void",
"close",
"(",
")",
"{",
"boolean",
"isPreviouslyClosed",
"=",
"isClosed",
".",
"getAndSet",
"(",
"true",
")",
";",
"if",
"(",
"isPreviouslyClosed",
")",
"{",
"return",
";",
"}",
"AdminClient",
"client",
";",
"while",
"(",
"(",
"client",
... | close the AdminPool, if no long required.
After closed, all public methods will throw IllegalStateException | [
"close",
"the",
"AdminPool",
"if",
"no",
"long",
"required",
".",
"After",
"closed",
"all",
"public",
"methods",
"will",
"throw",
"IllegalStateException"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/client/protocol/admin/AdminClientPool.java#L131-L141 |
161,135 | voldemort/voldemort | src/java/voldemort/utils/PartitionBalanceUtils.java | PartitionBalanceUtils.compressedListOfPartitionsInZone | public static String compressedListOfPartitionsInZone(final Cluster cluster, int zoneId) {
Map<Integer, Integer> idToRunLength = PartitionBalanceUtils.getMapOfContiguousPartitions(cluster,
zoneId);
StringBu... | java | public static String compressedListOfPartitionsInZone(final Cluster cluster, int zoneId) {
Map<Integer, Integer> idToRunLength = PartitionBalanceUtils.getMapOfContiguousPartitions(cluster,
zoneId);
StringBu... | [
"public",
"static",
"String",
"compressedListOfPartitionsInZone",
"(",
"final",
"Cluster",
"cluster",
",",
"int",
"zoneId",
")",
"{",
"Map",
"<",
"Integer",
",",
"Integer",
">",
"idToRunLength",
"=",
"PartitionBalanceUtils",
".",
"getMapOfContiguousPartitions",
"(",
... | Compress contiguous partitions into format "e-i" instead of
"e, f, g, h, i". This helps illustrate contiguous partitions within a
zone.
@param cluster
@param zoneId
@return pretty string of partitions per zone | [
"Compress",
"contiguous",
"partitions",
"into",
"format",
"e",
"-",
"i",
"instead",
"of",
"e",
"f",
"g",
"h",
"i",
".",
"This",
"helps",
"illustrate",
"contiguous",
"partitions",
"within",
"a",
"zone",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/PartitionBalanceUtils.java#L54-L81 |
161,136 | voldemort/voldemort | src/java/voldemort/utils/PartitionBalanceUtils.java | PartitionBalanceUtils.getMapOfContiguousPartitions | public static Map<Integer, Integer> getMapOfContiguousPartitions(final Cluster cluster,
int zoneId) {
List<Integer> partitionIds = new ArrayList<Integer>(cluster.getPartitionIdsInZone(zoneId));
Map<Integer, Integer> partitionIdToRunLen... | java | public static Map<Integer, Integer> getMapOfContiguousPartitions(final Cluster cluster,
int zoneId) {
List<Integer> partitionIds = new ArrayList<Integer>(cluster.getPartitionIdsInZone(zoneId));
Map<Integer, Integer> partitionIdToRunLen... | [
"public",
"static",
"Map",
"<",
"Integer",
",",
"Integer",
">",
"getMapOfContiguousPartitions",
"(",
"final",
"Cluster",
"cluster",
",",
"int",
"zoneId",
")",
"{",
"List",
"<",
"Integer",
">",
"partitionIds",
"=",
"new",
"ArrayList",
"<",
"Integer",
">",
"("... | Determines run length for each 'initial' partition ID. Note that a
contiguous run may "wrap around" the end of the ring.
@param cluster
@param zoneId
@return map of initial partition Id to length of contiguous run of
partition IDs within the same zone.. | [
"Determines",
"run",
"length",
"for",
"each",
"initial",
"partition",
"ID",
".",
"Note",
"that",
"a",
"contiguous",
"run",
"may",
"wrap",
"around",
"the",
"end",
"of",
"the",
"ring",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/PartitionBalanceUtils.java#L92-L129 |
161,137 | voldemort/voldemort | src/java/voldemort/utils/PartitionBalanceUtils.java | PartitionBalanceUtils.getMapOfContiguousPartitionRunLengths | public static Map<Integer, Integer>
getMapOfContiguousPartitionRunLengths(final Cluster cluster, int zoneId) {
Map<Integer, Integer> idToRunLength = getMapOfContiguousPartitions(cluster, zoneId);
Map<Integer, Integer> runLengthToCount = Maps.newHashMap();
if(idToRunLength.isEmpty())... | java | public static Map<Integer, Integer>
getMapOfContiguousPartitionRunLengths(final Cluster cluster, int zoneId) {
Map<Integer, Integer> idToRunLength = getMapOfContiguousPartitions(cluster, zoneId);
Map<Integer, Integer> runLengthToCount = Maps.newHashMap();
if(idToRunLength.isEmpty())... | [
"public",
"static",
"Map",
"<",
"Integer",
",",
"Integer",
">",
"getMapOfContiguousPartitionRunLengths",
"(",
"final",
"Cluster",
"cluster",
",",
"int",
"zoneId",
")",
"{",
"Map",
"<",
"Integer",
",",
"Integer",
">",
"idToRunLength",
"=",
"getMapOfContiguousPartit... | Determines a histogram of contiguous runs of partitions within a zone.
I.e., for each run length of contiguous partitions, how many such runs
are there.
Does not correctly address "wrap around" of partition IDs (i.e., the fact
that partition ID 0 is "next" to partition ID 'max')
@param cluster
@param zoneId
@return m... | [
"Determines",
"a",
"histogram",
"of",
"contiguous",
"runs",
"of",
"partitions",
"within",
"a",
"zone",
".",
"I",
".",
"e",
".",
"for",
"each",
"run",
"length",
"of",
"contiguous",
"partitions",
"how",
"many",
"such",
"runs",
"are",
"there",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/PartitionBalanceUtils.java#L144-L161 |
161,138 | voldemort/voldemort | src/java/voldemort/utils/PartitionBalanceUtils.java | PartitionBalanceUtils.getPrettyMapOfContiguousPartitionRunLengths | public static String getPrettyMapOfContiguousPartitionRunLengths(final Cluster cluster,
int zoneId) {
Map<Integer, Integer> runLengthToCount = getMapOfContiguousPartitionRunLengths(cluster,
... | java | public static String getPrettyMapOfContiguousPartitionRunLengths(final Cluster cluster,
int zoneId) {
Map<Integer, Integer> runLengthToCount = getMapOfContiguousPartitionRunLengths(cluster,
... | [
"public",
"static",
"String",
"getPrettyMapOfContiguousPartitionRunLengths",
"(",
"final",
"Cluster",
"cluster",
",",
"int",
"zoneId",
")",
"{",
"Map",
"<",
"Integer",
",",
"Integer",
">",
"runLengthToCount",
"=",
"getMapOfContiguousPartitionRunLengths",
"(",
"cluster",... | Pretty prints the output of getMapOfContiguousPartitionRunLengths
@param cluster
@param zoneId
@return pretty string of contiguous run lengths | [
"Pretty",
"prints",
"the",
"output",
"of",
"getMapOfContiguousPartitionRunLengths"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/PartitionBalanceUtils.java#L170-L187 |
161,139 | voldemort/voldemort | src/java/voldemort/utils/PartitionBalanceUtils.java | PartitionBalanceUtils.getHotPartitionsDueToContiguity | public static String getHotPartitionsDueToContiguity(final Cluster cluster,
int hotContiguityCutoff) {
StringBuilder sb = new StringBuilder();
for(int zoneId: cluster.getZoneIds()) {
Map<Integer, Integer> idToRunLength = getMapOfConti... | java | public static String getHotPartitionsDueToContiguity(final Cluster cluster,
int hotContiguityCutoff) {
StringBuilder sb = new StringBuilder();
for(int zoneId: cluster.getZoneIds()) {
Map<Integer, Integer> idToRunLength = getMapOfConti... | [
"public",
"static",
"String",
"getHotPartitionsDueToContiguity",
"(",
"final",
"Cluster",
"cluster",
",",
"int",
"hotContiguityCutoff",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"int",
"zoneId",
":",
"cluster",
".",... | Returns a pretty printed string of nodes that host specific "hot"
partitions, where hot is defined as following a contiguous run of
partitions of some length in another zone.
@param cluster The cluster to analyze
@param hotContiguityCutoff cutoff below which a contiguous run is not
hot.
@return pretty string of hot pa... | [
"Returns",
"a",
"pretty",
"printed",
"string",
"of",
"nodes",
"that",
"host",
"specific",
"hot",
"partitions",
"where",
"hot",
"is",
"defined",
"as",
"following",
"a",
"contiguous",
"run",
"of",
"partitions",
"of",
"some",
"length",
"in",
"another",
"zone",
... | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/PartitionBalanceUtils.java#L199-L220 |
161,140 | voldemort/voldemort | src/java/voldemort/utils/PartitionBalanceUtils.java | PartitionBalanceUtils.analyzeInvalidMetadataRate | public static String analyzeInvalidMetadataRate(final Cluster currentCluster,
List<StoreDefinition> currentStoreDefs,
final Cluster finalCluster,
List<StoreDefiniti... | java | public static String analyzeInvalidMetadataRate(final Cluster currentCluster,
List<StoreDefinition> currentStoreDefs,
final Cluster finalCluster,
List<StoreDefiniti... | [
"public",
"static",
"String",
"analyzeInvalidMetadataRate",
"(",
"final",
"Cluster",
"currentCluster",
",",
"List",
"<",
"StoreDefinition",
">",
"currentStoreDefs",
",",
"final",
"Cluster",
"finalCluster",
",",
"List",
"<",
"StoreDefinition",
">",
"finalStoreDefs",
")... | Compares current cluster with final cluster. Uses pertinent store defs
for each cluster to determine if a node that hosts a zone-primary in the
current cluster will no longer host any zone-nary in the final cluster.
This check is the precondition for a server returning an invalid metadata
exception to a client on a nor... | [
"Compares",
"current",
"cluster",
"with",
"final",
"cluster",
".",
"Uses",
"pertinent",
"store",
"defs",
"for",
"each",
"cluster",
"to",
"determine",
"if",
"a",
"node",
"that",
"hosts",
"a",
"zone",
"-",
"primary",
"in",
"the",
"current",
"cluster",
"will",
... | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/PartitionBalanceUtils.java#L320-L369 |
161,141 | voldemort/voldemort | src/java/voldemort/utils/pool/QueuedKeyedResourcePool.java | QueuedKeyedResourcePool.create | public static <K, V> QueuedKeyedResourcePool<K, V> create(ResourceFactory<K, V> factory,
ResourcePoolConfig config) {
return new QueuedKeyedResourcePool<K, V>(factory, config);
} | java | public static <K, V> QueuedKeyedResourcePool<K, V> create(ResourceFactory<K, V> factory,
ResourcePoolConfig config) {
return new QueuedKeyedResourcePool<K, V>(factory, config);
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"QueuedKeyedResourcePool",
"<",
"K",
",",
"V",
">",
"create",
"(",
"ResourceFactory",
"<",
"K",
",",
"V",
">",
"factory",
",",
"ResourcePoolConfig",
"config",
")",
"{",
"return",
"new",
"QueuedKeyedResourcePool",
... | Create a new queued pool with key type K, request type R, and value type
V.
@param factory The factory that creates objects
@param config The pool config
@return The created pool | [
"Create",
"a",
"new",
"queued",
"pool",
"with",
"key",
"type",
"K",
"request",
"type",
"R",
"and",
"value",
"type",
"V",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/pool/QueuedKeyedResourcePool.java#L67-L70 |
161,142 | voldemort/voldemort | src/java/voldemort/utils/pool/QueuedKeyedResourcePool.java | QueuedKeyedResourcePool.create | public static <K, V> QueuedKeyedResourcePool<K, V> create(ResourceFactory<K, V> factory) {
return create(factory, new ResourcePoolConfig());
} | java | public static <K, V> QueuedKeyedResourcePool<K, V> create(ResourceFactory<K, V> factory) {
return create(factory, new ResourcePoolConfig());
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"QueuedKeyedResourcePool",
"<",
"K",
",",
"V",
">",
"create",
"(",
"ResourceFactory",
"<",
"K",
",",
"V",
">",
"factory",
")",
"{",
"return",
"create",
"(",
"factory",
",",
"new",
"ResourcePoolConfig",
"(",
... | Create a new queued pool using the defaults for key of type K, request of
type R, and value of Type V.
@param factory The factory that creates objects
@return The created pool | [
"Create",
"a",
"new",
"queued",
"pool",
"using",
"the",
"defaults",
"for",
"key",
"of",
"type",
"K",
"request",
"of",
"type",
"R",
"and",
"value",
"of",
"Type",
"V",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/pool/QueuedKeyedResourcePool.java#L79-L81 |
161,143 | voldemort/voldemort | src/java/voldemort/utils/pool/QueuedKeyedResourcePool.java | QueuedKeyedResourcePool.internalNonBlockingGet | public V internalNonBlockingGet(K key) throws Exception {
Pool<V> resourcePool = getResourcePoolForKey(key);
return attemptNonBlockingCheckout(key, resourcePool);
} | java | public V internalNonBlockingGet(K key) throws Exception {
Pool<V> resourcePool = getResourcePoolForKey(key);
return attemptNonBlockingCheckout(key, resourcePool);
} | [
"public",
"V",
"internalNonBlockingGet",
"(",
"K",
"key",
")",
"throws",
"Exception",
"{",
"Pool",
"<",
"V",
">",
"resourcePool",
"=",
"getResourcePoolForKey",
"(",
"key",
")",
";",
"return",
"attemptNonBlockingCheckout",
"(",
"key",
",",
"resourcePool",
")",
... | Used only for unit testing. Please do not use this method in other ways.
@param key
@return
@throws Exception | [
"Used",
"only",
"for",
"unit",
"testing",
".",
"Please",
"do",
"not",
"use",
"this",
"method",
"in",
"other",
"ways",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/pool/QueuedKeyedResourcePool.java#L131-L134 |
161,144 | voldemort/voldemort | src/java/voldemort/utils/pool/QueuedKeyedResourcePool.java | QueuedKeyedResourcePool.getNextUnexpiredResourceRequest | private AsyncResourceRequest<V> getNextUnexpiredResourceRequest(Queue<AsyncResourceRequest<V>> requestQueue) {
AsyncResourceRequest<V> resourceRequest = requestQueue.poll();
while(resourceRequest != null) {
if(resourceRequest.getDeadlineNs() < System.nanoTime()) {
resourceReq... | java | private AsyncResourceRequest<V> getNextUnexpiredResourceRequest(Queue<AsyncResourceRequest<V>> requestQueue) {
AsyncResourceRequest<V> resourceRequest = requestQueue.poll();
while(resourceRequest != null) {
if(resourceRequest.getDeadlineNs() < System.nanoTime()) {
resourceReq... | [
"private",
"AsyncResourceRequest",
"<",
"V",
">",
"getNextUnexpiredResourceRequest",
"(",
"Queue",
"<",
"AsyncResourceRequest",
"<",
"V",
">",
">",
"requestQueue",
")",
"{",
"AsyncResourceRequest",
"<",
"V",
">",
"resourceRequest",
"=",
"requestQueue",
".",
"poll",
... | Pops resource requests off the queue until queue is empty or an unexpired
resource request is found. Invokes .handleTimeout on all expired resource
requests popped off the queue.
@return null or a valid ResourceRequest | [
"Pops",
"resource",
"requests",
"off",
"the",
"queue",
"until",
"queue",
"is",
"empty",
"or",
"an",
"unexpired",
"resource",
"request",
"is",
"found",
".",
"Invokes",
".",
"handleTimeout",
"on",
"all",
"expired",
"resource",
"requests",
"popped",
"off",
"the",... | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/pool/QueuedKeyedResourcePool.java#L143-L154 |
161,145 | voldemort/voldemort | src/java/voldemort/utils/pool/QueuedKeyedResourcePool.java | QueuedKeyedResourcePool.processQueue | private boolean processQueue(K key) {
Queue<AsyncResourceRequest<V>> requestQueue = getRequestQueueForKey(key);
if(requestQueue.isEmpty()) {
return false;
}
// Attempt to get a resource.
Pool<V> resourcePool = getResourcePoolForKey(key);
V resource = null;
... | java | private boolean processQueue(K key) {
Queue<AsyncResourceRequest<V>> requestQueue = getRequestQueueForKey(key);
if(requestQueue.isEmpty()) {
return false;
}
// Attempt to get a resource.
Pool<V> resourcePool = getResourcePoolForKey(key);
V resource = null;
... | [
"private",
"boolean",
"processQueue",
"(",
"K",
"key",
")",
"{",
"Queue",
"<",
"AsyncResourceRequest",
"<",
"V",
">>",
"requestQueue",
"=",
"getRequestQueueForKey",
"(",
"key",
")",
";",
"if",
"(",
"requestQueue",
".",
"isEmpty",
"(",
")",
")",
"{",
"retur... | Attempts to checkout a resource so that one queued request can be
serviced.
@param key The key for which to process the requestQueue
@return true iff an item was processed from the Queue. | [
"Attempts",
"to",
"checkout",
"a",
"resource",
"so",
"that",
"one",
"queued",
"request",
"can",
"be",
"serviced",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/pool/QueuedKeyedResourcePool.java#L163-L214 |
161,146 | voldemort/voldemort | src/java/voldemort/utils/pool/QueuedKeyedResourcePool.java | QueuedKeyedResourcePool.checkin | @Override
public void checkin(K key, V resource) {
super.checkin(key, resource);
// NB: Blocking checkout calls for synchronous requests get the resource
// checked in above before processQueueLoop() attempts checkout below.
// There is therefore a risk that asynchronous requests wil... | java | @Override
public void checkin(K key, V resource) {
super.checkin(key, resource);
// NB: Blocking checkout calls for synchronous requests get the resource
// checked in above before processQueueLoop() attempts checkout below.
// There is therefore a risk that asynchronous requests wil... | [
"@",
"Override",
"public",
"void",
"checkin",
"(",
"K",
"key",
",",
"V",
"resource",
")",
"{",
"super",
".",
"checkin",
"(",
"key",
",",
"resource",
")",
";",
"// NB: Blocking checkout calls for synchronous requests get the resource",
"// checked in above before process... | Check the given resource back into the pool
@param key The key for the resource
@param resource The resource | [
"Check",
"the",
"given",
"resource",
"back",
"into",
"the",
"pool"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/pool/QueuedKeyedResourcePool.java#L248-L255 |
161,147 | voldemort/voldemort | src/java/voldemort/utils/pool/QueuedKeyedResourcePool.java | QueuedKeyedResourcePool.destroyRequest | protected void destroyRequest(AsyncResourceRequest<V> resourceRequest) {
if(resourceRequest != null) {
try {
// To hand control back to the owner of the
// AsyncResourceRequest, treat "destroy" as an exception since
// there is no resource to pass into... | java | protected void destroyRequest(AsyncResourceRequest<V> resourceRequest) {
if(resourceRequest != null) {
try {
// To hand control back to the owner of the
// AsyncResourceRequest, treat "destroy" as an exception since
// there is no resource to pass into... | [
"protected",
"void",
"destroyRequest",
"(",
"AsyncResourceRequest",
"<",
"V",
">",
"resourceRequest",
")",
"{",
"if",
"(",
"resourceRequest",
"!=",
"null",
")",
"{",
"try",
"{",
"// To hand control back to the owner of the",
"// AsyncResourceRequest, treat \"destroy\" as an... | A safe wrapper to destroy the given resource request. | [
"A",
"safe",
"wrapper",
"to",
"destroy",
"the",
"given",
"resource",
"request",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/pool/QueuedKeyedResourcePool.java#L260-L273 |
161,148 | voldemort/voldemort | src/java/voldemort/utils/pool/QueuedKeyedResourcePool.java | QueuedKeyedResourcePool.destroyRequestQueue | private void destroyRequestQueue(Queue<AsyncResourceRequest<V>> requestQueue) {
if(requestQueue != null) {
AsyncResourceRequest<V> resourceRequest = requestQueue.poll();
while(resourceRequest != null) {
destroyRequest(resourceRequest);
resourceRequest = re... | java | private void destroyRequestQueue(Queue<AsyncResourceRequest<V>> requestQueue) {
if(requestQueue != null) {
AsyncResourceRequest<V> resourceRequest = requestQueue.poll();
while(resourceRequest != null) {
destroyRequest(resourceRequest);
resourceRequest = re... | [
"private",
"void",
"destroyRequestQueue",
"(",
"Queue",
"<",
"AsyncResourceRequest",
"<",
"V",
">",
">",
"requestQueue",
")",
"{",
"if",
"(",
"requestQueue",
"!=",
"null",
")",
"{",
"AsyncResourceRequest",
"<",
"V",
">",
"resourceRequest",
"=",
"requestQueue",
... | Destroys all resource requests in requestQueue.
@param requestQueue The queue for which all resource requests are to be
destroyed. | [
"Destroys",
"all",
"resource",
"requests",
"in",
"requestQueue",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/pool/QueuedKeyedResourcePool.java#L281-L289 |
161,149 | voldemort/voldemort | src/java/voldemort/utils/pool/QueuedKeyedResourcePool.java | QueuedKeyedResourcePool.getRegisteredResourceRequestCount | public int getRegisteredResourceRequestCount(K key) {
if(requestQueueMap.containsKey(key)) {
Queue<AsyncResourceRequest<V>> requestQueue = getRequestQueueForExistingKey(key);
// FYI: .size() is not constant time in the next call. ;)
if(requestQueue != null) {
... | java | public int getRegisteredResourceRequestCount(K key) {
if(requestQueueMap.containsKey(key)) {
Queue<AsyncResourceRequest<V>> requestQueue = getRequestQueueForExistingKey(key);
// FYI: .size() is not constant time in the next call. ;)
if(requestQueue != null) {
... | [
"public",
"int",
"getRegisteredResourceRequestCount",
"(",
"K",
"key",
")",
"{",
"if",
"(",
"requestQueueMap",
".",
"containsKey",
"(",
"key",
")",
")",
"{",
"Queue",
"<",
"AsyncResourceRequest",
"<",
"V",
">>",
"requestQueue",
"=",
"getRequestQueueForExistingKey"... | Count the number of queued resource requests for a specific pool.
@param key The key
@return The count of queued resource requests. Returns 0 if no queue
exists for given key. | [
"Count",
"the",
"number",
"of",
"queued",
"resource",
"requests",
"for",
"a",
"specific",
"pool",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/pool/QueuedKeyedResourcePool.java#L355-L364 |
161,150 | voldemort/voldemort | src/java/voldemort/utils/pool/QueuedKeyedResourcePool.java | QueuedKeyedResourcePool.getRegisteredResourceRequestCount | public int getRegisteredResourceRequestCount() {
int count = 0;
for(Entry<K, Queue<AsyncResourceRequest<V>>> entry: this.requestQueueMap.entrySet()) {
// FYI: .size() is not constant time in the next call. ;)
count += entry.getValue().size();
}
return count;
} | java | public int getRegisteredResourceRequestCount() {
int count = 0;
for(Entry<K, Queue<AsyncResourceRequest<V>>> entry: this.requestQueueMap.entrySet()) {
// FYI: .size() is not constant time in the next call. ;)
count += entry.getValue().size();
}
return count;
} | [
"public",
"int",
"getRegisteredResourceRequestCount",
"(",
")",
"{",
"int",
"count",
"=",
"0",
";",
"for",
"(",
"Entry",
"<",
"K",
",",
"Queue",
"<",
"AsyncResourceRequest",
"<",
"V",
">",
">",
">",
"entry",
":",
"this",
".",
"requestQueueMap",
".",
"ent... | Count the total number of queued resource requests for all queues. The
result is "approximate" in the face of concurrency since individual
queues can change size during the aggregate count.
@return The (approximate) aggregate count of queued resource requests. | [
"Count",
"the",
"total",
"number",
"of",
"queued",
"resource",
"requests",
"for",
"all",
"queues",
".",
"The",
"result",
"is",
"approximate",
"in",
"the",
"face",
"of",
"concurrency",
"since",
"individual",
"queues",
"can",
"change",
"size",
"during",
"the",
... | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/pool/QueuedKeyedResourcePool.java#L373-L380 |
161,151 | voldemort/voldemort | src/java/voldemort/client/rebalance/RebalanceScheduler.java | RebalanceScheduler.populateTasksByStealer | protected void populateTasksByStealer(List<StealerBasedRebalanceTask> sbTaskList) {
// Setup mapping of stealers to work for this run.
for(StealerBasedRebalanceTask task: sbTaskList) {
if(task.getStealInfos().size() != 1) {
throw new VoldemortException("StealerBasedRebalanceT... | java | protected void populateTasksByStealer(List<StealerBasedRebalanceTask> sbTaskList) {
// Setup mapping of stealers to work for this run.
for(StealerBasedRebalanceTask task: sbTaskList) {
if(task.getStealInfos().size() != 1) {
throw new VoldemortException("StealerBasedRebalanceT... | [
"protected",
"void",
"populateTasksByStealer",
"(",
"List",
"<",
"StealerBasedRebalanceTask",
">",
"sbTaskList",
")",
"{",
"// Setup mapping of stealers to work for this run.",
"for",
"(",
"StealerBasedRebalanceTask",
"task",
":",
"sbTaskList",
")",
"{",
"if",
"(",
"task"... | Go over the task list and create a map of stealerId -> Tasks
@param sbTaskList List of all stealer-based rebalancing tasks to be
scheduled. | [
"Go",
"over",
"the",
"task",
"list",
"and",
"create",
"a",
"map",
"of",
"stealerId",
"-",
">",
"Tasks"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/client/rebalance/RebalanceScheduler.java#L92-L116 |
161,152 | voldemort/voldemort | src/java/voldemort/client/rebalance/RebalanceScheduler.java | RebalanceScheduler.scheduleNextTask | protected synchronized StealerBasedRebalanceTask scheduleNextTask(boolean executeService) {
// Make sure there is work left to do.
if(doneSignal.getCount() == 0) {
logger.info("All tasks completion signaled... returning");
return null;
}
// Limit number of tasks ... | java | protected synchronized StealerBasedRebalanceTask scheduleNextTask(boolean executeService) {
// Make sure there is work left to do.
if(doneSignal.getCount() == 0) {
logger.info("All tasks completion signaled... returning");
return null;
}
// Limit number of tasks ... | [
"protected",
"synchronized",
"StealerBasedRebalanceTask",
"scheduleNextTask",
"(",
"boolean",
"executeService",
")",
"{",
"// Make sure there is work left to do.",
"if",
"(",
"doneSignal",
".",
"getCount",
"(",
")",
"==",
"0",
")",
"{",
"logger",
".",
"info",
"(",
"... | Schedule at most one task.
The scheduled task *must* invoke 'doneTask()' upon
completion/termination.
@param executeService flag to control execution of the service, some tests pass
in value 'false'
@return The task scheduled or null if not possible to schedule a task at
this time. | [
"Schedule",
"at",
"most",
"one",
"task",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/client/rebalance/RebalanceScheduler.java#L177-L233 |
161,153 | voldemort/voldemort | src/java/voldemort/client/rebalance/RebalanceScheduler.java | RebalanceScheduler.addNodesToWorkerList | public synchronized void addNodesToWorkerList(List<Integer> nodeIds) {
// Bookkeeping for nodes that will be involved in the next task
nodeIdsWithWork.addAll(nodeIds);
logger.info("Node IDs with work: " + nodeIdsWithWork + " Newly added nodes " + nodeIds);
} | java | public synchronized void addNodesToWorkerList(List<Integer> nodeIds) {
// Bookkeeping for nodes that will be involved in the next task
nodeIdsWithWork.addAll(nodeIds);
logger.info("Node IDs with work: " + nodeIdsWithWork + " Newly added nodes " + nodeIds);
} | [
"public",
"synchronized",
"void",
"addNodesToWorkerList",
"(",
"List",
"<",
"Integer",
">",
"nodeIds",
")",
"{",
"// Bookkeeping for nodes that will be involved in the next task",
"nodeIdsWithWork",
".",
"addAll",
"(",
"nodeIds",
")",
";",
"logger",
".",
"info",
"(",
... | Add nodes to the workers list
@param nodeIds list of node ids. | [
"Add",
"nodes",
"to",
"the",
"workers",
"list"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/client/rebalance/RebalanceScheduler.java#L251-L255 |
161,154 | voldemort/voldemort | src/java/voldemort/client/rebalance/RebalanceScheduler.java | RebalanceScheduler.doneTask | public synchronized void doneTask(int stealerId, int donorId) {
removeNodesFromWorkerList(Arrays.asList(stealerId, donorId));
numTasksExecuting--;
doneSignal.countDown();
// Try and schedule more tasks now that resources may be available to do
// so.
scheduleMoreTasks();
... | java | public synchronized void doneTask(int stealerId, int donorId) {
removeNodesFromWorkerList(Arrays.asList(stealerId, donorId));
numTasksExecuting--;
doneSignal.countDown();
// Try and schedule more tasks now that resources may be available to do
// so.
scheduleMoreTasks();
... | [
"public",
"synchronized",
"void",
"doneTask",
"(",
"int",
"stealerId",
",",
"int",
"donorId",
")",
"{",
"removeNodesFromWorkerList",
"(",
"Arrays",
".",
"asList",
"(",
"stealerId",
",",
"donorId",
")",
")",
";",
"numTasksExecuting",
"--",
";",
"doneSignal",
".... | Method must be invoked upon completion of a rebalancing task. It is the
task's responsibility to do so.
@param stealerId
@param donorId | [
"Method",
"must",
"be",
"invoked",
"upon",
"completion",
"of",
"a",
"rebalancing",
"task",
".",
"It",
"is",
"the",
"task",
"s",
"responsibility",
"to",
"do",
"so",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/client/rebalance/RebalanceScheduler.java#L274-L281 |
161,155 | voldemort/voldemort | src/java/voldemort/store/bdb/stats/AggregatedBdbEnvironmentStats.java | AggregatedBdbEnvironmentStats.collectLongMetric | private List<Long> collectLongMetric(String metricGetterName) {
List<Long> vals = new ArrayList<Long>();
for(BdbEnvironmentStats envStats: environmentStatsTracked) {
vals.add((Long) ReflectUtils.callMethod(envStats,
BdbEnvironmentStats.clas... | java | private List<Long> collectLongMetric(String metricGetterName) {
List<Long> vals = new ArrayList<Long>();
for(BdbEnvironmentStats envStats: environmentStatsTracked) {
vals.add((Long) ReflectUtils.callMethod(envStats,
BdbEnvironmentStats.clas... | [
"private",
"List",
"<",
"Long",
">",
"collectLongMetric",
"(",
"String",
"metricGetterName",
")",
"{",
"List",
"<",
"Long",
">",
"vals",
"=",
"new",
"ArrayList",
"<",
"Long",
">",
"(",
")",
";",
"for",
"(",
"BdbEnvironmentStats",
"envStats",
":",
"environm... | Calls the provided metric getter on all the tracked environments and
obtains their values
@param metricGetterName
@return | [
"Calls",
"the",
"provided",
"metric",
"getter",
"on",
"all",
"the",
"tracked",
"environments",
"and",
"obtains",
"their",
"values"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/bdb/stats/AggregatedBdbEnvironmentStats.java#L38-L48 |
161,156 | voldemort/voldemort | src/java/voldemort/utils/ByteArray.java | ByteArray.toHexStrings | public static Iterable<String> toHexStrings(Iterable<ByteArray> arrays) {
ArrayList<String> ret = new ArrayList<String>();
for(ByteArray array: arrays)
ret.add(ByteUtils.toHexString(array.get()));
return ret;
} | java | public static Iterable<String> toHexStrings(Iterable<ByteArray> arrays) {
ArrayList<String> ret = new ArrayList<String>();
for(ByteArray array: arrays)
ret.add(ByteUtils.toHexString(array.get()));
return ret;
} | [
"public",
"static",
"Iterable",
"<",
"String",
">",
"toHexStrings",
"(",
"Iterable",
"<",
"ByteArray",
">",
"arrays",
")",
"{",
"ArrayList",
"<",
"String",
">",
"ret",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"for",
"(",
"ByteArray",
... | Translate the each ByteArray in an iterable into a hexadecimal string
@param arrays The array of bytes to translate
@return An iterable of converted strings | [
"Translate",
"the",
"each",
"ByteArray",
"in",
"an",
"iterable",
"into",
"a",
"hexadecimal",
"string"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/ByteArray.java#L53-L58 |
161,157 | voldemort/voldemort | src/java/voldemort/rest/GetResponseSender.java | GetResponseSender.sendResponse | @Override
public void sendResponse(StoreStats performanceStats,
boolean isFromLocalZone,
long startTimeInMs) throws Exception {
/*
* Pay attention to the code below. Note that in this method we wrap a multiPart object with a mimeMessage.
... | java | @Override
public void sendResponse(StoreStats performanceStats,
boolean isFromLocalZone,
long startTimeInMs) throws Exception {
/*
* Pay attention to the code below. Note that in this method we wrap a multiPart object with a mimeMessage.
... | [
"@",
"Override",
"public",
"void",
"sendResponse",
"(",
"StoreStats",
"performanceStats",
",",
"boolean",
"isFromLocalZone",
",",
"long",
"startTimeInMs",
")",
"throws",
"Exception",
"{",
"/*\n * Pay attention to the code below. Note that in this method we wrap a multiPar... | Sends a multipart response. Each body part represents a versioned value
of the given key.
@throws IOException
@throws MessagingException | [
"Sends",
"a",
"multipart",
"response",
".",
"Each",
"body",
"part",
"represents",
"a",
"versioned",
"value",
"of",
"the",
"given",
"key",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/GetResponseSender.java#L58-L159 |
161,158 | voldemort/voldemort | src/java/voldemort/server/VoldemortConfig.java | VoldemortConfig.getPublicConfigValue | public String getPublicConfigValue(String key) throws ConfigurationException {
if (!allProps.containsKey(key)) {
throw new UndefinedPropertyException("The requested config key does not exist.");
}
if (restrictedConfigs.contains(key)) {
throw new ConfigurationException("Th... | java | public String getPublicConfigValue(String key) throws ConfigurationException {
if (!allProps.containsKey(key)) {
throw new UndefinedPropertyException("The requested config key does not exist.");
}
if (restrictedConfigs.contains(key)) {
throw new ConfigurationException("Th... | [
"public",
"String",
"getPublicConfigValue",
"(",
"String",
"key",
")",
"throws",
"ConfigurationException",
"{",
"if",
"(",
"!",
"allProps",
".",
"containsKey",
"(",
"key",
")",
")",
"{",
"throw",
"new",
"UndefinedPropertyException",
"(",
"\"The requested config key ... | This is a generic function for retrieving any config value. The returned value
is the one the server is operating with, no matter whether it comes from defaults
or from the user-supplied configuration.
This function only provides access to configs which are deemed safe to share
publicly (i.e.: not security-related con... | [
"This",
"is",
"a",
"generic",
"function",
"for",
"retrieving",
"any",
"config",
"value",
".",
"The",
"returned",
"value",
"is",
"the",
"one",
"the",
"server",
"is",
"operating",
"with",
"no",
"matter",
"whether",
"it",
"comes",
"from",
"defaults",
"or",
"f... | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/server/VoldemortConfig.java#L1171-L1179 |
161,159 | voldemort/voldemort | src/java/voldemort/store/quota/QuotaLimitingStore.java | QuotaLimitingStore.checkRateLimit | private void checkRateLimit(String quotaKey, Tracked trackedOp) {
String quotaValue = null;
try {
if(!metadataStore.getQuotaEnforcingEnabledUnlocked()) {
return;
}
quotaValue = quotaStore.cacheGet(quotaKey);
// Store may not have any quotas... | java | private void checkRateLimit(String quotaKey, Tracked trackedOp) {
String quotaValue = null;
try {
if(!metadataStore.getQuotaEnforcingEnabledUnlocked()) {
return;
}
quotaValue = quotaStore.cacheGet(quotaKey);
// Store may not have any quotas... | [
"private",
"void",
"checkRateLimit",
"(",
"String",
"quotaKey",
",",
"Tracked",
"trackedOp",
")",
"{",
"String",
"quotaValue",
"=",
"null",
";",
"try",
"{",
"if",
"(",
"!",
"metadataStore",
".",
"getQuotaEnforcingEnabledUnlocked",
"(",
")",
")",
"{",
"return",... | Ensure the current throughput levels for the tracked operation does not
exceed set quota limits. Throws an exception if exceeded quota.
@param quotaKey
@param trackedOp | [
"Ensure",
"the",
"current",
"throughput",
"levels",
"for",
"the",
"tracked",
"operation",
"does",
"not",
"exceed",
"set",
"quota",
"limits",
".",
"Throws",
"an",
"exception",
"if",
"exceeded",
"quota",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/quota/QuotaLimitingStore.java#L88-L120 |
161,160 | voldemort/voldemort | src/java/voldemort/server/protocol/admin/AsyncOperationService.java | AsyncOperationService.submitOperation | public synchronized void submitOperation(int requestId, AsyncOperation operation) {
if(this.operations.containsKey(requestId))
throw new VoldemortException("Request " + requestId
+ " already submitted to the system");
this.operations.put(requestId, o... | java | public synchronized void submitOperation(int requestId, AsyncOperation operation) {
if(this.operations.containsKey(requestId))
throw new VoldemortException("Request " + requestId
+ " already submitted to the system");
this.operations.put(requestId, o... | [
"public",
"synchronized",
"void",
"submitOperation",
"(",
"int",
"requestId",
",",
"AsyncOperation",
"operation",
")",
"{",
"if",
"(",
"this",
".",
"operations",
".",
"containsKey",
"(",
"requestId",
")",
")",
"throw",
"new",
"VoldemortException",
"(",
"\"Reques... | Submit a operations. Throw a run time exception if the operations is
already submitted
@param operation The asynchronous operations to submit
@param requestId Id of the request | [
"Submit",
"a",
"operations",
".",
"Throw",
"a",
"run",
"time",
"exception",
"if",
"the",
"operations",
"is",
"already",
"submitted"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/server/protocol/admin/AsyncOperationService.java#L68-L76 |
161,161 | voldemort/voldemort | src/java/voldemort/server/protocol/admin/AsyncOperationService.java | AsyncOperationService.isComplete | public synchronized boolean isComplete(int requestId, boolean remove) {
if (!operations.containsKey(requestId))
throw new VoldemortException("No operation with id " + requestId + " found");
if (operations.get(requestId).getStatus().isComplete()) {
if (logger.isDebugEnabled())
... | java | public synchronized boolean isComplete(int requestId, boolean remove) {
if (!operations.containsKey(requestId))
throw new VoldemortException("No operation with id " + requestId + " found");
if (operations.get(requestId).getStatus().isComplete()) {
if (logger.isDebugEnabled())
... | [
"public",
"synchronized",
"boolean",
"isComplete",
"(",
"int",
"requestId",
",",
"boolean",
"remove",
")",
"{",
"if",
"(",
"!",
"operations",
".",
"containsKey",
"(",
"requestId",
")",
")",
"throw",
"new",
"VoldemortException",
"(",
"\"No operation with id \"",
... | Check if the an operation is done or not.
@param requestId Id of the request
@param remove Whether remove the request out of the list if it is done.
@return True if request is complete, false otherwise | [
"Check",
"if",
"the",
"an",
"operation",
"is",
"done",
"or",
"not",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/server/protocol/admin/AsyncOperationService.java#L85-L100 |
161,162 | voldemort/voldemort | src/java/voldemort/server/protocol/admin/AsyncOperationService.java | AsyncOperationService.getStatus | @JmxOperation(description = "Retrieve operation status")
public String getStatus(int id) {
try {
return getOperationStatus(id).toString();
} catch(VoldemortException e) {
return "No operation with id " + id + " found";
}
} | java | @JmxOperation(description = "Retrieve operation status")
public String getStatus(int id) {
try {
return getOperationStatus(id).toString();
} catch(VoldemortException e) {
return "No operation with id " + id + " found";
}
} | [
"@",
"JmxOperation",
"(",
"description",
"=",
"\"Retrieve operation status\"",
")",
"public",
"String",
"getStatus",
"(",
"int",
"id",
")",
"{",
"try",
"{",
"return",
"getOperationStatus",
"(",
"id",
")",
".",
"toString",
"(",
")",
";",
"}",
"catch",
"(",
... | Wrap getOperationStatus to avoid throwing exception over JMX | [
"Wrap",
"getOperationStatus",
"to",
"avoid",
"throwing",
"exception",
"over",
"JMX"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/server/protocol/admin/AsyncOperationService.java#L110-L117 |
161,163 | voldemort/voldemort | src/java/voldemort/server/protocol/admin/AsyncOperationService.java | AsyncOperationService.getAsyncOperationList | public List<Integer> getAsyncOperationList(boolean showCompleted) {
/**
* Create a copy using an immutable set to avoid a
* {@link java.util.ConcurrentModificationException}
*/
Set<Integer> keySet = ImmutableSet.copyOf(operations.keySet());
if(showCompleted)
... | java | public List<Integer> getAsyncOperationList(boolean showCompleted) {
/**
* Create a copy using an immutable set to avoid a
* {@link java.util.ConcurrentModificationException}
*/
Set<Integer> keySet = ImmutableSet.copyOf(operations.keySet());
if(showCompleted)
... | [
"public",
"List",
"<",
"Integer",
">",
"getAsyncOperationList",
"(",
"boolean",
"showCompleted",
")",
"{",
"/**\n * Create a copy using an immutable set to avoid a\n * {@link java.util.ConcurrentModificationException}\n */",
"Set",
"<",
"Integer",
">",
"keySet... | Get list of asynchronous operations on this node. By default, only the
pending operations are returned.
@param showCompleted Show completed operations
@return A list of operation ids. | [
"Get",
"list",
"of",
"asynchronous",
"operations",
"on",
"this",
"node",
".",
"By",
"default",
"only",
"the",
"pending",
"operations",
"are",
"returned",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/server/protocol/admin/AsyncOperationService.java#L150-L167 |
161,164 | voldemort/voldemort | src/java/voldemort/server/protocol/admin/AsyncOperationService.java | AsyncOperationService.stopAsyncOperation | @JmxOperation
public String stopAsyncOperation(int requestId) {
try {
stopOperation(requestId);
} catch(VoldemortException e) {
return e.getMessage();
}
return "Stopping operation " + requestId;
} | java | @JmxOperation
public String stopAsyncOperation(int requestId) {
try {
stopOperation(requestId);
} catch(VoldemortException e) {
return e.getMessage();
}
return "Stopping operation " + requestId;
} | [
"@",
"JmxOperation",
"public",
"String",
"stopAsyncOperation",
"(",
"int",
"requestId",
")",
"{",
"try",
"{",
"stopOperation",
"(",
"requestId",
")",
";",
"}",
"catch",
"(",
"VoldemortException",
"e",
")",
"{",
"return",
"e",
".",
"getMessage",
"(",
")",
"... | Wrapper to avoid throwing an exception over JMX | [
"Wrapper",
"to",
"avoid",
"throwing",
"an",
"exception",
"over",
"JMX"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/server/protocol/admin/AsyncOperationService.java#L177-L186 |
161,165 | voldemort/voldemort | src/java/voldemort/store/retention/RetentionEnforcingStore.java | RetentionEnforcingStore.updateStoreDefinition | @Override
public void updateStoreDefinition(StoreDefinition storeDef) {
this.storeDef = storeDef;
if(storeDef.hasRetentionPeriod())
this.retentionTimeMs = storeDef.getRetentionDays() * Time.MS_PER_DAY;
} | java | @Override
public void updateStoreDefinition(StoreDefinition storeDef) {
this.storeDef = storeDef;
if(storeDef.hasRetentionPeriod())
this.retentionTimeMs = storeDef.getRetentionDays() * Time.MS_PER_DAY;
} | [
"@",
"Override",
"public",
"void",
"updateStoreDefinition",
"(",
"StoreDefinition",
"storeDef",
")",
"{",
"this",
".",
"storeDef",
"=",
"storeDef",
";",
"if",
"(",
"storeDef",
".",
"hasRetentionPeriod",
"(",
")",
")",
"this",
".",
"retentionTimeMs",
"=",
"stor... | Updates the store definition object and the retention time based on the
updated store definition | [
"Updates",
"the",
"store",
"definition",
"object",
"and",
"the",
"retention",
"time",
"based",
"on",
"the",
"updated",
"store",
"definition"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/retention/RetentionEnforcingStore.java#L51-L56 |
161,166 | voldemort/voldemort | src/java/voldemort/store/retention/RetentionEnforcingStore.java | RetentionEnforcingStore.filterExpiredEntries | private List<Versioned<byte[]>> filterExpiredEntries(ByteArray key, List<Versioned<byte[]>> vals) {
Iterator<Versioned<byte[]>> valsIterator = vals.iterator();
while(valsIterator.hasNext()) {
Versioned<byte[]> val = valsIterator.next();
VectorClock clock = (VectorClock) val.getVe... | java | private List<Versioned<byte[]>> filterExpiredEntries(ByteArray key, List<Versioned<byte[]>> vals) {
Iterator<Versioned<byte[]>> valsIterator = vals.iterator();
while(valsIterator.hasNext()) {
Versioned<byte[]> val = valsIterator.next();
VectorClock clock = (VectorClock) val.getVe... | [
"private",
"List",
"<",
"Versioned",
"<",
"byte",
"[",
"]",
">",
">",
"filterExpiredEntries",
"(",
"ByteArray",
"key",
",",
"List",
"<",
"Versioned",
"<",
"byte",
"[",
"]",
">",
">",
"vals",
")",
"{",
"Iterator",
"<",
"Versioned",
"<",
"byte",
"[",
"... | Performs the filtering of the expired entries based on retention time.
Optionally, deletes them also
@param key the key whose value is to be deleted if needed
@param vals set of values to be filtered out
@return filtered list of values which are currently valid | [
"Performs",
"the",
"filtering",
"of",
"the",
"expired",
"entries",
"based",
"on",
"retention",
"time",
".",
"Optionally",
"deletes",
"them",
"also"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/retention/RetentionEnforcingStore.java#L66-L81 |
161,167 | voldemort/voldemort | src/java/voldemort/store/configuration/FileBackedCachingStorageEngine.java | FileBackedCachingStorageEngine.flushData | private synchronized void flushData() {
BufferedWriter writer = null;
try {
writer = new BufferedWriter(new FileWriter(new File(this.inputPath)));
for(String key: this.metadataMap.keySet()) {
writer.write(NEW_PROPERTY_SEPARATOR + key.toString() + "]" + NEW_LINE);
... | java | private synchronized void flushData() {
BufferedWriter writer = null;
try {
writer = new BufferedWriter(new FileWriter(new File(this.inputPath)));
for(String key: this.metadataMap.keySet()) {
writer.write(NEW_PROPERTY_SEPARATOR + key.toString() + "]" + NEW_LINE);
... | [
"private",
"synchronized",
"void",
"flushData",
"(",
")",
"{",
"BufferedWriter",
"writer",
"=",
"null",
";",
"try",
"{",
"writer",
"=",
"new",
"BufferedWriter",
"(",
"new",
"FileWriter",
"(",
"new",
"File",
"(",
"this",
".",
"inputPath",
")",
")",
")",
"... | Flush the in-memory data to the file | [
"Flush",
"the",
"in",
"-",
"memory",
"data",
"to",
"the",
"file"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/configuration/FileBackedCachingStorageEngine.java#L181-L202 |
161,168 | voldemort/voldemort | src/java/voldemort/rest/RestUtils.java | RestUtils.getSerializedVectorClock | public static String getSerializedVectorClock(VectorClock vc) {
VectorClockWrapper vcWrapper = new VectorClockWrapper(vc);
String serializedVC = "";
try {
serializedVC = mapper.writeValueAsString(vcWrapper);
} catch(Exception e) {
e.printStackTrace();
}
... | java | public static String getSerializedVectorClock(VectorClock vc) {
VectorClockWrapper vcWrapper = new VectorClockWrapper(vc);
String serializedVC = "";
try {
serializedVC = mapper.writeValueAsString(vcWrapper);
} catch(Exception e) {
e.printStackTrace();
}
... | [
"public",
"static",
"String",
"getSerializedVectorClock",
"(",
"VectorClock",
"vc",
")",
"{",
"VectorClockWrapper",
"vcWrapper",
"=",
"new",
"VectorClockWrapper",
"(",
"vc",
")",
";",
"String",
"serializedVC",
"=",
"\"\"",
";",
"try",
"{",
"serializedVC",
"=",
"... | Function to serialize the given Vector clock into a string. If something
goes wrong, it returns an empty string.
@param vc The Vector clock to serialize
@return The string (JSON) version of the specified Vector clock | [
"Function",
"to",
"serialize",
"the",
"given",
"Vector",
"clock",
"into",
"a",
"string",
".",
"If",
"something",
"goes",
"wrong",
"it",
"returns",
"an",
"empty",
"string",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/RestUtils.java#L40-L49 |
161,169 | voldemort/voldemort | src/java/voldemort/rest/RestUtils.java | RestUtils.getSerializedVectorClocks | public static String getSerializedVectorClocks(List<VectorClock> vectorClocks) {
List<VectorClockWrapper> vectorClockWrappers = new ArrayList<VectorClockWrapper>();
for(VectorClock vc: vectorClocks) {
vectorClockWrappers.add(new VectorClockWrapper(vc));
}
String serializedVC ... | java | public static String getSerializedVectorClocks(List<VectorClock> vectorClocks) {
List<VectorClockWrapper> vectorClockWrappers = new ArrayList<VectorClockWrapper>();
for(VectorClock vc: vectorClocks) {
vectorClockWrappers.add(new VectorClockWrapper(vc));
}
String serializedVC ... | [
"public",
"static",
"String",
"getSerializedVectorClocks",
"(",
"List",
"<",
"VectorClock",
">",
"vectorClocks",
")",
"{",
"List",
"<",
"VectorClockWrapper",
">",
"vectorClockWrappers",
"=",
"new",
"ArrayList",
"<",
"VectorClockWrapper",
">",
"(",
")",
";",
"for",... | Function to serialize the given list of Vector clocks into a string. If
something goes wrong, it returns an empty string.
@param vectorClocks The Vector clock list to serialize
@return The string (JSON) version of the specified Vector clock | [
"Function",
"to",
"serialize",
"the",
"given",
"list",
"of",
"Vector",
"clocks",
"into",
"a",
"string",
".",
"If",
"something",
"goes",
"wrong",
"it",
"returns",
"an",
"empty",
"string",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/RestUtils.java#L74-L86 |
161,170 | voldemort/voldemort | src/java/voldemort/rest/RestUtils.java | RestUtils.constructSerializerInfoXml | public static String constructSerializerInfoXml(StoreDefinition storeDefinition) {
Element store = new Element(StoreDefinitionsMapper.STORE_ELMT);
store.addContent(new Element(StoreDefinitionsMapper.STORE_NAME_ELMT).setText(storeDefinition.getName()));
Element keySerializer = new Element(StoreDe... | java | public static String constructSerializerInfoXml(StoreDefinition storeDefinition) {
Element store = new Element(StoreDefinitionsMapper.STORE_ELMT);
store.addContent(new Element(StoreDefinitionsMapper.STORE_NAME_ELMT).setText(storeDefinition.getName()));
Element keySerializer = new Element(StoreDe... | [
"public",
"static",
"String",
"constructSerializerInfoXml",
"(",
"StoreDefinition",
"storeDefinition",
")",
"{",
"Element",
"store",
"=",
"new",
"Element",
"(",
"StoreDefinitionsMapper",
".",
"STORE_ELMT",
")",
";",
"store",
".",
"addContent",
"(",
"new",
"Element",... | Given a storedefinition, constructs the xml string to be sent out in
response to a "schemata" fetch request
@param storeDefinition
@return serialized store definition | [
"Given",
"a",
"storedefinition",
"constructs",
"the",
"xml",
"string",
"to",
"be",
"sent",
"out",
"in",
"response",
"to",
"a",
"schemata",
"fetch",
"request"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/RestUtils.java#L119-L132 |
161,171 | voldemort/voldemort | src/java/voldemort/client/scheduler/AsyncMetadataVersionManager.java | AsyncMetadataVersionManager.updateMetadataVersions | public void updateMetadataVersions() {
Properties versionProps = MetadataVersionStoreUtils.getProperties(this.systemStoreRepository.getMetadataVersionStore());
Long newVersion = fetchNewVersion(SystemStoreConstants.CLUSTER_VERSION_KEY,
null,
... | java | public void updateMetadataVersions() {
Properties versionProps = MetadataVersionStoreUtils.getProperties(this.systemStoreRepository.getMetadataVersionStore());
Long newVersion = fetchNewVersion(SystemStoreConstants.CLUSTER_VERSION_KEY,
null,
... | [
"public",
"void",
"updateMetadataVersions",
"(",
")",
"{",
"Properties",
"versionProps",
"=",
"MetadataVersionStoreUtils",
".",
"getProperties",
"(",
"this",
".",
"systemStoreRepository",
".",
"getMetadataVersionStore",
"(",
")",
")",
";",
"Long",
"newVersion",
"=",
... | Fetch the latest versions for cluster metadata | [
"Fetch",
"the",
"latest",
"versions",
"for",
"cluster",
"metadata"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/client/scheduler/AsyncMetadataVersionManager.java#L203-L211 |
161,172 | voldemort/voldemort | src/java/voldemort/utils/RebalanceUtils.java | RebalanceUtils.validateClusterStores | public static void validateClusterStores(final Cluster cluster,
final List<StoreDefinition> storeDefs) {
// Constructing a StoreRoutingPlan has the (desirable in this
// case) side-effect of verifying that the store definition is congruent
// with the... | java | public static void validateClusterStores(final Cluster cluster,
final List<StoreDefinition> storeDefs) {
// Constructing a StoreRoutingPlan has the (desirable in this
// case) side-effect of verifying that the store definition is congruent
// with the... | [
"public",
"static",
"void",
"validateClusterStores",
"(",
"final",
"Cluster",
"cluster",
",",
"final",
"List",
"<",
"StoreDefinition",
">",
"storeDefs",
")",
"{",
"// Constructing a StoreRoutingPlan has the (desirable in this",
"// case) side-effect of verifying that the store de... | Verify store definitions are congruent with cluster definition.
@param cluster
@param storeDefs | [
"Verify",
"store",
"definitions",
"are",
"congruent",
"with",
"cluster",
"definition",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/RebalanceUtils.java#L76-L86 |
161,173 | voldemort/voldemort | src/java/voldemort/utils/RebalanceUtils.java | RebalanceUtils.validateCurrentFinalCluster | public static void validateCurrentFinalCluster(final Cluster currentCluster,
final Cluster finalCluster) {
validateClusterPartitionCounts(currentCluster, finalCluster);
validateClusterNodeState(currentCluster, finalCluster);
return;
} | java | public static void validateCurrentFinalCluster(final Cluster currentCluster,
final Cluster finalCluster) {
validateClusterPartitionCounts(currentCluster, finalCluster);
validateClusterNodeState(currentCluster, finalCluster);
return;
} | [
"public",
"static",
"void",
"validateCurrentFinalCluster",
"(",
"final",
"Cluster",
"currentCluster",
",",
"final",
"Cluster",
"finalCluster",
")",
"{",
"validateClusterPartitionCounts",
"(",
"currentCluster",
",",
"finalCluster",
")",
";",
"validateClusterNodeState",
"("... | A final cluster ought to be a super set of current cluster. I.e.,
existing node IDs ought to map to same server, but partition layout can
have changed and there may exist new nodes.
@param currentCluster
@param finalCluster | [
"A",
"final",
"cluster",
"ought",
"to",
"be",
"a",
"super",
"set",
"of",
"current",
"cluster",
".",
"I",
".",
"e",
".",
"existing",
"node",
"IDs",
"ought",
"to",
"map",
"to",
"same",
"server",
"but",
"partition",
"layout",
"can",
"have",
"changed",
"an... | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/RebalanceUtils.java#L102-L108 |
161,174 | voldemort/voldemort | src/java/voldemort/utils/RebalanceUtils.java | RebalanceUtils.validateInterimFinalCluster | public static void validateInterimFinalCluster(final Cluster interimCluster,
final Cluster finalCluster) {
validateClusterPartitionCounts(interimCluster, finalCluster);
validateClusterZonesSame(interimCluster, finalCluster);
validateClusterNodeC... | java | public static void validateInterimFinalCluster(final Cluster interimCluster,
final Cluster finalCluster) {
validateClusterPartitionCounts(interimCluster, finalCluster);
validateClusterZonesSame(interimCluster, finalCluster);
validateClusterNodeC... | [
"public",
"static",
"void",
"validateInterimFinalCluster",
"(",
"final",
"Cluster",
"interimCluster",
",",
"final",
"Cluster",
"finalCluster",
")",
"{",
"validateClusterPartitionCounts",
"(",
"interimCluster",
",",
"finalCluster",
")",
";",
"validateClusterZonesSame",
"("... | Interim and final clusters ought to have same partition counts, same
zones, and same node state. Partitions per node may of course differ.
@param interimCluster
@param finalCluster | [
"Interim",
"and",
"final",
"clusters",
"ought",
"to",
"have",
"same",
"partition",
"counts",
"same",
"zones",
"and",
"same",
"node",
"state",
".",
"Partitions",
"per",
"node",
"may",
"of",
"course",
"differ",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/RebalanceUtils.java#L135-L142 |
161,175 | voldemort/voldemort | src/java/voldemort/utils/RebalanceUtils.java | RebalanceUtils.validateClusterPartitionCounts | public static void validateClusterPartitionCounts(final Cluster lhs, final Cluster rhs) {
if(lhs.getNumberOfPartitions() != rhs.getNumberOfPartitions())
throw new VoldemortException("Total number of partitions should be equal [ lhs cluster ("
+ lhs.getNumberO... | java | public static void validateClusterPartitionCounts(final Cluster lhs, final Cluster rhs) {
if(lhs.getNumberOfPartitions() != rhs.getNumberOfPartitions())
throw new VoldemortException("Total number of partitions should be equal [ lhs cluster ("
+ lhs.getNumberO... | [
"public",
"static",
"void",
"validateClusterPartitionCounts",
"(",
"final",
"Cluster",
"lhs",
",",
"final",
"Cluster",
"rhs",
")",
"{",
"if",
"(",
"lhs",
".",
"getNumberOfPartitions",
"(",
")",
"!=",
"rhs",
".",
"getNumberOfPartitions",
"(",
")",
")",
"throw",... | Confirms that both clusters have the same number of total partitions.
@param lhs
@param rhs | [
"Confirms",
"that",
"both",
"clusters",
"have",
"the",
"same",
"number",
"of",
"total",
"partitions",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/RebalanceUtils.java#L150-L156 |
161,176 | voldemort/voldemort | src/java/voldemort/utils/RebalanceUtils.java | RebalanceUtils.validateClusterPartitionState | public static void validateClusterPartitionState(final Cluster subsetCluster,
final Cluster supersetCluster) {
if(!supersetCluster.getNodeIds().containsAll(subsetCluster.getNodeIds())) {
throw new VoldemortException("Superset cluster does not cont... | java | public static void validateClusterPartitionState(final Cluster subsetCluster,
final Cluster supersetCluster) {
if(!supersetCluster.getNodeIds().containsAll(subsetCluster.getNodeIds())) {
throw new VoldemortException("Superset cluster does not cont... | [
"public",
"static",
"void",
"validateClusterPartitionState",
"(",
"final",
"Cluster",
"subsetCluster",
",",
"final",
"Cluster",
"supersetCluster",
")",
"{",
"if",
"(",
"!",
"supersetCluster",
".",
"getNodeIds",
"(",
")",
".",
"containsAll",
"(",
"subsetCluster",
"... | Confirm that all nodes shared between clusters host exact same partition
IDs and that nodes only in the super set cluster have no partition IDs.
@param subsetCluster
@param supersetCluster | [
"Confirm",
"that",
"all",
"nodes",
"shared",
"between",
"clusters",
"host",
"exact",
"same",
"partition",
"IDs",
"and",
"that",
"nodes",
"only",
"in",
"the",
"super",
"set",
"cluster",
"have",
"no",
"partition",
"IDs",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/RebalanceUtils.java#L165-L197 |
161,177 | voldemort/voldemort | src/java/voldemort/utils/RebalanceUtils.java | RebalanceUtils.validateClusterZonesSame | public static void validateClusterZonesSame(final Cluster lhs, final Cluster rhs) {
Set<Zone> lhsSet = new HashSet<Zone>(lhs.getZones());
Set<Zone> rhsSet = new HashSet<Zone>(rhs.getZones());
if(!lhsSet.equals(rhsSet))
throw new VoldemortException("Zones are not the same [ lhs cluste... | java | public static void validateClusterZonesSame(final Cluster lhs, final Cluster rhs) {
Set<Zone> lhsSet = new HashSet<Zone>(lhs.getZones());
Set<Zone> rhsSet = new HashSet<Zone>(rhs.getZones());
if(!lhsSet.equals(rhsSet))
throw new VoldemortException("Zones are not the same [ lhs cluste... | [
"public",
"static",
"void",
"validateClusterZonesSame",
"(",
"final",
"Cluster",
"lhs",
",",
"final",
"Cluster",
"rhs",
")",
"{",
"Set",
"<",
"Zone",
">",
"lhsSet",
"=",
"new",
"HashSet",
"<",
"Zone",
">",
"(",
"lhs",
".",
"getZones",
"(",
")",
")",
";... | Confirms that both clusters have the same set of zones defined.
@param lhs
@param rhs | [
"Confirms",
"that",
"both",
"clusters",
"have",
"the",
"same",
"set",
"of",
"zones",
"defined",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/RebalanceUtils.java#L205-L212 |
161,178 | voldemort/voldemort | src/java/voldemort/utils/RebalanceUtils.java | RebalanceUtils.validateClusterNodeCounts | public static void validateClusterNodeCounts(final Cluster lhs, final Cluster rhs) {
if(!lhs.getNodeIds().equals(rhs.getNodeIds())) {
throw new VoldemortException("Node ids are not the same [ lhs cluster node ids ("
+ lhs.getNodeIds()
... | java | public static void validateClusterNodeCounts(final Cluster lhs, final Cluster rhs) {
if(!lhs.getNodeIds().equals(rhs.getNodeIds())) {
throw new VoldemortException("Node ids are not the same [ lhs cluster node ids ("
+ lhs.getNodeIds()
... | [
"public",
"static",
"void",
"validateClusterNodeCounts",
"(",
"final",
"Cluster",
"lhs",
",",
"final",
"Cluster",
"rhs",
")",
"{",
"if",
"(",
"!",
"lhs",
".",
"getNodeIds",
"(",
")",
".",
"equals",
"(",
"rhs",
".",
"getNodeIds",
"(",
")",
")",
")",
"{"... | Confirms that both clusters have the same number of nodes by comparing
set of node Ids between clusters.
@param lhs
@param rhs | [
"Confirms",
"that",
"both",
"clusters",
"have",
"the",
"same",
"number",
"of",
"nodes",
"by",
"comparing",
"set",
"of",
"node",
"Ids",
"between",
"clusters",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/RebalanceUtils.java#L221-L228 |
161,179 | voldemort/voldemort | src/java/voldemort/utils/RebalanceUtils.java | RebalanceUtils.vacateZone | public static Cluster vacateZone(Cluster currentCluster, int dropZoneId) {
Cluster returnCluster = Cluster.cloneCluster(currentCluster);
// Go over each node in the zone being dropped
for(Integer nodeId: currentCluster.getNodeIdsInZone(dropZoneId)) {
// For each node grab all the par... | java | public static Cluster vacateZone(Cluster currentCluster, int dropZoneId) {
Cluster returnCluster = Cluster.cloneCluster(currentCluster);
// Go over each node in the zone being dropped
for(Integer nodeId: currentCluster.getNodeIdsInZone(dropZoneId)) {
// For each node grab all the par... | [
"public",
"static",
"Cluster",
"vacateZone",
"(",
"Cluster",
"currentCluster",
",",
"int",
"dropZoneId",
")",
"{",
"Cluster",
"returnCluster",
"=",
"Cluster",
".",
"cloneCluster",
"(",
"currentCluster",
")",
";",
"// Go over each node in the zone being dropped",
"for",
... | Given the current cluster and a zone id that needs to be dropped, this
method will remove all partitions from the zone that is being dropped and
move it to the existing zones. The partitions are moved intelligently so
as not to avoid any data movement in the existing zones.
This is achieved by moving the partitions to... | [
"Given",
"the",
"current",
"cluster",
"and",
"a",
"zone",
"id",
"that",
"needs",
"to",
"be",
"dropped",
"this",
"method",
"will",
"remove",
"all",
"partitions",
"from",
"the",
"zone",
"that",
"is",
"being",
"dropped",
"and",
"move",
"it",
"to",
"the",
"e... | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/RebalanceUtils.java#L295-L325 |
161,180 | voldemort/voldemort | src/java/voldemort/utils/RebalanceUtils.java | RebalanceUtils.dropZone | public static Cluster dropZone(Cluster intermediateCluster, int dropZoneId) {
// Filter out nodes that don't belong to the zone being dropped
Set<Node> survivingNodes = new HashSet<Node>();
for(int nodeId: intermediateCluster.getNodeIds()) {
if(intermediateCluster.getNodeById(nodeId)... | java | public static Cluster dropZone(Cluster intermediateCluster, int dropZoneId) {
// Filter out nodes that don't belong to the zone being dropped
Set<Node> survivingNodes = new HashSet<Node>();
for(int nodeId: intermediateCluster.getNodeIds()) {
if(intermediateCluster.getNodeById(nodeId)... | [
"public",
"static",
"Cluster",
"dropZone",
"(",
"Cluster",
"intermediateCluster",
",",
"int",
"dropZoneId",
")",
"{",
"// Filter out nodes that don't belong to the zone being dropped",
"Set",
"<",
"Node",
">",
"survivingNodes",
"=",
"new",
"HashSet",
"<",
"Node",
">",
... | Given a interim cluster with a previously vacated zone, constructs a new
cluster object with the drop zone completely removed
@param intermediateCluster
@param dropZoneId
@return adjusted cluster with the zone dropped | [
"Given",
"a",
"interim",
"cluster",
"with",
"a",
"previously",
"vacated",
"zone",
"constructs",
"a",
"new",
"cluster",
"object",
"with",
"the",
"drop",
"zone",
"completely",
"removed"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/RebalanceUtils.java#L335-L359 |
161,181 | voldemort/voldemort | src/java/voldemort/utils/RebalanceUtils.java | RebalanceUtils.getStolenPrimaryPartitions | public static List<Integer> getStolenPrimaryPartitions(final Cluster currentCluster,
final Cluster finalCluster,
final int stealNodeId) {
List<Integer> finalList = new ArrayList<Integer>(finalCl... | java | public static List<Integer> getStolenPrimaryPartitions(final Cluster currentCluster,
final Cluster finalCluster,
final int stealNodeId) {
List<Integer> finalList = new ArrayList<Integer>(finalCl... | [
"public",
"static",
"List",
"<",
"Integer",
">",
"getStolenPrimaryPartitions",
"(",
"final",
"Cluster",
"currentCluster",
",",
"final",
"Cluster",
"finalCluster",
",",
"final",
"int",
"stealNodeId",
")",
"{",
"List",
"<",
"Integer",
">",
"finalList",
"=",
"new",... | For a particular stealer node find all the primary partitions tuples it
will steal.
@param currentCluster The cluster definition of the existing cluster
@param finalCluster The final cluster definition
@param stealNodeId Node id of the stealer node
@return Returns a list of primary partitions which this stealer node w... | [
"For",
"a",
"particular",
"stealer",
"node",
"find",
"all",
"the",
"primary",
"partitions",
"tuples",
"it",
"will",
"steal",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/RebalanceUtils.java#L425-L443 |
161,182 | voldemort/voldemort | src/java/voldemort/utils/RebalanceUtils.java | RebalanceUtils.validateRebalanceStore | public static List<StoreDefinition> validateRebalanceStore(List<StoreDefinition> storeDefList) {
List<StoreDefinition> returnList = new ArrayList<StoreDefinition>(storeDefList.size());
for(StoreDefinition def: storeDefList) {
if(!def.isView() && !canRebalanceList.contains(def.getType())) {
... | java | public static List<StoreDefinition> validateRebalanceStore(List<StoreDefinition> storeDefList) {
List<StoreDefinition> returnList = new ArrayList<StoreDefinition>(storeDefList.size());
for(StoreDefinition def: storeDefList) {
if(!def.isView() && !canRebalanceList.contains(def.getType())) {
... | [
"public",
"static",
"List",
"<",
"StoreDefinition",
">",
"validateRebalanceStore",
"(",
"List",
"<",
"StoreDefinition",
">",
"storeDefList",
")",
"{",
"List",
"<",
"StoreDefinition",
">",
"returnList",
"=",
"new",
"ArrayList",
"<",
"StoreDefinition",
">",
"(",
"... | Given a list of store definitions, makes sure that rebalance supports all
of them. If not it throws an error.
@param storeDefList List of store definitions
@return Filtered list of store definitions which rebalancing supports | [
"Given",
"a",
"list",
"of",
"store",
"definitions",
"makes",
"sure",
"that",
"rebalance",
"supports",
"all",
"of",
"them",
".",
"If",
"not",
"it",
"throws",
"an",
"error",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/RebalanceUtils.java#L490-L504 |
161,183 | voldemort/voldemort | src/java/voldemort/utils/RebalanceUtils.java | RebalanceUtils.dumpClusters | public static void dumpClusters(Cluster currentCluster,
Cluster finalCluster,
String outputDirName,
String filePrefix) {
dumpClusterToFile(outputDirName, filePrefix + currentClusterFileName, currentCluste... | java | public static void dumpClusters(Cluster currentCluster,
Cluster finalCluster,
String outputDirName,
String filePrefix) {
dumpClusterToFile(outputDirName, filePrefix + currentClusterFileName, currentCluste... | [
"public",
"static",
"void",
"dumpClusters",
"(",
"Cluster",
"currentCluster",
",",
"Cluster",
"finalCluster",
",",
"String",
"outputDirName",
",",
"String",
"filePrefix",
")",
"{",
"dumpClusterToFile",
"(",
"outputDirName",
",",
"filePrefix",
"+",
"currentClusterFileN... | Given the initial and final cluster dumps it into the output directory
@param currentCluster Initial cluster metadata
@param finalCluster Final cluster metadata
@param outputDirName Output directory where to dump this file
@param filePrefix String to prepend to the initial & final cluster
metadata files
@throws IOExce... | [
"Given",
"the",
"initial",
"and",
"final",
"cluster",
"dumps",
"it",
"into",
"the",
"output",
"directory"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/RebalanceUtils.java#L516-L522 |
161,184 | voldemort/voldemort | src/java/voldemort/utils/RebalanceUtils.java | RebalanceUtils.dumpClusters | public static void dumpClusters(Cluster currentCluster,
Cluster finalCluster,
String outputDirName) {
dumpClusters(currentCluster, finalCluster, outputDirName, "");
} | java | public static void dumpClusters(Cluster currentCluster,
Cluster finalCluster,
String outputDirName) {
dumpClusters(currentCluster, finalCluster, outputDirName, "");
} | [
"public",
"static",
"void",
"dumpClusters",
"(",
"Cluster",
"currentCluster",
",",
"Cluster",
"finalCluster",
",",
"String",
"outputDirName",
")",
"{",
"dumpClusters",
"(",
"currentCluster",
",",
"finalCluster",
",",
"outputDirName",
",",
"\"\"",
")",
";",
"}"
] | Given the current and final cluster dumps it into the output directory
@param currentCluster Initial cluster metadata
@param finalCluster Final cluster metadata
@param outputDirName Output directory where to dump this file
@throws IOException | [
"Given",
"the",
"current",
"and",
"final",
"cluster",
"dumps",
"it",
"into",
"the",
"output",
"directory"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/RebalanceUtils.java#L532-L536 |
161,185 | voldemort/voldemort | src/java/voldemort/utils/RebalanceUtils.java | RebalanceUtils.dumpClusterToFile | public static void dumpClusterToFile(String outputDirName, String fileName, Cluster cluster) {
if(outputDirName != null) {
File outputDir = new File(outputDirName);
if(!outputDir.exists()) {
Utils.mkdirs(outputDir);
}
try {
FileUt... | java | public static void dumpClusterToFile(String outputDirName, String fileName, Cluster cluster) {
if(outputDirName != null) {
File outputDir = new File(outputDirName);
if(!outputDir.exists()) {
Utils.mkdirs(outputDir);
}
try {
FileUt... | [
"public",
"static",
"void",
"dumpClusterToFile",
"(",
"String",
"outputDirName",
",",
"String",
"fileName",
",",
"Cluster",
"cluster",
")",
"{",
"if",
"(",
"outputDirName",
"!=",
"null",
")",
"{",
"File",
"outputDir",
"=",
"new",
"File",
"(",
"outputDirName",
... | Prints a cluster xml to a file.
@param outputDirName
@param fileName
@param cluster | [
"Prints",
"a",
"cluster",
"xml",
"to",
"a",
"file",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/RebalanceUtils.java#L545-L560 |
161,186 | voldemort/voldemort | src/java/voldemort/utils/RebalanceUtils.java | RebalanceUtils.dumpStoreDefsToFile | public static void dumpStoreDefsToFile(String outputDirName,
String fileName,
List<StoreDefinition> storeDefs) {
if(outputDirName != null) {
File outputDir = new File(outputDirName);
if(!outputDir.exis... | java | public static void dumpStoreDefsToFile(String outputDirName,
String fileName,
List<StoreDefinition> storeDefs) {
if(outputDirName != null) {
File outputDir = new File(outputDirName);
if(!outputDir.exis... | [
"public",
"static",
"void",
"dumpStoreDefsToFile",
"(",
"String",
"outputDirName",
",",
"String",
"fileName",
",",
"List",
"<",
"StoreDefinition",
">",
"storeDefs",
")",
"{",
"if",
"(",
"outputDirName",
"!=",
"null",
")",
"{",
"File",
"outputDir",
"=",
"new",
... | Prints a stores xml to a file.
@param outputDirName
@param fileName
@param list of storeDefs | [
"Prints",
"a",
"stores",
"xml",
"to",
"a",
"file",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/RebalanceUtils.java#L569-L586 |
161,187 | voldemort/voldemort | src/java/voldemort/utils/RebalanceUtils.java | RebalanceUtils.dumpAnalysisToFile | public static void dumpAnalysisToFile(String outputDirName,
String baseFileName,
PartitionBalance partitionBalance) {
if(outputDirName != null) {
File outputDir = new File(outputDirName);
if(!outputDir.ex... | java | public static void dumpAnalysisToFile(String outputDirName,
String baseFileName,
PartitionBalance partitionBalance) {
if(outputDirName != null) {
File outputDir = new File(outputDirName);
if(!outputDir.ex... | [
"public",
"static",
"void",
"dumpAnalysisToFile",
"(",
"String",
"outputDirName",
",",
"String",
"baseFileName",
",",
"PartitionBalance",
"partitionBalance",
")",
"{",
"if",
"(",
"outputDirName",
"!=",
"null",
")",
"{",
"File",
"outputDir",
"=",
"new",
"File",
"... | Prints a balance analysis to a file.
@param outputDirName
@param baseFileName suffix '.analysis' is appended to baseFileName.
@param partitionBalance | [
"Prints",
"a",
"balance",
"analysis",
"to",
"a",
"file",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/RebalanceUtils.java#L595-L611 |
161,188 | voldemort/voldemort | src/java/voldemort/utils/RebalanceUtils.java | RebalanceUtils.dumpPlanToFile | public static void dumpPlanToFile(String outputDirName, RebalancePlan plan) {
if(outputDirName != null) {
File outputDir = new File(outputDirName);
if(!outputDir.exists()) {
Utils.mkdirs(outputDir);
}
try {
FileUtils.writeStringToFi... | java | public static void dumpPlanToFile(String outputDirName, RebalancePlan plan) {
if(outputDirName != null) {
File outputDir = new File(outputDirName);
if(!outputDir.exists()) {
Utils.mkdirs(outputDir);
}
try {
FileUtils.writeStringToFi... | [
"public",
"static",
"void",
"dumpPlanToFile",
"(",
"String",
"outputDirName",
",",
"RebalancePlan",
"plan",
")",
"{",
"if",
"(",
"outputDirName",
"!=",
"null",
")",
"{",
"File",
"outputDir",
"=",
"new",
"File",
"(",
"outputDirName",
")",
";",
"if",
"(",
"!... | Prints the plan to a file.
@param outputDirName
@param plan | [
"Prints",
"the",
"plan",
"to",
"a",
"file",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/RebalanceUtils.java#L619-L631 |
161,189 | voldemort/voldemort | src/java/voldemort/utils/RebalanceUtils.java | RebalanceUtils.filterTaskPlanWithStores | public static List<RebalanceTaskInfo> filterTaskPlanWithStores(List<RebalanceTaskInfo> existingPlanList,
List<StoreDefinition> storeDefs) {
List<RebalanceTaskInfo> plans = Lists.newArrayList();
List<String> storeNames = StoreDefinitionUt... | java | public static List<RebalanceTaskInfo> filterTaskPlanWithStores(List<RebalanceTaskInfo> existingPlanList,
List<StoreDefinition> storeDefs) {
List<RebalanceTaskInfo> plans = Lists.newArrayList();
List<String> storeNames = StoreDefinitionUt... | [
"public",
"static",
"List",
"<",
"RebalanceTaskInfo",
">",
"filterTaskPlanWithStores",
"(",
"List",
"<",
"RebalanceTaskInfo",
">",
"existingPlanList",
",",
"List",
"<",
"StoreDefinition",
">",
"storeDefs",
")",
"{",
"List",
"<",
"RebalanceTaskInfo",
">",
"plans",
... | Given a list of partition plans and a set of stores, copies the store
names to every individual plan and creates a new list
@param existingPlanList Existing partition plan list
@param storeDefs List of store names we are rebalancing
@return List of updated partition plan | [
"Given",
"a",
"list",
"of",
"partition",
"plans",
"and",
"a",
"set",
"of",
"stores",
"copies",
"the",
"store",
"names",
"to",
"every",
"individual",
"plan",
"and",
"creates",
"a",
"new",
"list"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/RebalanceUtils.java#L649-L669 |
161,190 | voldemort/voldemort | src/java/voldemort/utils/RebalanceUtils.java | RebalanceUtils.executorShutDown | public static void executorShutDown(ExecutorService executorService, long timeOutSec) {
try {
executorService.shutdown();
executorService.awaitTermination(timeOutSec, TimeUnit.SECONDS);
} catch(Exception e) {
logger.warn("Error while stoping executor service.", e);
... | java | public static void executorShutDown(ExecutorService executorService, long timeOutSec) {
try {
executorService.shutdown();
executorService.awaitTermination(timeOutSec, TimeUnit.SECONDS);
} catch(Exception e) {
logger.warn("Error while stoping executor service.", e);
... | [
"public",
"static",
"void",
"executorShutDown",
"(",
"ExecutorService",
"executorService",
",",
"long",
"timeOutSec",
")",
"{",
"try",
"{",
"executorService",
".",
"shutdown",
"(",
")",
";",
"executorService",
".",
"awaitTermination",
"(",
"timeOutSec",
",",
"Time... | Wait to shutdown service
@param executorService Executor service to shutdown
@param timeOutSec Time we wait for | [
"Wait",
"to",
"shutdown",
"service"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/RebalanceUtils.java#L704-L711 |
161,191 | voldemort/voldemort | src/java/voldemort/versioning/ArbitraryInconsistencyResolver.java | ArbitraryInconsistencyResolver.resolveConflicts | public List<T> resolveConflicts(List<T> values) {
if(values.size() > 1)
return values;
else
return Collections.singletonList(values.get(0));
} | java | public List<T> resolveConflicts(List<T> values) {
if(values.size() > 1)
return values;
else
return Collections.singletonList(values.get(0));
} | [
"public",
"List",
"<",
"T",
">",
"resolveConflicts",
"(",
"List",
"<",
"T",
">",
"values",
")",
"{",
"if",
"(",
"values",
".",
"size",
"(",
")",
">",
"1",
")",
"return",
"values",
";",
"else",
"return",
"Collections",
".",
"singletonList",
"(",
"valu... | Arbitrarily resolve the inconsistency by choosing the first object if
there is one.
@param values The list of objects
@return A single value, if one exists, taken from the input list. | [
"Arbitrarily",
"resolve",
"the",
"inconsistency",
"by",
"choosing",
"the",
"first",
"object",
"if",
"there",
"is",
"one",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/versioning/ArbitraryInconsistencyResolver.java#L37-L42 |
161,192 | voldemort/voldemort | src/java/voldemort/store/StoreUtils.java | StoreUtils.get | public static <K, V, T> List<Versioned<V>> get(Store<K, V, T> storageEngine, K key, T transform) {
Map<K, List<Versioned<V>>> result = storageEngine.getAll(Collections.singleton(key),
Collections.singletonMap(key,
... | java | public static <K, V, T> List<Versioned<V>> get(Store<K, V, T> storageEngine, K key, T transform) {
Map<K, List<Versioned<V>>> result = storageEngine.getAll(Collections.singleton(key),
Collections.singletonMap(key,
... | [
"public",
"static",
"<",
"K",
",",
"V",
",",
"T",
">",
"List",
"<",
"Versioned",
"<",
"V",
">",
">",
"get",
"(",
"Store",
"<",
"K",
",",
"V",
",",
"T",
">",
"storageEngine",
",",
"K",
"key",
",",
"T",
"transform",
")",
"{",
"Map",
"<",
"K",
... | Implements get by delegating to getAll. | [
"Implements",
"get",
"by",
"delegating",
"to",
"getAll",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/StoreUtils.java#L68-L76 |
161,193 | voldemort/voldemort | src/java/voldemort/store/StoreUtils.java | StoreUtils.getAll | public static <K, V, T> Map<K, List<Versioned<V>>> getAll(Store<K, V, T> storageEngine,
Iterable<K> keys,
Map<K, T> transforms) {
Map<K, List<Versioned<V>>> result = newEmptyHashMap(keys);... | java | public static <K, V, T> Map<K, List<Versioned<V>>> getAll(Store<K, V, T> storageEngine,
Iterable<K> keys,
Map<K, T> transforms) {
Map<K, List<Versioned<V>>> result = newEmptyHashMap(keys);... | [
"public",
"static",
"<",
"K",
",",
"V",
",",
"T",
">",
"Map",
"<",
"K",
",",
"List",
"<",
"Versioned",
"<",
"V",
">",
">",
">",
"getAll",
"(",
"Store",
"<",
"K",
",",
"V",
",",
"T",
">",
"storageEngine",
",",
"Iterable",
"<",
"K",
">",
"keys"... | Implements getAll by delegating to get. | [
"Implements",
"getAll",
"by",
"delegating",
"to",
"get",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/StoreUtils.java#L81-L93 |
161,194 | voldemort/voldemort | src/java/voldemort/store/StoreUtils.java | StoreUtils.newEmptyHashMap | public static <K, V> HashMap<K, V> newEmptyHashMap(Iterable<?> iterable) {
if(iterable instanceof Collection<?>)
return Maps.newHashMapWithExpectedSize(((Collection<?>) iterable).size());
return Maps.newHashMap();
} | java | public static <K, V> HashMap<K, V> newEmptyHashMap(Iterable<?> iterable) {
if(iterable instanceof Collection<?>)
return Maps.newHashMapWithExpectedSize(((Collection<?>) iterable).size());
return Maps.newHashMap();
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"HashMap",
"<",
"K",
",",
"V",
">",
"newEmptyHashMap",
"(",
"Iterable",
"<",
"?",
">",
"iterable",
")",
"{",
"if",
"(",
"iterable",
"instanceof",
"Collection",
"<",
"?",
">",
")",
"return",
"Maps",
".",
... | Returns an empty map with expected size matching the iterable size if
it's of type Collection. Otherwise, an empty map with the default size is
returned. | [
"Returns",
"an",
"empty",
"map",
"with",
"expected",
"size",
"matching",
"the",
"iterable",
"size",
"if",
"it",
"s",
"of",
"type",
"Collection",
".",
"Otherwise",
"an",
"empty",
"map",
"with",
"the",
"default",
"size",
"is",
"returned",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/StoreUtils.java#L100-L104 |
161,195 | voldemort/voldemort | src/java/voldemort/store/StoreUtils.java | StoreUtils.assertValidMetadata | public static void assertValidMetadata(ByteArray key,
RoutingStrategy routingStrategy,
Node currentNode) {
List<Node> nodes = routingStrategy.routeRequest(key.get());
for(Node node: nodes) {
if(node.getId()... | java | public static void assertValidMetadata(ByteArray key,
RoutingStrategy routingStrategy,
Node currentNode) {
List<Node> nodes = routingStrategy.routeRequest(key.get());
for(Node node: nodes) {
if(node.getId()... | [
"public",
"static",
"void",
"assertValidMetadata",
"(",
"ByteArray",
"key",
",",
"RoutingStrategy",
"routingStrategy",
",",
"Node",
"currentNode",
")",
"{",
"List",
"<",
"Node",
">",
"nodes",
"=",
"routingStrategy",
".",
"routeRequest",
"(",
"key",
".",
"get",
... | Check if the current node is part of routing request based on cluster.xml
or throw an exception.
@param key The key we are checking
@param routingStrategy The routing strategy
@param currentNode Current node | [
"Check",
"if",
"the",
"current",
"node",
"is",
"part",
"of",
"routing",
"request",
"based",
"on",
"cluster",
".",
"xml",
"or",
"throw",
"an",
"exception",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/StoreUtils.java#L133-L146 |
161,196 | voldemort/voldemort | src/java/voldemort/store/StoreUtils.java | StoreUtils.assertValidNode | public static void assertValidNode(MetadataStore metadataStore, Integer nodeId) {
if(!metadataStore.getCluster().hasNodeWithId(nodeId)) {
throw new InvalidMetadataException("NodeId " + nodeId + " is not or no longer in this cluster");
}
} | java | public static void assertValidNode(MetadataStore metadataStore, Integer nodeId) {
if(!metadataStore.getCluster().hasNodeWithId(nodeId)) {
throw new InvalidMetadataException("NodeId " + nodeId + " is not or no longer in this cluster");
}
} | [
"public",
"static",
"void",
"assertValidNode",
"(",
"MetadataStore",
"metadataStore",
",",
"Integer",
"nodeId",
")",
"{",
"if",
"(",
"!",
"metadataStore",
".",
"getCluster",
"(",
")",
".",
"hasNodeWithId",
"(",
"nodeId",
")",
")",
"{",
"throw",
"new",
"Inval... | Check if the the nodeId is present in the cluster managed by the metadata store
or throw an exception.
@param nodeId The nodeId to check existence of | [
"Check",
"if",
"the",
"the",
"nodeId",
"is",
"present",
"in",
"the",
"cluster",
"managed",
"by",
"the",
"metadata",
"store",
"or",
"throw",
"an",
"exception",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/StoreUtils.java#L154-L158 |
161,197 | voldemort/voldemort | src/java/voldemort/store/StoreUtils.java | StoreUtils.unsafeGetSerializer | @SuppressWarnings("unchecked")
public static <T> Serializer<T> unsafeGetSerializer(SerializerFactory serializerFactory,
SerializerDefinition serializerDefinition) {
return (Serializer<T>) serializerFactory.getSerializer(serializerDefinition);
} | java | @SuppressWarnings("unchecked")
public static <T> Serializer<T> unsafeGetSerializer(SerializerFactory serializerFactory,
SerializerDefinition serializerDefinition) {
return (Serializer<T>) serializerFactory.getSerializer(serializerDefinition);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"Serializer",
"<",
"T",
">",
"unsafeGetSerializer",
"(",
"SerializerFactory",
"serializerFactory",
",",
"SerializerDefinition",
"serializerDefinition",
")",
"{",
"return",
"(",
"S... | This is a temporary measure until we have a type-safe solution for
retrieving serializers from a SerializerFactory. It avoids warnings all
over the codebase while making it easy to verify who calls it. | [
"This",
"is",
"a",
"temporary",
"measure",
"until",
"we",
"have",
"a",
"type",
"-",
"safe",
"solution",
"for",
"retrieving",
"serializers",
"from",
"a",
"SerializerFactory",
".",
"It",
"avoids",
"warnings",
"all",
"over",
"the",
"codebase",
"while",
"making",
... | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/StoreUtils.java#L197-L201 |
161,198 | voldemort/voldemort | src/java/voldemort/store/StoreUtils.java | StoreUtils.getStoreDef | public static StoreDefinition getStoreDef(List<StoreDefinition> list, String name) {
for(StoreDefinition def: list)
if(def.getName().equals(name))
return def;
return null;
} | java | public static StoreDefinition getStoreDef(List<StoreDefinition> list, String name) {
for(StoreDefinition def: list)
if(def.getName().equals(name))
return def;
return null;
} | [
"public",
"static",
"StoreDefinition",
"getStoreDef",
"(",
"List",
"<",
"StoreDefinition",
">",
"list",
",",
"String",
"name",
")",
"{",
"for",
"(",
"StoreDefinition",
"def",
":",
"list",
")",
"if",
"(",
"def",
".",
"getName",
"(",
")",
".",
"equals",
"(... | Get a store definition from the given list of store definitions
@param list A list of store definitions
@param name The name of the store
@return The store definition | [
"Get",
"a",
"store",
"definition",
"from",
"the",
"given",
"list",
"of",
"store",
"definitions"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/StoreUtils.java#L210-L215 |
161,199 | voldemort/voldemort | src/java/voldemort/store/StoreUtils.java | StoreUtils.getStoreNames | public static List<String> getStoreNames(List<StoreDefinition> list, boolean ignoreViews) {
List<String> storeNameSet = new ArrayList<String>();
for(StoreDefinition def: list)
if(!def.isView() || !ignoreViews)
storeNameSet.add(def.getName());
return storeNameSet;
... | java | public static List<String> getStoreNames(List<StoreDefinition> list, boolean ignoreViews) {
List<String> storeNameSet = new ArrayList<String>();
for(StoreDefinition def: list)
if(!def.isView() || !ignoreViews)
storeNameSet.add(def.getName());
return storeNameSet;
... | [
"public",
"static",
"List",
"<",
"String",
">",
"getStoreNames",
"(",
"List",
"<",
"StoreDefinition",
">",
"list",
",",
"boolean",
"ignoreViews",
")",
"{",
"List",
"<",
"String",
">",
"storeNameSet",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
... | Get the list of store names from a list of store definitions
@param list
@param ignoreViews
@return list of store names | [
"Get",
"the",
"list",
"of",
"store",
"names",
"from",
"a",
"list",
"of",
"store",
"definitions"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/StoreUtils.java#L224-L230 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.