Permalink
Browse files

Added Entropy Detection

  • Loading branch information...
rsumbaly authored and afeinberg committed Oct 18, 2010
1 parent 8bdfa83 commit 47a002ee544926ac9e29731491b31de78d114d3a

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -288,12 +288,14 @@ private void initiateFetchRequest(DataOutputStream outputStream,
List<Integer> partitionList,
VoldemortFilter filter,
boolean fetchValues,
- boolean fetchMasterEntries) throws IOException {
+ boolean fetchMasterEntries,
+ long skipRecords) throws IOException {
VAdminProto.FetchPartitionEntriesRequest.Builder fetchRequest = VAdminProto.FetchPartitionEntriesRequest.newBuilder()
.addAllPartitions(partitionList)
.setFetchValues(fetchValues)
.setFetchMasterEntries(fetchMasterEntries)
- .setStore(storeName);
+ .setStore(storeName)
+ .setSkipRecords(skipRecords);
if(filter != null) {
fetchRequest.setFilter(encodeFilter(filter));
@@ -337,7 +339,8 @@ private void initiateFetchRequest(DataOutputStream outputStream,
* @param partitionList List of the partitions
* @param filter Custom filter implementation to filter out entries which
* should not be fetched.
- * @param fetch only entries which belong to Master
+ * @param fetchMasterEntries Fetch an entry only if master replica
+ * @param skipRecords Number of records to skip
* @return An iterator which allows entries to be streamed as they're being
* iterated over.
* @throws VoldemortException
@@ -346,7 +349,9 @@ private void initiateFetchRequest(DataOutputStream outputStream,
String storeName,
List<Integer> partitionList,
VoldemortFilter filter,
- boolean fetchMasterEntries) {
+ boolean fetchMasterEntries,
+ long skipRecords) {
+
Node node = this.getAdminClientCluster().getNodeById(nodeId);
final SocketDestination destination = new SocketDestination(node.getHost(),
node.getAdminPort(),
@@ -361,7 +366,8 @@ private void initiateFetchRequest(DataOutputStream outputStream,
partitionList,
filter,
true,
- fetchMasterEntries);
+ fetchMasterEntries,
+ skipRecords);
} catch(IOException e) {
close(sands.getSocket());
pool.checkin(destination, sands);
@@ -401,6 +407,19 @@ private void initiateFetchRequest(DataOutputStream outputStream,
}
+ /**
+ * See documentation for
+ * {@link AdminClient#fetchEntries(int, String, List, VoldemortFilter, boolean, long)}
+ * . Kept for backwards compatibility
+ */
+ public Iterator<Pair<ByteArray, Versioned<byte[]>>> fetchEntries(int nodeId,
+ String storeName,
+ List<Integer> partitionList,
+ VoldemortFilter filter,
+ boolean fetchMasterEntries) {
+ return fetchEntries(nodeId, storeName, partitionList, filter, fetchMasterEntries, 0);
+ }
+
/**
* Fetch All keys belonging to partitionList from requested node. Identical
* to {@link AdminClient#fetchEntries} but will <em>only fetch the keys</em>
@@ -410,13 +429,16 @@ private void initiateFetchRequest(DataOutputStream outputStream,
* @param partitionList See documentation for
* {@link AdminClient#fetchEntries}
* @param filter See documentation for {@link AdminClient#fetchEntries}
+ * @param skipRecords See documentation for
+ * {@link AdminClient#fetchEntries(int, String, List, VoldemortFilter, boolean, long)}
* @return See documentation for {@link AdminClient#fetchEntries}
*/
public Iterator<ByteArray> fetchKeys(int nodeId,
String storeName,
List<Integer> partitionList,
VoldemortFilter filter,
- boolean fetchMasterEntries) {
+ boolean fetchMasterEntries,
+ long skipRecords) {
Node node = this.getAdminClientCluster().getNodeById(nodeId);
final SocketDestination destination = new SocketDestination(node.getHost(),
node.getAdminPort(),
@@ -431,7 +453,8 @@ private void initiateFetchRequest(DataOutputStream outputStream,
partitionList,
filter,
false,
- fetchMasterEntries);
+ fetchMasterEntries,
+ skipRecords);
} catch(IOException e) {
close(sands.getSocket());
pool.checkin(destination, sands);
@@ -468,6 +491,19 @@ public ByteArray computeNext() {
};
}
+ /**
+ * See documentation for
+ * {@link AdminClient#fetchKeys(int, String, List, VoldemortFilter, boolean, long)}
+ * . Kept for backwards compatibility
+ */
+ public Iterator<ByteArray> fetchKeys(int nodeId,
+ String storeName,
+ List<Integer> partitionList,
+ VoldemortFilter filter,
+ boolean fetchMasterEntries) {
+ return fetchKeys(nodeId, storeName, partitionList, filter, fetchMasterEntries, 0);
+ }
+
/**
* RestoreData from copies on other machines for the given nodeId
* <p>
Oops, something went wrong.

0 comments on commit 47a002e

Please sign in to comment.