Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.1.6 issue - java.lang.NoClassDefFoundError: org.apache.cassandra.service.LuceneStorageProxy (initialization failure) #39

Open
wants to merge 1 commit into
base: cassandra-4.1.6
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import org.apache.cassandra.schema.TableMetadata;
import org.apache.cassandra.service.reads.range.LuceneReplicaPlanIterator;
import org.apache.cassandra.service.reads.range.LuceneReplicaPlanMerger;
import org.apache.cassandra.transport.Dispatcher;
//import org.apache.cassandra.service.StorageProxy.RangeIterator;
//import org.apache.cassandra.service.StorageProxy.RangeMerger;

Expand All @@ -53,7 +54,7 @@ public class LuceneStorageProxy {
try {
systemKeyspaceQuery = StorageProxy.class.getDeclaredMethod("systemKeyspaceQuery", List.class);
systemKeyspaceQuery.setAccessible(true);
fetchRows = StorageProxy.class.getDeclaredMethod("fetchRows", List.class, ConsistencyLevel.class, long.class);
fetchRows = StorageProxy.class.getDeclaredMethod("fetchRows", List.class, ConsistencyLevel.class, Dispatcher.RequestTime.class);
fetchRows.setAccessible(true);
} catch (ReflectiveOperationException e) {
throw new RuntimeException(e);
Expand All @@ -64,14 +65,15 @@ private static boolean systemKeyspaceQuery(List<? extends ReadCommand> cmds) thr
return (boolean) systemKeyspaceQuery.invoke(null, cmds);
}

private static PartitionIterator fetchRows(List<SinglePartitionReadCommand> commands, ConsistencyLevel cl, long queryStartNanoTime)
private static PartitionIterator fetchRows(List<SinglePartitionReadCommand> commands, ConsistencyLevel cl,
Dispatcher.RequestTime requestTime)
throws ReflectiveOperationException {
return (PartitionIterator) fetchRows.invoke(null, commands, cl, queryStartNanoTime);
return (PartitionIterator) fetchRows.invoke(null, commands, cl, requestTime);
}

public static PartitionIterator read(SinglePartitionReadCommand.Group group,
ConsistencyLevel consistencyLevel,
long queryStartNanoTime)
Dispatcher.RequestTime requestTime)
throws UnavailableException, IsBootstrappingException, ReadFailureException, ReadTimeoutException,
InvalidRequestException, ReflectiveOperationException {

Expand All @@ -80,16 +82,16 @@ public static PartitionIterator read(SinglePartitionReadCommand.Group group,
throw new IsBootstrappingException();
}

return readRegular(group, consistencyLevel, queryStartNanoTime);
return readRegular(group, consistencyLevel, requestTime);
}

private static PartitionIterator readRegular(SinglePartitionReadCommand.Group group,
ConsistencyLevel consistencyLevel,
long queryStartNanoTime)
Dispatcher.RequestTime requestTime)
throws UnavailableException, ReadFailureException, ReadTimeoutException, ReflectiveOperationException {
long start = System.nanoTime();
try {
PartitionIterator result = fetchRows(group.queries, consistencyLevel, queryStartNanoTime);
PartitionIterator result = fetchRows(group.queries, consistencyLevel, requestTime);
// If we have more than one command, then despite each read command honoring the limit, the total result
// might not honor it and so we should enforce it
if (group.queries.size() > 1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ class IndexQueryHandler extends QueryHandler with Logging {
// Read data
val data = query match {
case group: Group if group.queries.size > 1 =>
LuceneStorageProxy.read(group, consistency, requestTime.startedAtNanos())
LuceneStorageProxy.read(group, consistency, requestTime)
case _ => query.execute(consistency, state.getClientState, requestTime)
}

Expand Down