Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

use composite key format for solr core resources; This is a breaking …

…change, must reindex or at least re insert solr core info if you are upgrading
  • Loading branch information...
commit 7b18f06f286820d4f3181c1ddafda6dfb2cc9672 1 parent d140f78
@tjake authored
Showing with 12 additions and 4 deletions.
  1. +12 −4 src/org/apache/solr/core/SolandraCoreContainer.java
View
16 src/org/apache/solr/core/SolandraCoreContainer.java
@@ -241,6 +241,10 @@ public static ByteBuffer readCoreResource(String coreName, String resourceName)
}
ByteBuffer resourceValue = null;
+
+ ByteBuffer coreKey = CassandraUtils.hashKeyBytes(coreName.getBytes("UTF-8"),
+ CassandraUtils.delimeterBytes, "resources".getBytes("UTF-8"));
+
ByteBuffer coreNameBytes = ByteBufferUtil.bytes(coreName);
ByteBuffer resourceNameBytes = ByteBufferUtil.bytes(resourceName);
@@ -250,7 +254,7 @@ public static ByteBuffer readCoreResource(String coreName, String resourceName)
coreNameBytes);
List<Row> rows = CassandraUtils.robustRead(
- coreNameBytes,
+ coreKey,
queryPath,
Arrays.asList(resourceNameBytes),
ConsistencyLevel.QUORUM);
@@ -294,11 +298,15 @@ public static void writeCoreResource(String coreName, String resourceName, Strin
logger.debug(resourceValue);
}
- ByteBuffer coreNameBytes = ByteBufferUtil.bytes(coreName);
- ByteBuffer resourceNameBytes = ByteBufferUtil.bytes(resourceName);
- RowMutation rm = new RowMutation(CassandraUtils.keySpace, coreNameBytes);
+ ByteBuffer coreKey = CassandraUtils.hashKeyBytes(coreName.getBytes("UTF-8"),
+ CassandraUtils.delimeterBytes, "resources".getBytes("UTF-8"));
+
+ RowMutation rm = new RowMutation(CassandraUtils.keySpace, coreKey);
+ ByteBuffer coreNameBytes = ByteBufferUtil.bytes(coreName);
+ ByteBuffer resourceNameBytes = ByteBufferUtil.bytes(resourceName);
+
QueryPath queryPath = new QueryPath(
CassandraUtils.schemaInfoColumnFamily,
coreNameBytes,
Please sign in to comment.
Something went wrong with that request. Please try again.