This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package voldemort; | |
import java.io.File; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.util.Collections; | |
import java.util.List; | |
import voldemort.client.rebalance.RebalanceClusterPlan; | |
import voldemort.cluster.Cluster; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void testIssue311() { | |
List<Node> nodes = Lists.newArrayList(); | |
nodes.add(new Node(0, "localhost", 1, 2, 3, Lists.newArrayList(0, 3, 6))); | |
nodes.add(new Node(1, "localhost", 1, 2, 3, Lists.newArrayList(1, 4, 7))); | |
nodes.add(new Node(2, "localhost", 1, 2, 3, Lists.newArrayList(2, 5, 8))); | |
List<Node> newNodes = Lists.newArrayList(); | |
newNodes.add(new Node(0, "localhost", 1, 2, 3, Lists.newArrayList(0, 3, 6))); | |
newNodes.add(new Node(1, "localhost", 1, 2, 3, Lists.newArrayList(4, 7))); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright 2008-2010 LinkedIn, Inc | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); you may not | |
* use this file except in compliance with the License. You may obtain a copy of | |
* the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package voldemort.utils; | |
import java.io.File; | |
import java.io.IOException; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Set; | |
import joptsimple.OptionParser; | |
import joptsimple.OptionSet; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package voldemort; | |
import java.io.File; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.util.Collections; | |
import java.util.List; | |
import voldemort.cluster.Cluster; | |
import voldemort.cluster.Node; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package voldemort.client.rebalance; | |
import java.util.ArrayList; | |
import java.util.Collection; | |
import java.util.Collections; | |
import java.util.HashMap; | |
import java.util.HashSet; | |
import java.util.Iterator; | |
import java.util.LinkedHashMap; | |
import java.util.List; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void testPutDeleteZoneRouting() throws Exception { | |
cluster = VoldemortTestConstants.getEightNodeClusterWithZones(); | |
HashMap<Integer, Integer> zoneReplicationFactor = Maps.newHashMap(); | |
zoneReplicationFactor.put(0, 2); | |
zoneReplicationFactor.put(1, 2); | |
Versioned<byte[]> versioned = new Versioned<byte[]>(new byte[] { 1 }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package voldemort.utils; | |
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.util.HashMap; | |
import java.util.Iterator; | |
import java.util.List; | |
import java.util.Set; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void invokeUpdateClusterMetadata() { | |
Versioned<Cluster> latestCluster = new Versioned<Cluster>(adminClient.getAdminClientCluster()); | |
List<Integer> requiredNodeIds = new ArrayList<Integer>(); | |
ArrayList<Versioned<Cluster>> clusterList = new ArrayList<Versioned<Cluster>>(); | |
clusterList.add(latestCluster); | |
boolean sameCluster = true; | |
for(Node node: adminClient.getAdminClientCluster().getNodes()) { | |
requiredNodeIds.add(node.getId()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
num, [k_size, v_size , k , v ]* | |
key iterator => read k_size and v_size at once, jump by 8 bytes, read key [ 2 reads, no jumps ] | |
value iterator => read k_size and v_size at once, jump by 8 bytes, read key + value at once [ 2 reads ] | |
full entry => read (k_size + v_size ), jump by 8 bytes, read key + value at once [ 2 reads ] | |
Vs | |
num, [k_size, k, v_size, v]* |