Skip to content

Commit

Permalink
Adding System store functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
Chinmay Soman authored and Lei Gao committed Jun 27, 2012
1 parent a21bf21 commit 234ac9b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/java/voldemort/client/DefaultStoreClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import voldemort.cluster.Node;
import voldemort.routing.RoutingStrategy;
import voldemort.serialization.Serializer;
import voldemort.server.SystemStoreConstants;
import voldemort.store.InvalidMetadataException;
import voldemort.store.Store;
import voldemort.store.StoreCapabilityType;
Expand Down Expand Up @@ -136,7 +137,7 @@ public Void call() throws Exception {
}

public void initializeSystemStores() {
for(String storeName: systemStoreNames) {
for(String storeName: SystemStoreConstants.SystemStoreName.) {
SystemStore<String, Long> sysStore = new SystemStore<String, Long>(storeName,
config.getBootstrapUrls(),
config.getClientZoneId());
Expand All @@ -148,6 +149,13 @@ public void initializeSystemStores() {
public void bootStrap() {
logger.info("Bootstrapping metadata for store " + this.storeName);
this.store = storeFactory.getRawStore(storeName, resolver, clientId);

logger.info("Creating System store");
String systemKey = storeName + "-client";
this.sysStore = new SystemStore<String, String>("voldsys$_client_registry",
this.storeFactory);
sysStore.putSysStore(systemKey, "Registered");
logger.info("Getting value - " + sysStore.getSysStore(systemKey));
}

public boolean delete(K key) {
Expand Down
6 changes: 6 additions & 0 deletions src/java/voldemort/client/StoreClientFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ <K, V, T> Store<K, V, T> getRawStore(String storeName,

/**
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> Adding System store functionality
* Get the underlying store, not the public StoreClient interface
*
* @param storeName The name of the store
Expand All @@ -102,8 +105,11 @@ <K, V, T> Store<K, V, T> getRawStore(String storeName,
String customStoresXml);

/**
<<<<<<< HEAD
=======
>>>>>>> add clientId for voldemort client
=======
>>>>>>> Adding System store functionality
* Close the store client
*/
public void close();
Expand Down

0 comments on commit 234ac9b

Please sign in to comment.