Permalink
Browse files

Merge branch 'elasticsqlite'

  • Loading branch information...
2 parents 89327a1 + 95adbcc commit c7f75a95ce895ccccd49072c31c2e62e30d10556 @labisso labisso committed Jun 20, 2011
Showing with 843 additions and 607 deletions.
  1. +1 −0 .idea-modules/ec2soap/ec2soap.iml
  2. +8 −3 messaging/gt4.0-elastic/java/msgbridge/etc/elastic/other/main.xml
  3. +2 −2 messaging/gt4.0-elastic/java/msgbridge/etc/elastic/other/other-elastic.conf
  4. +77 −0 ...msgbridge/src/org/nimbustools/messaging/gt4_0_elastic/v2008_05_05/general/ElasticPersistence.java
  5. +457 −0 ...g/nimbustools/messaging/gt4_0_elastic/v2008_05_05/general/defaults/DefaultElasticPersistence.java
  6. +199 −279 .../msgbridge/src/org/nimbustools/messaging/gt4_0_elastic/v2008_05_05/rm/defaults/DefaultIDMgmt.java
  7. +1 −20 ...ridge/src/org/nimbustools/messaging/gt4_0_elastic/v2008_05_05/rm/defaults/DefaultIDMgmtProxy.java
  8. +0 −85 ...tic/java/msgbridge/src/org/nimbustools/messaging/gt4_0_elastic/v2008_05_05/rm/defaults/IDMap.java
  9. +0 −50 ...ic/java/msgbridge/src/org/nimbustools/messaging/gt4_0_elastic/v2008_05_05/rm/defaults/ehcache.xml
  10. +30 −107 ...dge/src/org/nimbustools/messaging/gt4_0_elastic/v2008_05_05/security/defaults/DefaultSSHKeys.java
  11. +0 −24 ...e/src/org/nimbustools/messaging/gt4_0_elastic/v2008_05_05/security/defaults/KeyCacheProvider.java
  12. +6 −2 messaging/query/java/source/etc/query/other/main.xml
  13. +10 −2 scripts/integration-suites.sh
  14. +1 −3 service/service/java/source/share/lib/db-mgmt.xml
  15. +8 −3 service/service/java/tests/suites/basic/home/services/etc/nimbus/elastic/other/main.xml
  16. +2 −2 service/service/java/tests/suites/basic/home/services/etc/nimbus/elastic/other/other-elastic.conf
  17. +6 −2 service/service/java/tests/suites/basic/home/services/etc/nimbus/query/other/main.xml
  18. +1 −3 service/service/java/tests/suites/basic/home/services/share/nimbus/lib/db-mgmt.xml
  19. +8 −3 service/service/java/tests/suites/failure/home/services/etc/nimbus/elastic/other/main.xml
  20. +2 −2 service/service/java/tests/suites/failure/home/services/etc/nimbus/elastic/other/other-elastic.conf
  21. +6 −2 service/service/java/tests/suites/failure/home/services/etc/nimbus/query/other/main.xml
  22. +1 −3 service/service/java/tests/suites/failure/home/services/share/nimbus/lib/db-mgmt.xml
  23. +8 −3 service/service/java/tests/suites/spotinstances/home/services/etc/nimbus/elastic/other/main.xml
  24. +2 −2 ...service/java/tests/suites/spotinstances/home/services/etc/nimbus/elastic/other/other-elastic.conf
  25. +6 −2 service/service/java/tests/suites/spotinstances/home/services/etc/nimbus/query/other/main.xml
  26. +1 −3 service/service/java/tests/suites/spotinstances/home/services/share/nimbus/lib/db-mgmt.xml
View
1 .idea-modules/ec2soap/ec2soap.iml
@@ -31,6 +31,7 @@
</orderEntry>
<orderEntry type="module" module-name="workspace-service" />
<orderEntry type="module" module-name="authzdb" />
+ <orderEntry type="library" name="workspace-service-libs" level="project" />
</component>
</module>
View
11 messaging/gt4.0-elastic/java/msgbridge/etc/elastic/other/main.xml
@@ -76,10 +76,16 @@
<bean id="nimbus-elastic.rm.idmappings"
class="org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.rm.defaults.DefaultIDMgmtProxy" />
+ <bean id="nimbus-elastic.rm.persistence"
+ class="org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.general.defaults.DefaultElasticPersistence"
+ init-method="initialize">
+ <constructor-arg value="$OTHER_ELASTIC{elastic.db}"/>
+ </bean>
+
<!-- Don't reference this bean directly. See DefaultIDMgmtProxy class notes. -->
<bean id="nimbus-elastic.rm.realidmappings"
class="org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.rm.defaults.DefaultIDMgmt">
- <constructor-arg value="$OTHER_ELASTIC{caches.dir}" />
+ <constructor-arg ref="nimbus-elastic.rm.persistence"/>
</bean>
<!-- ************ Spot Instances *********** -->
@@ -191,8 +197,7 @@
class="org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.security.defaults.DefaultSSHKeys"
init-method="validate">
- <!-- key cache provider -->
- <constructor-arg ref="nimbus-elastic.rm.idmappings" />
+ <constructor-arg ref="nimbus-elastic.rm.persistence" />
<property name="pubkeyOnly" value="$ELASTIC{ssh.pubkey.only}" />
<property name="splitToken" value="$ELASTIC{ssh.split.token}" />
View
4 messaging/gt4.0-elastic/java/msgbridge/etc/elastic/other/other-elastic.conf
@@ -67,5 +67,5 @@ ra.name.unknown=[unknown]
unknown.pubnet=[unknown]
unknown.privnet=[unknown]
-# disk-persistent caching
-caches.dir=$NIMBUS_HOME/services/var/nimbus/elastic-caches
+
+elastic.db=$NIMBUS_HOME/services/var/nimbus/elastic.db
View
77 ...e/src/org/nimbustools/messaging/gt4_0_elastic/v2008_05_05/general/ElasticPersistence.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright 1999-2011 University of Chicago
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.general;
+
+import org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.security.SSHKey;
+
+import java.util.List;
+
+public interface ElasticPersistence {
+ String INSERT_INSTANCE = "insert into instances " +
+ "(elastic_id, manager_id, reservation_id, sshkey) values(?,?,?,?)";
+ String GET_MANAGER_FROM_ELASTIC_INSTANCE =
+ "select manager_id from instances where elastic_id = ?";
+ String GET_ELASTIC_FROM_MANAGER_INSTANCE =
+ "select elastic_id from instances where manager_id = ?";
+ String INSERT_RESERVATION = "insert into reservations " +
+ "(reservation_id, group_id, cosched_id) values(?,?,?)";
+ String GET_SSHKEY_FROM_ELASTIC_INSTANCE =
+ "select sshkey from instances where elastic_id = ?";
+ String GET_GROUP_FROM_ELASTIC_RESERVATION =
+ "select group_id from reservations where reservation_id = ?";
+ String GET_COSCHED_FROM_ELASTIC_RESERVATION =
+ "select cosched_id from reservations where reservation_id = ?";
+ String GET_RESERVATION_FROM_MANAGER_INSTANCE =
+ "select reservation_id from instances where manager_id = ?";
+ String GET_RESERVATION_FROM_GROUP =
+ "select reservation_id from reservations where group_id = ?";
+ String GET_RESERVATION_FROM_COSCHED =
+ "select reservation_id from reservations where cosched_id = ?";
+ // a little silly
+ String GET_RESERVATION =
+ "select reservation_id from reservations where reservation_id = ?";
+ String GET_SSH_KEY = "select owner, keyname, pubkey, fingerprint " +
+ "from ssh_keypairs where owner = ? and keyname = ?";
+ String GET_SSH_KEYS_BY_OWNER = "select owner, keyname, pubkey, " +
+ "fingerprint from ssh_keypairs where owner = ?";
+ String INSERT_SSH_KEY = "insert into ssh_keypairs " +
+ "(owner, keyname, pubkey, fingerprint) values(?,?,?,?)";
+ String UPDATE_SSH_KEY = "updatessh_keypairs " +
+ "set pubkey = ?, fingerprint = ? where owner = ? and keyname = ?";
+ String DELETE_SSH_KEY = "delete from ssh_keypairs " +
+ "where owner = ? and keyname = ?";
+
+ void insertInstance(String elasticInstanceId,
+ String managerInstanceId,
+ String elasticReservationId,
+ String sshKeyUsed) throws Exception;
+
+ void insertReservation(String elasticReservationId,
+ String groupId, String coschedId)
+ throws Exception;
+
+ String selectIdFromId(String query, String id);
+
+ List<SSHKey> getSSHKeys(String owner) throws Exception;
+
+ SSHKey getSSHKey(String owner, String keyname) throws Exception;
+
+ void putSSHKey(SSHKey key) throws Exception;
+
+ boolean updateSSHKey(SSHKey key) throws Exception;
+
+ boolean deleteSSHKey(String owner, String keyname) throws Exception;
+}
View
457 ...tools/messaging/gt4_0_elastic/v2008_05_05/general/defaults/DefaultElasticPersistence.java
@@ -0,0 +1,457 @@
+/*
+ * Copyright 1999-2011 University of Chicago
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.general.defaults;
+
+import org.apache.commons.dbcp.BasicDataSource;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.general.ElasticPersistence;
+import org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.security.SSHKey;
+import org.springframework.core.io.Resource;
+
+import javax.sql.DataSource;
+import java.io.IOException;
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.List;
+
+public class DefaultElasticPersistence implements ElasticPersistence {
+
+ private static final Log logger =
+ LogFactory.getLog(DefaultElasticPersistence.class.getName());
+
+ //schema
+ private static final String SCHEMA_CREATE_INSTANCES =
+ "create table if not exists instances (" +
+ " elastic_id varchar(10) unique not null," +
+ " manager_id varchar(10) unique not null," +
+ " reservation_id varchar(10) not null," +
+ " sshkey varchar(128))";
+ private static final String SCHEMA_CREATE_RESERVATIONS =
+ "create table if not exists reservations (" +
+ " reservation_id varchar(10) primary key," +
+ " group_id varchar(10)," +
+ " cosched_id varchar(10))";
+ private static final String SCHEMA_CREATE_SSH_KEYPAIRS =
+ "create table if not exists ssh_keypairs (" +
+ " owner text not null," +
+ " keyname text not null," +
+ " pubkey text not null," +
+ " fingerprint text," +
+ " primary key (owner, keyname))";
+ private static final String SCHEMA_CREATE_VERSION =
+ "create table if not exists schema_version (version int primary key)";
+
+ // this acts as a 2-phase commit. if this record isn't present, the
+ // schema will be idempotently (re)created on the next service boot.
+ private static final String SCHEMA_INSERT_VERSION =
+ "insert into schema_version (version) values(0)";
+ private static final String[] SCHEMA_ALL =
+ new String[]{SCHEMA_CREATE_INSTANCES, SCHEMA_CREATE_RESERVATIONS,
+ SCHEMA_CREATE_SSH_KEYPAIRS, SCHEMA_CREATE_VERSION,
+ SCHEMA_INSERT_VERSION};
+
+ // schema check query
+ private static final String GET_SCHEMA_VERSION =
+ "select version from schema_version limit 1";
+
+
+ private final DataSource dataSource;
+
+ public DefaultElasticPersistence(Resource dbResource) throws IOException {
+ if (dbResource == null) {
+ throw new IllegalArgumentException("diskStoreResource may not be null");
+ }
+
+ final String dbPath = dbResource.getFile().getAbsolutePath();
+
+ //don't know how to feed this in with Spring and still have it fixup the
+ // $NIMBUS_HOME in path
+ final BasicDataSource ds = new BasicDataSource();
+ ds.setDriverClassName("org.sqlite.JDBC");
+ ds.setUrl("jdbc:sqlite://"+dbPath);
+
+ this.dataSource = ds;
+ }
+
+ public void initialize() throws Exception {
+ if (this.dataSource == null) {
+ throw new IllegalArgumentException("this.dataSource may not be null");
+ }
+
+
+ // make sure we can get a connection
+ final Connection connection = this.dataSource.getConnection();
+ returnConnection(connection);
+
+ if (!this.checkSchema()) {
+ logger.info("Creating elastic sqlite schema");
+ this.createSchema();
+ }
+ }
+
+ private boolean checkSchema() {
+ Connection c = null;
+ PreparedStatement pstmt = null;
+ ResultSet rs;
+
+ try {
+ c = dataSource.getConnection();
+ pstmt = c.prepareStatement(DefaultElasticPersistence.GET_SCHEMA_VERSION);
+ rs = pstmt.executeQuery();
+ // we're just interested in whether there are any rows. in the future this
+ // could be used for automatically updating schemas
+ return rs.next();
+ } catch (SQLException e) {
+ logger.debug("Error querying elastic sqlite schema version", e);
+ return false;
+ } finally {
+ try {
+ if (pstmt != null) {
+ pstmt.close();
+ }
+ if (c != null) {
+ returnConnection(c);
+ }
+ } catch (SQLException sql) {
+ logger.error("SQLException in finally cleanup", sql);
+ }
+ }
+ }
+
+ private void createSchema() throws Exception {
+ Connection c = null;
+ PreparedStatement pstmt = null;
+
+ try {
+ c = dataSource.getConnection();
+
+ for (String query : DefaultElasticPersistence.SCHEMA_ALL) {
+ pstmt = c.prepareStatement(query);
+ pstmt.executeUpdate();
+ }
+
+ } catch (SQLException e) {
+ logger.error("", e);
+ throw e;
+ } finally {
+ try {
+ if (pstmt != null) {
+ pstmt.close();
+ }
+ if (c != null) {
+ returnConnection(c);
+ }
+ } catch (SQLException sql) {
+ logger.error("SQLException in finally cleanup", sql);
+ }
+ }
+
+ }
+
+ public void insertInstance(String elasticInstanceId,
+ String managerInstanceId,
+ String elasticReservationId,
+ String sshKeyUsed) throws Exception {
+ Connection c = null;
+ PreparedStatement pstmt = null;
+
+ try {
+ c = dataSource.getConnection();
+ pstmt = c.prepareStatement(ElasticPersistence.INSERT_INSTANCE);
+ pstmt.setString(1, elasticInstanceId);
+ pstmt.setString(2, managerInstanceId);
+ pstmt.setString(3, elasticReservationId);
+ pstmt.setString(4, sshKeyUsed);
+
+ int rc = pstmt.executeUpdate();
+ if (rc != 1) {
+ throw new Exception("did not insert the row properly");
+ }
+ } catch (SQLException e) {
+ logger.error("", e);
+ throw e;
+ } finally {
+ try {
+ if (pstmt != null) {
+ pstmt.close();
+ }
+ if (c != null) {
+ returnConnection(c);
+ }
+ } catch (SQLException sql) {
+ logger.error("SQLException in finally cleanup", sql);
+ }
+ }
+ }
+
+ public void insertReservation(String elasticReservationId,
+ String groupId, String coschedId)
+ throws Exception {
+
+ Connection c = null;
+ PreparedStatement pstmt = null;
+
+ try {
+ c = dataSource.getConnection();
+ pstmt = c.prepareStatement(ElasticPersistence.INSERT_RESERVATION);
+ pstmt.setString(1, elasticReservationId);
+ pstmt.setString(2, groupId);
+ pstmt.setString(3, coschedId);
+
+ int rc = pstmt.executeUpdate();
+ if (rc != 1) {
+ throw new Exception("did not insert the row properly");
+ }
+ } catch (SQLException e) {
+ logger.error("", e);
+ throw e;
+ } finally {
+ try {
+ if (pstmt != null) {
+ pstmt.close();
+ }
+ if (c != null) {
+ returnConnection(c);
+ }
+ } catch (SQLException sql) {
+ logger.error("SQLException in finally cleanup", sql);
+ }
+ }
+
+ }
+
+ public String selectIdFromId(String query, String id) {
+ Connection c = null;
+ PreparedStatement pstmt = null;
+ ResultSet rs;
+
+ try {
+ c = dataSource.getConnection();
+ pstmt = c.prepareStatement(query);
+ pstmt.setString(1, id);
+ rs = pstmt.executeQuery();
+ if (!rs.next()) {
+ return null;
+ }
+ return rs.getString(1);
+ } catch (SQLException e) {
+ logger.error("", e);
+ return null;
+ } finally {
+ try {
+ if (pstmt != null) {
+ pstmt.close();
+ }
+ if (c != null) {
+ returnConnection(c);
+ }
+ } catch (SQLException sql) {
+ logger.error("SQLException in finally cleanup", sql);
+ }
+ }
+ }
+
+ public List<SSHKey> getSSHKeys(String owner) throws Exception {
+ if (owner == null) {
+ throw new IllegalArgumentException("owner may not be null");
+ }
+ return this.getSSHKeys(owner, null);
+ }
+
+ public SSHKey getSSHKey(String owner, String keyname) throws Exception {
+ if (owner == null) {
+ throw new IllegalArgumentException("owner may not be null");
+ }
+ if (keyname == null) {
+ throw new IllegalArgumentException("keyname may not be null");
+ }
+ final List<SSHKey> keys = getSSHKeys(owner, keyname);
+ if (keys.isEmpty()) {
+ return null;
+ }
+ return keys.get(0);
+ }
+
+ public void putSSHKey(SSHKey key) throws Exception {
+ if (key == null) {
+ throw new IllegalArgumentException("key may not be null");
+ }
+ Connection c = null;
+ PreparedStatement pstmt = null;
+
+ try {
+ c = dataSource.getConnection();
+ pstmt = c.prepareStatement(INSERT_SSH_KEY);
+ pstmt.setString(1, key.getOwnerID());
+ pstmt.setString(2, key.getKeyName());
+ pstmt.setString(3, key.getPubKeyValue());
+ pstmt.setString(4, key.getFingerprint());
+
+ int rc = pstmt.executeUpdate();
+ if (rc != 1) {
+ throw new Exception("did not insert the row properly");
+ }
+ } catch (SQLException e) {
+ logger.error("", e);
+ throw e;
+ } finally {
+ try {
+ if (pstmt != null) {
+ pstmt.close();
+ }
+ if (c != null) {
+ returnConnection(c);
+ }
+ } catch (SQLException sql) {
+ logger.error("SQLException in finally cleanup", sql);
+ }
+ }
+ }
+
+ public boolean updateSSHKey(SSHKey key) throws Exception {
+ if (key == null) {
+ throw new IllegalArgumentException("key may not be null");
+ }
+ Connection c = null;
+ PreparedStatement pstmt = null;
+
+ try {
+ c = dataSource.getConnection();
+ pstmt = c.prepareStatement(UPDATE_SSH_KEY);
+ pstmt.setString(1, key.getPubKeyValue());
+ pstmt.setString(2, key.getFingerprint());
+ pstmt.setString(3, key.getOwnerID());
+ pstmt.setString(4, key.getKeyName());
+
+ int rc = pstmt.executeUpdate();
+ return rc != 0;
+
+ } catch (SQLException e) {
+ logger.error("", e);
+ throw e;
+ } finally {
+ try {
+ if (pstmt != null) {
+ pstmt.close();
+ }
+ if (c != null) {
+ returnConnection(c);
+ }
+ } catch (SQLException sql) {
+ logger.error("SQLException in finally cleanup", sql);
+ }
+ }
+ }
+
+ public boolean deleteSSHKey(String owner, String keyname) throws Exception {
+ if (owner == null) {
+ throw new IllegalArgumentException("owner may not be null");
+ }
+ if (keyname == null) {
+ throw new IllegalArgumentException("keyname may not be null");
+ }
+ Connection c = null;
+ PreparedStatement pstmt = null;
+
+ try {
+ c = dataSource.getConnection();
+ pstmt = c.prepareStatement(DELETE_SSH_KEY);
+ pstmt.setString(1, owner);
+ pstmt.setString(2, keyname);
+
+ int rc = pstmt.executeUpdate();
+ return rc != 0;
+
+ } catch (SQLException e) {
+ logger.error("", e);
+ throw e;
+ } finally {
+ try {
+ if (pstmt != null) {
+ pstmt.close();
+ }
+ if (c != null) {
+ returnConnection(c);
+ }
+ } catch (SQLException sql) {
+ logger.error("SQLException in finally cleanup", sql);
+ }
+ }
+ }
+
+ private List<SSHKey> getSSHKeys(String owner, String keyname) throws SQLException {
+
+ Connection c = null;
+ PreparedStatement pstmt = null;
+ ResultSet rs;
+
+ try {
+ c = dataSource.getConnection();
+
+ if (keyname == null) {
+ pstmt = c.prepareStatement(GET_SSH_KEYS_BY_OWNER);
+ pstmt.setString(1, owner);
+ } else {
+ pstmt = c.prepareStatement(GET_SSH_KEY);
+ pstmt.setString(1, owner);
+ pstmt.setString(2, keyname);
+ }
+ rs = pstmt.executeQuery();
+
+ List<SSHKey> keys = new ArrayList<SSHKey>(4);
+ while (rs.next()) {
+ SSHKey key = new SSHKey(
+ rs.getString("owner"),
+ rs.getString("keyname"),
+ rs.getString("pubkey"),
+ rs.getString("fingerprint"));
+ keys.add(key);
+ }
+ return keys;
+ } catch (SQLException e) {
+ logger.error("", e);
+ throw e;
+ } finally {
+ try {
+ if (pstmt != null) {
+ pstmt.close();
+ }
+ if (c != null) {
+ returnConnection(c);
+ }
+ } catch (SQLException sql) {
+ logger.error("SQLException in finally cleanup", sql);
+ }
+ }
+ }
+
+
+
+ private void returnConnection(Connection connection) {
+ if (connection != null) {
+ try {
+ connection.close();
+ } catch (SQLException e) {
+ logger.error("", e);
+ }
+ }
+ }
+
+}
View
478 ...ge/src/org/nimbustools/messaging/gt4_0_elastic/v2008_05_05/rm/defaults/DefaultIDMgmt.java
@@ -1,5 +1,5 @@
/*
- * Copyright 1999-2008 University of Chicago
+ * Copyright 1999-2011 University of Chicago
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy
@@ -13,194 +13,129 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-
package org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.rm.defaults;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.general.ElasticPersistence;
import org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.rm.IDMappings;
-import org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.security.defaults.KeyCacheProvider;
-import java.io.IOException;
import java.util.Random;
-import java.net.URL;
-import net.sf.ehcache.Cache;
-import net.sf.ehcache.CacheManager;
-import net.sf.ehcache.Element;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.springframework.core.io.Resource;
-
-/**
- * Translations between underlying manager IDs and elastic style. Since the
- * elastic reservations can technically correspond to either a group or cosched
- * group, they are typed. You can have duplicate keys of all three types
- * (instance, group, cosched group).
- */
-public class DefaultIDMgmt implements IDMappings, KeyCacheProvider {
+public class DefaultIDMgmt implements IDMappings {
// -------------------------------------------------------------------------
// STATIC VARIABLES
// -------------------------------------------------------------------------
private static final Log logger =
LogFactory.getLog(DefaultIDMgmt.class.getName());
-
+
private static final char[] legalIDchars =
{'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
- private static final String DISK_PROPKEY =
- "ehcache.disk.store.dir";
- private static final String SHUTDOWN_PROPKEY =
- "net.sf.ehcache.enableShutdownHook";
-
// -------------------------------------------------------------------------
// INSTANCE VARIABLES
// -------------------------------------------------------------------------
-
+
// example instance id: i-936e83fa
// example reservation id: r-602bca09
private final Random random = new Random();
- private final Cache cacheElasticKeys;
- private final Cache cacheManageKeys;
- private final Cache sshKeyCache;
+ private final ElasticPersistence persistence;
// -------------------------------------------------------------------------
// CONSTRUCTOR
// -------------------------------------------------------------------------
- public DefaultIDMgmt(Resource diskStoreResource) throws IOException {
-
- if (diskStoreResource == null) {
- throw new IllegalArgumentException("diskStoreResource may not be null");
- }
-
- final String diskStorePath = diskStoreResource.getFile().getAbsolutePath();
-
- // TODO: Do dynamically. This must not be in conflict with other ehcache+diskstore
- // users (and there is at least one other), could not see how to set
- // on per-manager basis via spring (specifically, the to-disk part).
- System.setProperty(DISK_PROPKEY, diskStorePath);
-
- // TODO: We need a shutdown hook with disk-based. This creates a jvm
- // shutdown hook and is the least-recommended solution.
- System.setProperty(SHUTDOWN_PROPKEY, "true");
-
- final URL url = this.getClass().getResource("ehcache.xml");
- final CacheManager cacheManager = new CacheManager(url);
- this.cacheElasticKeys = cacheManager.getCache("nimbus-elasticCache");
- this.cacheManageKeys = cacheManager.getCache("nimbus-elasticCache2");
- this.sshKeyCache = cacheManager.getCache("nimbus-elasticCache3");
- }
-
- // -------------------------------------------------------------------------
- // implements KeyCacheProvider
- // -------------------------------------------------------------------------
-
- public Cache getKeyCache() {
- return this.sshKeyCache;
+ public DefaultIDMgmt(ElasticPersistence persistence) {
+ this.persistence = persistence;
}
-
- // -------------------------------------------------------------------------
- // NEW ELASTIC IDs
- // -------------------------------------------------------------------------
-
+ /**
+ * Returns new, unique instance elastic ID for the instance ID
+ *
+ * @param managerInstanceID Manager instance ID
+ * @param elasticReservationID already created elastic resid
+ * @param sshkeyUsed nickname of key customization task, may be null
+ * @return new instance ID
+ * @throws Exception could not obtain ID
+ */
public synchronized String newInstanceID(String managerInstanceID,
- String elasticReservationID,
- String sshkeyUsed)
- throws Exception {
-
+ String elasticReservationID,
+ String sshkeyUsed) throws Exception {
+
if (managerInstanceID == null) {
throw new Exception("managerInstanceID may not be null");
}
if (elasticReservationID == null) {
throw new Exception("elasticReservationID may not be null");
}
final String id = this.newUniqueInstanceID();
- final IDMap map = new IDMap(elasticReservationID, id,
- managerInstanceID, sshkeyUsed);
- this.addToCache(id, managerInstanceID, map, IDMap.INST);
+
+ persistence.insertInstance(id, managerInstanceID, elasticReservationID, sshkeyUsed);
+
return id;
}
+ /**
+ * Returns new, unique reservation elastic ID for the instance ID when
+ * there is no outside group to make a reservation ID from
+ *
+ * @param managerInstanceID Manager instance ID
+ * @param sshkeyUsed nickname of key customization task, may be null
+ * @return new reservation ID
+ * @throws Exception could not obtain ID
+ */
public synchronized String newGrouplessInstanceID(String managerInstanceID,
- String sshkeyUsed)
- throws Exception {
-
+ String sshkeyUsed) throws Exception {
if (managerInstanceID == null) {
throw new Exception("managerInstanceID may not be null");
}
final String id = this.newUniqueInstanceID();
final String resid = this.newUniqueReservationID();
- final IDMap map = new IDMap(resid, id, managerInstanceID, sshkeyUsed);
- this.addToCache(id, managerInstanceID, map, IDMap.INST);
+ persistence.insertReservation(resid, null, null);
+ persistence.insertInstance(id, managerInstanceID, resid, sshkeyUsed);
return resid;
}
- public synchronized String newGroupReservationID(String managerGroupID)
- throws Exception {
-
+ /**
+ * Returns new, unique reservation elastic ID for a group ID
+ *
+ * @param managerGroupID Manager group ID
+ * @return new reservation ID
+ * @throws Exception could not obtain ID
+ */
+ public synchronized String newGroupReservationID(String managerGroupID) throws Exception {
if (managerGroupID == null) {
throw new Exception("managerGroupID may not be null");
}
final String resid = this.newUniqueReservationID();
- final IDMap map = new IDMap(resid, managerGroupID, IDMap.GRP);
- this.addToCache(resid, managerGroupID, map, IDMap.GRP);
+ persistence.insertReservation(resid, managerGroupID, null);
+
return resid;
}
- public synchronized String newCoschedReservationID(String managerCoschedID)
- throws Exception {
-
+ /**
+ * Returns new, unique reservation elastic ID for a cosched ID
+ *
+ * @param managerCoschedID Manager cosched ID
+ * @return new reservation ID
+ * @throws Exception could not obtain ID
+ */
+ public synchronized String newCoschedReservationID(String managerCoschedID) throws Exception {
if (managerCoschedID == null) {
throw new Exception("managerCoschedID may not be null");
}
- final String id = this.newUniqueReservationID();
- final IDMap map = new IDMap(id, managerCoschedID, IDMap.COSCH);
- this.addToCache(id, managerCoschedID, map, IDMap.COSCH);
- return id;
- }
-
- protected synchronized void addToCache(String elastic, String manager,
- IDMap map, int type)
- throws Exception {
-
- if (elastic == null) {
- throw new IllegalArgumentException("elastic may not be null");
- }
- if (manager == null) {
- throw new IllegalArgumentException("manager may not be null");
- }
- if (map == null) {
- throw new IllegalArgumentException("map may not be null");
- }
+ final String resid = this.newUniqueReservationID();
+ persistence.insertReservation(resid, null, managerCoschedID);
- if (this.cacheElasticKeys.isKeyInCache(elastic)) {
- final String err = "illegal, already mapped " + elastic;
- logger.fatal(err);
- throw new Exception(err);
- }
- final Element el = new Element(elastic, map);
- this.cacheElasticKeys.put(el);
- this.cacheElasticKeys.flush();
-
- final String id2 = type + manager;
- if (this.cacheManageKeys.isKeyInCache(id2)) {
- final String err = "illegal, already mapped " + id2;
- logger.fatal(err);
- throw new Exception(err);
- }
- final Element el2 = new Element(id2, map);
- this.cacheManageKeys.put(el2);
- this.cacheManageKeys.flush();
+ return resid;
}
-
- // -------------------------------------------------------------------------
+ // -------------------------------------------------------------------------
// GET-OR-NEW ELASTIC IDs
// -------------------------------------------------------------------------
@@ -216,7 +151,7 @@ public synchronized String getOrNewInstanceID(String managerInstanceID,
public synchronized String getOrNewInstanceReservationID(String managerInstanceID,
String sshkeyUsed)
throws Exception {
-
+
if (!this.isElasticInstanceID(managerInstanceID)) {
this.newGrouplessInstanceID(managerInstanceID, sshkeyUsed);
}
@@ -262,196 +197,174 @@ public synchronized String checkInstanceAndReservation(
null);
}
-
- // -------------------------------------------------------------------------
- // ELASTIC INSTANCE --> MANAGER INSTANCE
- // -------------------------------------------------------------------------
-
- public synchronized boolean isInstanceID(String elasticKey) {
- return elasticKey != null &&
- this.cacheElasticKeys.isKeyInCache(elasticKey);
- }
-
- public synchronized String instanceToManager(String elasticInstanceID) {
- return this.elasticToManager(elasticInstanceID, IDMap.INST);
+ /**
+ * @param elasticKey some elastic key
+ * @return true if this key has a corresponding Manager instance ID
+ */
+ public boolean isInstanceID(String elasticKey) {
+ return this.instanceToManager(elasticKey) != null;
}
-
- // -------------------------------------------------------------------------
- // ELASTIC RESERVATION --> MANAGER GROUP
- // -------------------------------------------------------------------------
-
- public synchronized boolean isManagerGroupID(String elasticKey) {
- return elasticKey != null &&
- this.cacheElasticKeys.isKeyInCache(elasticKey);
+ /**
+ * Returns manager ID for the elastic instance ID
+ *
+ * @param elasticInstanceID elastic instance ID
+ * @return Manager instance ID or null if unknown
+ */
+ public String instanceToManager(String elasticInstanceID) {
+ if (elasticInstanceID == null) {
+ throw new IllegalArgumentException("elasticInstanceID may not be null");
+ }
+ return persistence.selectIdFromId(
+ ElasticPersistence.GET_MANAGER_FROM_ELASTIC_INSTANCE,
+ elasticInstanceID);
}
- public synchronized String reservationToManagerGroup(String elasticReservationID) {
- return this.elasticToManager(elasticReservationID, IDMap.GRP);
+ /**
+ * @param elasticKey some elastic key
+ * @return true if this key has a corresponding Manager group ID
+ */
+ public boolean isManagerGroupID(String elasticKey) {
+ return this.reservationToManagerGroup(elasticKey) != null;
}
-
- // -------------------------------------------------------------------------
- // ELASTIC RESERVATION --> MANAGER COSCHED
- // -------------------------------------------------------------------------
-
- public synchronized boolean isCoschedReservationID(String elasticKey) {
- return elasticKey != null &&
- this.cacheElasticKeys.isKeyInCache(elasticKey);
+ /**
+ * Returns Manager group ID for a reservation ID
+ *
+ * @param elasticReservationID elastic reservation ID
+ * @return Manager group ID or null if unknown
+ */
+ public String reservationToManagerGroup(String elasticReservationID) {
+ if (elasticReservationID == null) {
+ throw new IllegalArgumentException("elasticReservationID may not be null");
+ }
+ return persistence.selectIdFromId(
+ ElasticPersistence.GET_GROUP_FROM_ELASTIC_RESERVATION,
+ elasticReservationID);
}
- public synchronized String reservationToManagerCosched(String elasticReservationID) {
- return this.elasticToManager(elasticReservationID, IDMap.COSCH);
+ /**
+ * @param elasticKey some elastic key
+ * @return true if this key has a corresponding Manager cosched ID
+ */
+ public boolean isCoschedReservationID(String elasticKey) {
+ return this.reservationToManagerCosched(elasticKey) != null;
}
-
- // -------------------------------------------------------------------------
- // MANAGER INSTANCE --> ELASTIC INSTANCE
- // -------------------------------------------------------------------------
-
- public synchronized boolean isElasticInstanceID(String managerKey) {
- return managerKey != null &&
- this.cacheManageKeys.isKeyInCache(IDMap.INST + managerKey);
+ /**
+ * Returns Manager cosched ID for a reservation ID
+ *
+ * @param elasticReservationID elastic reservation ID
+ * @return Manager cosched ID or null if unknown
+ */
+ public String reservationToManagerCosched(String elasticReservationID) {
+ if (elasticReservationID == null) {
+ throw new IllegalArgumentException("elasticReservationID may not be null");
+ }
+ return persistence.selectIdFromId(
+ ElasticPersistence.GET_COSCHED_FROM_ELASTIC_RESERVATION,
+ elasticReservationID);
}
- public synchronized String managerInstanceToElasticInstance(String managerInstanceID) {
- return this.managerToElastic(managerInstanceID, IDMap.INST);
+ /**
+ * @param managerKey manager key
+ * @return true if this key has a corresponding elastic instance ID
+ */
+ public boolean isElasticInstanceID(String managerKey) {
+ return managerInstanceToElasticInstance(managerKey) != null;
}
-
- // -------------------------------------------------------------------------
- // MANAGER INSTANCE --> ELASTIC RESERVATION
- // -------------------------------------------------------------------------
-
- public synchronized String managerInstanceToElasticReservation(String managerInstanceID) {
-
+ /**
+ * Returns elastic ID for the manager instance ID
+ *
+ * @param managerInstanceID manager instance ID
+ * @return elastic instance ID or null if unknown
+ */
+ public String managerInstanceToElasticInstance(String managerInstanceID) {
if (managerInstanceID == null) {
- return null;
- }
- final Element el =
- this.cacheManageKeys.get(IDMap.INST + managerInstanceID);
- if (el == null) {
- return null;
- }
- final IDMap map = (IDMap) el.getObjectValue();
- if (map == null) {
- logger.fatal("illegal object extension, no null values allowed");
- return null;
+ throw new IllegalArgumentException("managerInstanceID may not be null");
}
- if (IDMap.INST == map.type) {
- return map.elasticReservationID;
- }
- return null;
+ return persistence.selectIdFromId(
+ ElasticPersistence.GET_ELASTIC_FROM_MANAGER_INSTANCE,
+ managerInstanceID);
}
-
- // -------------------------------------------------------------------------
- // MANAGER GROUP --> RESERVATION
- // -------------------------------------------------------------------------
-
- public synchronized boolean isElasticReservationIDGroup(String managerKey) {
- return managerKey != null &&
- this.cacheManageKeys.isKeyInCache(IDMap.GRP + managerKey);
- }
-
- public synchronized String managerGroupToElasticReservation(String managerGroupID) {
- return this.managerToElastic(managerGroupID, IDMap.GRP);
- }
-
-
- // -------------------------------------------------------------------------
- // MANAGER COSCHED --> RESERVATION
- // -------------------------------------------------------------------------
-
- public synchronized boolean isElasticReservationIDCosched(String managerKey) {
- return managerKey != null &&
- this.cacheManageKeys.isKeyInCache(IDMap.COSCH + managerKey);
+ /**
+ * Returns elastic reservation ID for the manager instance ID
+ *
+ * @param managerInstanceID manager instance ID
+ * @return elastic instance ID or null if unknown
+ */
+ public String managerInstanceToElasticReservation(String managerInstanceID) {
+ if (managerInstanceID == null) {
+ throw new IllegalArgumentException("managerInstanceID may not be null");
+ }
+ return persistence.selectIdFromId(
+ ElasticPersistence.GET_RESERVATION_FROM_MANAGER_INSTANCE,
+ managerInstanceID);
}
- public synchronized String managerCoschedToElasticReservation(String managerCoschedID) {
- return this.managerToElastic(managerCoschedID, IDMap.COSCH);
+ /**
+ * @param managerKey manager group key
+ * @return true if this group key has a corresponding elastic reservation ID
+ */
+ public boolean isElasticReservationIDGroup(String managerKey) {
+ return managerGroupToElasticReservation(managerKey) != null;
}
-
- // -------------------------------------------------------------------------
- // GENERIC ELASTIC --> MANAGER
- // -------------------------------------------------------------------------
-
- protected synchronized String elasticToManager(String elastic, int type) {
- if (elastic == null) {
- return null;
- }
- final Element el = this.cacheElasticKeys.get(elastic);
- if (el == null) {
- return null;
- }
- final IDMap map = (IDMap) el.getObjectValue();
- if (map == null) {
- logger.fatal("illegal object extension, no null values allowed");
- return null;
- }
- if (type == map.type) {
- return map.manager;
+ /**
+ * Returns elastic reservation ID for the manager group ID
+ *
+ * @param managerGroupID elastic reservation ID
+ * @return Manager group ID or null if unknown
+ */
+ public String managerGroupToElasticReservation(String managerGroupID) {
+ if (managerGroupID == null) {
+ throw new IllegalArgumentException("managerGroupID may not be null");
}
- return null;
+ return persistence.selectIdFromId(
+ ElasticPersistence.GET_RESERVATION_FROM_GROUP,
+ managerGroupID);
}
+ /**
+ * @param managerKey manager cosched key
+ * @return true if this cosched key has a corresponding elastic res ID
+ */
+ public boolean isElasticReservationIDCosched(String managerKey) {
+ return this.managerCoschedToElasticReservation(managerKey) != null;
+ }
- // -------------------------------------------------------------------------
- // GENERIC MANAGER --> ELASTIC
- // -------------------------------------------------------------------------
-
- protected synchronized String managerToElastic(String manager, int type) {
- if (manager == null) {
- return null;
- }
- final Element el = this.cacheManageKeys.get(type + manager);
- if (el == null) {
- return null;
- }
- final IDMap map = (IDMap) el.getObjectValue();
- if (map == null) {
- logger.fatal("illegal object extension, no null values allowed");
- return null;
- }
- if (type == map.type) {
- return map.elastic;
+ /**
+ * Returns elastic reservation ID for the manager group ID
+ *
+ * @param managerCoschedID elastic reservation ID
+ * @return Manager group ID or null if unknown
+ */
+ public String managerCoschedToElasticReservation(String managerCoschedID) {
+ if (managerCoschedID == null) {
+ throw new IllegalArgumentException("managerCoschedID may not be null");
}
- return null;
+ return persistence.selectIdFromId(
+ ElasticPersistence.GET_RESERVATION_FROM_COSCHED,
+ managerCoschedID);
}
-
-
- // -------------------------------------------------------------------------
- // OTHER
- // -------------------------------------------------------------------------
-
/**
* @param elasticID elastic instance ID
* @return key name, may be null
- * (e.g. if VM was not created with this protocol)
+ * (e.g. if VM was not created with this protocol)
*/
public String getKeyName(String elasticID) {
if (elasticID == null) {
- return null;
- }
- final Element el = this.cacheElasticKeys.get(elasticID);
- if (el == null) {
- return null;
- }
- final IDMap map = (IDMap) el.getObjectValue();
- if (map == null) {
- logger.fatal("illegal object extension, no null values allowed");
- return null;
+ throw new IllegalArgumentException("elasticID may not be null");
}
- if (map.type != IDMap.INST) {
- return null;
- }
- return map.sshkeyUsed;
+ return persistence.selectIdFromId(
+ ElasticPersistence.GET_SSHKEY_FROM_ELASTIC_INSTANCE,
+ elasticID);
}
-
-
+
// -------------------------------------------------------------------------
// ID GENERATOR
// -------------------------------------------------------------------------
@@ -477,15 +390,22 @@ protected synchronized String newUniqueInstanceID() throws Exception {
protected synchronized String newUniqueReservationID() throws Exception {
return this.newUniqueID(false);
}
-
+
protected synchronized String newUniqueID(boolean instance)
throws Exception {
+ final String query;
+ if (instance) {
+ query = ElasticPersistence.GET_MANAGER_FROM_ELASTIC_INSTANCE;
+ } else {
+ query = ElasticPersistence.GET_RESERVATION;
+ }
+
final int TRIES = 512;
String id = null;
for (int i = 0; i < TRIES; i++) {
id = this.randomID(instance);
- if (this.cacheElasticKeys.isKeyInCache(id)) {
+ if (persistence.selectIdFromId(query, id) != null) {
id = null; // keep looking
} else {
break; // found unique
View
21 ...c/org/nimbustools/messaging/gt4_0_elastic/v2008_05_05/rm/defaults/DefaultIDMgmtProxy.java
@@ -16,10 +16,8 @@
package org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.rm.defaults;
-import net.sf.ehcache.Cache;
import org.nimbustools.messaging.gt4_0_elastic.context.ElasticContext;
import org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.rm.IDMappings;
-import org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.security.defaults.KeyCacheProvider;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.context.ApplicationContext;
@@ -37,7 +35,7 @@
* JNDI config in your alternate installation. That will also then mean you'll get multiple
* DefaultIDMgmt instances, one per service stack).
*/
-public class DefaultIDMgmtProxy implements IDMappings, KeyCacheProvider,
+public class DefaultIDMgmtProxy implements IDMappings,
ApplicationContextAware {
public static final String ID_MAPPING_BEAN_NAME = "nimbus-elastic.rm.realidmappings";
@@ -89,24 +87,11 @@ private IDMappings getReal() throws RuntimeException {
throw new RuntimeException("bean does not implement" +
" IDMappings? '" + ID_MAPPING_BEAN_NAME + "'");
}
- if (!(idMappings instanceof KeyCacheProvider)) {
- throw new RuntimeException("bean does not implement" +
- " KeyCacheProvider? '" + ID_MAPPING_BEAN_NAME + "'");
- }
return this.correctIDMappings;
}
- /**
- * See class notes.
- * @return the proper KeyCacheProvider instance, never null
- * @throws Exception cannot find it
- */
- private KeyCacheProvider getRealKeyCacheProvider() throws RuntimeException {
- return (KeyCacheProvider) this.getReal();
- }
-
// **************************************************************************************
public String newInstanceID(String managerInstanceID, String elasticReservationID,
@@ -208,8 +193,4 @@ public String getOrNewInstanceID(String managerInstanceID,
elasticReservationID,
sshkeyUsed);
}
-
- public Cache getKeyCache() {
- return this.getRealKeyCacheProvider().getKeyCache();
- }
}
View
85 .../msgbridge/src/org/nimbustools/messaging/gt4_0_elastic/v2008_05_05/rm/defaults/IDMap.java
@@ -1,85 +0,0 @@
-/*
- * Copyright 1999-2008 University of Chicago
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy
- * of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.rm.defaults;
-
-import java.io.Serializable;
-
-public class IDMap implements Serializable {
-
- // -------------------------------------------------------------------------
- // STATIC VARIABLES
- // -------------------------------------------------------------------------
-
- public static final int INST = 1;
- public static final int GRP = 2;
- public static final int COSCH = 4;
-
-
- // -------------------------------------------------------------------------
- // INSTANCE VARIABLES
- // -------------------------------------------------------------------------
-
- public final String elastic;
- public final String manager;
- public final int type;
- public final String elasticReservationID; // backmap instances to resid
- public final String sshkeyUsed; // name of key, could be null
-
- // -------------------------------------------------------------------------
- // CONSTRUCTOR
- // -------------------------------------------------------------------------
-
- public IDMap(String elastic, String manager, int type) {
- this(elastic, manager, type, null, null);
- }
-
- public IDMap(String elasticReservationID,
- String elasticInstanceID,
- String managerInstanceID,
- String sshkeyUsed) {
- this(elasticInstanceID, managerInstanceID, INST,
- elasticReservationID, sshkeyUsed);
- if (elasticReservationID == null) {
- throw new IllegalArgumentException("elasticReservationID may not be null");
- }
- }
-
- private IDMap(String elastic, String manager, int type,
- String elasticReservationID, String sshkeyUsed) {
-
- if (elastic == null) {
- throw new IllegalArgumentException("elastic may not be null");
- }
- if (manager == null) {
- throw new IllegalArgumentException("manager may not be null");
- }
-
- switch (type) {
- case INST: break;
- case GRP: break;
- case COSCH: break;
- default:
- throw new IllegalArgumentException("unknown type: " + type);
- }
-
- this.elastic = elastic;
- this.manager = manager;
- this.type = type;
- this.elasticReservationID = elasticReservationID;
- this.sshkeyUsed = sshkeyUsed;
- }
-}
View
50 ...msgbridge/src/org/nimbustools/messaging/gt4_0_elastic/v2008_05_05/rm/defaults/ehcache.xml
@@ -1,50 +0,0 @@
-<?xml version="1.0"?>
-
-<ehcache>
-
- <defaultCache
- maxElementsInMemory="2000"
- eternal="false"
- timeToIdleSeconds="120"
- timeToLiveSeconds="120"
- overflowToDisk="false"
- />
-
- <!-- set via system property for now, spring Cache injection doesn't support
- setting the diskStore path it seems -->
- <diskStore path="ehcache.disk.store.dir"/>
-
- <cache name="nimbus-elasticCache"
- maxElementsInMemory="100000"
- diskPersistent="true"
- diskSpoolBufferSizeMB="0"
- eternal="true"
- timeToIdleSeconds="0"
- timeToLiveSeconds="0"
- overflowToDisk="true"
- clearOnFlush="false"
- />
-
- <cache name="nimbus-elasticCache2"
- maxElementsInMemory="100000"
- diskPersistent="true"
- diskSpoolBufferSizeMB="0"
- eternal="true"
- timeToIdleSeconds="0"
- timeToLiveSeconds="0"
- overflowToDisk="true"
- clearOnFlush="false"
- />
-
- <cache name="nimbus-elasticCache3"
- maxElementsInMemory="5000"
- diskPersistent="true"
- diskSpoolBufferSizeMB="0"
- eternal="true"
- timeToIdleSeconds="0"
- timeToLiveSeconds="0"
- overflowToDisk="true"
- clearOnFlush="false"
- />
-
-</ehcache>
View
137 ...org/nimbustools/messaging/gt4_0_elastic/v2008_05_05/security/defaults/DefaultSSHKeys.java
@@ -16,14 +16,11 @@
package org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.security.defaults;
-import net.sf.ehcache.Cache;
-import net.sf.ehcache.Element;
import org.nimbustools.messaging.gt4_0_elastic.DisabledException;
+import org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.general.ElasticPersistence;
import org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.security.SSHKey;
import org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.security.SSHKeys;
-import java.util.Iterator;
-import java.util.LinkedList;
import java.util.List;
public class DefaultSSHKeys implements SSHKeys {
@@ -39,9 +36,7 @@
// INSTANCE VARIABLES
// -------------------------------------------------------------------------
- // key: 'ownerID', value: List of SSHKey objects
- private Cache sshKeyCache;
- private final KeyCacheProvider keyCacheProvider;
+ final private ElasticPersistence persistence;
protected boolean pubkeyOnly;
protected String splitToken;
@@ -51,24 +46,12 @@
// CONSTRUCTORS
// -------------------------------------------------------------------------
- public DefaultSSHKeys(KeyCacheProvider cacheLocator) {
-
- if (cacheLocator == null) {
- throw new IllegalArgumentException("cacheLocator may not be null");
+ public DefaultSSHKeys(ElasticPersistence persistence) {
+ if (persistence == null) {
+ throw new IllegalArgumentException("persistence may not be null");
}
- this.keyCacheProvider = cacheLocator;
- }
+ this.persistence = persistence;
- // avoids a circular dependency with Spring context instantiation
- private void ensureCache() {
- if (this.sshKeyCache != null) {
- return;
- }
- this.sshKeyCache = this.keyCacheProvider.getKeyCache();
- if (this.sshKeyCache == null) {
- throw new IllegalArgumentException(
- "cacheLocator failed to provide key cache");
- }
}
@@ -130,35 +113,18 @@ public String getSplitToken() throws DisabledException {
*/
public synchronized SSHKey findKey(String ownerID, String keyName) {
- this.ensureCache();
-
if (ownerID == null) {
throw new IllegalArgumentException("ownerID may not be null");
}
if (keyName == null) {
throw new IllegalArgumentException("keyName may not be null");
}
- final Element el = this.sshKeyCache.get(ownerID);
-
- if (el == null) {
- return null; // *** EARLY RETURN ***
- }
-
- final List allOwnerKeys = (List) el.getObjectValue();
- if (allOwnerKeys.isEmpty()) {
- return null; // *** EARLY RETURN ***
+ try {
+ return this.persistence.getSSHKey(ownerID, keyName);
+ } catch (Exception e) {
+ return null;
}
-
- final Iterator iter = allOwnerKeys.iterator();
- while (iter.hasNext()) {
- final SSHKey key = (SSHKey)iter.next();
- if (key.getKeyName().equals(keyName)) {
- return key;
- }
- }
-
- return null;
}
/**
@@ -170,24 +136,17 @@ public synchronized SSHKey findKey(String ownerID, String keyName) {
*/
public synchronized SSHKey[] getOwnerKeys(String ownerID) {
- this.ensureCache();
-
if (ownerID == null) {
throw new IllegalArgumentException("ownerID may not be null");
}
- final Element el = this.sshKeyCache.get(ownerID);
+ try {
+ final List<SSHKey> keys = persistence.getSSHKeys(ownerID);
+ return keys.toArray(new SSHKey[keys.size()]);
- if (el == null) {
- return EMPTY_SSH_KEYS; // *** EARLY RETURN ***
+ } catch (Exception e) {
+ return EMPTY_SSH_KEYS;
}
-
- final List allOwnerKeys = (List) el.getObjectValue();
- if (allOwnerKeys.isEmpty()) {
- return EMPTY_SSH_KEYS; // *** EARLY RETURN ***
- }
-
- return (SSHKey[]) allOwnerKeys.toArray(new SSHKey[allOwnerKeys.size()]);
}
/**
@@ -208,8 +167,6 @@ public synchronized boolean newKey(String ownerID,
String pubKeyContent,
String fingerprint) {
- this.ensureCache();
-
if (ownerID == null) {
throw new IllegalArgumentException("ownerID may not be null");
}
@@ -223,34 +180,21 @@ public synchronized boolean newKey(String ownerID,
throw new IllegalArgumentException("fingerprint may not be null");
}
- final Element el = this.sshKeyCache.get(ownerID);
- final List allOwnerKeys;
- if (el == null) {
- allOwnerKeys = new LinkedList();
- final Element newel = new Element(ownerID, allOwnerKeys);
- this.sshKeyCache.put(newel);
- } else {
- allOwnerKeys = (List) el.getObjectValue();
- }
+ final SSHKey key = new SSHKey(ownerID, keyName,
+ pubKeyContent, fingerprint);
- boolean isNewKey = true;
+ try {
+ final boolean exists = persistence.getSSHKey(ownerID, keyName) != null;
- final Iterator iter = allOwnerKeys.iterator();
- while (iter.hasNext()) {
- final SSHKey key = (SSHKey)iter.next();
- if (key.getKeyName().equals(keyName)) {
- iter.remove();
- isNewKey = false;
- break;
+ if (exists) {
+ persistence.updateSSHKey(key);
+ } else {
+ persistence.putSSHKey(key);
}
+ return !exists;
+ } catch (Exception e) {
+ return false;
}
-
- final SSHKey key = new SSHKey(ownerID, keyName,
- pubKeyContent, fingerprint);
- allOwnerKeys.add(key);
- this.sshKeyCache.flush();
-
- return isNewKey;
}
/**
@@ -262,38 +206,17 @@ public synchronized boolean newKey(String ownerID,
*/
public boolean removeKey(String ownerID, String keyName) {
- this.ensureCache();
-
if (ownerID == null) {
throw new IllegalArgumentException("ownerID may not be null");
}
if (keyName == null) {
throw new IllegalArgumentException("keyName may not be null");
}
- final Element el = this.sshKeyCache.get(ownerID);
-
- if (el == null) {
- return false; // *** EARLY RETURN ***
- }
-
- final List allOwnerKeys = (List) el.getObjectValue();
- if (allOwnerKeys.isEmpty()) {
- return false; // *** EARLY RETURN ***
+ try {
+ return persistence.deleteSSHKey(ownerID, keyName);
+ } catch (Exception e) {
+ return false;
}
-
- boolean deletedKey = false;
-
- final Iterator iter = allOwnerKeys.iterator();
- while (iter.hasNext()) {
- final SSHKey key = (SSHKey)iter.next();
- if (key.getKeyName().equals(keyName)) {
- iter.remove();
- deletedKey = true;
- break;
- }
- }
-
- return deletedKey;
}
}
View
24 ...g/nimbustools/messaging/gt4_0_elastic/v2008_05_05/security/defaults/KeyCacheProvider.java
@@ -1,24 +0,0 @@
-/*
- * Copyright 1999-2008 University of Chicago
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy
- * of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.security.defaults;
-
-import net.sf.ehcache.Cache;
-
-public interface KeyCacheProvider {
-
- public Cache getKeyCache();
-}
View
8 messaging/query/java/source/etc/query/other/main.xml
@@ -161,6 +161,11 @@ http://cxf.apache.org/schemas/jaxrs.xsd">
<constructor-arg ref="userDetailsService" />
</bean>
+ <bean id="nimbus-elastic.rm.persistence"
+ class="org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.general.defaults.DefaultElasticPersistence"
+ init-method="initialize">
+ <constructor-arg value="$OTHER_ELASTIC{elastic.db}"/>
+ </bean>
<bean id="nimbus-query.rm.idmappings"
class="org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.rm.defaults.DefaultIDMgmtProxy" />
@@ -274,8 +279,7 @@ http://cxf.apache.org/schemas/jaxrs.xsd">
class="org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.security.defaults.DefaultSSHKeys"
init-method="validate">
- <!-- key cache provider -->
- <constructor-arg ref="nimbus-query.rm.idmappings" />
+ <constructor-arg ref="nimbus-elastic.rm.persistence" />
<property name="pubkeyOnly" value="$ELASTIC{ssh.pubkey.only}" />
<property name="splitToken" value="$ELASTIC{ssh.split.token}" />
View
12 scripts/integration-suites.sh
@@ -11,6 +11,14 @@ fi
REPORTS_DIR=$1
+# remaining arguments are specific tests to run. If unspecified, all will be run.
+shift 1
+RUN_TEST_SUITES=$@
+
+if [ "X$RUN_TEST_SUITES" = "X" ]; then
+ RUN_TEST_SUITES=$ALL_TEST_SUITES
+fi
+
if [ -e $REPORTS_DIR ]; then
echo "Directory exists, use a different argument: $REPORTS_DIR"
exit 1
@@ -47,10 +55,10 @@ FAILED_SUITES=""
TIMINGS="Timings:\n"
total_time=0
-for test_suite in $ALL_TEST_SUITES; do
+for test_suite in $RUN_TEST_SUITES; do
possible_count=`expr $possible_count + 1`
done
-for test_suite in $ALL_TEST_SUITES; do
+for test_suite in $RUN_TEST_SUITES; do
echo ""
echo ""
View
4 service/service/java/source/share/lib/db-mgmt.xml
@@ -98,7 +98,7 @@
also need a reset -->
<echo message="Deleting disk-caches for the Workspace Service"/>
<delete dir="${workspace.dbdir.prop}/caches" />
- <delete dir="${workspace.dbdir.prop}/elastic-caches" />
+ <delete file="${workspace.dbdir.prop}/elastic.db" />
<echo message="Deleting notification msgs for the Workspace Service"/>
<delete dir="${workspace.dbdir.prop}/msg-sinks" />
</target>
@@ -269,8 +269,6 @@
<mkdir dir="${workspace.dbdir.prop}/caches" />
- <mkdir dir="${workspace.dbdir.prop}/elastic-caches" />
-
<mkdir dir="${workspace.dbdir.prop}/tmpfiles" />
<mkdir dir="${workspace.dbdir.prop}/msg-sinks" />
View
11 service/service/java/tests/suites/basic/home/services/etc/nimbus/elastic/other/main.xml
@@ -76,10 +76,16 @@
<bean id="nimbus-elastic.rm.idmappings"
class="org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.rm.defaults.DefaultIDMgmtProxy" />
+ <bean id="nimbus-elastic.rm.persistence"
+ class="org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.general.defaults.DefaultElasticPersistence"
+ init-method="initialize">
+ <constructor-arg value="$OTHER_ELASTIC{elastic.db}"/>
+ </bean>
+
<!-- Don't reference this bean directly. See DefaultIDMgmtProxy class notes. -->
<bean id="nimbus-elastic.rm.realidmappings"
class="org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.rm.defaults.DefaultIDMgmt">
- <constructor-arg value="$OTHER_ELASTIC{caches.dir}" />
+ <constructor-arg ref="nimbus-elastic.rm.persistence"/>
</bean>
<!-- ************ Spot Instances *********** -->
@@ -191,8 +197,7 @@
class="org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.security.defaults.DefaultSSHKeys"
init-method="validate">
- <!-- key cache provider -->
- <constructor-arg ref="nimbus-elastic.rm.idmappings" />
+ <constructor-arg ref="nimbus-elastic.rm.persistence" />
<property name="pubkeyOnly" value="$ELASTIC{ssh.pubkey.only}" />
<property name="splitToken" value="$ELASTIC{ssh.split.token}" />
View
4 ...service/java/tests/suites/basic/home/services/etc/nimbus/elastic/other/other-elastic.conf
@@ -67,5 +67,5 @@ ra.name.unknown=[unknown]
unknown.pubnet=[unknown]
unknown.privnet=[unknown]
-# disk-persistent caching
-caches.dir=$NIMBUS_HOME/services/var/nimbus/elastic-caches
+
+elastic.db=$NIMBUS_HOME/services/var/nimbus/elastic.db
View
8 service/service/java/tests/suites/basic/home/services/etc/nimbus/query/other/main.xml
@@ -161,6 +161,11 @@ http://cxf.apache.org/schemas/jaxrs.xsd">
<constructor-arg ref="userDetailsService" />
</bean>
+ <bean id="nimbus-elastic.rm.persistence"
+ class="org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.general.defaults.DefaultElasticPersistence"
+ init-method="initialize">
+ <constructor-arg value="$OTHER_ELASTIC{elastic.db}"/>
+ </bean>
<bean id="nimbus-query.rm.idmappings"
class="org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.rm.defaults.DefaultIDMgmtProxy" />
@@ -274,8 +279,7 @@ http://cxf.apache.org/schemas/jaxrs.xsd">
class="org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.security.defaults.DefaultSSHKeys"
init-method="validate">
- <!-- key cache provider -->
- <constructor-arg ref="nimbus-query.rm.idmappings" />
+ <constructor-arg ref="nimbus-elastic.rm.persistence" />
<property name="pubkeyOnly" value="$ELASTIC{ssh.pubkey.only}" />
<property name="splitToken" value="$ELASTIC{ssh.split.token}" />
View
4 service/service/java/tests/suites/basic/home/services/share/nimbus/lib/db-mgmt.xml
@@ -98,7 +98,7 @@
also need a reset -->
<echo message="Deleting disk-caches for the Workspace Service"/>
<delete dir="${workspace.dbdir.prop}/caches" />
- <delete dir="${workspace.dbdir.prop}/elastic-caches" />
+ <delete file="${workspace.dbdir.prop}/elastic.db" />
<echo message="Deleting notification msgs for the Workspace Service"/>
<delete dir="${workspace.dbdir.prop}/msg-sinks" />
</target>
@@ -269,8 +269,6 @@
<mkdir dir="${workspace.dbdir.prop}/caches" />
- <mkdir dir="${workspace.dbdir.prop}/elastic-caches" />
-
<mkdir dir="${workspace.dbdir.prop}/tmpfiles" />
<mkdir dir="${workspace.dbdir.prop}/msg-sinks" />
View
11 service/service/java/tests/suites/failure/home/services/etc/nimbus/elastic/other/main.xml
@@ -76,10 +76,16 @@
<bean id="nimbus-elastic.rm.idmappings"
class="org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.rm.defaults.DefaultIDMgmtProxy" />
+ <bean id="nimbus-elastic.rm.persistence"
+ class="org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.general.defaults.DefaultElasticPersistence"
+ init-method="initialize">
+ <constructor-arg value="$OTHER_ELASTIC{elastic.db}"/>
+ </bean>
+
<!-- Don't reference this bean directly. See DefaultIDMgmtProxy class notes. -->
<bean id="nimbus-elastic.rm.realidmappings"
class="org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.rm.defaults.DefaultIDMgmt">
- <constructor-arg value="$OTHER_ELASTIC{caches.dir}" />
+ <constructor-arg ref="nimbus-elastic.rm.persistence"/>
</bean>
<!-- ************ Spot Instances *********** -->
@@ -191,8 +197,7 @@
class="org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.security.defaults.DefaultSSHKeys"
init-method="validate">
- <!-- key cache provider -->
- <constructor-arg ref="nimbus-elastic.rm.idmappings" />
+ <constructor-arg ref="nimbus-elastic.rm.persistence" />
<property name="pubkeyOnly" value="$ELASTIC{ssh.pubkey.only}" />
<property name="splitToken" value="$ELASTIC{ssh.split.token}" />
View
4 ...rvice/java/tests/suites/failure/home/services/etc/nimbus/elastic/other/other-elastic.conf
@@ -67,5 +67,5 @@ ra.name.unknown=[unknown]
unknown.pubnet=[unknown]
unknown.privnet=[unknown]
-# disk-persistent caching
-caches.dir=$NIMBUS_HOME/services/var/nimbus/elastic-caches
+
+elastic.db=$NIMBUS_HOME/services/var/nimbus/elastic.db
View
8 service/service/java/tests/suites/failure/home/services/etc/nimbus/query/other/main.xml
@@ -161,6 +161,11 @@ http://cxf.apache.org/schemas/jaxrs.xsd">
<constructor-arg ref="userDetailsService" />
</bean>
+ <bean id="nimbus-elastic.rm.persistence"
+ class="org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.general.defaults.DefaultElasticPersistence"
+ init-method="initialize">
+ <constructor-arg value="$OTHER_ELASTIC{elastic.db}"/>
+ </bean>
<bean id="nimbus-query.rm.idmappings"
class="org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.rm.defaults.DefaultIDMgmtProxy" />
@@ -274,8 +279,7 @@ http://cxf.apache.org/schemas/jaxrs.xsd">
class="org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.security.defaults.DefaultSSHKeys"
init-method="validate">
- <!-- key cache provider -->
- <constructor-arg ref="nimbus-query.rm.idmappings" />
+ <constructor-arg ref="nimbus-elastic.rm.persistence" />
<property name="pubkeyOnly" value="$ELASTIC{ssh.pubkey.only}" />
<property name="splitToken" value="$ELASTIC{ssh.split.token}" />
View
4 service/service/java/tests/suites/failure/home/services/share/nimbus/lib/db-mgmt.xml
@@ -98,7 +98,7 @@
also need a reset -->
<echo message="Deleting disk-caches for the Workspace Service"/>
<delete dir="${workspace.dbdir.prop}/caches" />
- <delete dir="${workspace.dbdir.prop}/elastic-caches" />
+ <delete file="${workspace.dbdir.prop}/elastic.db" />
<echo message="Deleting notification msgs for the Workspace Service"/>
<delete dir="${workspace.dbdir.prop}/msg-sinks" />
</target>
@@ -269,8 +269,6 @@
<mkdir dir="${workspace.dbdir.prop}/caches" />
- <mkdir dir="${workspace.dbdir.prop}/elastic-caches" />
-
<mkdir dir="${workspace.dbdir.prop}/tmpfiles" />
<mkdir dir="${workspace.dbdir.prop}/msg-sinks" />
View
11 ...e/service/java/tests/suites/spotinstances/home/services/etc/nimbus/elastic/other/main.xml
@@ -76,10 +76,16 @@
<bean id="nimbus-elastic.rm.idmappings"
class="org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.rm.defaults.DefaultIDMgmtProxy" />
+ <bean id="nimbus-elastic.rm.persistence"
+ class="org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.general.defaults.DefaultElasticPersistence"
+ init-method="initialize">
+ <constructor-arg value="$OTHER_ELASTIC{elastic.db}"/>
+ </bean>
+
<!-- Don't reference this bean directly. See DefaultIDMgmtProxy class notes. -->
<bean id="nimbus-elastic.rm.realidmappings"
class="org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.rm.defaults.DefaultIDMgmt">
- <constructor-arg value="$OTHER_ELASTIC{caches.dir}" />
+ <constructor-arg ref="nimbus-elastic.rm.persistence"/>
</bean>
<!-- ************ Spot Instances *********** -->
@@ -191,8 +197,7 @@
class="org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.security.defaults.DefaultSSHKeys"
init-method="validate">
- <!-- key cache provider -->
- <constructor-arg ref="nimbus-elastic.rm.idmappings" />
+ <constructor-arg ref="nimbus-elastic.rm.persistence" />
<property name="pubkeyOnly" value="$ELASTIC{ssh.pubkey.only}" />
<property name="splitToken" value="$ELASTIC{ssh.split.token}" />
View
4 ...java/tests/suites/spotinstances/home/services/etc/nimbus/elastic/other/other-elastic.conf
@@ -67,5 +67,5 @@ ra.name.unknown=[unknown]
unknown.pubnet=[unknown]
unknown.privnet=[unknown]
-# disk-persistent caching
-caches.dir=$NIMBUS_HOME/services/var/nimbus/elastic-caches
+
+elastic.db=$NIMBUS_HOME/services/var/nimbus/elastic.db
View
8 ...ice/service/java/tests/suites/spotinstances/home/services/etc/nimbus/query/other/main.xml
@@ -161,6 +161,11 @@ http://cxf.apache.org/schemas/jaxrs.xsd">
<constructor-arg ref="userDetailsService" />
</bean>
+ <bean id="nimbus-elastic.rm.persistence"
+ class="org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.general.defaults.DefaultElasticPersistence"
+ init-method="initialize">
+ <constructor-arg value="$OTHER_ELASTIC{elastic.db}"/>
+ </bean>
<bean id="nimbus-query.rm.idmappings"
class="org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.rm.defaults.DefaultIDMgmtProxy" />
@@ -274,8 +279,7 @@ http://cxf.apache.org/schemas/jaxrs.xsd">
class="org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.security.defaults.DefaultSSHKeys"
init-method="validate">
- <!-- key cache provider -->
- <constructor-arg ref="nimbus-query.rm.idmappings" />
+ <constructor-arg ref="nimbus-elastic.rm.persistence" />
<property name="pubkeyOnly" value="$ELASTIC{ssh.pubkey.only}" />
<property name="splitToken" value="$ELASTIC{ssh.split.token}" />
View
4 service/service/java/tests/suites/spotinstances/home/services/share/nimbus/lib/db-mgmt.xml
@@ -98,7 +98,7 @@
also need a reset -->
<echo message="Deleting disk-caches for the Workspace Service"/>
<delete dir="${workspace.dbdir.prop}/caches" />
- <delete dir="${workspace.dbdir.prop}/elastic-caches" />
+ <delete file="${workspace.dbdir.prop}/elastic.db" />
<echo message="Deleting notification msgs for the Workspace Service"/>
<delete dir="${workspace.dbdir.prop}/msg-sinks" />
</target>
@@ -269,8 +269,6 @@
<mkdir dir="${workspace.dbdir.prop}/caches" />
- <mkdir dir="${workspace.dbdir.prop}/elastic-caches" />
-
<mkdir dir="${workspace.dbdir.prop}/tmpfiles" />
<mkdir dir="${workspace.dbdir.prop}/msg-sinks" />

0 comments on commit c7f75a9

Please sign in to comment.