Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' into server-transforms

  • Loading branch information...
commit 27d5f5b6fc9d336ecacef527b33e71b1772d5072 2 parents 3327ec2 + 06579fa
@afeinberg afeinberg authored
View
14 src/java/voldemort/server/http/gui/ReadOnlyStoreManagementServlet.java
@@ -61,7 +61,7 @@
private static final long serialVersionUID = 1;
private static final Logger logger = Logger.getLogger(ReadOnlyStoreManagementServlet.class);
- private List<ReadOnlyStorageEngine> stores;
+ private volatile List<ReadOnlyStorageEngine> stores;
private VelocityEngine velocityEngine;
private FileFetcher fileFetcher;
@@ -78,9 +78,17 @@ public void init() throws ServletException {
super.init();
VoldemortServer server = (VoldemortServer) getServletContext().getAttribute(VoldemortServletContextListener.SERVER_KEY);
+ initStores(server);
+ initVelocity();
+ setFetcherClass(server);
+ }
+
+ public void initStores(VoldemortServer server) {
this.stores = getReadOnlyStores(server);
+ }
+
+ public void initVelocity() {
this.velocityEngine = (VelocityEngine) Utils.notNull(getServletContext().getAttribute(VoldemortServletContextListener.VELOCITY_ENGINE_KEY));
- setFetcherClass(server);
}
private void setFetcherClass(VoldemortServer server) {
@@ -117,6 +125,7 @@ private void setFetcherClass(VoldemortServer server) {
@Override
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException,
IOException {
+ initStores((VoldemortServer) getServletContext().getAttribute(VoldemortServletContextListener.SERVER_KEY));
Map<String, Object> params = Maps.newHashMap();
params.put("stores", stores);
velocityEngine.render("read-only-mgmt.vm", params, resp.getOutputStream());
@@ -200,6 +209,7 @@ private String getRequired(HttpServletRequest req, String name) throws ServletEx
}
private ReadOnlyStorageEngine getStore(String storeName) throws ServletException {
+ initStores((VoldemortServer) getServletContext().getAttribute(VoldemortServletContextListener.SERVER_KEY));
for(ReadOnlyStorageEngine store: this.stores)
if(store.getName().equals(storeName))
return store;
Please sign in to comment.
Something went wrong with that request. Please try again.