Repository: cassandra Updated Branches: refs/heads/trunk d3bd26eb3 -> 946aaa7b0
Add meaningful toString() impls patch by Jogesh Anand; reviewed by Dinesh Joshi for CASSANDRA-13653 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/946aaa7b Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/946aaa7b Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/946aaa7b Branch: refs/heads/trunk Commit: 946aaa7b06f2ccd697e31dcc15c29468da523311 Parents: d3bd26e Author: djanand <jogeshan...@gmail.com> Authored: Sat Mar 31 17:53:09 2018 -0500 Committer: Jason Brown <jasedbr...@gmail.com> Committed: Thu Apr 5 05:19:22 2018 -0700 ---------------------------------------------------------------------- CHANGES.txt | 1 + .../org/apache/cassandra/cql3/Attributes.java | 8 ++++++++ .../cassandra/cql3/BatchQueryOptions.java | 8 ++++++++ .../org/apache/cassandra/cql3/QueryOptions.java | 8 ++++++++ .../org/apache/cassandra/cql3/WhereClause.java | 8 ++++++++ .../cql3/conditions/ColumnCondition.java | 20 ++++++++++++++++++++ .../cql3/conditions/ColumnConditions.java | 8 ++++++++ .../restrictions/CustomIndexExpression.java | 8 ++++++++ .../cql3/restrictions/IndexRestrictions.java | 8 ++++++++ .../restrictions/MultiColumnRestriction.java | 8 ++++++++ .../cql3/restrictions/RestrictionSet.java | 8 ++++++++ .../restrictions/RestrictionSetWrapper.java | 8 ++++++++ .../restrictions/StatementRestrictions.java | 8 ++++++++ .../cql3/statements/AlterKeyspaceStatement.java | 8 ++++++++ .../cql3/statements/AlterRoleStatement.java | 8 ++++++++ .../statements/AlterTableStatementColumn.java | 8 ++++++++ .../cql3/statements/AlterTypeStatement.java | 8 ++++++++ .../cql3/statements/AuthorizationStatement.java | 8 ++++++++ .../cassandra/cql3/statements/CFProperties.java | 8 ++++++++ .../cassandra/cql3/statements/CFStatement.java | 8 ++++++++ .../cql3/statements/CQL3CasRequest.java | 8 ++++++++ .../statements/CreateAggregateStatement.java | 8 ++++++++ .../statements/CreateFunctionStatement.java | 8 ++++++++ .../cql3/statements/CreateIndexStatement.java | 8 ++++++++ .../statements/CreateKeyspaceStatement.java | 8 ++++++++ .../cql3/statements/CreateRoleStatement.java | 8 ++++++++ .../cql3/statements/CreateTableStatement.java | 8 ++++++++ .../cql3/statements/CreateTriggerStatement.java | 8 ++++++++ .../cql3/statements/CreateTypeStatement.java | 8 ++++++++ .../cql3/statements/CreateViewStatement.java | 8 ++++++++ .../cql3/statements/DeleteStatement.java | 8 ++++++++ .../cql3/statements/DropAggregateStatement.java | 8 ++++++++ .../cql3/statements/DropFunctionStatement.java | 8 ++++++++ .../cql3/statements/DropIndexStatement.java | 8 ++++++++ .../cql3/statements/DropKeyspaceStatement.java | 8 ++++++++ .../cql3/statements/DropRoleStatement.java | 8 ++++++++ .../cql3/statements/DropTableStatement.java | 8 ++++++++ .../cql3/statements/DropTriggerStatement.java | 8 ++++++++ .../cql3/statements/DropTypeStatement.java | 8 ++++++++ .../cql3/statements/DropViewStatement.java | 8 ++++++++ .../cql3/statements/GrantRoleStatement.java | 8 ++++++++ .../cassandra/cql3/statements/IndexTarget.java | 8 ++++++++ .../statements/ListPermissionsStatement.java | 8 ++++++++ .../cql3/statements/ListRolesStatement.java | 8 ++++++++ .../cql3/statements/ListUsersStatement.java | 8 ++++++++ .../PermissionsManagementStatement.java | 8 ++++++++ .../statements/RevokePermissionsStatement.java | 8 ++++++++ .../cql3/statements/RevokeRoleStatement.java | 8 ++++++++ .../statements/RoleManagementStatement.java | 8 ++++++++ .../cql3/statements/SelectStatement.java | 8 ++++++++ .../cql3/statements/TruncateStatement.java | 8 ++++++++ .../cql3/statements/UpdateStatement.java | 8 ++++++++ .../cassandra/cql3/statements/UseStatement.java | 8 ++++++++ 53 files changed, 429 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index 4fd76fc..b3617c3 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 4.0 + * Add meaningful toString() impls (CASSANDRA-13653) * Add sstableloader option to accept target keyspace name (CASSANDRA-13884) * Move processing of EchoMessage response to gossip stage (CASSANDRA-13713) * Add coordinator write metric per CF (CASSANDRA-14232) http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/Attributes.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/Attributes.java b/src/java/org/apache/cassandra/cql3/Attributes.java index 262a510..11acc2a 100644 --- a/src/java/org/apache/cassandra/cql3/Attributes.java +++ b/src/java/org/apache/cassandra/cql3/Attributes.java @@ -29,6 +29,8 @@ import org.apache.cassandra.exceptions.InvalidRequestException; import org.apache.cassandra.schema.TableMetadata; import org.apache.cassandra.serializers.MarshalException; import org.apache.cassandra.utils.ByteBufferUtil; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; /** * Utility class for the Parser to gather attributes for modification @@ -169,4 +171,10 @@ public class Attributes return new ColumnSpecification(ksName, cfName, new ColumnIdentifier("[ttl]", true), Int32Type.instance); } } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/BatchQueryOptions.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/BatchQueryOptions.java b/src/java/org/apache/cassandra/cql3/BatchQueryOptions.java index 3d3cda0..22fb45b 100644 --- a/src/java/org/apache/cassandra/cql3/BatchQueryOptions.java +++ b/src/java/org/apache/cassandra/cql3/BatchQueryOptions.java @@ -26,6 +26,8 @@ import org.apache.cassandra.utils.MD5Digest; import org.apache.cassandra.db.ConsistencyLevel; import org.apache.cassandra.service.QueryState; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; public abstract class BatchQueryOptions { @@ -141,4 +143,10 @@ public abstract class BatchQueryOptions return getQueryOrIdList().get(i) instanceof MD5Digest; } } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/QueryOptions.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/QueryOptions.java b/src/java/org/apache/cassandra/cql3/QueryOptions.java index e4d443d..d89db82 100644 --- a/src/java/org/apache/cassandra/cql3/QueryOptions.java +++ b/src/java/org/apache/cassandra/cql3/QueryOptions.java @@ -35,6 +35,8 @@ import org.apache.cassandra.transport.CBUtil; import org.apache.cassandra.transport.ProtocolException; import org.apache.cassandra.transport.ProtocolVersion; import org.apache.cassandra.utils.Pair; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; /** * Options for a query. @@ -518,4 +520,10 @@ public abstract class QueryOptions return flags; } } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/WhereClause.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/WhereClause.java b/src/java/org/apache/cassandra/cql3/WhereClause.java index 9d4e51a..d663231 100644 --- a/src/java/org/apache/cassandra/cql3/WhereClause.java +++ b/src/java/org/apache/cassandra/cql3/WhereClause.java @@ -23,6 +23,8 @@ import java.util.List; import com.google.common.collect.ImmutableList; import org.apache.cassandra.cql3.restrictions.CustomIndexExpression; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; public final class WhereClause { @@ -71,4 +73,10 @@ public final class WhereClause return new WhereClause(this); } } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/conditions/ColumnCondition.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/conditions/ColumnCondition.java b/src/java/org/apache/cassandra/cql3/conditions/ColumnCondition.java index f3e0ee2..1380471 100644 --- a/src/java/org/apache/cassandra/cql3/conditions/ColumnCondition.java +++ b/src/java/org/apache/cassandra/cql3/conditions/ColumnCondition.java @@ -31,6 +31,8 @@ import org.apache.cassandra.schema.ColumnMetadata; import org.apache.cassandra.schema.TableMetadata; import org.apache.cassandra.transport.ProtocolVersion; import org.apache.cassandra.utils.ByteBufferUtil; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; import static org.apache.cassandra.cql3.statements.RequestValidations.*; @@ -628,6 +630,12 @@ public abstract class ColumnCondition } return false; } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } /** @@ -675,6 +683,12 @@ public abstract class ColumnCondition } return false; } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } public static class Raw @@ -835,5 +849,11 @@ public abstract class ColumnCondition throw invalidRequest("Slice conditions ( %s ) are not supported on durations", operator); } } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/conditions/ColumnConditions.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/conditions/ColumnConditions.java b/src/java/org/apache/cassandra/cql3/conditions/ColumnConditions.java index 3057b05..4e4b043 100644 --- a/src/java/org/apache/cassandra/cql3/conditions/ColumnConditions.java +++ b/src/java/org/apache/cassandra/cql3/conditions/ColumnConditions.java @@ -29,6 +29,8 @@ import org.apache.cassandra.cql3.functions.Function; import org.apache.cassandra.cql3.statements.CQL3CasRequest; import org.apache.cassandra.db.Clustering; import org.apache.cassandra.schema.ColumnMetadata; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; /** * A set of <code>ColumnCondition</code>s. @@ -162,4 +164,10 @@ public final class ColumnConditions extends AbstractConditions { } } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/restrictions/CustomIndexExpression.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/restrictions/CustomIndexExpression.java b/src/java/org/apache/cassandra/cql3/restrictions/CustomIndexExpression.java index 6ea6842..68bfb48 100644 --- a/src/java/org/apache/cassandra/cql3/restrictions/CustomIndexExpression.java +++ b/src/java/org/apache/cassandra/cql3/restrictions/CustomIndexExpression.java @@ -22,6 +22,8 @@ import org.apache.cassandra.schema.TableMetadata; import org.apache.cassandra.cql3.*; import org.apache.cassandra.db.filter.RowFilter; import org.apache.cassandra.db.marshal.AbstractType; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; public class CustomIndexExpression { @@ -53,4 +55,10 @@ public class CustomIndexExpression .orElseThrow(() -> IndexRestrictions.indexNotFound(targetIndex, table)), value.bindAndGet(options)); } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/restrictions/IndexRestrictions.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/restrictions/IndexRestrictions.java b/src/java/org/apache/cassandra/cql3/restrictions/IndexRestrictions.java index ced04ed..7cf9b12 100644 --- a/src/java/org/apache/cassandra/cql3/restrictions/IndexRestrictions.java +++ b/src/java/org/apache/cassandra/cql3/restrictions/IndexRestrictions.java @@ -24,6 +24,8 @@ import java.util.List; import org.apache.cassandra.schema.TableMetadata; import org.apache.cassandra.cql3.IndexName; import org.apache.cassandra.exceptions.InvalidRequestException; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; public class IndexRestrictions { @@ -80,4 +82,10 @@ public class IndexRestrictions { return new InvalidRequestException(String.format(CUSTOM_EXPRESSION_NOT_SUPPORTED, indexName.getIdx())); } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/restrictions/MultiColumnRestriction.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/restrictions/MultiColumnRestriction.java b/src/java/org/apache/cassandra/cql3/restrictions/MultiColumnRestriction.java index 07ebb74..2ce4595 100644 --- a/src/java/org/apache/cassandra/cql3/restrictions/MultiColumnRestriction.java +++ b/src/java/org/apache/cassandra/cql3/restrictions/MultiColumnRestriction.java @@ -29,6 +29,8 @@ import org.apache.cassandra.db.MultiCBuilder; import org.apache.cassandra.db.filter.RowFilter; import org.apache.cassandra.index.Index; import org.apache.cassandra.index.SecondaryIndexManager; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; import static org.apache.cassandra.cql3.statements.RequestValidations.checkFalse; import static org.apache.cassandra.cql3.statements.RequestValidations.checkNotNull; @@ -564,4 +566,10 @@ public abstract class MultiColumnRestriction implements SingleRestriction throw new UnsupportedOperationException("Secondary indexes do not support IS NOT NULL restrictions"); } } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/restrictions/RestrictionSet.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/restrictions/RestrictionSet.java b/src/java/org/apache/cassandra/cql3/restrictions/RestrictionSet.java index 574d3e4..8a9ee3c 100644 --- a/src/java/org/apache/cassandra/cql3/restrictions/RestrictionSet.java +++ b/src/java/org/apache/cassandra/cql3/restrictions/RestrictionSet.java @@ -28,6 +28,8 @@ import org.apache.cassandra.cql3.restrictions.SingleColumnRestriction.ContainsRe import org.apache.cassandra.db.filter.RowFilter; import org.apache.cassandra.exceptions.InvalidRequestException; import org.apache.cassandra.index.SecondaryIndexManager; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; /** * Sets of column restrictions. @@ -354,4 +356,10 @@ final class RestrictionSet implements Restrictions, Iterable<SingleRestriction> return endOfData(); } } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/restrictions/RestrictionSetWrapper.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/restrictions/RestrictionSetWrapper.java b/src/java/org/apache/cassandra/cql3/restrictions/RestrictionSetWrapper.java index 5ebcc05..cae5307 100644 --- a/src/java/org/apache/cassandra/cql3/restrictions/RestrictionSetWrapper.java +++ b/src/java/org/apache/cassandra/cql3/restrictions/RestrictionSetWrapper.java @@ -25,6 +25,8 @@ import org.apache.cassandra.cql3.QueryOptions; import org.apache.cassandra.cql3.functions.Function; import org.apache.cassandra.db.filter.RowFilter; import org.apache.cassandra.index.SecondaryIndexManager; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; /** * A <code>RestrictionSet</code> wrapper that can be extended to allow to modify the <code>RestrictionSet</code> @@ -108,4 +110,10 @@ class RestrictionSetWrapper implements Restrictions { return restrictions.getRestrictions(columnDef); } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/restrictions/StatementRestrictions.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/restrictions/StatementRestrictions.java b/src/java/org/apache/cassandra/cql3/restrictions/StatementRestrictions.java index b368c22..e852e2a 100644 --- a/src/java/org/apache/cassandra/cql3/restrictions/StatementRestrictions.java +++ b/src/java/org/apache/cassandra/cql3/restrictions/StatementRestrictions.java @@ -36,6 +36,8 @@ import org.apache.cassandra.index.SecondaryIndexManager; import org.apache.cassandra.schema.ColumnMetadata; import org.apache.cassandra.schema.TableMetadata; import org.apache.cassandra.utils.btree.BTreeSet; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; import static org.apache.cassandra.cql3.statements.RequestValidations.checkFalse; import static org.apache.cassandra.cql3.statements.RequestValidations.checkNotNull; @@ -826,4 +828,10 @@ public final class StatementRestrictions { return hasRegularColumnsRestrictions; } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/statements/AlterKeyspaceStatement.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/statements/AlterKeyspaceStatement.java b/src/java/org/apache/cassandra/cql3/statements/AlterKeyspaceStatement.java index b1ab138..8fab143 100644 --- a/src/java/org/apache/cassandra/cql3/statements/AlterKeyspaceStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/AlterKeyspaceStatement.java @@ -32,6 +32,8 @@ import org.apache.cassandra.service.ClientWarn; import org.apache.cassandra.service.QueryState; import org.apache.cassandra.service.StorageService; import org.apache.cassandra.transport.Event; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; public class AlterKeyspaceStatement extends SchemaAlteringStatement { @@ -109,4 +111,10 @@ public class AlterKeyspaceStatement extends SchemaAlteringStatement MigrationManager.announceKeyspaceUpdate(newKsm, isLocalOnly); return new Event.SchemaChange(Event.SchemaChange.Change.UPDATED, keyspace()); } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/statements/AlterRoleStatement.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/statements/AlterRoleStatement.java b/src/java/org/apache/cassandra/cql3/statements/AlterRoleStatement.java index 6134741..e419135 100644 --- a/src/java/org/apache/cassandra/cql3/statements/AlterRoleStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/AlterRoleStatement.java @@ -24,6 +24,8 @@ import org.apache.cassandra.cql3.RoleName; import org.apache.cassandra.exceptions.*; import org.apache.cassandra.service.ClientState; import org.apache.cassandra.transport.messages.ResultMessage; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; public class AlterRoleStatement extends AuthenticationStatement { @@ -87,4 +89,10 @@ public class AlterRoleStatement extends AuthenticationStatement DatabaseDescriptor.getRoleManager().alterRole(state.getUser(), role, opts); return null; } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/statements/AlterTableStatementColumn.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/statements/AlterTableStatementColumn.java b/src/java/org/apache/cassandra/cql3/statements/AlterTableStatementColumn.java index c1ba0d3..66565f6 100644 --- a/src/java/org/apache/cassandra/cql3/statements/AlterTableStatementColumn.java +++ b/src/java/org/apache/cassandra/cql3/statements/AlterTableStatementColumn.java @@ -19,6 +19,8 @@ package org.apache.cassandra.cql3.statements; import org.apache.cassandra.schema.ColumnMetadata; import org.apache.cassandra.cql3.CQL3Type; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; /** * Stores a column name and optionally type for an Alter Table statement definition. @@ -63,4 +65,10 @@ public class AlterTableStatementColumn { return isStatic; } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/statements/AlterTypeStatement.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/statements/AlterTypeStatement.java b/src/java/org/apache/cassandra/cql3/statements/AlterTypeStatement.java index 614b482..5170347 100644 --- a/src/java/org/apache/cassandra/cql3/statements/AlterTypeStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/AlterTypeStatement.java @@ -29,6 +29,8 @@ import org.apache.cassandra.schema.Schema; import org.apache.cassandra.service.ClientState; import org.apache.cassandra.service.QueryState; import org.apache.cassandra.transport.Event; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; public abstract class AlterTypeStatement extends SchemaAlteringStatement { @@ -177,4 +179,10 @@ public abstract class AlterTypeStatement extends SchemaAlteringStatement } } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/statements/AuthorizationStatement.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/statements/AuthorizationStatement.java b/src/java/org/apache/cassandra/cql3/statements/AuthorizationStatement.java index 83081c8..218703e 100644 --- a/src/java/org/apache/cassandra/cql3/statements/AuthorizationStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/AuthorizationStatement.java @@ -28,6 +28,8 @@ import org.apache.cassandra.exceptions.RequestValidationException; import org.apache.cassandra.service.ClientState; import org.apache.cassandra.service.QueryState; import org.apache.cassandra.transport.messages.ResultMessage; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; public abstract class AuthorizationStatement extends ParsedStatement implements CQLStatement { @@ -66,4 +68,10 @@ public abstract class AuthorizationStatement extends ParsedStatement implements } return resource; } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/statements/CFProperties.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/statements/CFProperties.java b/src/java/org/apache/cassandra/cql3/statements/CFProperties.java index 92dd994..f80baf5 100644 --- a/src/java/org/apache/cassandra/cql3/statements/CFProperties.java +++ b/src/java/org/apache/cassandra/cql3/statements/CFProperties.java @@ -23,6 +23,8 @@ import java.util.Map; import org.apache.cassandra.cql3.ColumnIdentifier; import org.apache.cassandra.db.marshal.AbstractType; import org.apache.cassandra.db.marshal.ReversedType; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; public class CFProperties { @@ -53,4 +55,10 @@ public class CFProperties } return definedOrdering.get(targetIdentifier) ? ReversedType.getInstance(type) : type; } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/statements/CFStatement.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/statements/CFStatement.java b/src/java/org/apache/cassandra/cql3/statements/CFStatement.java index 136860e..c971db2 100644 --- a/src/java/org/apache/cassandra/cql3/statements/CFStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/CFStatement.java @@ -20,6 +20,8 @@ package org.apache.cassandra.cql3.statements; import org.apache.cassandra.cql3.CFName; import org.apache.cassandra.service.ClientState; import org.apache.cassandra.exceptions.InvalidRequestException; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; /** * Abstract class for statements that apply on a given column family. @@ -63,4 +65,10 @@ public abstract class CFStatement extends ParsedStatement { return cfName.getColumnFamily(); } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/statements/CQL3CasRequest.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/statements/CQL3CasRequest.java b/src/java/org/apache/cassandra/cql3/statements/CQL3CasRequest.java index 8619945..5a84f22 100644 --- a/src/java/org/apache/cassandra/cql3/statements/CQL3CasRequest.java +++ b/src/java/org/apache/cassandra/cql3/statements/CQL3CasRequest.java @@ -34,6 +34,8 @@ import org.apache.cassandra.db.partitions.PartitionUpdate; import org.apache.cassandra.exceptions.InvalidRequestException; import org.apache.cassandra.service.CASRequest; import org.apache.cassandra.utils.Pair; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; /** * Processed CAS conditions and update on potentially multiple rows of the same partition. @@ -367,4 +369,10 @@ public class CQL3CasRequest implements CASRequest return true; } } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/statements/CreateAggregateStatement.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/statements/CreateAggregateStatement.java b/src/java/org/apache/cassandra/cql3/statements/CreateAggregateStatement.java index ade2752..328695a 100644 --- a/src/java/org/apache/cassandra/cql3/statements/CreateAggregateStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/CreateAggregateStatement.java @@ -36,6 +36,8 @@ import org.apache.cassandra.schema.MigrationManager; import org.apache.cassandra.service.QueryState; import org.apache.cassandra.transport.Event; import org.apache.cassandra.transport.ProtocolVersion; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; /** * A {@code CREATE AGGREGATE} statement parsed from a CQL query. @@ -258,4 +260,10 @@ public final class CreateAggregateStatement extends SchemaAlteringStatement r.addAll(argTypes); return r; } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/statements/CreateFunctionStatement.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/statements/CreateFunctionStatement.java b/src/java/org/apache/cassandra/cql3/statements/CreateFunctionStatement.java index 2e1f78c..c74afed 100644 --- a/src/java/org/apache/cassandra/cql3/statements/CreateFunctionStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/CreateFunctionStatement.java @@ -34,6 +34,8 @@ import org.apache.cassandra.service.ClientState; import org.apache.cassandra.schema.MigrationManager; import org.apache.cassandra.service.QueryState; import org.apache.cassandra.transport.Event; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; /** * A {@code CREATE FUNCTION} statement parsed from a CQL query. @@ -180,4 +182,10 @@ public final class CreateFunctionStatement extends SchemaAlteringStatement AbstractType<?> type = rawType.prepare(functionName.keyspace).getType(); return type; } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/statements/CreateIndexStatement.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/statements/CreateIndexStatement.java b/src/java/org/apache/cassandra/cql3/statements/CreateIndexStatement.java index a0955af..bc4c7df 100644 --- a/src/java/org/apache/cassandra/cql3/statements/CreateIndexStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/CreateIndexStatement.java @@ -43,6 +43,8 @@ import org.apache.cassandra.schema.TableMetadata; import org.apache.cassandra.service.ClientState; import org.apache.cassandra.service.QueryState; import org.apache.cassandra.transport.Event; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; import static org.apache.cassandra.cql3.statements.RequestValidations.checkFalse; import static org.apache.cassandra.cql3.statements.RequestValidations.invalidRequest; @@ -255,4 +257,10 @@ public class CreateIndexStatement extends SchemaAlteringStatement // Creating an index is akin to updating the CF return new Event.SchemaChange(Event.SchemaChange.Change.UPDATED, Event.SchemaChange.Target.TABLE, keyspace(), columnFamily()); } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/statements/CreateKeyspaceStatement.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/statements/CreateKeyspaceStatement.java b/src/java/org/apache/cassandra/cql3/statements/CreateKeyspaceStatement.java index f859ff7..7ecca25 100644 --- a/src/java/org/apache/cassandra/cql3/statements/CreateKeyspaceStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/CreateKeyspaceStatement.java @@ -30,6 +30,8 @@ import org.apache.cassandra.schema.Schema; import org.apache.cassandra.schema.SchemaConstants; import org.apache.cassandra.service.*; import org.apache.cassandra.transport.Event; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; /** A <code>CREATE KEYSPACE</code> statement parsed from a CQL query. */ public class CreateKeyspaceStatement extends SchemaAlteringStatement @@ -134,4 +136,10 @@ public class CreateKeyspaceStatement extends SchemaAlteringStatement throw new RuntimeException(e); } } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/statements/CreateRoleStatement.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/statements/CreateRoleStatement.java b/src/java/org/apache/cassandra/cql3/statements/CreateRoleStatement.java index 9be4c89..5d667ff 100644 --- a/src/java/org/apache/cassandra/cql3/statements/CreateRoleStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/CreateRoleStatement.java @@ -23,6 +23,8 @@ import org.apache.cassandra.cql3.RoleName; import org.apache.cassandra.exceptions.*; import org.apache.cassandra.service.ClientState; import org.apache.cassandra.transport.messages.ResultMessage; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; public class CreateRoleStatement extends AuthenticationStatement { @@ -99,4 +101,10 @@ public class CreateRoleStatement extends AuthenticationStatement } } } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/statements/CreateTableStatement.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/statements/CreateTableStatement.java b/src/java/org/apache/cassandra/cql3/statements/CreateTableStatement.java index 1b09c0b..ceb23fb 100644 --- a/src/java/org/apache/cassandra/cql3/statements/CreateTableStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/CreateTableStatement.java @@ -34,6 +34,8 @@ import org.apache.cassandra.schema.*; import org.apache.cassandra.service.ClientState; import org.apache.cassandra.service.QueryState; import org.apache.cassandra.transport.Event; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; /** A {@code CREATE TABLE} parsed from a CQL query statement. */ public class CreateTableStatement extends SchemaAlteringStatement @@ -411,4 +413,10 @@ public class CreateTableStatement extends SchemaAlteringStatement columnAliases.add(alias); } } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/statements/CreateTriggerStatement.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/statements/CreateTriggerStatement.java b/src/java/org/apache/cassandra/cql3/statements/CreateTriggerStatement.java index 0f12b9c..364202e 100644 --- a/src/java/org/apache/cassandra/cql3/statements/CreateTriggerStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/CreateTriggerStatement.java @@ -34,6 +34,8 @@ import org.apache.cassandra.service.ClientState; import org.apache.cassandra.service.QueryState; import org.apache.cassandra.transport.Event; import org.apache.cassandra.triggers.TriggerExecutor; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; public class CreateTriggerStatement extends SchemaAlteringStatement { @@ -95,4 +97,10 @@ public class CreateTriggerStatement extends SchemaAlteringStatement MigrationManager.announceTableUpdate(updated, isLocalOnly); return new Event.SchemaChange(Event.SchemaChange.Change.UPDATED, Event.SchemaChange.Target.TABLE, keyspace(), columnFamily()); } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/statements/CreateTypeStatement.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/statements/CreateTypeStatement.java b/src/java/org/apache/cassandra/cql3/statements/CreateTypeStatement.java index 4462bc2..2bd7bba 100644 --- a/src/java/org/apache/cassandra/cql3/statements/CreateTypeStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/CreateTypeStatement.java @@ -32,6 +32,8 @@ import org.apache.cassandra.schema.Types; import org.apache.cassandra.service.ClientState; import org.apache.cassandra.service.QueryState; import org.apache.cassandra.transport.Event; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; public class CreateTypeStatement extends SchemaAlteringStatement { @@ -132,4 +134,10 @@ public class CreateTypeStatement extends SchemaAlteringStatement MigrationManager.announceNewType(type, isLocalOnly); return new Event.SchemaChange(Event.SchemaChange.Change.CREATED, Event.SchemaChange.Target.TYPE, keyspace(), name.getStringTypeName()); } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/statements/CreateViewStatement.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/statements/CreateViewStatement.java b/src/java/org/apache/cassandra/cql3/statements/CreateViewStatement.java index 2b707a7..a3b6e89 100644 --- a/src/java/org/apache/cassandra/cql3/statements/CreateViewStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/CreateViewStatement.java @@ -51,6 +51,8 @@ import org.apache.cassandra.service.ClientState; import org.apache.cassandra.service.ClientWarn; import org.apache.cassandra.service.QueryState; import org.apache.cassandra.transport.Event; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; public class CreateViewStatement extends SchemaAlteringStatement { @@ -371,4 +373,10 @@ public class CreateViewStatement extends SchemaAlteringStatement columns.add(def.name); return !isPk; } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/statements/DeleteStatement.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/statements/DeleteStatement.java b/src/java/org/apache/cassandra/cql3/statements/DeleteStatement.java index 8f3349e..7822bc8 100644 --- a/src/java/org/apache/cassandra/cql3/statements/DeleteStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/DeleteStatement.java @@ -30,6 +30,8 @@ import org.apache.cassandra.exceptions.InvalidRequestException; import org.apache.cassandra.schema.ColumnMetadata; import org.apache.cassandra.schema.TableMetadata; import org.apache.cassandra.utils.Pair; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; import static org.apache.cassandra.cql3.statements.RequestValidations.checkFalse; import static org.apache.cassandra.cql3.statements.RequestValidations.checkTrue; @@ -183,4 +185,10 @@ public class DeleteStatement extends ModificationStatement return stmt; } } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/statements/DropAggregateStatement.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/statements/DropAggregateStatement.java b/src/java/org/apache/cassandra/cql3/statements/DropAggregateStatement.java index 1a02903..a1a946c 100644 --- a/src/java/org/apache/cassandra/cql3/statements/DropAggregateStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/DropAggregateStatement.java @@ -33,6 +33,8 @@ import org.apache.cassandra.schema.Schema; import org.apache.cassandra.service.ClientState; import org.apache.cassandra.service.QueryState; import org.apache.cassandra.transport.Event; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; /** * A {@code DROP AGGREGATE} statement parsed from a CQL query. @@ -149,4 +151,10 @@ public final class DropAggregateStatement extends SchemaAlteringStatement AbstractType<?> type = rawType.prepare(functionName.keyspace).getType(); return type; } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/statements/DropFunctionStatement.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/statements/DropFunctionStatement.java b/src/java/org/apache/cassandra/cql3/statements/DropFunctionStatement.java index 87bfff8..e74733a 100644 --- a/src/java/org/apache/cassandra/cql3/statements/DropFunctionStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/DropFunctionStatement.java @@ -37,6 +37,8 @@ import org.apache.cassandra.schema.Schema; import org.apache.cassandra.service.ClientState; import org.apache.cassandra.service.QueryState; import org.apache.cassandra.transport.Event; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; /** * A {@code DROP FUNCTION} statement parsed from a CQL query. @@ -186,4 +188,10 @@ public final class DropFunctionStatement extends SchemaAlteringStatement } return old; } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/statements/DropIndexStatement.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/statements/DropIndexStatement.java b/src/java/org/apache/cassandra/cql3/statements/DropIndexStatement.java index 2420f3b..12a2f32 100644 --- a/src/java/org/apache/cassandra/cql3/statements/DropIndexStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/DropIndexStatement.java @@ -30,6 +30,8 @@ import org.apache.cassandra.schema.MigrationManager; import org.apache.cassandra.service.QueryState; import org.apache.cassandra.transport.Event; import org.apache.cassandra.transport.messages.ResultMessage; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; public class DropIndexStatement extends SchemaAlteringStatement { @@ -113,4 +115,10 @@ public class DropIndexStatement extends SchemaAlteringStatement indexName, keyspace())); }); } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/statements/DropKeyspaceStatement.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/statements/DropKeyspaceStatement.java b/src/java/org/apache/cassandra/cql3/statements/DropKeyspaceStatement.java index 21040f9..002da0f 100644 --- a/src/java/org/apache/cassandra/cql3/statements/DropKeyspaceStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/DropKeyspaceStatement.java @@ -27,6 +27,8 @@ import org.apache.cassandra.schema.Schema; import org.apache.cassandra.service.ClientState; import org.apache.cassandra.service.QueryState; import org.apache.cassandra.transport.Event; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; public class DropKeyspaceStatement extends SchemaAlteringStatement { @@ -70,4 +72,10 @@ public class DropKeyspaceStatement extends SchemaAlteringStatement throw e; } } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/statements/DropRoleStatement.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/statements/DropRoleStatement.java b/src/java/org/apache/cassandra/cql3/statements/DropRoleStatement.java index 55fa83a..89502bb 100644 --- a/src/java/org/apache/cassandra/cql3/statements/DropRoleStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/DropRoleStatement.java @@ -23,6 +23,8 @@ import org.apache.cassandra.cql3.RoleName; import org.apache.cassandra.exceptions.*; import org.apache.cassandra.service.ClientState; import org.apache.cassandra.transport.messages.ResultMessage; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; public class DropRoleStatement extends AuthenticationStatement { @@ -72,4 +74,10 @@ public class DropRoleStatement extends AuthenticationStatement DatabaseDescriptor.getAuthorizer().revokeAllOn(role); return null; } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/statements/DropTableStatement.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/statements/DropTableStatement.java b/src/java/org/apache/cassandra/cql3/statements/DropTableStatement.java index 83b787e..ec0d285 100644 --- a/src/java/org/apache/cassandra/cql3/statements/DropTableStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/DropTableStatement.java @@ -30,6 +30,8 @@ import org.apache.cassandra.schema.ViewMetadata; import org.apache.cassandra.service.ClientState; import org.apache.cassandra.service.QueryState; import org.apache.cassandra.transport.Event; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; public class DropTableStatement extends SchemaAlteringStatement { @@ -101,4 +103,10 @@ public class DropTableStatement extends SchemaAlteringStatement throw e; } } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/statements/DropTriggerStatement.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/statements/DropTriggerStatement.java b/src/java/org/apache/cassandra/cql3/statements/DropTriggerStatement.java index b9536fb..05d691c 100644 --- a/src/java/org/apache/cassandra/cql3/statements/DropTriggerStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/DropTriggerStatement.java @@ -32,6 +32,8 @@ import org.apache.cassandra.schema.Triggers; import org.apache.cassandra.service.ClientState; import org.apache.cassandra.service.QueryState; import org.apache.cassandra.transport.Event; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; public class DropTriggerStatement extends SchemaAlteringStatement { @@ -82,4 +84,10 @@ public class DropTriggerStatement extends SchemaAlteringStatement return new Event.SchemaChange(Event.SchemaChange.Change.UPDATED, Event.SchemaChange.Target.TABLE, keyspace(), columnFamily()); } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/statements/DropTypeStatement.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/statements/DropTypeStatement.java b/src/java/org/apache/cassandra/cql3/statements/DropTypeStatement.java index 5909888..44ce2ad 100644 --- a/src/java/org/apache/cassandra/cql3/statements/DropTypeStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/DropTypeStatement.java @@ -30,6 +30,8 @@ import org.apache.cassandra.schema.TableMetadata; import org.apache.cassandra.service.ClientState; import org.apache.cassandra.service.QueryState; import org.apache.cassandra.transport.Event; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; public class DropTypeStatement extends SchemaAlteringStatement { @@ -120,4 +122,10 @@ public class DropTypeStatement extends SchemaAlteringStatement MigrationManager.announceTypeDrop(toDrop, isLocalOnly); return new Event.SchemaChange(Event.SchemaChange.Change.DROPPED, Event.SchemaChange.Target.TYPE, keyspace(), name.getStringTypeName()); } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/statements/DropViewStatement.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/statements/DropViewStatement.java b/src/java/org/apache/cassandra/cql3/statements/DropViewStatement.java index 1909e89..5ea0b95 100644 --- a/src/java/org/apache/cassandra/cql3/statements/DropViewStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/DropViewStatement.java @@ -29,6 +29,8 @@ import org.apache.cassandra.schema.TableMetadataRef; import org.apache.cassandra.service.ClientState; import org.apache.cassandra.service.QueryState; import org.apache.cassandra.transport.Event; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; public class DropViewStatement extends SchemaAlteringStatement { @@ -66,4 +68,10 @@ public class DropViewStatement extends SchemaAlteringStatement throw e; } } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/statements/GrantRoleStatement.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/statements/GrantRoleStatement.java b/src/java/org/apache/cassandra/cql3/statements/GrantRoleStatement.java index a22a99a..6a9f160 100644 --- a/src/java/org/apache/cassandra/cql3/statements/GrantRoleStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/GrantRoleStatement.java @@ -23,6 +23,8 @@ import org.apache.cassandra.exceptions.RequestExecutionException; import org.apache.cassandra.exceptions.RequestValidationException; import org.apache.cassandra.service.ClientState; import org.apache.cassandra.transport.messages.ResultMessage; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; public class GrantRoleStatement extends RoleManagementStatement { @@ -36,4 +38,10 @@ public class GrantRoleStatement extends RoleManagementStatement DatabaseDescriptor.getRoleManager().grantRole(state.getUser(), role, grantee); return null; } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/statements/IndexTarget.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/statements/IndexTarget.java b/src/java/org/apache/cassandra/cql3/statements/IndexTarget.java index a82f600..e00494a 100644 --- a/src/java/org/apache/cassandra/cql3/statements/IndexTarget.java +++ b/src/java/org/apache/cassandra/cql3/statements/IndexTarget.java @@ -20,6 +20,8 @@ package org.apache.cassandra.cql3.statements; import org.apache.cassandra.schema.ColumnMetadata; import org.apache.cassandra.schema.TableMetadata; import org.apache.cassandra.cql3.ColumnIdentifier; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; public class IndexTarget { @@ -124,4 +126,10 @@ public class IndexTarget throw new AssertionError("Unrecognized index target type " + s); } } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/statements/ListPermissionsStatement.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/statements/ListPermissionsStatement.java b/src/java/org/apache/cassandra/cql3/statements/ListPermissionsStatement.java index aa2157a..f556645 100644 --- a/src/java/org/apache/cassandra/cql3/statements/ListPermissionsStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/ListPermissionsStatement.java @@ -29,6 +29,8 @@ import org.apache.cassandra.exceptions.RequestExecutionException; import org.apache.cassandra.exceptions.RequestValidationException; import org.apache.cassandra.service.ClientState; import org.apache.cassandra.transport.messages.ResultMessage; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; public class ListPermissionsStatement extends AuthorizationStatement { @@ -129,4 +131,10 @@ public class ListPermissionsStatement extends AuthorizationStatement } return new ResultMessage.Rows(result); } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/statements/ListRolesStatement.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/statements/ListRolesStatement.java b/src/java/org/apache/cassandra/cql3/statements/ListRolesStatement.java index 7ed460c..bc738a6 100644 --- a/src/java/org/apache/cassandra/cql3/statements/ListRolesStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/ListRolesStatement.java @@ -34,6 +34,8 @@ import org.apache.cassandra.db.marshal.UTF8Type; import org.apache.cassandra.exceptions.*; import org.apache.cassandra.service.ClientState; import org.apache.cassandra.transport.messages.ResultMessage; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; public class ListRolesStatement extends AuthorizationStatement { @@ -125,4 +127,10 @@ public class ListRolesStatement extends AuthorizationStatement } return new ResultMessage.Rows(result); } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/statements/ListUsersStatement.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/statements/ListUsersStatement.java b/src/java/org/apache/cassandra/cql3/statements/ListUsersStatement.java index 1347fba..288a9cb 100644 --- a/src/java/org/apache/cassandra/cql3/statements/ListUsersStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/ListUsersStatement.java @@ -30,6 +30,8 @@ import org.apache.cassandra.cql3.ResultSet; import org.apache.cassandra.db.marshal.BooleanType; import org.apache.cassandra.db.marshal.UTF8Type; import org.apache.cassandra.transport.messages.ResultMessage; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; public class ListUsersStatement extends ListRolesStatement { @@ -58,4 +60,10 @@ public class ListUsersStatement extends ListRolesStatement return new ResultMessage.Rows(result); } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/statements/PermissionsManagementStatement.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/statements/PermissionsManagementStatement.java b/src/java/org/apache/cassandra/cql3/statements/PermissionsManagementStatement.java index 70d6f54..7dfe579 100644 --- a/src/java/org/apache/cassandra/cql3/statements/PermissionsManagementStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/PermissionsManagementStatement.java @@ -27,6 +27,8 @@ import org.apache.cassandra.exceptions.InvalidRequestException; import org.apache.cassandra.exceptions.RequestValidationException; import org.apache.cassandra.exceptions.UnauthorizedException; import org.apache.cassandra.service.ClientState; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; public abstract class PermissionsManagementStatement extends AuthorizationStatement { @@ -76,4 +78,10 @@ public abstract class PermissionsManagementStatement extends AuthorizationStatem for (Permission p : permissions) state.ensureHasPermission(p, resource); } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/statements/RevokePermissionsStatement.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/statements/RevokePermissionsStatement.java b/src/java/org/apache/cassandra/cql3/statements/RevokePermissionsStatement.java index 9acc685..83ad375 100644 --- a/src/java/org/apache/cassandra/cql3/statements/RevokePermissionsStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/RevokePermissionsStatement.java @@ -27,6 +27,8 @@ import org.apache.cassandra.exceptions.RequestExecutionException; import org.apache.cassandra.exceptions.RequestValidationException; import org.apache.cassandra.service.ClientState; import org.apache.cassandra.transport.messages.ResultMessage; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; public class RevokePermissionsStatement extends PermissionsManagementStatement { @@ -40,4 +42,10 @@ public class RevokePermissionsStatement extends PermissionsManagementStatement DatabaseDescriptor.getAuthorizer().revoke(state.getUser(), permissions, resource, grantee); return null; } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/statements/RevokeRoleStatement.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/statements/RevokeRoleStatement.java b/src/java/org/apache/cassandra/cql3/statements/RevokeRoleStatement.java index 4de905f..804291d 100644 --- a/src/java/org/apache/cassandra/cql3/statements/RevokeRoleStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/RevokeRoleStatement.java @@ -23,6 +23,8 @@ import org.apache.cassandra.exceptions.RequestExecutionException; import org.apache.cassandra.exceptions.RequestValidationException; import org.apache.cassandra.service.ClientState; import org.apache.cassandra.transport.messages.ResultMessage; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; public class RevokeRoleStatement extends RoleManagementStatement { @@ -36,4 +38,10 @@ public class RevokeRoleStatement extends RoleManagementStatement DatabaseDescriptor.getRoleManager().revokeRole(state.getUser(), role, grantee); return null; } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/statements/RoleManagementStatement.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/statements/RoleManagementStatement.java b/src/java/org/apache/cassandra/cql3/statements/RoleManagementStatement.java index e12b626..215560f 100644 --- a/src/java/org/apache/cassandra/cql3/statements/RoleManagementStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/RoleManagementStatement.java @@ -25,6 +25,8 @@ import org.apache.cassandra.exceptions.InvalidRequestException; import org.apache.cassandra.exceptions.RequestValidationException; import org.apache.cassandra.exceptions.UnauthorizedException; import org.apache.cassandra.service.ClientState; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; public abstract class RoleManagementStatement extends AuthenticationStatement { @@ -52,4 +54,10 @@ public abstract class RoleManagementStatement extends AuthenticationStatement if (!DatabaseDescriptor.getRoleManager().isExistingRole(grantee)) throw new InvalidRequestException(String.format("%s doesn't exist", grantee.getRoleName())); } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java index ae206a5..04ebff5 100644 --- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java @@ -66,6 +66,8 @@ import org.apache.cassandra.transport.ProtocolVersion; import org.apache.cassandra.transport.messages.ResultMessage; import org.apache.cassandra.utils.ByteBufferUtil; import org.apache.cassandra.utils.FBUtilities; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; import static org.apache.cassandra.cql3.statements.RequestValidations.checkFalse; import static org.apache.cassandra.cql3.statements.RequestValidations.checkNotNull; @@ -1374,4 +1376,10 @@ public class SelectStatement implements CQLStatement return 0; } } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/statements/TruncateStatement.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/statements/TruncateStatement.java b/src/java/org/apache/cassandra/cql3/statements/TruncateStatement.java index 300d8f4..406456c 100644 --- a/src/java/org/apache/cassandra/cql3/statements/TruncateStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/TruncateStatement.java @@ -30,6 +30,8 @@ import org.apache.cassandra.service.ClientState; import org.apache.cassandra.service.QueryState; import org.apache.cassandra.service.StorageProxy; import org.apache.cassandra.transport.messages.ResultMessage; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; public class TruncateStatement extends CFStatement implements CQLStatement { @@ -88,4 +90,10 @@ public class TruncateStatement extends CFStatement implements CQLStatement } return null; } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java b/src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java index a373ba1..ab84ed0 100644 --- a/src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java @@ -33,6 +33,8 @@ import org.apache.cassandra.schema.ColumnMetadata; import org.apache.cassandra.schema.TableMetadata; import org.apache.cassandra.utils.ByteBufferUtil; import org.apache.cassandra.utils.Pair; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; import static org.apache.cassandra.cql3.statements.RequestValidations.checkContainsNoDuplicates; import static org.apache.cassandra.cql3.statements.RequestValidations.checkFalse; @@ -325,4 +327,10 @@ public class UpdateStatement extends ModificationStatement attrs); } } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/946aaa7b/src/java/org/apache/cassandra/cql3/statements/UseStatement.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/statements/UseStatement.java b/src/java/org/apache/cassandra/cql3/statements/UseStatement.java index 02a678a..8068705 100644 --- a/src/java/org/apache/cassandra/cql3/statements/UseStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/UseStatement.java @@ -24,6 +24,8 @@ import org.apache.cassandra.exceptions.UnauthorizedException; import org.apache.cassandra.transport.messages.ResultMessage; import org.apache.cassandra.service.ClientState; import org.apache.cassandra.service.QueryState; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; public class UseStatement extends ParsedStatement implements CQLStatement { @@ -65,4 +67,10 @@ public class UseStatement extends ParsedStatement implements CQLStatement // but for some unit tests we need to set the keyspace (e.g. for tests with DROP INDEX) return execute(state, options, System.nanoTime()); } + + @Override + public String toString() + { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org