kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | 23b509af140fb587e19ee13d9f388f51f623f96cd8014c62dc52b43ea65ab52a |
|---|---|
| Author | Alexandre Dutra <alexandre.dutra@datastax.com> · 2015-12-28 14:53 +01:00 |
| Committer | olim7t <omichallat+github@gmail.com> · 2016-01-04 18:04 +01:00 |
| Parents | 697c5b0360ec |
7 files changed
modified driver-core/src/main/java/com/datastax/driver/core/Connection.java +43 −43
| @@ -70,7 +70,7 @@ | ||
| 70 | 70 | |
| 71 | 71 | volatile long maxIdleTime; |
| 72 | 72 | |
| 73 | - public final InetSocketAddress address; | |
| 73 | + final InetSocketAddress address; | |
| 74 | 74 | private final String name; |
| 75 | 75 | |
| 76 | 76 | @VisibleForTesting |
| @@ -81,7 +81,7 @@ | ||
| 81 | 81 | final Dispatcher dispatcher; |
| 82 | 82 | |
| 83 | 83 | // Used by connection pooling to count how many requests are "in flight" on that connection. |
| 84 | - public final AtomicInteger inFlight = new AtomicInteger(0); | |
| 84 | + final AtomicInteger inFlight = new AtomicInteger(0); | |
| 85 | 85 | |
| 86 | 86 | private final AtomicInteger writer = new AtomicInteger(0); |
| 87 | 87 | private volatile String keyspace; |
| @@ -118,7 +118,7 @@ | ||
| 118 | 118 | this(name, address, factory, null); |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | - public ListenableFuture<Void> initAsync() { | |
| 121 | + ListenableFuture<Void> initAsync() { | |
| 122 | 122 | if (factory.isShutdown) |
| 123 | 123 | return Futures.immediateFailedFuture(new ConnectionException(address, "Connection factory is shut down")); |
| 124 | 124 | |
| @@ -386,11 +386,11 @@ | ||
| 386 | 386 | return new UnsupportedProtocolVersionException(address, triedVersion, serverProtocolVersion); |
| 387 | 387 | } |
| 388 | 388 | |
| 389 | - public boolean isDefunct() { | |
| 389 | + boolean isDefunct() { | |
| 390 | 390 | return isDefunct.get(); |
| 391 | 391 | } |
| 392 | 392 | |
| 393 | - public int maxAvailableStreams() { | |
| 393 | + int maxAvailableStreams() { | |
| 394 | 394 | return dispatcher.streamIdHandler.maxAvailableStreams(); |
| 395 | 395 | } |
| 396 | 396 | |
| @@ -420,11 +420,11 @@ | ||
| 420 | 420 | owner.onConnectionDefunct(this); |
| 421 | 421 | } |
| 422 | 422 | |
| 423 | - public String keyspace() { | |
| 423 | + String keyspace() { | |
| 424 | 424 | return keyspace; |
| 425 | 425 | } |
| 426 | 426 | |
| 427 | - public void setKeyspace(String keyspace) throws ConnectionException { | |
| 427 | + void setKeyspace(String keyspace) throws ConnectionException { | |
| 428 | 428 | if (keyspace == null) |
| 429 | 429 | return; |
| 430 | 430 | |
| @@ -482,17 +482,17 @@ | ||
| 482 | 482 | * @throws ConnectionException if the connection is closed |
| 483 | 483 | * @throws TransportException if an I/O error while sending the request |
| 484 | 484 | */ |
| 485 | - public Future write(Message.Request request) throws ConnectionException, BusyConnectionException { | |
| 485 | + Future write(Message.Request request) throws ConnectionException, BusyConnectionException { | |
| 486 | 486 | Future future = new Future(request); |
| 487 | 487 | write(future); |
| 488 | 488 | return future; |
| 489 | 489 | } |
| 490 | 490 | |
| 491 | - public ResponseHandler write(ResponseCallback callback) throws ConnectionException, BusyConnectionException { | |
| 491 | + ResponseHandler write(ResponseCallback callback) throws ConnectionException, BusyConnectionException { | |
| 492 | 492 | return write(callback, true); |
| 493 | 493 | } |
| 494 | 494 | |
| 495 | - public ResponseHandler write(ResponseCallback callback, boolean startTimeout) throws ConnectionException, BusyConnectionException { | |
| 495 | + ResponseHandler write(ResponseCallback callback, boolean startTimeout) throws ConnectionException, BusyConnectionException { | |
| 496 | 496 | |
| 497 | 497 | Message.Request request = callback.request(); |
| 498 | 498 | |
| @@ -591,7 +591,7 @@ | ||
| 591 | 591 | ((HostConnectionPool) owner).returnConnection(this); |
| 592 | 592 | } |
| 593 | 593 | |
| 594 | - public boolean isClosed() { | |
| 594 | + boolean isClosed() { | |
| 595 | 595 | return closeFuture.get() != null; |
| 596 | 596 | } |
| 597 | 597 | |
| @@ -605,7 +605,7 @@ | ||
| 605 | 605 | * @return a future that will complete once the connection has terminated. |
| 606 | 606 | * @see #tryTerminate(boolean) |
| 607 | 607 | */ |
| 608 | - public CloseFuture closeAsync() { | |
| 608 | + CloseFuture closeAsync() { | |
| 609 | 609 | |
| 610 | 610 | ConnectionCloseFuture future = new ConnectionCloseFuture(); |
| 611 | 611 | if (!closeFuture.compareAndSet(null, future)) { |
| @@ -674,9 +674,9 @@ | ||
| 674 | 674 | return String.format("Connection[%s, inFlight=%d, closed=%b]", name, inFlight.get(), isClosed()); |
| 675 | 675 | } |
| 676 | 676 | |
| 677 | - public static class Factory { | |
| 677 | + static class Factory { | |
| 678 | 678 | |
| 679 | - public final Timer timer; | |
| 679 | + final Timer timer; | |
| 680 | 680 | |
| 681 | 681 | private final EventLoopGroup eventLoopGroup; |
| 682 | 682 | private final Class<? extends Channel> channelClass; |
| @@ -684,12 +684,12 @@ | ||
| 684 | 684 | private final ChannelGroup allChannels = new DefaultChannelGroup(GlobalEventExecutor.INSTANCE); |
| 685 | 685 | |
| 686 | 686 | private final ConcurrentMap<Host, AtomicInteger> idGenerators = new ConcurrentHashMap<Host, AtomicInteger>(); |
| 687 | - public final DefaultResponseHandler defaultHandler; | |
| 687 | + final DefaultResponseHandler defaultHandler; | |
| 688 | 688 | final Cluster.Manager manager; |
| 689 | 689 | final Cluster.ConnectionReaper reaper; |
| 690 | - public final Configuration configuration; | |
| 690 | + final Configuration configuration; | |
| 691 | 691 | |
| 692 | - public final AuthProvider authProvider; | |
| 692 | + final AuthProvider authProvider; | |
| 693 | 693 | private volatile boolean isShutdown; |
| 694 | 694 | |
| 695 | 695 | volatile ProtocolVersion protocolVersion; |
| @@ -708,7 +708,7 @@ | ||
| 708 | 708 | this.timer = nettyOptions.timer(manager.threadFactory("timeouter")); |
| 709 | 709 | } |
| 710 | 710 | |
| 711 | - public int getPort() { | |
| 711 | + int getPort() { | |
| 712 | 712 | return configuration.getProtocolOptions().getPort(); |
| 713 | 713 | } |
| 714 | 714 | |
| @@ -718,7 +718,7 @@ | ||
| 718 | 718 | * @return the newly created (and initialized) connection. |
| 719 | 719 | * @throws ConnectionException if connection attempt fails. |
| 720 | 720 | */ |
| 721 | - public Connection open(Host host) throws ConnectionException, InterruptedException, UnsupportedProtocolVersionException, ClusterNameMismatchException { | |
| 721 | + Connection open(Host host) throws ConnectionException, InterruptedException, UnsupportedProtocolVersionException, ClusterNameMismatchException { | |
| 722 | 722 | InetSocketAddress address = host.getSocketAddress(); |
| 723 | 723 | |
| 724 | 724 | if (isShutdown) |
| @@ -738,7 +738,7 @@ | ||
| 738 | 738 | /** |
| 739 | 739 | * Same as open, but associate the created connection to the provided connection pool. |
| 740 | 740 | */ |
| 741 | - public Connection open(HostConnectionPool pool) throws ConnectionException, InterruptedException, UnsupportedProtocolVersionException, ClusterNameMismatchException { | |
| 741 | + Connection open(HostConnectionPool pool) throws ConnectionException, InterruptedException, UnsupportedProtocolVersionException, ClusterNameMismatchException { | |
| 742 | 742 | pool.host.convictionPolicy.signalConnectionsOpening(1); |
| 743 | 743 | Connection connection = new Connection(buildConnectionName(pool.host), pool.host.getSocketAddress(), this, pool); |
| 744 | 744 | try { |
| @@ -752,7 +752,7 @@ | ||
| 752 | 752 | /** |
| 753 | 753 | * Creates new connections and associate them to the provided connection pool, but does not start them. |
| 754 | 754 | */ |
| 755 | - public List<Connection> newConnections(HostConnectionPool pool, int count) { | |
| 755 | + List<Connection> newConnections(HostConnectionPool pool, int count) { | |
| 756 | 756 | pool.host.convictionPolicy.signalConnectionsOpening(count); |
| 757 | 757 | List<Connection> connections = Lists.newArrayListWithCapacity(count); |
| 758 | 758 | for (int i = 0; i < count; i++) |
| @@ -791,7 +791,7 @@ | ||
| 791 | 791 | return g; |
| 792 | 792 | } |
| 793 | 793 | |
| 794 | - public long getReadTimeoutMillis() { | |
| 794 | + long getReadTimeoutMillis() { | |
| 795 | 795 | return configuration.getSocketOptions().getReadTimeoutMillis(); |
| 796 | 796 | } |
| 797 | 797 | |
| @@ -826,7 +826,7 @@ | ||
| 826 | 826 | return b; |
| 827 | 827 | } |
| 828 | 828 | |
| 829 | - public void shutdown() { | |
| 829 | + void shutdown() { | |
| 830 | 830 | // Make sure we skip creating connection from now on. |
| 831 | 831 | isShutdown = true; |
| 832 | 832 | |
| @@ -927,7 +927,7 @@ | ||
| 927 | 927 | |
| 928 | 928 | class Dispatcher extends SimpleChannelInboundHandler<Message.Response> { |
| 929 | 929 | |
| 930 | - public final StreamIdGenerator streamIdHandler; | |
| 930 | + final StreamIdGenerator streamIdHandler; | |
| 931 | 931 | private final ConcurrentMap<Integer, ResponseHandler> pending = new ConcurrentHashMap<Integer, ResponseHandler>(); |
| 932 | 932 | |
| 933 | 933 | Dispatcher() { |
| @@ -940,12 +940,12 @@ | ||
| 940 | 940 | streamIdHandler = StreamIdGenerator.newInstance(protocolVersion); |
| 941 | 941 | } |
| 942 | 942 | |
| 943 | - public void add(ResponseHandler handler) { | |
| 943 | + void add(ResponseHandler handler) { | |
| 944 | 944 | ResponseHandler old = pending.put(handler.streamId, handler); |
| 945 | 945 | assert old == null; |
| 946 | 946 | } |
| 947 | 947 | |
| 948 | - public void removeHandler(ResponseHandler handler, boolean releaseStreamId) { | |
| 948 | + void removeHandler(ResponseHandler handler, boolean releaseStreamId) { | |
| 949 | 949 | |
| 950 | 950 | // If we don't release the ID, mark first so that we can rely later on the fact that if |
| 951 | 951 | // we receive a response for an ID with no handler, it's that this ID has been marked. |
| @@ -1042,7 +1042,7 @@ | ||
| 1042 | 1042 | defunct(new TransportException(address, String.format("Unexpected exception triggered (%s)", cause), cause)); |
| 1043 | 1043 | } |
| 1044 | 1044 | |
| 1045 | - public void errorOutAllHandler(ConnectionException ce) { | |
| 1045 | + void errorOutAllHandler(ConnectionException ce) { | |
| 1046 | 1046 | Iterator<ResponseHandler> iter = pending.values().iterator(); |
| 1047 | 1047 | while (iter.hasNext()) { |
| 1048 | 1048 | ResponseHandler handler = iter.next(); |
| @@ -1143,7 +1143,7 @@ | ||
| 1143 | 1143 | private final Message.Request request; |
| 1144 | 1144 | private volatile InetSocketAddress address; |
| 1145 | 1145 | |
| 1146 | - public Future(Message.Request request) { | |
| 1146 | + Future(Message.Request request) { | |
| 1147 | 1147 | this.request = request; |
| 1148 | 1148 | } |
| 1149 | 1149 | |
| @@ -1190,36 +1190,36 @@ | ||
| 1190 | 1190 | return super.setException(new OperationTimedOutException(connection.address)); |
| 1191 | 1191 | } |
| 1192 | 1192 | |
| 1193 | - public InetSocketAddress getAddress() { | |
| 1193 | + InetSocketAddress getAddress() { | |
| 1194 | 1194 | return address; |
| 1195 | 1195 | } |
| 1196 | 1196 | } |
| 1197 | 1197 | |
| 1198 | 1198 | interface ResponseCallback { |
| 1199 | - public Message.Request request(); | |
| 1199 | + Message.Request request(); | |
| 1200 | 1200 | |
| 1201 | - public int retryCount(); | |
| 1201 | + int retryCount(); | |
| 1202 | 1202 | |
| 1203 | - public void onSet(Connection connection, Message.Response response, long latency, int retryCount); | |
| 1203 | + void onSet(Connection connection, Message.Response response, long latency, int retryCount); | |
| 1204 | 1204 | |
| 1205 | - public void onException(Connection connection, Exception exception, long latency, int retryCount); | |
| 1205 | + void onException(Connection connection, Exception exception, long latency, int retryCount); | |
| 1206 | 1206 | |
| 1207 | - public boolean onTimeout(Connection connection, long latency, int retryCount); | |
| 1207 | + boolean onTimeout(Connection connection, long latency, int retryCount); | |
| 1208 | 1208 | } |
| 1209 | 1209 | |
| 1210 | 1210 | static class ResponseHandler { |
| 1211 | 1211 | |
| 1212 | - public final Connection connection; | |
| 1213 | - public final int streamId; | |
| 1214 | - public final ResponseCallback callback; | |
| 1215 | - public final int retryCount; | |
| 1212 | + final Connection connection; | |
| 1213 | + final int streamId; | |
| 1214 | + final ResponseCallback callback; | |
| 1215 | + final int retryCount; | |
| 1216 | 1216 | |
| 1217 | 1217 | private final long startTime; |
| 1218 | 1218 | private volatile Timeout timeout; |
| 1219 | 1219 | |
| 1220 | 1220 | private final AtomicBoolean isCancelled = new AtomicBoolean(); |
| 1221 | 1221 | |
| 1222 | - public ResponseHandler(Connection connection, ResponseCallback callback) throws BusyConnectionException { | |
| 1222 | + ResponseHandler(Connection connection, ResponseCallback callback) throws BusyConnectionException { | |
| 1223 | 1223 | this.connection = connection; |
| 1224 | 1224 | this.streamId = connection.dispatcher.streamIdHandler.next(); |
| 1225 | 1225 | if (streamId == -1) |
| @@ -1240,7 +1240,7 @@ | ||
| 1240 | 1240 | timeout.cancel(); |
| 1241 | 1241 | } |
| 1242 | 1242 | |
| 1243 | - public boolean cancelHandler() { | |
| 1243 | + boolean cancelHandler() { | |
| 1244 | 1244 | if (!isCancelled.compareAndSet(false, true)) |
| 1245 | 1245 | return false; |
| 1246 | 1246 | |
| @@ -1263,8 +1263,8 @@ | ||
| 1263 | 1263 | } |
| 1264 | 1264 | } |
| 1265 | 1265 | |
| 1266 | - public interface DefaultResponseHandler { | |
| 1267 | - public void handle(Message.Response response); | |
| 1266 | + interface DefaultResponseHandler { | |
| 1267 | + void handle(Message.Response response); | |
| 1268 | 1268 | } |
| 1269 | 1269 | |
| 1270 | 1270 | private static class Initializer extends ChannelInitializer<SocketChannel> { |
| @@ -1284,7 +1284,7 @@ | ||
| 1284 | 1284 | private final ChannelHandler idleStateHandler; |
| 1285 | 1285 | private final CodecRegistry codecRegistry; |
| 1286 | 1286 | |
| 1287 | - public Initializer(Connection connection, ProtocolVersion protocolVersion, FrameCompressor compressor, SSLOptions sslOptions, int heartBeatIntervalSeconds, NettyOptions nettyOptions, CodecRegistry codecRegistry) { | |
| 1287 | + Initializer(Connection connection, ProtocolVersion protocolVersion, FrameCompressor compressor, SSLOptions sslOptions, int heartBeatIntervalSeconds, NettyOptions nettyOptions, CodecRegistry codecRegistry) { | |
| 1288 | 1288 | this.connection = connection; |
| 1289 | 1289 | this.protocolVersion = protocolVersion; |
| 1290 | 1290 | this.compressor = compressor; |
modified driver-core/src/main/java/com/datastax/driver/core/Frame.java +19 −19
| @@ -76,8 +76,8 @@ | ||
| 76 | 76 | */ |
| 77 | 77 | class Frame { |
| 78 | 78 | |
| 79 | - public final Header header; | |
| 80 | - public final ByteBuf body; | |
| 79 | + final Header header; | |
| 80 | + final ByteBuf body; | |
| 81 | 81 | |
| 82 | 82 | private Frame(Header header, ByteBuf body) { |
| 83 | 83 | this.header = header; |
| @@ -116,17 +116,17 @@ | ||
| 116 | 116 | } |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | - public static Frame create(ProtocolVersion version, int opcode, int streamId, EnumSet<Header.Flag> flags, ByteBuf body) { | |
| 119 | + static Frame create(ProtocolVersion version, int opcode, int streamId, EnumSet<Header.Flag> flags, ByteBuf body) { | |
| 120 | 120 | Header header = new Header(version, flags, streamId, opcode); |
| 121 | 121 | return new Frame(header, body); |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | - public static class Header { | |
| 124 | + static class Header { | |
| 125 | 125 | |
| 126 | - public final ProtocolVersion version; | |
| 127 | - public final EnumSet<Flag> flags; | |
| 128 | - public final int streamId; | |
| 129 | - public final int opcode; | |
| 126 | + final ProtocolVersion version; | |
| 127 | + final EnumSet<Flag> flags; | |
| 128 | + final int streamId; | |
| 129 | + final int opcode; | |
| 130 | 130 | |
| 131 | 131 | private Header(ProtocolVersion version, int flags, int streamId, int opcode) { |
| 132 | 132 | this(version, Flag.deserialize(flags), streamId, opcode); |
| @@ -145,7 +145,7 @@ | ||
| 145 | 145 | * @param version the protocol version in use |
| 146 | 146 | * @return the expected frame header length in bytes |
| 147 | 147 | */ |
| 148 | - public static int lengthFor(ProtocolVersion version) { | |
| 148 | + static int lengthFor(ProtocolVersion version) { | |
| 149 | 149 | switch (version) { |
| 150 | 150 | case V1: |
| 151 | 151 | case V2: |
| @@ -158,14 +158,14 @@ | ||
| 158 | 158 | } |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | - public static enum Flag { | |
| 161 | + enum Flag { | |
| 162 | 162 | // The order of that enum matters!! |
| 163 | 163 | COMPRESSED, |
| 164 | 164 | TRACING, |
| 165 | 165 | CUSTOM_PAYLOAD, |
| 166 | 166 | WARNING; |
| 167 | 167 | |
| 168 | - public static EnumSet<Flag> deserialize(int flags) { | |
| 168 | + static EnumSet<Flag> deserialize(int flags) { | |
| 169 | 169 | EnumSet<Flag> set = EnumSet.noneOf(Flag.class); |
| 170 | 170 | Flag[] values = Flag.values(); |
| 171 | 171 | for (int n = 0; n < 8; n++) { |
| @@ -175,7 +175,7 @@ | ||
| 175 | 175 | return set; |
| 176 | 176 | } |
| 177 | 177 | |
| 178 | - public static int serialize(EnumSet<Flag> flags) { | |
| 178 | + static int serialize(EnumSet<Flag> flags) { | |
| 179 | 179 | int i = 0; |
| 180 | 180 | for (Flag flag : flags) |
| 181 | 181 | i |= 1 << flag.ordinal(); |
| @@ -184,11 +184,11 @@ | ||
| 184 | 184 | } |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | - public Frame with(ByteBuf newBody) { | |
| 187 | + Frame with(ByteBuf newBody) { | |
| 188 | 188 | return new Frame(header, newBody); |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | - public static final class Decoder extends ByteToMessageDecoder { | |
| 191 | + static final class Decoder extends ByteToMessageDecoder { | |
| 192 | 192 | static final DecoderForStreamIdSize decoderV1 = new DecoderForStreamIdSize(1); |
| 193 | 193 | static final DecoderForStreamIdSize decoderV3 = new DecoderForStreamIdSize(2); |
| 194 | 194 | |
| @@ -243,7 +243,7 @@ | ||
| 243 | 243 | } |
| 244 | 244 | |
| 245 | 245 | @ChannelHandler.Sharable |
| 246 | - public static class Encoder extends MessageToMessageEncoder<Frame> { | |
| 246 | + static class Encoder extends MessageToMessageEncoder<Frame> { | |
| 247 | 247 | |
| 248 | 248 | @Override |
| 249 | 249 | protected void encode(ChannelHandlerContext ctx, Frame frame, List<Object> out) throws Exception { |
| @@ -276,11 +276,11 @@ | ||
| 276 | 276 | } |
| 277 | 277 | } |
| 278 | 278 | |
| 279 | - public static class Decompressor extends MessageToMessageDecoder<Frame> { | |
| 279 | + static class Decompressor extends MessageToMessageDecoder<Frame> { | |
| 280 | 280 | |
| 281 | 281 | private final FrameCompressor compressor; |
| 282 | 282 | |
| 283 | - public Decompressor(FrameCompressor compressor) { | |
| 283 | + Decompressor(FrameCompressor compressor) { | |
| 284 | 284 | assert compressor != null; |
| 285 | 285 | this.compressor = compressor; |
| 286 | 286 | } |
| @@ -302,11 +302,11 @@ | ||
| 302 | 302 | } |
| 303 | 303 | } |
| 304 | 304 | |
| 305 | - public static class Compressor extends MessageToMessageEncoder<Frame> { | |
| 305 | + static class Compressor extends MessageToMessageEncoder<Frame> { | |
| 306 | 306 | |
| 307 | 307 | private final FrameCompressor compressor; |
| 308 | 308 | |
| 309 | - public Compressor(FrameCompressor compressor) { | |
| 309 | + Compressor(FrameCompressor compressor) { | |
| 310 | 310 | assert compressor != null; |
| 311 | 311 | this.compressor = compressor; |
| 312 | 312 | } |
modified driver-core/src/main/java/com/datastax/driver/core/Message.java +29 −30
| @@ -38,14 +38,14 @@ | ||
| 38 | 38 | |
| 39 | 39 | static AttributeKey<CodecRegistry> CODEC_REGISTRY_ATTRIBUTE_KEY = AttributeKey.newInstance("com.datastax.driver.core.CodecRegistry"); |
| 40 | 40 | |
| 41 | - public interface Coder<R extends Request> { | |
| 42 | - public void encode(R request, ByteBuf dest, ProtocolVersion version); | |
| 41 | + interface Coder<R extends Request> { | |
| 42 | + void encode(R request, ByteBuf dest, ProtocolVersion version); | |
| 43 | 43 | |
| 44 | - public int encodedSize(R request, ProtocolVersion version); | |
| 44 | + int encodedSize(R request, ProtocolVersion version); | |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | - public interface Decoder<R extends Response> { | |
| 48 | - public R decode(ByteBuf body, ProtocolVersion version, CodecRegistry codecRegistry); | |
| 47 | + interface Decoder<R extends Response> { | |
| 48 | + R decode(ByteBuf body, ProtocolVersion version, CodecRegistry codecRegistry); | |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | private volatile int streamId; |
| @@ -61,27 +61,27 @@ | ||
| 61 | 61 | protected Message() { |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | - public Message setStreamId(int streamId) { | |
| 64 | + Message setStreamId(int streamId) { | |
| 65 | 65 | this.streamId = streamId; |
| 66 | 66 | return this; |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | - public int getStreamId() { | |
| 69 | + int getStreamId() { | |
| 70 | 70 | return streamId; |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | - public Map<String, ByteBuffer> getCustomPayload() { | |
| 73 | + Map<String, ByteBuffer> getCustomPayload() { | |
| 74 | 74 | return customPayload; |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | - public Message setCustomPayload(Map<String, ByteBuffer> customPayload) { | |
| 77 | + Message setCustomPayload(Map<String, ByteBuffer> customPayload) { | |
| 78 | 78 | this.customPayload = customPayload; |
| 79 | 79 | return this; |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | - public static abstract class Request extends Message { | |
| 82 | + static abstract class Request extends Message { | |
| 83 | 83 | |
| 84 | - public enum Type { | |
| 84 | + enum Type { | |
| 85 | 85 | STARTUP(1, Requests.Startup.coder), |
| 86 | 86 | CREDENTIALS(4, Requests.Credentials.coder), |
| 87 | 87 | OPTIONS(5, Requests.Options.coder), |
| @@ -92,16 +92,16 @@ | ||
| 92 | 92 | BATCH(13, Requests.Batch.coder), |
| 93 | 93 | AUTH_RESPONSE(15, Requests.AuthResponse.coder); |
| 94 | 94 | |
| 95 | - public final int opcode; | |
| 96 | - public final Coder<?> coder; | |
| 95 | + final int opcode; | |
| 96 | + final Coder<?> coder; | |
| 97 | 97 | |
| 98 | - private Type(int opcode, Coder<?> coder) { | |
| 98 | + Type(int opcode, Coder<?> coder) { | |
| 99 | 99 | this.opcode = opcode; |
| 100 | 100 | this.coder = coder; |
| 101 | 101 | } |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | - public final Type type; | |
| 104 | + final Type type; | |
| 105 | 105 | private final boolean tracingRequested; |
| 106 | 106 | |
| 107 | 107 | protected Request(Type type) { |
| @@ -113,7 +113,7 @@ | ||
| 113 | 113 | this.tracingRequested = tracingRequested; |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | - public boolean isTracingRequested() { | |
| 116 | + boolean isTracingRequested() { | |
| 117 | 117 | return tracingRequested; |
| 118 | 118 | } |
| 119 | 119 | |
| @@ -176,9 +176,9 @@ | ||
| 176 | 176 | } |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | - public static abstract class Response extends Message { | |
| 179 | + static abstract class Response extends Message { | |
| 180 | 180 | |
| 181 | - public enum Type { | |
| 181 | + enum Type { | |
| 182 | 182 | ERROR(0, Responses.Error.decoder), |
| 183 | 183 | READY(2, Responses.Ready.decoder), |
| 184 | 184 | AUTHENTICATE(3, Responses.Authenticate.decoder), |
| @@ -188,8 +188,8 @@ | ||
| 188 | 188 | AUTH_CHALLENGE(14, Responses.AuthChallenge.decoder), |
| 189 | 189 | AUTH_SUCCESS(16, Responses.AuthSuccess.decoder); |
| 190 | 190 | |
| 191 | - public final int opcode; | |
| 192 | - public final Decoder<?> decoder; | |
| 191 | + final int opcode; | |
| 192 | + final Decoder<?> decoder; | |
| 193 | 193 | |
| 194 | 194 | private static final Type[] opcodeIdx; |
| 195 | 195 | |
| @@ -205,12 +205,12 @@ | ||
| 205 | 205 | } |
| 206 | 206 | } |
| 207 | 207 | |
| 208 | - private Type(int opcode, Decoder<?> decoder) { | |
| 208 | + Type(int opcode, Decoder<?> decoder) { | |
| 209 | 209 | this.opcode = opcode; |
| 210 | 210 | this.decoder = decoder; |
| 211 | 211 | } |
| 212 | 212 | |
| 213 | - public static Type fromOpcode(int opcode) { | |
| 213 | + static Type fromOpcode(int opcode) { | |
| 214 | 214 | if (opcode < 0 || opcode >= opcodeIdx.length) |
| 215 | 215 | throw new DriverInternalError(String.format("Unknown response opcode %d", opcode)); |
| 216 | 216 | Type t = opcodeIdx[opcode]; |
| @@ -220,7 +220,7 @@ | ||
| 220 | 220 | } |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | - public final Type type; | |
| 223 | + final Type type; | |
| 224 | 224 | protected volatile UUID tracingId; |
| 225 | 225 | protected volatile List<String> warnings; |
| 226 | 226 | |
| @@ -228,23 +228,23 @@ | ||
| 228 | 228 | this.type = type; |
| 229 | 229 | } |
| 230 | 230 | |
| 231 | - public Response setTracingId(UUID tracingId) { | |
| 231 | + Response setTracingId(UUID tracingId) { | |
| 232 | 232 | this.tracingId = tracingId; |
| 233 | 233 | return this; |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | - public UUID getTracingId() { | |
| 236 | + UUID getTracingId() { | |
| 237 | 237 | return tracingId; |
| 238 | 238 | } |
| 239 | 239 | |
| 240 | - public Response setWarnings(List<String> warnings) { | |
| 240 | + Response setWarnings(List<String> warnings) { | |
| 241 | 241 | this.warnings = warnings; |
| 242 | 242 | return this; |
| 243 | 243 | } |
| 244 | 244 | } |
| 245 | 245 | |
| 246 | 246 | @ChannelHandler.Sharable |
| 247 | - public static class ProtocolDecoder extends MessageToMessageDecoder<Frame> { | |
| 247 | + static class ProtocolDecoder extends MessageToMessageDecoder<Frame> { | |
| 248 | 248 | |
| 249 | 249 | @Override |
| 250 | 250 | protected void decode(ChannelHandlerContext ctx, Frame frame, List<Object> out) throws Exception { |
| @@ -278,11 +278,11 @@ | ||
| 278 | 278 | } |
| 279 | 279 | |
| 280 | 280 | @ChannelHandler.Sharable |
| 281 | - public static class ProtocolEncoder extends MessageToMessageEncoder<Request> { | |
| 281 | + static class ProtocolEncoder extends MessageToMessageEncoder<Request> { | |
| 282 | 282 | |
| 283 | 283 | private final ProtocolVersion protocolVersion; |
| 284 | 284 | |
| 285 | - public ProtocolEncoder(ProtocolVersion version) { | |
| 285 | + ProtocolEncoder(ProtocolVersion version) { | |
| 286 | 286 | this.protocolVersion = version; |
| 287 | 287 | } |
| 288 | 288 | |
| @@ -350,7 +350,6 @@ | ||
| 350 | 350 | // this method doesn't modify the given ByteBuffer |
| 351 | 351 | static void bytesToHex(ByteBuffer bytes, StringBuilder sb) { |
| 352 | 352 | int length = Math.min(bytes.remaining(), 50); |
| 353 | - char[] hexChars = new char[length * 2]; | |
| 354 | 353 | sb.append("0x"); |
| 355 | 354 | for (int i = 0; i < length; i++) { |
| 356 | 355 | int v = bytes.get(i) & 0xFF; |
modified driver-core/src/main/java/com/datastax/driver/core/ProtocolEvent.java +20 −20
| @@ -25,15 +25,15 @@ | ||
| 25 | 25 | |
| 26 | 26 | class ProtocolEvent { |
| 27 | 27 | |
| 28 | - public enum Type {TOPOLOGY_CHANGE, STATUS_CHANGE, SCHEMA_CHANGE} | |
| 28 | + enum Type {TOPOLOGY_CHANGE, STATUS_CHANGE, SCHEMA_CHANGE} | |
| 29 | 29 | |
| 30 | - public final Type type; | |
| 30 | + final Type type; | |
| 31 | 31 | |
| 32 | 32 | private ProtocolEvent(Type type) { |
| 33 | 33 | this.type = type; |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - public static ProtocolEvent deserialize(ByteBuf bb, ProtocolVersion version) { | |
| 36 | + static ProtocolEvent deserialize(ByteBuf bb, ProtocolVersion version) { | |
| 37 | 37 | switch (CBUtil.readEnumValue(Type.class, bb)) { |
| 38 | 38 | case TOPOLOGY_CHANGE: |
| 39 | 39 | return TopologyChange.deserializeEvent(bb); |
| @@ -45,11 +45,11 @@ | ||
| 45 | 45 | throw new AssertionError(); |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | - public static class TopologyChange extends ProtocolEvent { | |
| 49 | - public enum Change {NEW_NODE, REMOVED_NODE, MOVED_NODE} | |
| 48 | + static class TopologyChange extends ProtocolEvent { | |
| 49 | + enum Change {NEW_NODE, REMOVED_NODE, MOVED_NODE} | |
| 50 | 50 | |
| 51 | - public final Change change; | |
| 52 | - public final InetSocketAddress node; | |
| 51 | + final Change change; | |
| 52 | + final InetSocketAddress node; | |
| 53 | 53 | |
| 54 | 54 | private TopologyChange(Change change, InetSocketAddress node) { |
| 55 | 55 | super(Type.TOPOLOGY_CHANGE); |
| @@ -70,12 +70,12 @@ | ||
| 70 | 70 | } |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | - public static class StatusChange extends ProtocolEvent { | |
| 73 | + static class StatusChange extends ProtocolEvent { | |
| 74 | 74 | |
| 75 | - public enum Status {UP, DOWN} | |
| 75 | + enum Status {UP, DOWN} | |
| 76 | 76 | |
| 77 | - public final Status status; | |
| 78 | - public final InetSocketAddress node; | |
| 77 | + final Status status; | |
| 78 | + final InetSocketAddress node; | |
| 79 | 79 | |
| 80 | 80 | private StatusChange(Status status, InetSocketAddress node) { |
| 81 | 81 | super(Type.STATUS_CHANGE); |
| @@ -96,17 +96,17 @@ | ||
| 96 | 96 | } |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | - public static class SchemaChange extends ProtocolEvent { | |
| 99 | + static class SchemaChange extends ProtocolEvent { | |
| 100 | 100 | |
| 101 | - public enum Change {CREATED, UPDATED, DROPPED} | |
| 101 | + enum Change {CREATED, UPDATED, DROPPED} | |
| 102 | 102 | |
| 103 | - public final Change change; | |
| 104 | - public final SchemaElement targetType; | |
| 105 | - public final String targetKeyspace; | |
| 106 | - public final String targetName; | |
| 107 | - public final List<String> targetSignature; | |
| 103 | + final Change change; | |
| 104 | + final SchemaElement targetType; | |
| 105 | + final String targetKeyspace; | |
| 106 | + final String targetName; | |
| 107 | + final List<String> targetSignature; | |
| 108 | 108 | |
| 109 | - public SchemaChange(Change change, SchemaElement targetType, String targetKeyspace, String targetName, List<String> targetSignature) { | |
| 109 | + SchemaChange(Change change, SchemaElement targetType, String targetKeyspace, String targetName, List<String> targetSignature) { | |
| 110 | 110 | super(Type.SCHEMA_CHANGE); |
| 111 | 111 | this.change = change; |
| 112 | 112 | this.targetType = targetType; |
| @@ -116,7 +116,7 @@ | ||
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | // Assumes the type has already been deserialized |
| 119 | - private static SchemaChange deserializeEvent(ByteBuf bb, ProtocolVersion version) { | |
| 119 | + static SchemaChange deserializeEvent(ByteBuf bb, ProtocolVersion version) { | |
| 120 | 120 | Change change; |
| 121 | 121 | SchemaElement targetType; |
| 122 | 122 | String targetKeyspace, targetName; |
modified driver-core/src/main/java/com/datastax/driver/core/Requests.java +68 −68
| @@ -29,13 +29,13 @@ | ||
| 29 | 29 | private Requests() { |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | - public static class Startup extends Message.Request { | |
| 32 | + static class Startup extends Message.Request { | |
| 33 | 33 | private static final String CQL_VERSION_OPTION = "CQL_VERSION"; |
| 34 | 34 | private static final String CQL_VERSION = "3.0.0"; |
| 35 | 35 | |
| 36 | - public static final String COMPRESSION_OPTION = "COMPRESSION"; | |
| 36 | + static final String COMPRESSION_OPTION = "COMPRESSION"; | |
| 37 | 37 | |
| 38 | - public static final Message.Coder<Startup> coder = new Message.Coder<Startup>() { | |
| 38 | + static final Message.Coder<Startup> coder = new Message.Coder<Startup>() { | |
| 39 | 39 | public void encode(Startup msg, ByteBuf dest, ProtocolVersion version) { |
| 40 | 40 | CBUtil.writeStringMap(msg.options, dest); |
| 41 | 41 | } |
| @@ -47,7 +47,7 @@ | ||
| 47 | 47 | |
| 48 | 48 | private final Map<String, String> options; |
| 49 | 49 | |
| 50 | - public Startup(ProtocolOptions.Compression compression) { | |
| 50 | + Startup(ProtocolOptions.Compression compression) { | |
| 51 | 51 | super(Message.Request.Type.STARTUP); |
| 52 | 52 | |
| 53 | 53 | ImmutableMap.Builder<String, String> map = new ImmutableMap.Builder<String, String>(); |
| @@ -64,9 +64,9 @@ | ||
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | // Only for protocol v1 |
| 67 | - public static class Credentials extends Message.Request { | |
| 67 | + static class Credentials extends Message.Request { | |
| 68 | 68 | |
| 69 | - public static final Message.Coder<Credentials> coder = new Message.Coder<Credentials>() { | |
| 69 | + static final Message.Coder<Credentials> coder = new Message.Coder<Credentials>() { | |
| 70 | 70 | |
| 71 | 71 | public void encode(Credentials msg, ByteBuf dest, ProtocolVersion version) { |
| 72 | 72 | assert version == ProtocolVersion.V1; |
| @@ -81,15 +81,15 @@ | ||
| 81 | 81 | |
| 82 | 82 | private final Map<String, String> credentials; |
| 83 | 83 | |
| 84 | - public Credentials(Map<String, String> credentials) { | |
| 84 | + Credentials(Map<String, String> credentials) { | |
| 85 | 85 | super(Message.Request.Type.CREDENTIALS); |
| 86 | 86 | this.credentials = credentials; |
| 87 | 87 | } |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | - public static class Options extends Message.Request { | |
| 90 | + static class Options extends Message.Request { | |
| 91 | 91 | |
| 92 | - public static final Message.Coder<Options> coder = new Message.Coder<Options>() { | |
| 92 | + static final Message.Coder<Options> coder = new Message.Coder<Options>() { | |
| 93 | 93 | public void encode(Options msg, ByteBuf dest, ProtocolVersion version) { |
| 94 | 94 | } |
| 95 | 95 | |
| @@ -98,7 +98,7 @@ | ||
| 98 | 98 | } |
| 99 | 99 | }; |
| 100 | 100 | |
| 101 | - public Options() { | |
| 101 | + Options() { | |
| 102 | 102 | super(Message.Request.Type.OPTIONS); |
| 103 | 103 | } |
| 104 | 104 | |
| @@ -108,9 +108,9 @@ | ||
| 108 | 108 | } |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | - public static class Query extends Message.Request { | |
| 111 | + static class Query extends Message.Request { | |
| 112 | 112 | |
| 113 | - public static final Message.Coder<Query> coder = new Message.Coder<Query>() { | |
| 113 | + static final Message.Coder<Query> coder = new Message.Coder<Query>() { | |
| 114 | 114 | public void encode(Query msg, ByteBuf dest, ProtocolVersion version) { |
| 115 | 115 | CBUtil.writeLongString(msg.query, dest); |
| 116 | 116 | msg.options.encode(dest, version); |
| @@ -122,14 +122,14 @@ | ||
| 122 | 122 | } |
| 123 | 123 | }; |
| 124 | 124 | |
| 125 | - public final String query; | |
| 126 | - public final QueryProtocolOptions options; | |
| 125 | + final String query; | |
| 126 | + final QueryProtocolOptions options; | |
| 127 | 127 | |
| 128 | - public Query(String query) { | |
| 128 | + Query(String query) { | |
| 129 | 129 | this(query, QueryProtocolOptions.DEFAULT, false); |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | - public Query(String query, QueryProtocolOptions options, boolean tracingRequested) { | |
| 132 | + Query(String query, QueryProtocolOptions options, boolean tracingRequested) { | |
| 133 | 133 | super(Type.QUERY, tracingRequested); |
| 134 | 134 | this.query = query; |
| 135 | 135 | this.options = options; |
| @@ -151,9 +151,9 @@ | ||
| 151 | 151 | } |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | - public static class Execute extends Message.Request { | |
| 154 | + static class Execute extends Message.Request { | |
| 155 | 155 | |
| 156 | - public static final Message.Coder<Execute> coder = new Message.Coder<Execute>() { | |
| 156 | + static final Message.Coder<Execute> coder = new Message.Coder<Execute>() { | |
| 157 | 157 | public void encode(Execute msg, ByteBuf dest, ProtocolVersion version) { |
| 158 | 158 | CBUtil.writeBytes(msg.statementId.bytes, dest); |
| 159 | 159 | msg.options.encode(dest, version); |
| @@ -165,10 +165,10 @@ | ||
| 165 | 165 | } |
| 166 | 166 | }; |
| 167 | 167 | |
| 168 | - public final MD5Digest statementId; | |
| 169 | - public final QueryProtocolOptions options; | |
| 168 | + final MD5Digest statementId; | |
| 169 | + final QueryProtocolOptions options; | |
| 170 | 170 | |
| 171 | - public Execute(MD5Digest statementId, QueryProtocolOptions options, boolean tracingRequested) { | |
| 171 | + Execute(MD5Digest statementId, QueryProtocolOptions options, boolean tracingRequested) { | |
| 172 | 172 | super(Message.Request.Type.EXECUTE, tracingRequested); |
| 173 | 173 | this.statementId = statementId; |
| 174 | 174 | this.options = options; |
| @@ -190,7 +190,7 @@ | ||
| 190 | 190 | } |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | - static enum QueryFlag { | |
| 193 | + enum QueryFlag { | |
| 194 | 194 | // The order of that enum matters!! |
| 195 | 195 | VALUES, |
| 196 | 196 | SKIP_METADATA, |
| @@ -200,7 +200,7 @@ | ||
| 200 | 200 | DEFAULT_TIMESTAMP, |
| 201 | 201 | VALUE_NAMES; |
| 202 | 202 | |
| 203 | - public static EnumSet<QueryFlag> deserialize(int flags) { | |
| 203 | + static EnumSet<QueryFlag> deserialize(int flags) { | |
| 204 | 204 | EnumSet<QueryFlag> set = EnumSet.noneOf(QueryFlag.class); |
| 205 | 205 | QueryFlag[] values = QueryFlag.values(); |
| 206 | 206 | for (int n = 0; n < values.length; n++) { |
| @@ -210,7 +210,7 @@ | ||
| 210 | 210 | return set; |
| 211 | 211 | } |
| 212 | 212 | |
| 213 | - public static int serialize(EnumSet<QueryFlag> flags) { | |
| 213 | + static int serialize(EnumSet<QueryFlag> flags) { | |
| 214 | 214 | int i = 0; |
| 215 | 215 | for (QueryFlag flag : flags) |
| 216 | 216 | i |= 1 << flag.ordinal(); |
| @@ -218,9 +218,9 @@ | ||
| 218 | 218 | } |
| 219 | 219 | } |
| 220 | 220 | |
| 221 | - public static class QueryProtocolOptions { | |
| 221 | + static class QueryProtocolOptions { | |
| 222 | 222 | |
| 223 | - public static final QueryProtocolOptions DEFAULT = new QueryProtocolOptions(ConsistencyLevel.ONE, | |
| 223 | + static final QueryProtocolOptions DEFAULT = new QueryProtocolOptions(ConsistencyLevel.ONE, | |
| 224 | 224 | Collections.<ByteBuffer>emptyList(), |
| 225 | 225 | false, |
| 226 | 226 | -1, |
| @@ -229,21 +229,21 @@ | ||
| 229 | 229 | Long.MIN_VALUE); |
| 230 | 230 | |
| 231 | 231 | private final EnumSet<QueryFlag> flags = EnumSet.noneOf(QueryFlag.class); |
| 232 | - public final ConsistencyLevel consistency; | |
| 233 | - public final List<ByteBuffer> values; | |
| 234 | - public final boolean skipMetadata; | |
| 235 | - public final int pageSize; | |
| 236 | - public final ByteBuffer pagingState; | |
| 237 | - public final ConsistencyLevel serialConsistency; | |
| 238 | - public final long defaultTimestamp; | |
| 239 | - | |
| 240 | - public QueryProtocolOptions(ConsistencyLevel consistency, | |
| 241 | - List<ByteBuffer> values, | |
| 242 | - boolean skipMetadata, | |
| 243 | - int pageSize, | |
| 244 | - ByteBuffer pagingState, | |
| 245 | - ConsistencyLevel serialConsistency, | |
| 246 | - long defaultTimestamp) { | |
| 232 | + final ConsistencyLevel consistency; | |
| 233 | + final List<ByteBuffer> values; | |
| 234 | + final boolean skipMetadata; | |
| 235 | + final int pageSize; | |
| 236 | + final ByteBuffer pagingState; | |
| 237 | + final ConsistencyLevel serialConsistency; | |
| 238 | + final long defaultTimestamp; | |
| 239 | + | |
| 240 | + QueryProtocolOptions(ConsistencyLevel consistency, | |
| 241 | + List<ByteBuffer> values, | |
| 242 | + boolean skipMetadata, | |
| 243 | + int pageSize, | |
| 244 | + ByteBuffer pagingState, | |
| 245 | + ConsistencyLevel serialConsistency, | |
| 246 | + long defaultTimestamp) { | |
| 247 | 247 | |
| 248 | 248 | this.consistency = consistency; |
| 249 | 249 | this.values = values; |
| @@ -268,11 +268,11 @@ | ||
| 268 | 268 | flags.add(QueryFlag.DEFAULT_TIMESTAMP); |
| 269 | 269 | } |
| 270 | 270 | |
| 271 | - public QueryProtocolOptions copy(ConsistencyLevel newConsistencyLevel) { | |
| 271 | + QueryProtocolOptions copy(ConsistencyLevel newConsistencyLevel) { | |
| 272 | 272 | return new QueryProtocolOptions(newConsistencyLevel, values, skipMetadata, pageSize, pagingState, serialConsistency, defaultTimestamp); |
| 273 | 273 | } |
| 274 | 274 | |
| 275 | - public void encode(ByteBuf dest, ProtocolVersion version) { | |
| 275 | + void encode(ByteBuf dest, ProtocolVersion version) { | |
| 276 | 276 | switch (version) { |
| 277 | 277 | case V1: |
| 278 | 278 | if (flags.contains(QueryFlag.VALUES)) |
| @@ -300,7 +300,7 @@ | ||
| 300 | 300 | } |
| 301 | 301 | } |
| 302 | 302 | |
| 303 | - public int encodedSize(ProtocolVersion version) { | |
| 303 | + int encodedSize(ProtocolVersion version) { | |
| 304 | 304 | switch (version) { |
| 305 | 305 | case V1: |
| 306 | 306 | return CBUtil.sizeOfValueList(values) |
| @@ -333,9 +333,9 @@ | ||
| 333 | 333 | } |
| 334 | 334 | } |
| 335 | 335 | |
| 336 | - public static class Batch extends Message.Request { | |
| 336 | + static class Batch extends Message.Request { | |
| 337 | 337 | |
| 338 | - public static final Message.Coder<Batch> coder = new Message.Coder<Batch>() { | |
| 338 | + static final Message.Coder<Batch> coder = new Message.Coder<Batch>() { | |
| 339 | 339 | public void encode(Batch msg, ByteBuf dest, ProtocolVersion version) { |
| 340 | 340 | int queries = msg.queryOrIdList.size(); |
| 341 | 341 | assert queries <= 0xFFFF; |
| @@ -385,12 +385,12 @@ | ||
| 385 | 385 | } |
| 386 | 386 | }; |
| 387 | 387 | |
| 388 | - public final BatchStatement.Type type; | |
| 389 | - public final List<Object> queryOrIdList; | |
| 390 | - public final List<List<ByteBuffer>> values; | |
| 391 | - public final BatchProtocolOptions options; | |
| 388 | + final BatchStatement.Type type; | |
| 389 | + final List<Object> queryOrIdList; | |
| 390 | + final List<List<ByteBuffer>> values; | |
| 391 | + final BatchProtocolOptions options; | |
| 392 | 392 | |
| 393 | - public Batch(BatchStatement.Type type, List<Object> queryOrIdList, List<List<ByteBuffer>> values, BatchProtocolOptions options, boolean tracingRequested) { | |
| 393 | + Batch(BatchStatement.Type type, List<Object> queryOrIdList, List<List<ByteBuffer>> values, BatchProtocolOptions options, boolean tracingRequested) { | |
| 394 | 394 | super(Message.Request.Type.BATCH, tracingRequested); |
| 395 | 395 | this.type = type; |
| 396 | 396 | this.queryOrIdList = queryOrIdList; |
| @@ -421,13 +421,13 @@ | ||
| 421 | 421 | } |
| 422 | 422 | } |
| 423 | 423 | |
| 424 | - public static class BatchProtocolOptions { | |
| 424 | + static class BatchProtocolOptions { | |
| 425 | 425 | private final EnumSet<QueryFlag> flags = EnumSet.noneOf(QueryFlag.class); |
| 426 | - public final ConsistencyLevel consistency; | |
| 427 | - public final ConsistencyLevel serialConsistency; | |
| 428 | - public final long defaultTimestamp; | |
| 429 | - | |
| 430 | - public BatchProtocolOptions(ConsistencyLevel consistency, ConsistencyLevel serialConsistency, long defaultTimestamp) { | |
| 426 | + final ConsistencyLevel consistency; | |
| 427 | + final ConsistencyLevel serialConsistency; | |
| 428 | + final long defaultTimestamp; | |
| 429 | + | |
| 430 | + BatchProtocolOptions(ConsistencyLevel consistency, ConsistencyLevel serialConsistency, long defaultTimestamp) { | |
| 431 | 431 | this.consistency = consistency; |
| 432 | 432 | this.serialConsistency = serialConsistency; |
| 433 | 433 | this.defaultTimestamp = defaultTimestamp; |
| @@ -442,7 +442,7 @@ | ||
| 442 | 442 | return new BatchProtocolOptions(newConsistencyLevel, serialConsistency, defaultTimestamp); |
| 443 | 443 | } |
| 444 | 444 | |
| 445 | - public void encode(ByteBuf dest, ProtocolVersion version) { | |
| 445 | + void encode(ByteBuf dest, ProtocolVersion version) { | |
| 446 | 446 | switch (version) { |
| 447 | 447 | case V2: |
| 448 | 448 | CBUtil.writeConsistencyLevel(consistency, dest); |
| @@ -461,7 +461,7 @@ | ||
| 461 | 461 | } |
| 462 | 462 | } |
| 463 | 463 | |
| 464 | - public int encodedSize(ProtocolVersion version) { | |
| 464 | + int encodedSize(ProtocolVersion version) { | |
| 465 | 465 | switch (version) { |
| 466 | 466 | case V2: |
| 467 | 467 | return CBUtil.sizeOfConsistencyLevel(consistency); |
| @@ -487,9 +487,9 @@ | ||
| 487 | 487 | } |
| 488 | 488 | } |
| 489 | 489 | |
| 490 | - public static class Prepare extends Message.Request { | |
| 490 | + static class Prepare extends Message.Request { | |
| 491 | 491 | |
| 492 | - public static final Message.Coder<Prepare> coder = new Message.Coder<Prepare>() { | |
| 492 | + static final Message.Coder<Prepare> coder = new Message.Coder<Prepare>() { | |
| 493 | 493 | |
| 494 | 494 | public void encode(Prepare msg, ByteBuf dest, ProtocolVersion version) { |
| 495 | 495 | CBUtil.writeLongString(msg.query, dest); |
| @@ -502,7 +502,7 @@ | ||
| 502 | 502 | |
| 503 | 503 | private final String query; |
| 504 | 504 | |
| 505 | - public Prepare(String query) { | |
| 505 | + Prepare(String query) { | |
| 506 | 506 | super(Message.Request.Type.PREPARE); |
| 507 | 507 | this.query = query; |
| 508 | 508 | } |
| @@ -513,9 +513,9 @@ | ||
| 513 | 513 | } |
| 514 | 514 | } |
| 515 | 515 | |
| 516 | - public static class Register extends Message.Request { | |
| 516 | + static class Register extends Message.Request { | |
| 517 | 517 | |
| 518 | - public static final Message.Coder<Register> coder = new Message.Coder<Register>() { | |
| 518 | + static final Message.Coder<Register> coder = new Message.Coder<Register>() { | |
| 519 | 519 | public void encode(Register msg, ByteBuf dest, ProtocolVersion version) { |
| 520 | 520 | dest.writeShort(msg.eventTypes.size()); |
| 521 | 521 | for (ProtocolEvent.Type type : msg.eventTypes) |
| @@ -532,7 +532,7 @@ | ||
| 532 | 532 | |
| 533 | 533 | private final List<ProtocolEvent.Type> eventTypes; |
| 534 | 534 | |
| 535 | - public Register(List<ProtocolEvent.Type> eventTypes) { | |
| 535 | + Register(List<ProtocolEvent.Type> eventTypes) { | |
| 536 | 536 | super(Message.Request.Type.REGISTER); |
| 537 | 537 | this.eventTypes = eventTypes; |
| 538 | 538 | } |
| @@ -543,9 +543,9 @@ | ||
| 543 | 543 | } |
| 544 | 544 | } |
| 545 | 545 | |
| 546 | - public static class AuthResponse extends Message.Request { | |
| 546 | + static class AuthResponse extends Message.Request { | |
| 547 | 547 | |
| 548 | - public static final Message.Coder<AuthResponse> coder = new Message.Coder<AuthResponse>() { | |
| 548 | + static final Message.Coder<AuthResponse> coder = new Message.Coder<AuthResponse>() { | |
| 549 | 549 | |
| 550 | 550 | public void encode(AuthResponse response, ByteBuf dest, ProtocolVersion version) { |
| 551 | 551 | CBUtil.writeValue(response.token, dest); |
| @@ -558,7 +558,7 @@ | ||
| 558 | 558 | |
| 559 | 559 | private final byte[] token; |
| 560 | 560 | |
| 561 | - public AuthResponse(byte[] token) { | |
| 561 | + AuthResponse(byte[] token) { | |
| 562 | 562 | super(Message.Request.Type.AUTH_RESPONSE); |
| 563 | 563 | this.token = token; |
| 564 | 564 | } |
modified driver-core/src/main/java/com/datastax/driver/core/Responses.java +68 −68
| @@ -32,9 +32,9 @@ | ||
| 32 | 32 | private Responses() { |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | - public static class Error extends Message.Response { | |
| 35 | + static class Error extends Message.Response { | |
| 36 | 36 | |
| 37 | - public static final Message.Decoder<Error> decoder = new Message.Decoder<Error>() { | |
| 37 | + static final Message.Decoder<Error> decoder = new Message.Decoder<Error>() { | |
| 38 | 38 | @Override |
| 39 | 39 | public Error decode(ByteBuf body, ProtocolVersion version, CodecRegistry codecRegistry) { |
| 40 | 40 | ExceptionCode code = ExceptionCode.fromValue(body.readInt()); |
| @@ -89,10 +89,10 @@ | ||
| 89 | 89 | } |
| 90 | 90 | }; |
| 91 | 91 | |
| 92 | - public final ProtocolVersion serverProtocolVersion; | |
| 93 | - public final ExceptionCode code; | |
| 94 | - public final String message; | |
| 95 | - public final Object infos; // can be null | |
| 92 | + final ProtocolVersion serverProtocolVersion; | |
| 93 | + final ExceptionCode code; | |
| 94 | + final String message; | |
| 95 | + final Object infos; // can be null | |
| 96 | 96 | |
| 97 | 97 | private Error(ProtocolVersion serverProtocolVersion, ExceptionCode code, String message, Object infos) { |
| 98 | 98 | super(Message.Response.Type.ERROR); |
| @@ -102,7 +102,7 @@ | ||
| 102 | 102 | this.infos = infos; |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | - public DriverException asException(InetSocketAddress host) { | |
| 105 | + DriverException asException(InetSocketAddress host) { | |
| 106 | 106 | switch (code) { |
| 107 | 107 | case SERVER_ERROR: |
| 108 | 108 | return new ServerError(host, message); |
| @@ -151,9 +151,9 @@ | ||
| 151 | 151 | } |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | - public static class Ready extends Message.Response { | |
| 154 | + static class Ready extends Message.Response { | |
| 155 | 155 | |
| 156 | - public static final Message.Decoder<Ready> decoder = new Message.Decoder<Ready>() { | |
| 156 | + static final Message.Decoder<Ready> decoder = new Message.Decoder<Ready>() { | |
| 157 | 157 | public Ready decode(ByteBuf body, ProtocolVersion version, CodecRegistry codecRegistry) { |
| 158 | 158 | // TODO: Would it be cool to return a singleton? Check we don't need to |
| 159 | 159 | // set the streamId or something |
| @@ -161,7 +161,7 @@ | ||
| 161 | 161 | } |
| 162 | 162 | }; |
| 163 | 163 | |
| 164 | - public Ready() { | |
| 164 | + Ready() { | |
| 165 | 165 | super(Message.Response.Type.READY); |
| 166 | 166 | } |
| 167 | 167 | |
| @@ -171,18 +171,18 @@ | ||
| 171 | 171 | } |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | - public static class Authenticate extends Message.Response { | |
| 174 | + static class Authenticate extends Message.Response { | |
| 175 | 175 | |
| 176 | - public static final Message.Decoder<Authenticate> decoder = new Message.Decoder<Authenticate>() { | |
| 176 | + static final Message.Decoder<Authenticate> decoder = new Message.Decoder<Authenticate>() { | |
| 177 | 177 | public Authenticate decode(ByteBuf body, ProtocolVersion version, CodecRegistry codecRegistry) { |
| 178 | 178 | String authenticator = CBUtil.readString(body); |
| 179 | 179 | return new Authenticate(authenticator); |
| 180 | 180 | } |
| 181 | 181 | }; |
| 182 | 182 | |
| 183 | - public final String authenticator; | |
| 183 | + final String authenticator; | |
| 184 | 184 | |
| 185 | - public Authenticate(String authenticator) { | |
| 185 | + Authenticate(String authenticator) { | |
| 186 | 186 | super(Message.Response.Type.AUTHENTICATE); |
| 187 | 187 | this.authenticator = authenticator; |
| 188 | 188 | } |
| @@ -193,18 +193,18 @@ | ||
| 193 | 193 | } |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | - public static class Supported extends Message.Response { | |
| 196 | + static class Supported extends Message.Response { | |
| 197 | 197 | |
| 198 | - public static final Message.Decoder<Supported> decoder = new Message.Decoder<Supported>() { | |
| 198 | + static final Message.Decoder<Supported> decoder = new Message.Decoder<Supported>() { | |
| 199 | 199 | public Supported decode(ByteBuf body, ProtocolVersion version, CodecRegistry codecRegistry) { |
| 200 | 200 | return new Supported(CBUtil.readStringToStringListMap(body)); |
| 201 | 201 | } |
| 202 | 202 | }; |
| 203 | 203 | |
| 204 | - public final Map<String, List<String>> supported; | |
| 205 | - public final Set<ProtocolOptions.Compression> supportedCompressions = EnumSet.noneOf(ProtocolOptions.Compression.class); | |
| 204 | + final Map<String, List<String>> supported; | |
| 205 | + final Set<ProtocolOptions.Compression> supportedCompressions = EnumSet.noneOf(ProtocolOptions.Compression.class); | |
| 206 | 206 | |
| 207 | - public Supported(Map<String, List<String>> supported) { | |
| 207 | + Supported(Map<String, List<String>> supported) { | |
| 208 | 208 | super(Message.Response.Type.SUPPORTED); |
| 209 | 209 | this.supported = supported; |
| 210 | 210 | |
| @@ -229,16 +229,16 @@ | ||
| 229 | 229 | } |
| 230 | 230 | } |
| 231 | 231 | |
| 232 | - public static abstract class Result extends Message.Response { | |
| 232 | + static abstract class Result extends Message.Response { | |
| 233 | 233 | |
| 234 | - public static final Message.Decoder<Result> decoder = new Message.Decoder<Result>() { | |
| 234 | + static final Message.Decoder<Result> decoder = new Message.Decoder<Result>() { | |
| 235 | 235 | public Result decode(ByteBuf body, ProtocolVersion version, CodecRegistry codecRegistry) { |
| 236 | 236 | Kind kind = Kind.fromId(body.readInt()); |
| 237 | 237 | return kind.subDecoder.decode(body, version, codecRegistry); |
| 238 | 238 | } |
| 239 | 239 | }; |
| 240 | 240 | |
| 241 | - public enum Kind { | |
| 241 | + enum Kind { | |
| 242 | 242 | VOID(1, Void.subcodec), |
| 243 | 243 | ROWS(2, Rows.subcodec), |
| 244 | 244 | SET_KEYSPACE(3, SetKeyspace.subcodec), |
| @@ -262,12 +262,12 @@ | ||
| 262 | 262 | } |
| 263 | 263 | } |
| 264 | 264 | |
| 265 | - private Kind(int id, Message.Decoder<Result> subDecoder) { | |
| 265 | + Kind(int id, Message.Decoder<Result> subDecoder) { | |
| 266 | 266 | this.id = id; |
| 267 | 267 | this.subDecoder = subDecoder; |
| 268 | 268 | } |
| 269 | 269 | |
| 270 | - public static Kind fromId(int id) { | |
| 270 | + static Kind fromId(int id) { | |
| 271 | 271 | Kind k = ids[id]; |
| 272 | 272 | if (k == null) |
| 273 | 273 | throw new DriverInternalError(String.format("Unknown kind id %d in RESULT message", id)); |
| @@ -275,21 +275,21 @@ | ||
| 275 | 275 | } |
| 276 | 276 | } |
| 277 | 277 | |
| 278 | - public final Kind kind; | |
| 278 | + final Kind kind; | |
| 279 | 279 | |
| 280 | 280 | protected Result(Kind kind) { |
| 281 | 281 | super(Message.Response.Type.RESULT); |
| 282 | 282 | this.kind = kind; |
| 283 | 283 | } |
| 284 | 284 | |
| 285 | - public static class Void extends Result { | |
| 285 | + static class Void extends Result { | |
| 286 | 286 | // Even though we have no specific information here, don't make a |
| 287 | 287 | // singleton since as each message it has in fact a streamid and connection. |
| 288 | - public Void() { | |
| 288 | + Void() { | |
| 289 | 289 | super(Kind.VOID); |
| 290 | 290 | } |
| 291 | 291 | |
| 292 | - public static final Message.Decoder<Result> subcodec = new Message.Decoder<Result>() { | |
| 292 | + static final Message.Decoder<Result> subcodec = new Message.Decoder<Result>() { | |
| 293 | 293 | public Result decode(ByteBuf body, ProtocolVersion version, CodecRegistry codecRegistry) { |
| 294 | 294 | return new Void(); |
| 295 | 295 | } |
| @@ -301,15 +301,15 @@ | ||
| 301 | 301 | } |
| 302 | 302 | } |
| 303 | 303 | |
| 304 | - public static class SetKeyspace extends Result { | |
| 305 | - public final String keyspace; | |
| 304 | + static class SetKeyspace extends Result { | |
| 305 | + final String keyspace; | |
| 306 | 306 | |
| 307 | 307 | private SetKeyspace(String keyspace) { |
| 308 | 308 | super(Kind.SET_KEYSPACE); |
| 309 | 309 | this.keyspace = keyspace; |
| 310 | 310 | } |
| 311 | 311 | |
| 312 | - public static final Message.Decoder<Result> subcodec = new Message.Decoder<Result>() { | |
| 312 | + static final Message.Decoder<Result> subcodec = new Message.Decoder<Result>() { | |
| 313 | 313 | public Result decode(ByteBuf body, ProtocolVersion version, CodecRegistry codecRegistry) { |
| 314 | 314 | return new SetKeyspace(CBUtil.readString(body)); |
| 315 | 315 | } |
| @@ -321,17 +321,17 @@ | ||
| 321 | 321 | } |
| 322 | 322 | } |
| 323 | 323 | |
| 324 | - public static class Rows extends Result { | |
| 324 | + static class Rows extends Result { | |
| 325 | 325 | |
| 326 | - public static class Metadata { | |
| 326 | + static class Metadata { | |
| 327 | 327 | |
| 328 | - private static enum Flag { | |
| 328 | + private enum Flag { | |
| 329 | 329 | // The order of that enum matters!! |
| 330 | 330 | GLOBAL_TABLES_SPEC, |
| 331 | 331 | HAS_MORE_PAGES, |
| 332 | 332 | NO_METADATA; |
| 333 | 333 | |
| 334 | - public static EnumSet<Flag> deserialize(int flags) { | |
| 334 | + static EnumSet<Flag> deserialize(int flags) { | |
| 335 | 335 | EnumSet<Flag> set = EnumSet.noneOf(Flag.class); |
| 336 | 336 | Flag[] values = Flag.values(); |
| 337 | 337 | for (int n = 0; n < values.length; n++) { |
| @@ -341,7 +341,7 @@ | ||
| 341 | 341 | return set; |
| 342 | 342 | } |
| 343 | 343 | |
| 344 | - public static int serialize(EnumSet<Flag> flags) { | |
| 344 | + static int serialize(EnumSet<Flag> flags) { | |
| 345 | 345 | int i = 0; |
| 346 | 346 | for (Flag flag : flags) |
| 347 | 347 | i |= 1 << flag.ordinal(); |
| @@ -351,10 +351,10 @@ | ||
| 351 | 351 | |
| 352 | 352 | static final Metadata EMPTY = new Metadata(0, null, null, null); |
| 353 | 353 | |
| 354 | - public final int columnCount; | |
| 355 | - public final ColumnDefinitions columns; // Can be null if no metadata was asked by the query | |
| 356 | - public final ByteBuffer pagingState; | |
| 357 | - public final int[] pkIndices; | |
| 354 | + final int columnCount; | |
| 355 | + final ColumnDefinitions columns; // Can be null if no metadata was asked by the query | |
| 356 | + final ByteBuffer pagingState; | |
| 357 | + final int[] pkIndices; | |
| 358 | 358 | |
| 359 | 359 | private Metadata(int columnCount, ColumnDefinitions columns, ByteBuffer pagingState, int[] pkIndices) { |
| 360 | 360 | this.columnCount = columnCount; |
| @@ -363,11 +363,11 @@ | ||
| 363 | 363 | this.pkIndices = pkIndices; |
| 364 | 364 | } |
| 365 | 365 | |
| 366 | - public static Metadata decode(ByteBuf body, ProtocolVersion protocolVersion, CodecRegistry codecRegistry) { | |
| 366 | + static Metadata decode(ByteBuf body, ProtocolVersion protocolVersion, CodecRegistry codecRegistry) { | |
| 367 | 367 | return decode(body, false, protocolVersion, codecRegistry); |
| 368 | 368 | } |
| 369 | 369 | |
| 370 | - public static Metadata decode(ByteBuf body, boolean withPkIndices, ProtocolVersion protocolVersion, CodecRegistry codecRegistry) { | |
| 370 | + static Metadata decode(ByteBuf body, boolean withPkIndices, ProtocolVersion protocolVersion, CodecRegistry codecRegistry) { | |
| 371 | 371 | |
| 372 | 372 | // flags & column count |
| 373 | 373 | EnumSet<Flag> flags = Flag.deserialize(body.readInt()); |
| @@ -428,7 +428,7 @@ | ||
| 428 | 428 | } |
| 429 | 429 | } |
| 430 | 430 | |
| 431 | - public static final Message.Decoder<Result> subcodec = new Message.Decoder<Result>() { | |
| 431 | + static final Message.Decoder<Result> subcodec = new Message.Decoder<Result>() { | |
| 432 | 432 | public Result decode(ByteBuf body, ProtocolVersion version, CodecRegistry codecRegistry) { |
| 433 | 433 | |
| 434 | 434 | Metadata metadata = Metadata.decode(body, version, codecRegistry); |
| @@ -448,8 +448,8 @@ | ||
| 448 | 448 | } |
| 449 | 449 | }; |
| 450 | 450 | |
| 451 | - public final Metadata metadata; | |
| 452 | - public final Queue<List<ByteBuffer>> data; | |
| 451 | + final Metadata metadata; | |
| 452 | + final Queue<List<ByteBuffer>> data; | |
| 453 | 453 | private final ProtocolVersion version; |
| 454 | 454 | |
| 455 | 455 | private Rows(Metadata metadata, Queue<List<ByteBuffer>> data, ProtocolVersion version) { |
| @@ -492,9 +492,9 @@ | ||
| 492 | 492 | } |
| 493 | 493 | } |
| 494 | 494 | |
| 495 | - public static class Prepared extends Result { | |
| 495 | + static class Prepared extends Result { | |
| 496 | 496 | |
| 497 | - public static final Message.Decoder<Result> subcodec = new Message.Decoder<Result>() { | |
| 497 | + static final Message.Decoder<Result> subcodec = new Message.Decoder<Result>() { | |
| 498 | 498 | public Result decode(ByteBuf body, ProtocolVersion version, CodecRegistry codecRegistry) { |
| 499 | 499 | MD5Digest id = MD5Digest.wrap(CBUtil.readBytes(body)); |
| 500 | 500 | boolean withPkIndices = version.compareTo(V4) >= 0; |
| @@ -517,9 +517,9 @@ | ||
| 517 | 517 | } |
| 518 | 518 | }; |
| 519 | 519 | |
| 520 | - public final MD5Digest statementId; | |
| 521 | - public final Rows.Metadata metadata; | |
| 522 | - public final Rows.Metadata resultMetadata; | |
| 520 | + final MD5Digest statementId; | |
| 521 | + final Rows.Metadata metadata; | |
| 522 | + final Rows.Metadata resultMetadata; | |
| 523 | 523 | |
| 524 | 524 | private Prepared(MD5Digest statementId, Rows.Metadata metadata, Rows.Metadata resultMetadata) { |
| 525 | 525 | super(Kind.PREPARED); |
| @@ -534,17 +534,17 @@ | ||
| 534 | 534 | } |
| 535 | 535 | } |
| 536 | 536 | |
| 537 | - public static class SchemaChange extends Result { | |
| 537 | + static class SchemaChange extends Result { | |
| 538 | 538 | |
| 539 | - public enum Change {CREATED, UPDATED, DROPPED} | |
| 539 | + enum Change {CREATED, UPDATED, DROPPED} | |
| 540 | 540 | |
| 541 | - public final Change change; | |
| 542 | - public final SchemaElement targetType; | |
| 543 | - public final String targetKeyspace; | |
| 544 | - public final String targetName; | |
| 545 | - public final List<String> targetSignature; | |
| 541 | + final Change change; | |
| 542 | + final SchemaElement targetType; | |
| 543 | + final String targetKeyspace; | |
| 544 | + final String targetName; | |
| 545 | + final List<String> targetSignature; | |
| 546 | 546 | |
| 547 | - public static final Message.Decoder<Result> subcodec = new Message.Decoder<Result>() { | |
| 547 | + static final Message.Decoder<Result> subcodec = new Message.Decoder<Result>() { | |
| 548 | 548 | public Result decode(ByteBuf body, ProtocolVersion version, CodecRegistry codecRegistry) { |
| 549 | 549 | // Note: the CREATE KEYSPACE/TABLE/TYPE SCHEMA_CHANGE response is different from the SCHEMA_CHANGE EVENT type |
| 550 | 550 | Change change; |
| @@ -592,17 +592,17 @@ | ||
| 592 | 592 | } |
| 593 | 593 | } |
| 594 | 594 | |
| 595 | - public static class Event extends Message.Response { | |
| 595 | + static class Event extends Message.Response { | |
| 596 | 596 | |
| 597 | - public static final Message.Decoder<Event> decoder = new Message.Decoder<Event>() { | |
| 597 | + static final Message.Decoder<Event> decoder = new Message.Decoder<Event>() { | |
| 598 | 598 | public Event decode(ByteBuf body, ProtocolVersion version, CodecRegistry codecRegistry) { |
| 599 | 599 | return new Event(ProtocolEvent.deserialize(body, version)); |
| 600 | 600 | } |
| 601 | 601 | }; |
| 602 | 602 | |
| 603 | - public final ProtocolEvent event; | |
| 603 | + final ProtocolEvent event; | |
| 604 | 604 | |
| 605 | - public Event(ProtocolEvent event) { | |
| 605 | + Event(ProtocolEvent event) { | |
| 606 | 606 | super(Message.Response.Type.EVENT); |
| 607 | 607 | this.event = event; |
| 608 | 608 | } |
| @@ -613,9 +613,9 @@ | ||
| 613 | 613 | } |
| 614 | 614 | } |
| 615 | 615 | |
| 616 | - public static class AuthChallenge extends Message.Response { | |
| 616 | + static class AuthChallenge extends Message.Response { | |
| 617 | 617 | |
| 618 | - public static final Message.Decoder<AuthChallenge> decoder = new Message.Decoder<AuthChallenge>() { | |
| 618 | + static final Message.Decoder<AuthChallenge> decoder = new Message.Decoder<AuthChallenge>() { | |
| 619 | 619 | public AuthChallenge decode(ByteBuf body, ProtocolVersion version, CodecRegistry codecRegistry) { |
| 620 | 620 | ByteBuffer b = CBUtil.readValue(body); |
| 621 | 621 | if (b == null) |
| @@ -627,7 +627,7 @@ | ||
| 627 | 627 | } |
| 628 | 628 | }; |
| 629 | 629 | |
| 630 | - public final byte[] token; | |
| 630 | + final byte[] token; | |
| 631 | 631 | |
| 632 | 632 | private AuthChallenge(byte[] token) { |
| 633 | 633 | super(Message.Response.Type.AUTH_CHALLENGE); |
| @@ -635,9 +635,9 @@ | ||
| 635 | 635 | } |
| 636 | 636 | } |
| 637 | 637 | |
| 638 | - public static class AuthSuccess extends Message.Response { | |
| 638 | + static class AuthSuccess extends Message.Response { | |
| 639 | 639 | |
| 640 | - public static final Message.Decoder<AuthSuccess> decoder = new Message.Decoder<AuthSuccess>() { | |
| 640 | + static final Message.Decoder<AuthSuccess> decoder = new Message.Decoder<AuthSuccess>() { | |
| 641 | 641 | public AuthSuccess decode(ByteBuf body, ProtocolVersion version, CodecRegistry codecRegistry) { |
| 642 | 642 | ByteBuffer b = CBUtil.readValue(body); |
| 643 | 643 | if (b == null) |
| @@ -649,7 +649,7 @@ | ||
| 649 | 649 | } |
| 650 | 650 | }; |
| 651 | 651 | |
| 652 | - public final byte[] token; | |
| 652 | + final byte[] token; | |
| 653 | 653 | |
| 654 | 654 | private AuthSuccess(byte[] token) { |
| 655 | 655 | super(Message.Response.Type.AUTH_SUCCESS); |
modified pom.xml +0 −9
| @@ -233,15 +233,6 @@ | ||
| 233 | 233 | <configuration> |
| 234 | 234 | <comparisonVersion>3.0.0</comparisonVersion> |
| 235 | 235 | <ignoredDifferencesFile>../clirr-ignores.xml</ignoredDifferencesFile> |
| 236 | - <excludes> | |
| 237 | - <!-- Package-private, internal classes --> | |
| 238 | - <exclude>com/datastax/driver/core/Frame$*</exclude> | |
| 239 | - <exclude>com/datastax/driver/core/ProtocolEvent$*</exclude> | |
| 240 | - <exclude>com/datastax/driver/core/Message$*</exclude> | |
| 241 | - <exclude>com/datastax/driver/core/Requests$*</exclude> | |
| 242 | - <exclude>com/datastax/driver/core/Responses$*</exclude> | |
| 243 | - <exclude>com/datastax/driver/core/Connection$*</exclude> | |
| 244 | - </excludes> | |
| 245 | 236 | </configuration> |
| 246 | 237 | <!-- |
| 247 | 238 | Workaround to make clirr plugin work with Java 8. |