Skip to content

Commit

Permalink
change maxRecords to recordsPerPartition in fetch API and protobuf
Browse files Browse the repository at this point in the history
These are cosmetic changes. The client-side and server-side code does not properly do recordsPerPartition yet.

Added a few TODOs in the code too.
  • Loading branch information
jayjwylie committed Mar 20, 2013
1 parent a2d9ebb commit 5aca5c0
Show file tree
Hide file tree
Showing 10 changed files with 254 additions and 233 deletions.
20 changes: 10 additions & 10 deletions src/java/voldemort/client/protocol/admin/AdminClient.java
Expand Up @@ -1444,7 +1444,7 @@ private void initiateFetchRequest(DataOutputStream outputStream,
boolean fetchValues,
boolean fetchMasterEntries,
Cluster initialCluster,
long maxRecords) throws IOException {
long recordsPerPartition) throws IOException {
HashMap<Integer, List<Integer>> filteredReplicaToPartitionList = Maps.newHashMap();
if(fetchMasterEntries) {
if(!replicaToPartitionList.containsKey(0)) {
Expand All @@ -1459,7 +1459,7 @@ private void initiateFetchRequest(DataOutputStream outputStream,
.setFetchValues(fetchValues)
.addAllReplicaToPartition(ProtoUtils.encodePartitionTuple(filteredReplicaToPartitionList))
.setStore(storeName)
.setMaxRecords(maxRecords);
.setRecordsPerPartition(recordsPerPartition);

try {
if(filter != null) {
Expand Down Expand Up @@ -1582,14 +1582,14 @@ public Iterator<Pair<ByteArray, Versioned<byte[]>>> fetchEntries(int nodeId,
List<Integer> partitionList,
VoldemortFilter filter,
boolean fetchMasterEntries,
long maxRecords) {
long recordsPerPartition) {
return fetchEntries(nodeId,
storeName,
helperOps.getReplicaToPartitionMap(nodeId, storeName, partitionList),
filter,
fetchMasterEntries,
null,
maxRecords);
recordsPerPartition);
}

/**
Expand Down Expand Up @@ -1656,7 +1656,7 @@ public Iterator<Pair<ByteArray, Versioned<byte[]>>> fetchEntries(int nodeId,
VoldemortFilter filter,
boolean fetchMasterEntries,
Cluster initialCluster,
long maxRecords) {
long recordsPerPartition) {

Node node = AdminClient.this.getAdminClientCluster().getNodeById(nodeId);
final SocketDestination destination = new SocketDestination(node.getHost(),
Expand All @@ -1674,7 +1674,7 @@ public Iterator<Pair<ByteArray, Versioned<byte[]>>> fetchEntries(int nodeId,
true,
fetchMasterEntries,
initialCluster,
maxRecords);
recordsPerPartition);
} catch(IOException e) {
helperOps.close(sands.getSocket());
socketPool.checkin(destination, sands);
Expand Down Expand Up @@ -1800,14 +1800,14 @@ public Iterator<ByteArray> fetchKeys(int nodeId,
List<Integer> partitionList,
VoldemortFilter filter,
boolean fetchMasterEntries,
long maxRecords) {
long recordsPerPartition) {
return fetchKeys(nodeId,
storeName,
helperOps.getReplicaToPartitionMap(nodeId, storeName, partitionList),
filter,
fetchMasterEntries,
null,
maxRecords);
recordsPerPartition);
}

/**
Expand Down Expand Up @@ -1852,7 +1852,7 @@ public Iterator<ByteArray> fetchKeys(int nodeId,
VoldemortFilter filter,
boolean fetchMasterEntries,
Cluster initialCluster,
long maxRecords) {
long recordsPerPartition) {
Node node = AdminClient.this.getAdminClientCluster().getNodeById(nodeId);
final SocketDestination destination = new SocketDestination(node.getHost(),
node.getAdminPort(),
Expand All @@ -1869,7 +1869,7 @@ public Iterator<ByteArray> fetchKeys(int nodeId,
false,
fetchMasterEntries,
initialCluster,
maxRecords);
recordsPerPartition);
} catch(IOException e) {
helperOps.close(sands.getSocket());
socketPool.checkin(destination, sands);
Expand Down

0 comments on commit 5aca5c0

Please sign in to comment.