-
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 create, truncate and delete table implementation to Cassandra Admin #278
Add create, truncate and delete table implementation to Cassandra Admin #278
Conversation
…ate_truncate_delete_implementation_to_cassandra_admin # Conflicts: # core/src/main/java/com/scalar/db/api/DistributedStorageAdmin.java # core/src/main/java/com/scalar/db/storage/cassandra/CassandraTableMetadataManager.java
f316f58
to
97196fe
Compare
@@ -62,6 +78,61 @@ | |||
// assume that recovery is a spied object | |||
private RecoveryHandler recovery; | |||
|
|||
protected static void createTables() throws ExecutionException { |
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.
Once thing I omitted to say in the JDBCAdmin
PR is that I am refactoring the ConsensusCommitIntegrationTestXXX
classes temporarily to make use of the few XXXAdmin
implementations that are already completed.
Once all the XXXAdmin
implementations will be completed, I should be able to simplify things further.
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.
Thank you! Overall LGTM! Just left some comments and suggestions. Please check them!
...src/integration-test/java/com/scalar/db/storage/cassandra/CassandraAdminIntegrationTest.java
Outdated
Show resolved
Hide resolved
core/src/integration-test/java/com/scalar/db/storage/cassandra/CassandraIntegrationTest.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/scalar/db/storage/cassandra/CassandraAdmin.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/scalar/db/storage/cassandra/CassandraTableMetadataManager.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/scalar/db/storage/cassandra/CassandraAdmin.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/scalar/db/storage/cassandra/CassandraAdmin.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/scalar/db/storage/cassandra/CassandraAdmin.java
Outdated
Show resolved
Hide resolved
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.
Just left a question and very minor suggestions. Please check them! Thanks.
core/src/main/java/com/scalar/db/storage/cassandra/CassandraAdmin.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/scalar/db/storage/cassandra/CassandraTableMetadataManager.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/scalar/db/storage/cassandra/CassandraAdmin.java
Outdated
Show resolved
Hide resolved
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.
LGTM! Thank you!
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.
Very sorry for the late review.
Overall looking good! Thank you!
Left some comments and questions.
core/src/main/java/com/scalar/db/storage/cassandra/CassandraTableMetadataManager.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/scalar/db/storage/cassandra/CassandraTableMetadataManager.java
Outdated
Show resolved
Hide resolved
...src/integration-test/java/com/scalar/db/storage/cassandra/CassandraAdminIntegrationTest.java
Show resolved
Hide resolved
} | ||
|
||
@Override | ||
public void createTable( | ||
String namespace, String table, TableMetadata metadata, Map<String, String> options) | ||
throws ExecutionException { | ||
throw new UnsupportedOperationException("implement later"); | ||
String fullKeyspace = fullKeyspace(namespace); | ||
createKeyspaceIfNotExists(fullKeyspace, options); |
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.
I'm wondering if createTable
should create a keyspace if it doesn't exist.
Users try to create a table with options (usually) specifically for table creation, not options for keyspace, so in such a case, it will create a keyspace with the default options most of the time? (but we don't know users want the default options for the keyspace)
I think simply throwing an exception might be safer and more intuitive.
What do you think?
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.
@feeblefakie @brfrn169
I see. If you are available, let's discuss this point after the daily meeting today.
core/src/main/java/com/scalar/db/storage/cassandra/CassandraAdmin.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/scalar/db/storage/cassandra/CassandraAdmin.java
Outdated
Show resolved
Hide resolved
As @brfrn169 suggested, let's merge this first then refactor the |
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.
LGTM! Thank you!
…to_cassandra_admin
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.
LGTM! Thank you!
This completes the implementation for the
CassandraAdmin
and theCassandraTableMetadataManager
.Please have a look when you get a chance.