Permalink
Browse files

small changes to make javadocs happy.

  • Loading branch information...
1 parent f802f98 commit 1cd6fcbb883bd6ab6aabafea5757c5aae86a7d3e @bbansal bbansal committed Dec 16, 2009
@@ -149,7 +149,7 @@ private SocketPool createSocketPool(ClientConfig config) {
}
private <T extends Message.Builder> T sendAndReceive(int nodeId, Message message, T builder) {
- Node node = this.getCluster().getNodeById(nodeId);
+ Node node = this.getAdminClientCluster().getNodeById(nodeId);
SocketDestination destination = new SocketDestination(node.getHost(),
node.getAdminPort(),
RequestFormatType.ADMIN_PROTOCOL_BUFFERS);
@@ -171,9 +171,8 @@ private SocketPool createSocketPool(ClientConfig config) {
}
/**
- * Update key/value entries for a specific store on a remote node given an
- * iterator of the entries. The entries are <em>streamed</em> from the
- * client to the server:
+ * Update a stream of key/value entries at the given node. The iterator
+ * entries are <em>streamed</em> from the client to the server:
* <ol>
* <li>Client performs a handshake with the server (sending in the update
* entries request with a store name and a {@link VoldemortFilter} instance.
@@ -197,7 +196,7 @@ public void updateEntries(int nodeId,
String storeName,
Iterator<Pair<ByteArray, Versioned<byte[]>>> entryIterator,
VoldemortFilter filter) {
- Node node = this.getCluster().getNodeById(nodeId);
+ Node node = this.getAdminClientCluster().getNodeById(nodeId);
SocketDestination destination = new SocketDestination(node.getHost(),
node.getAdminPort(),
RequestFormatType.ADMIN_PROTOCOL_BUFFERS);
@@ -283,8 +282,7 @@ private void initiateFetchRequest(DataOutputStream outputStream,
}
/**
- * Fetch all key/value entries belong to the partitions listed from the
- * server to the client.
+ * Fetch key/value entries belonging to partitionList from requested node.
* <p>
*
* <b>this is a streaming API.</b> The server keeps sending the messages as
@@ -309,7 +307,7 @@ private void initiateFetchRequest(DataOutputStream outputStream,
String storeName,
List<Integer> partitionList,
VoldemortFilter filter) {
- Node node = this.getCluster().getNodeById(nodeId);
+ Node node = this.getAdminClientCluster().getNodeById(nodeId);
final SocketDestination destination = new SocketDestination(node.getHost(),
node.getAdminPort(),
RequestFormatType.ADMIN_PROTOCOL_BUFFERS);
@@ -359,8 +357,8 @@ private void initiateFetchRequest(DataOutputStream outputStream,
}
/**
- * Identical to {@link AdminClient#fetchEntries} but will
- * <em>only fetch the keys</em>
+ * Fetch All keys belonging to partitionList from requested node. Identical
+ * to {@link AdminClient#fetchEntries} but will <em>only fetch the keys</em>
*
* @param nodeId See documentation for {@link AdminClient#fetchEntries}
* @param storeName See documentation for {@link AdminClient#fetchEntries}
@@ -373,7 +371,7 @@ private void initiateFetchRequest(DataOutputStream outputStream,
String storeName,
List<Integer> partitionList,
VoldemortFilter filter) {
- Node node = this.getCluster().getNodeById(nodeId);
+ Node node = this.getAdminClientCluster().getNodeById(nodeId);
final SocketDestination destination = new SocketDestination(node.getHost(),
node.getAdminPort(),
RequestFormatType.ADMIN_PROTOCOL_BUFFERS);
@@ -420,8 +418,7 @@ public ByteArray computeNext() {
}
/**
- * Fetch key/value entries from donorNodeId and Update entries at
- * stealerNodeId for the requested storeName and given partitionList.
+ * Fetch key/value entries from donorNodeId and Update at stealerNodeId.
* <p>
* This is a background operation (see
* {@link voldemort.server.protocol.admin.AsyncOperation} that runs on the
@@ -474,9 +471,8 @@ public int fetchAndUpdateStreams(int donorNodeId,
}
/**
- * Get the status of an
- * {@link voldemort.server.protocol.admin.AsyncOperation} which is running
- * on nodeId.<br>
+ * Get the status of an Async Operation running at (remote) node.
+ *
* <b>If The operation is complete, then the operation will be removed from
* a list of currently running operations.</b>
*
@@ -517,8 +513,7 @@ public AsyncOperationStatus getAsyncRequestStatus(int nodeId, int requestId) {
}
/**
- * Delete all entries belonging to partitions in requested partitionList for
- * given storeName on (remote) node nodeId.
+ * Delete all entries belonging to partitionList at requested node.
*
* @param nodeId Node on which the entries to be deleted
* @param storeName Name of the store holding the entries
@@ -570,6 +565,9 @@ private void close(Socket socket) {
}
}
+ /**
+ * Stop the AdminClient cleanly freeing all resources.
+ */
public void stop() {
this.pool.close();
}
@@ -614,12 +612,14 @@ public void waitForCompletion(int nodeId, int requestId, long maxWait, TimeUnit
}
/**
- * Update metadata at the given remoteNodeId.<br>
+ * Update metadata at the given remoteNodeId.
+ * <p>
*
* Metadata keys can be one of {@link MetadataStore#METADATA_KEYS}<br>
* eg.<br>
- * <li>cluster metadata (cluster.xml as string) <li>stores definitions
- * (stores.xml as string) <li>Server states <br <br>
+ * <li>cluster metadata (cluster.xml as string)
+ * <li>stores definitions (stores.xml as string)
+ * <li>Server states <br <br>
* See {@link voldemort.store.metadata.MetadataStore} for more information.
*
* @param remoteNodeId Id of the node
@@ -647,13 +647,17 @@ public void updateRemoteMetadata(int remoteNodeId, String key, Versioned<String>
}
/**
- * Get the metadata on a remote node. See
- * {@link AdminClient#updateRemoteMetadata)} for more documentation.
+ * Get the metadata on a remote node.
+ * <p>
+ * Metadata keys can be one of {@link MetadataStore#METADATA_KEYS}<br>
+ * eg.<br>
+ * <li>cluster metadata (cluster.xml as string)
+ * <li>stores definitions (stores.xml as string)
+ * <li>Server states <br <br>
+ * See {@link voldemort.store.metadata.MetadataStore} for more information.
*
- * @param remoteNodeId See {@link AdminClient#updateRemoteMetadata)} for
- * documentation.
- * @param key See {@link AdminClient#updateRemoteMetadata)} for
- * documentation.
+ * @param remoteNodeId Id of the node
+ * @param key Metadata key to update
* @return Metadata with its associated {@link voldemort.versioning.Version}
*/
public Versioned<String> getRemoteMetadata(int remoteNodeId, String key) {
@@ -756,11 +760,21 @@ public void updateRemoteServerState(int nodeId, MetadataStore.VoldemortState sta
value.getVersion());
}
- public void setCluster(Cluster cluster) {
+ /**
+ * Set cluster info for AdminClient to use.
+ *
+ * @param cluster
+ */
+ public void setAdminClientCluster(Cluster cluster) {
this.cluster = cluster;
}
- public Cluster getCluster() {
+ /**
+ * Get the cluster info AdminClient is using.
+ *
+ * @return
+ */
+ public Cluster getAdminClientCluster() {
return cluster;
}
}
@@ -40,8 +40,7 @@ public void stealPartitions(final int stealerNodeID,
final Cluster currentCluster);
/**
- * update stealerNodeId by fetching and updating given list of partitions
- * <br>
+ * update stealerNodeId by fetching and updating given list of partitions <br>
*
* @param stealerNodeID : The nodeId where partitions will be copied
* @param storeName : store to be rebalanced
@@ -58,7 +58,7 @@ public static void printUsage(PrintStream out, OptionParser parser) throws IOExc
private List<Integer> getNodes(int partition) {
List<Integer> rv = new LinkedList<Integer>();
- Cluster cluster = adminClient.getCluster();
+ Cluster cluster = adminClient.getAdminClientCluster();
for(Node node: cluster.getNodes()) {
if(node.getPartitionIds().contains(partition))
rv.add(node.getId());
@@ -68,7 +68,7 @@ public static void printUsage(PrintStream out, OptionParser parser) throws IOExc
}
private List<Integer> getPartitions(int nodeId) {
- Cluster cluster = adminClient.getCluster();
+ Cluster cluster = adminClient.getAdminClientCluster();
Node node = cluster.getNodeById(nodeId);
return node.getPartitionIds();
}

0 comments on commit 1cd6fcb

Please sign in to comment.