-
Notifications
You must be signed in to change notification settings - Fork 37
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
Add cross-partition scan options #1294
Changes from 1 commit
118aef8
66cd3a2
7bffcbb
36e1010
0ab1406
f670f4f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,6 @@ | |
import com.scalar.db.common.checker.OperationChecker; | ||
import com.scalar.db.config.DatabaseConfig; | ||
import com.scalar.db.exception.storage.ExecutionException; | ||
import com.scalar.db.util.ScalarDbUtils; | ||
import java.util.List; | ||
import java.util.Optional; | ||
import javax.annotation.Nonnull; | ||
|
@@ -45,6 +44,13 @@ public class Cassandra extends AbstractDistributedStorage { | |
@Inject | ||
public Cassandra(DatabaseConfig config) { | ||
super(config); | ||
|
||
if (config.isCrossPartitionScanFilteringEnabled() | ||
|| config.isCrossPartitionScanOrderingEnabled()) { | ||
throw new IllegalArgumentException( | ||
"Cross-partition scan with filtering or ordering is not supported in Cassandra"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is related to https://github.com/scalar-labs/scalardb/pull/1294/files#diff-660ca76c9b64d94000e0854e2a18fdc5e6a69c028a74b8cacfa4ef733d4604c2L111, but sorry, I forgot why these types of scan were prohibitted. Could you tell me that? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the question. Basically, it's hard to push down all kinds of filtering and ordering to NoSQL databases. But for filtering, we can support ScalarDB-side filtering in the near future since we already have a logic for evaluating all types of our predicates. |
||
} | ||
|
||
clusterManager = new ClusterManager(config); | ||
Session session = clusterManager.getSession(); | ||
|
||
|
@@ -63,7 +69,7 @@ public Cassandra(DatabaseConfig config) { | |
new TableMetadataManager( | ||
new CassandraAdmin(clusterManager, config), | ||
config.getMetadataCacheExpirationTimeSecs()); | ||
operationChecker = new OperationChecker(metadataManager); | ||
operationChecker = new OperationChecker(config, metadataManager); | ||
} | ||
|
||
@VisibleForTesting | ||
|
@@ -108,11 +114,6 @@ public Scanner scan(Scan scan) throws ExecutionException { | |
scan = copyAndSetTargetToIfNot(scan); | ||
operationChecker.check(scan); | ||
|
||
if (ScalarDbUtils.isRelational(scan)) { | ||
throw new UnsupportedOperationException( | ||
"Scanning all records with orderings or conditions is not supported in Cassandra"); | ||
} | ||
|
||
ResultSet results = handlers.select().handle(scan); | ||
|
||
return new ScannerImpl( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default value is
false
in v4.0.0 or later, but it should betrue
in v3.x for backward compatibility and warned when using it withSERIALIZABLE
. I will handle this after this PR is merged to the master.