From b326a2f98145d479b7737780faf3a70e31ad40a6 Mon Sep 17 00:00:00 2001 From: Andrea Cavalli Date: Thu, 28 Mar 2024 23:52:26 +0100 Subject: [PATCH] Add thrift API, add datagen serialization --- generate-api.sh | 2 + pom.xml | 70 +- .../it/cavallium/rockserver/core/Main.java | 43 +- .../rockserver/core/client/ClientBuilder.java | 7 +- .../core/client/EmbeddedConnection.java | 45 +- .../core/client/RocksDBConnection.java | 9 +- .../core/client/SocketConnection.java | 109 - .../core/client/SocketConnectionInet.java | 22 - .../core/client/SocketConnectionUnix.java | 29 - .../rockserver/core/common/Callback.java | 128 - .../rockserver/core/common/RequestType.java | 197 + .../rockserver/core/common/RocksDBAPI.java | 132 +- .../core/common/RocksDBAPICommand.java | 543 + .../core/common/RocksDBAsyncAPI.java | 111 + .../common/RocksDBAsyncAPIRequestHandler.java | 29 + .../core/common/RocksDBSyncAPI.java | 105 + .../common/RocksDBSyncAPIRequestHandler.java | 27 + .../core/common/SerializationUtils.java | 56 + .../core/common/api/ColumnHashType.java | 46 + .../core/common/api/ColumnSchema.java | 701 + .../rockserver/core/common/api/Delta.java | 518 + .../core/common/api/InvalidOperation.java | 490 + .../rockserver/core/common/api/Operation.java | 64 + .../core/common/api/OptionalBinary.java | 398 + .../rockserver/core/common/api/RocksDB.java | 21149 ++++++++++++++++ .../core/common/api/UpdateBegin.java | 501 + .../rockserver/core/impl/DataSizeDecoder.java | 12 +- .../core/impl/DbCompressionDecoder.java | 12 +- .../rockserver/core/impl/EmbeddedDB.java | 68 +- .../rockserver/core/server/Server.java | 19 + .../rockserver/core/server/ServerBuilder.java | 47 + .../rockserver/core/server/ThriftServer.java | 322 + src/main/java/module-info.java | 13 +- .../rockserver/core/resources/rocksdb.thrift | 83 + .../core/impl/test/EmbeddedDBTest.java | 135 +- src/test/java/module-info.java | 2 +- 36 files changed, 25667 insertions(+), 577 deletions(-) create mode 100755 generate-api.sh delete mode 100644 src/main/java/it/cavallium/rockserver/core/client/SocketConnection.java delete mode 100644 src/main/java/it/cavallium/rockserver/core/client/SocketConnectionInet.java delete mode 100644 src/main/java/it/cavallium/rockserver/core/client/SocketConnectionUnix.java delete mode 100644 src/main/java/it/cavallium/rockserver/core/common/Callback.java create mode 100644 src/main/java/it/cavallium/rockserver/core/common/RequestType.java create mode 100644 src/main/java/it/cavallium/rockserver/core/common/RocksDBAPICommand.java create mode 100644 src/main/java/it/cavallium/rockserver/core/common/RocksDBAsyncAPI.java create mode 100644 src/main/java/it/cavallium/rockserver/core/common/RocksDBAsyncAPIRequestHandler.java create mode 100644 src/main/java/it/cavallium/rockserver/core/common/RocksDBSyncAPI.java create mode 100644 src/main/java/it/cavallium/rockserver/core/common/RocksDBSyncAPIRequestHandler.java create mode 100644 src/main/java/it/cavallium/rockserver/core/common/SerializationUtils.java create mode 100644 src/main/java/it/cavallium/rockserver/core/common/api/ColumnHashType.java create mode 100644 src/main/java/it/cavallium/rockserver/core/common/api/ColumnSchema.java create mode 100644 src/main/java/it/cavallium/rockserver/core/common/api/Delta.java create mode 100644 src/main/java/it/cavallium/rockserver/core/common/api/InvalidOperation.java create mode 100644 src/main/java/it/cavallium/rockserver/core/common/api/Operation.java create mode 100644 src/main/java/it/cavallium/rockserver/core/common/api/OptionalBinary.java create mode 100644 src/main/java/it/cavallium/rockserver/core/common/api/RocksDB.java create mode 100644 src/main/java/it/cavallium/rockserver/core/common/api/UpdateBegin.java create mode 100644 src/main/java/it/cavallium/rockserver/core/server/Server.java create mode 100644 src/main/java/it/cavallium/rockserver/core/server/ServerBuilder.java create mode 100644 src/main/java/it/cavallium/rockserver/core/server/ThriftServer.java create mode 100644 src/main/resources/it/cavallium/rockserver/core/resources/rocksdb.thrift diff --git a/generate-api.sh b/generate-api.sh new file mode 100755 index 0000000..2645138 --- /dev/null +++ b/generate-api.sh @@ -0,0 +1,2 @@ +#!/bin/bash -e +thrift -r --gen java:generated_annotations=suppress -out src/main/java src/main/resources/it/cavallium/rockserver/core/resources/rocksdb.thrift diff --git a/pom.xml b/pom.xml index 6364377..11a566a 100644 --- a/pom.xml +++ b/pom.xml @@ -9,8 +9,8 @@ 1.0.0-SNAPSHOT - 21 - 21 + 22 + 22 0.9.28 0.25.3 9.0.0 @@ -18,6 +18,32 @@ it.cavallium.rockserver.core.Main + + + sonatype-snapshot + Sonatype OSS Snapshots + + false + + + true + + https://oss.sonatype.org/content/repositories/snapshots + + + + + + + io.netty + netty5-bom + 5.0.0.Alpha6-SNAPSHOT + pom + import + + + + org.rocksdb @@ -31,8 +57,8 @@ it.unimi.dsi - fastutil-core - 8.5.12 + fastutil + 8.5.13 com.github.seancfoley @@ -60,6 +86,27 @@ gestalt-hocon ${gestalt.version} + + io.netty + netty5-buffer + + + io.netty + netty5-codec-http2 + + + io.netty + netty5-transport-native-io_uring + + + io.netty + netty5-transport-classes-io_uring + + + org.apache.thrift + libthrift + 0.20.0 + org.lz4 @@ -99,9 +146,6 @@ it.cavallium.rockserver.core.Main - - --enable-preview - @@ -113,23 +157,13 @@ ${maven.compiler.source} ${maven.compiler.source} - true - - --enable-preview - maven-surefire-plugin - - --enable-preview - maven-failsafe-plugin - - --enable-preview - @@ -209,7 +243,6 @@ -march=native -H:IncludeResourceBundles=net.sourceforge.argparse4j.internal.ArgumentParserImpl -O1 - --enable-preview -H:+StaticExecutableWithDynamicLibC -H:+JNI -H:IncludeResources=librocksdbjni-linux64.so @@ -235,7 +268,6 @@ java ${project.build.directory} - --enable-preview -classpath ${mainClass} diff --git a/src/main/java/it/cavallium/rockserver/core/Main.java b/src/main/java/it/cavallium/rockserver/core/Main.java index 2f6d187..9a8c2d0 100644 --- a/src/main/java/it/cavallium/rockserver/core/Main.java +++ b/src/main/java/it/cavallium/rockserver/core/Main.java @@ -27,10 +27,14 @@ public class Main { ArgumentParser parser = ArgumentParsers.newFor("rockserver-core").build() .defaultHelp(true) .description("RocksDB server core"); - parser.addArgument("-u", "--url") + parser.addArgument("-u", "--database-url") .type(String.class) .setDefault(PRIVATE_MEMORY_URL.toString()) .help("Specify database rocksdb://hostname:port, or unix://, or file://"); + parser.addArgument("-l", "--listen-url") + .type(String.class) + .setDefault("http://127.0.0.1:5332") + .help("Specify database http://hostname:port, or unix://, or file://"); parser.addArgument("-n", "--name") .type(String.class) .setDefault("main") @@ -50,6 +54,7 @@ public class Main { System.exit(1); } var clientBuilder = new it.cavallium.rockserver.core.client.ClientBuilder(); + var serverBuilder = new it.cavallium.rockserver.core.server.ServerBuilder(); if (ns.getBoolean("print_default_config")) { requireNonNull(Main.class.getClassLoader() @@ -62,14 +67,16 @@ public class Main { LOG.info("Starting..."); RocksDBLoader.loadLibrary(); - var rawUrl = ns.getString("url"); + var rawDatabaseUrl = ns.getString("database_url"); + var rawListenUrl = ns.getString("listen_url"); var name = ns.getString("name"); var config = ns.getString("config"); - var url = new URI(rawUrl); + var databaseUrl = new URI(rawDatabaseUrl); + var listenUrl = new URI(rawListenUrl); if (config != null) { - if (!url.getScheme().equals("file")) { + if (!databaseUrl.getScheme().equals("file")) { System.err.println("Do not set --config if the database is not local!"); System.exit(1); return; @@ -78,20 +85,36 @@ public class Main { } } - switch (url.getScheme()) { - case "unix" -> clientBuilder.setUnixSocket(UnixDomainSocketAddress.of(Path.of(url.getPath()))); - case "file" -> clientBuilder.setEmbeddedPath(Path.of((url.getAuthority() != null ? url.getAuthority() : "") + url.getPath()).normalize()); + switch (databaseUrl.getScheme()) { + case "unix" -> clientBuilder.setUnixSocket(UnixDomainSocketAddress.of(Path.of(databaseUrl.getPath()))); + case "file" -> clientBuilder.setEmbeddedPath(Path.of((databaseUrl.getAuthority() != null ? databaseUrl.getAuthority() : "") + databaseUrl.getPath()).normalize()); case "memory" -> clientBuilder.setEmbeddedInMemory(true); - case "rocksdb" -> clientBuilder.setAddress(new HostName(url.getHost()).asInetSocketAddress()); - default -> throw new IllegalArgumentException("Invalid scheme: " + url.getScheme()); + case "rocksdb" -> clientBuilder.setAddress(new HostName(databaseUrl.getHost()).asInetSocketAddress()); + default -> throw new IllegalArgumentException("Invalid scheme: " + databaseUrl.getScheme()); + } + + switch (listenUrl.getScheme()) { + case "unix" -> serverBuilder.setUnixSocket(UnixDomainSocketAddress.of(Path.of(listenUrl.getPath()))); + case "http" -> serverBuilder.setHttpAddress(listenUrl.getHost(), listenUrl.getPort()); + case "rocksdb" -> serverBuilder.setAddress(new HostName(listenUrl.getHost()).asInetSocketAddress()); + default -> throw new IllegalArgumentException("Invalid scheme: " + listenUrl.getScheme()); } clientBuilder.setName(name); try (var connection = clientBuilder.build()) { LOG.log(Level.INFO, "Connected to {0}", connection); + + serverBuilder.setClient(connection); + CountDownLatch shutdownLatch = new CountDownLatch(1); Runtime.getRuntime().addShutdownHook(new Thread(shutdownLatch::countDown)); - LOG.info("Shutting down..."); + + try (var server = serverBuilder.build()) { + shutdownLatch.await(); + LOG.info("Shutting down..."); + } + } catch (InterruptedException e) { + throw new RuntimeException("Interrupted", e); } LOG.info("Shut down successfully"); } diff --git a/src/main/java/it/cavallium/rockserver/core/client/ClientBuilder.java b/src/main/java/it/cavallium/rockserver/core/client/ClientBuilder.java index 547c3c9..8818c22 100644 --- a/src/main/java/it/cavallium/rockserver/core/client/ClientBuilder.java +++ b/src/main/java/it/cavallium/rockserver/core/client/ClientBuilder.java @@ -1,5 +1,6 @@ package it.cavallium.rockserver.core.client; +import java.io.IOException; import java.net.InetSocketAddress; import java.net.UnixDomainSocketAddress; import java.nio.file.Path; @@ -37,15 +38,15 @@ public class ClientBuilder { this.embeddedConfig = embeddedConfig; } - public RocksDBConnection build() { + public RocksDBConnection build() throws IOException { if (embeddedInMemory) { return new EmbeddedConnection(null, name, embeddedConfig); } else if (embeddedPath != null) { return new EmbeddedConnection(embeddedPath, name, embeddedConfig); } else if (unixAddress != null) { - return new SocketConnectionUnix(unixAddress, name); + throw new UnsupportedOperationException("Not implemented: unix socket"); } else if (iNetAddress != null) { - return new SocketConnectionInet(iNetAddress, name); + throw new UnsupportedOperationException("Not implemented: inet address"); } else { throw new UnsupportedOperationException("Please set a connection type"); } diff --git a/src/main/java/it/cavallium/rockserver/core/client/EmbeddedConnection.java b/src/main/java/it/cavallium/rockserver/core/client/EmbeddedConnection.java index d47898b..8e54d69 100644 --- a/src/main/java/it/cavallium/rockserver/core/client/EmbeddedConnection.java +++ b/src/main/java/it/cavallium/rockserver/core/client/EmbeddedConnection.java @@ -1,10 +1,14 @@ package it.cavallium.rockserver.core.client; -import it.cavallium.rockserver.core.common.Callback.GetCallback; -import it.cavallium.rockserver.core.common.Callback.IteratorCallback; -import it.cavallium.rockserver.core.common.Callback.PutCallback; +import it.cavallium.rockserver.core.common.RequestType; +import it.cavallium.rockserver.core.common.RequestType.RequestGet; +import it.cavallium.rockserver.core.common.RequestType.RequestPut; import it.cavallium.rockserver.core.common.ColumnSchema; +import it.cavallium.rockserver.core.common.RocksDBAPI; +import it.cavallium.rockserver.core.common.RocksDBAPICommand; +import it.cavallium.rockserver.core.common.RocksDBAsyncAPI; import it.cavallium.rockserver.core.common.RocksDBException; +import it.cavallium.rockserver.core.common.RocksDBSyncAPI; import it.cavallium.rockserver.core.impl.EmbeddedDB; import java.io.IOException; import java.lang.foreign.Arena; @@ -13,10 +17,11 @@ import java.net.URI; import java.nio.file.Path; import java.util.Optional; +import java.util.concurrent.CompletionStage; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -public class EmbeddedConnection extends BaseConnection { +public class EmbeddedConnection extends BaseConnection implements RocksDBAPI { private final EmbeddedDB db; public static final URI PRIVATE_MEMORY_URL = URI.create("memory://private"); @@ -37,6 +42,16 @@ public class EmbeddedConnection extends BaseConnection { return Optional.ofNullable(db.getPath()).map(Path::toUri).orElse(PRIVATE_MEMORY_URL); } + @Override + public RocksDBSyncAPI getSyncApi() { + return this; + } + + @Override + public RocksDBAsyncAPI getAsyncApi() { + return this; + } + @Override public long openTransaction(long timeoutMs) { return db.openTransaction(timeoutMs); @@ -67,14 +82,24 @@ public class EmbeddedConnection extends BaseConnection { return db.getColumnId(name); } + @Override + public R requestSync(RocksDBAPICommand req) { + return req.handleSync(this); + } + + @Override + public CompletionStage requestAsync(RocksDBAPICommand req) { + return req.handleAsync(this); + } + @Override public T put(Arena arena, long transactionOrUpdateId, long columnId, @NotNull MemorySegment @NotNull [] keys, @NotNull MemorySegment value, - PutCallback callback) throws RocksDBException { - return db.put(arena, transactionOrUpdateId, columnId, keys, value, callback); + RequestPut requestType) throws RocksDBException { + return db.put(arena, transactionOrUpdateId, columnId, keys, value, requestType); } @Override @@ -82,8 +107,8 @@ public class EmbeddedConnection extends BaseConnection { long transactionOrUpdateId, long columnId, MemorySegment @NotNull [] keys, - GetCallback callback) throws RocksDBException { - return db.get(arena, transactionOrUpdateId, columnId, keys, callback); + RequestGet requestType) throws RocksDBException { + return db.get(arena, transactionOrUpdateId, columnId, keys, requestType); } @Override @@ -112,7 +137,7 @@ public class EmbeddedConnection extends BaseConnection { long iterationId, long skipCount, long takeCount, - @NotNull IteratorCallback callback) throws RocksDBException { - return db.subsequent(arena, iterationId, skipCount, takeCount, callback); + @NotNull RequestType.RequestIterate requestType) throws RocksDBException { + return db.subsequent(arena, iterationId, skipCount, takeCount, requestType); } } diff --git a/src/main/java/it/cavallium/rockserver/core/client/RocksDBConnection.java b/src/main/java/it/cavallium/rockserver/core/client/RocksDBConnection.java index 768b0f5..8554b22 100644 --- a/src/main/java/it/cavallium/rockserver/core/client/RocksDBConnection.java +++ b/src/main/java/it/cavallium/rockserver/core/client/RocksDBConnection.java @@ -1,10 +1,11 @@ package it.cavallium.rockserver.core.client; -import it.cavallium.rockserver.core.common.RocksDBAPI; +import it.cavallium.rockserver.core.common.RocksDBAsyncAPI; +import it.cavallium.rockserver.core.common.RocksDBSyncAPI; import java.io.Closeable; import java.net.URI; -public interface RocksDBConnection extends Closeable, RocksDBAPI { +public interface RocksDBConnection extends Closeable { /** * Get connection url @@ -12,4 +13,8 @@ public interface RocksDBConnection extends Closeable, RocksDBAPI { * @return connection url */ URI getUrl(); + + RocksDBSyncAPI getSyncApi(); + + RocksDBAsyncAPI getAsyncApi(); } diff --git a/src/main/java/it/cavallium/rockserver/core/client/SocketConnection.java b/src/main/java/it/cavallium/rockserver/core/client/SocketConnection.java deleted file mode 100644 index b274f99..0000000 --- a/src/main/java/it/cavallium/rockserver/core/client/SocketConnection.java +++ /dev/null @@ -1,109 +0,0 @@ -package it.cavallium.rockserver.core.client; - -import it.cavallium.rockserver.core.common.Callback.GetCallback; -import it.cavallium.rockserver.core.common.Callback.IteratorCallback; -import it.cavallium.rockserver.core.common.Callback.PutCallback; -import it.cavallium.rockserver.core.common.ColumnSchema; -import it.cavallium.rockserver.core.common.RocksDBException; -import java.io.IOException; -import java.lang.foreign.Arena; -import java.lang.foreign.MemorySegment; -import java.net.SocketAddress; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -public abstract class SocketConnection extends BaseConnection { - - private final SocketAddress address; - - public SocketConnection(SocketAddress address, String name) { - super(name); - this.address = address; - } - - public SocketAddress getAddress() { - return address; - } - - @Override - public void close() throws IOException { - super.close(); - } - @Override - public long openTransaction(long timeoutMs) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean closeTransaction(long transactionId, boolean commit) { - throw new UnsupportedOperationException(); - } - - @Override - public void closeFailedUpdate(long updateId) throws RocksDBException { - throw new UnsupportedOperationException(); - } - @Override - public long createColumn(String name, @NotNull ColumnSchema schema) { - throw new UnsupportedOperationException(); - } - - @Override - public void deleteColumn(long columnId) throws RocksDBException { - throw new UnsupportedOperationException(); - } - - @Override - public long getColumnId(@NotNull String name) { - throw new UnsupportedOperationException(); - } - - @Override - public T put(Arena arena, - long transactionOrUpdateId, - long columnId, - MemorySegment @NotNull [] keys, - @NotNull MemorySegment value, - PutCallback callback) throws RocksDBException { - throw new UnsupportedOperationException(); - } - - @Override - public T get(Arena arena, - long transactionOrUpdateId, - long columnId, - MemorySegment @NotNull [] keys, - GetCallback callback) throws RocksDBException { - throw new UnsupportedOperationException(); - } - - @Override - public long openIterator(Arena arena, - long transactionId, - long columnId, - MemorySegment @NotNull [] startKeysInclusive, - @Nullable MemorySegment[] endKeysExclusive, - boolean reverse, - long timeoutMs) throws RocksDBException { - throw new UnsupportedOperationException(); - } - - @Override - public void closeIterator(long iteratorId) throws RocksDBException { - throw new UnsupportedOperationException(); - } - - @Override - public void seekTo(Arena arena, long iterationId, MemorySegment @NotNull [] keys) throws RocksDBException { - throw new UnsupportedOperationException(); - } - - @Override - public T subsequent(Arena arena, - long iterationId, - long skipCount, - long takeCount, - @NotNull IteratorCallback callback) throws RocksDBException { - throw new UnsupportedOperationException(); - } -} diff --git a/src/main/java/it/cavallium/rockserver/core/client/SocketConnectionInet.java b/src/main/java/it/cavallium/rockserver/core/client/SocketConnectionInet.java deleted file mode 100644 index 21eab70..0000000 --- a/src/main/java/it/cavallium/rockserver/core/client/SocketConnectionInet.java +++ /dev/null @@ -1,22 +0,0 @@ -package it.cavallium.rockserver.core.client; - -import java.net.InetSocketAddress; -import java.net.URI; - -public class SocketConnectionInet extends SocketConnection { - - public SocketConnectionInet(InetSocketAddress address, String name) { - super(address, name); - } - - @Override - public InetSocketAddress getAddress() { - return (InetSocketAddress) super.getAddress(); - } - - @Override - public URI getUrl() { - return URI.create("rocksdb://" + getAddress().getHostString()); - } - -} diff --git a/src/main/java/it/cavallium/rockserver/core/client/SocketConnectionUnix.java b/src/main/java/it/cavallium/rockserver/core/client/SocketConnectionUnix.java deleted file mode 100644 index 9f92c4f..0000000 --- a/src/main/java/it/cavallium/rockserver/core/client/SocketConnectionUnix.java +++ /dev/null @@ -1,29 +0,0 @@ -package it.cavallium.rockserver.core.client; - -import java.io.IOException; -import java.net.URI; -import java.net.UnixDomainSocketAddress; -import java.nio.file.Files; - -public class SocketConnectionUnix extends SocketConnection { - - public SocketConnectionUnix(UnixDomainSocketAddress address, String name) { - super(address, name); - } - - @Override - public UnixDomainSocketAddress getAddress() { - return (UnixDomainSocketAddress) super.getAddress(); - } - - @Override - public void close() throws IOException { - super.close(); - Files.deleteIfExists(getAddress().getPath()); - } - - @Override - public URI getUrl() { - return URI.create("unix://" + getAddress().getPath()); - } -} diff --git a/src/main/java/it/cavallium/rockserver/core/common/Callback.java b/src/main/java/it/cavallium/rockserver/core/common/Callback.java deleted file mode 100644 index 9c1540b..0000000 --- a/src/main/java/it/cavallium/rockserver/core/common/Callback.java +++ /dev/null @@ -1,128 +0,0 @@ -package it.cavallium.rockserver.core.common; - -import it.cavallium.rockserver.core.common.Callback.CallbackForUpdate; -import it.cavallium.rockserver.core.common.Callback.CallbackPreviousPresence; -import java.util.List; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -public sealed interface Callback { - - static boolean requiresGettingPreviousValue(PutCallback callback) { - return callback instanceof CallbackPrevious - || callback instanceof CallbackDelta - || callback instanceof CallbackChanged; - } - - static boolean requiresGettingPreviousPresence(PutCallback callback) { - return callback instanceof Callback.CallbackPreviousPresence; - } - - static boolean requiresGettingCurrentValue(GetCallback callback) { - return callback instanceof CallbackCurrent - || callback instanceof Callback.CallbackForUpdate; - } - - static U safeCast(Object previousValue) { - //noinspection unchecked - return (U) previousValue; - } - - @SuppressWarnings("unchecked") - static CallbackPrevious previous() { - return (CallbackPrevious) CallbackPrevious.INSTANCE; - } - - @SuppressWarnings("unchecked") - static CallbackCurrent current() { - return (CallbackCurrent) CallbackCurrent.INSTANCE; - } - - @SuppressWarnings("unchecked") - static CallbackForUpdate forUpdate() { - return (CallbackForUpdate) CallbackForUpdate.INSTANCE; - } - - @SuppressWarnings("unchecked") - static CallbackDelta delta() { - return (CallbackDelta) CallbackDelta.INSTANCE; - } - - @SuppressWarnings("unchecked") - static CallbackExists exists() { - return (CallbackExists) CallbackExists.INSTANCE; - } - - @SuppressWarnings("unchecked") - static CallbackMulti multi() { - return (CallbackMulti) CallbackMulti.INSTANCE; - } - - @SuppressWarnings("unchecked") - static CallbackChanged changed() { - return (CallbackChanged) CallbackChanged.INSTANCE; - } - - @SuppressWarnings("unchecked") - static CallbackPreviousPresence previousPresence() { - return (CallbackPreviousPresence) CallbackPreviousPresence.INSTANCE; - } - - @SuppressWarnings("unchecked") - static CallbackVoid none() { - return (CallbackVoid) CallbackVoid.INSTANCE; - } - - sealed interface PutCallback extends Callback {} - - sealed interface PatchCallback extends Callback {} - - sealed interface GetCallback extends Callback {} - - sealed interface IteratorCallback extends Callback {} - - record CallbackVoid() implements PutCallback, PatchCallback, IteratorCallback, GetCallback { - - private static final CallbackVoid INSTANCE = new CallbackVoid<>(); - } - - record CallbackPrevious() implements PutCallback { - - private static final CallbackPrevious INSTANCE = new CallbackPrevious<>(); - } - - record CallbackCurrent() implements GetCallback { - - private static final CallbackCurrent INSTANCE = new CallbackCurrent<>(); - } - - record CallbackForUpdate() implements GetCallback> { - - private static final CallbackForUpdate INSTANCE = new CallbackForUpdate<>(); - } - - record CallbackExists() implements GetCallback, IteratorCallback { - - private static final CallbackExists INSTANCE = new CallbackExists<>(); - } - - record CallbackDelta() implements PutCallback> { - - private static final CallbackDelta INSTANCE = new CallbackDelta<>(); - } - - record CallbackMulti() implements IteratorCallback> { - - private static final CallbackMulti INSTANCE = new CallbackMulti<>(); - } - - record CallbackChanged() implements PutCallback, PatchCallback { - - private static final CallbackChanged INSTANCE = new CallbackChanged<>(); - } - - record CallbackPreviousPresence() implements PutCallback, PatchCallback { - - private static final CallbackPreviousPresence INSTANCE = new CallbackPreviousPresence<>(); - } -} diff --git a/src/main/java/it/cavallium/rockserver/core/common/RequestType.java b/src/main/java/it/cavallium/rockserver/core/common/RequestType.java new file mode 100644 index 0000000..5acb6ba --- /dev/null +++ b/src/main/java/it/cavallium/rockserver/core/common/RequestType.java @@ -0,0 +1,197 @@ +package it.cavallium.rockserver.core.common; + +import java.util.List; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public sealed interface RequestType { + + @SuppressWarnings("rawtypes") + enum RequestTypeId { + NOTHING(new RequestNothing()), + PREVIOUS(new RequestPrevious()), + CURRENT(new RequestCurrent()), + FOR_UPDATE(new RequestForUpdate()), + EXISTS(new RequestExists()), + DELTA(new RequestDelta()), + MULTI(new RequestMulti()), + CHANGED(new RequestChanged()), + PREVIOUS_PRESENCE(new RequestPreviousPresence()); + + private final RequestType requestType; + + RequestTypeId(RequestType requestType) { + this.requestType = requestType; + } + + public RequestType getRequestType() { + return requestType; + } + } + + RequestTypeId getRequestTypeId(); + + static boolean requiresGettingPreviousValue(RequestPut requestType) { + return requestType instanceof RequestType.RequestPrevious + || requestType instanceof RequestType.RequestDelta + || requestType instanceof RequestType.RequestChanged; + } + + static boolean requiresGettingPreviousPresence(RequestPut requestType) { + return requestType instanceof RequestType.RequestPreviousPresence; + } + + static boolean requiresGettingCurrentValue(RequestGet requestType) { + return requestType instanceof RequestType.RequestCurrent + || requestType instanceof RequestType.RequestForUpdate; + } + + static U safeCast(Object previousValue) { + //noinspection unchecked + return (U) previousValue; + } + + @SuppressWarnings("unchecked") + static RequestPrevious previous() { + return (RequestPrevious) RequestPrevious.INSTANCE; + } + + @SuppressWarnings("unchecked") + static RequestCurrent current() { + return (RequestCurrent) RequestCurrent.INSTANCE; + } + + @SuppressWarnings("unchecked") + static RequestForUpdate forUpdate() { + return (RequestForUpdate) RequestForUpdate.INSTANCE; + } + + @SuppressWarnings("unchecked") + static RequestDelta delta() { + return (RequestDelta) RequestDelta.INSTANCE; + } + + @SuppressWarnings("unchecked") + static RequestExists exists() { + return (RequestExists) RequestExists.INSTANCE; + } + + @SuppressWarnings("unchecked") + static RequestMulti multi() { + return (RequestMulti) RequestMulti.INSTANCE; + } + + @SuppressWarnings("unchecked") + static RequestChanged changed() { + return (RequestChanged) RequestChanged.INSTANCE; + } + + @SuppressWarnings("unchecked") + static RequestPreviousPresence previousPresence() { + return (RequestPreviousPresence) RequestPreviousPresence.INSTANCE; + } + + @SuppressWarnings("unchecked") + static RequestNothing none() { + return (RequestNothing) RequestNothing.INSTANCE; + } + + sealed interface RequestPut extends RequestType {} + + sealed interface RequestPatch extends RequestType {} + + sealed interface RequestGet extends RequestType {} + + sealed interface RequestIterate extends RequestType {} + + record RequestNothing() implements RequestPut, RequestPatch, RequestIterate, + RequestGet { + + private static final RequestNothing INSTANCE = new RequestNothing<>(); + + @Override + public RequestTypeId getRequestTypeId() { + return RequestTypeId.NOTHING; + } + } + + record RequestPrevious() implements RequestPut { + + private static final RequestPrevious INSTANCE = new RequestPrevious<>(); + + @Override + public RequestTypeId getRequestTypeId() { + return RequestTypeId.PREVIOUS; + } + } + + record RequestCurrent() implements RequestGet { + + private static final RequestCurrent INSTANCE = new RequestCurrent<>(); + + @Override + public RequestTypeId getRequestTypeId() { + return RequestTypeId.CURRENT; + } + } + + record RequestForUpdate() implements RequestGet> { + + private static final RequestForUpdate INSTANCE = new RequestForUpdate<>(); + + @Override + public RequestTypeId getRequestTypeId() { + return RequestTypeId.FOR_UPDATE; + } + } + + record RequestExists() implements RequestGet, RequestIterate { + + private static final RequestExists INSTANCE = new RequestExists<>(); + + @Override + public RequestTypeId getRequestTypeId() { + return RequestTypeId.EXISTS; + } + } + + record RequestDelta() implements RequestPut> { + + private static final RequestDelta INSTANCE = new RequestDelta<>(); + + @Override + public RequestTypeId getRequestTypeId() { + return RequestTypeId.DELTA; + } + } + + record RequestMulti() implements RequestIterate> { + + private static final RequestMulti INSTANCE = new RequestMulti<>(); + + @Override + public RequestTypeId getRequestTypeId() { + return RequestTypeId.MULTI; + } + } + + record RequestChanged() implements RequestPut, RequestPatch { + + private static final RequestChanged INSTANCE = new RequestChanged<>(); + + @Override + public RequestTypeId getRequestTypeId() { + return RequestTypeId.CHANGED; + } + } + + record RequestPreviousPresence() implements RequestPut, RequestPatch { + + private static final RequestPreviousPresence INSTANCE = new RequestPreviousPresence<>(); + + @Override + public RequestTypeId getRequestTypeId() { + return RequestTypeId.PREVIOUS_PRESENCE; + } + } +} diff --git a/src/main/java/it/cavallium/rockserver/core/common/RocksDBAPI.java b/src/main/java/it/cavallium/rockserver/core/common/RocksDBAPI.java index 40150d8..9410843 100644 --- a/src/main/java/it/cavallium/rockserver/core/common/RocksDBAPI.java +++ b/src/main/java/it/cavallium/rockserver/core/common/RocksDBAPI.java @@ -1,133 +1,3 @@ package it.cavallium.rockserver.core.common; -import it.cavallium.rockserver.core.common.Callback.GetCallback; -import it.cavallium.rockserver.core.common.Callback.IteratorCallback; -import it.cavallium.rockserver.core.common.Callback.PutCallback; -import java.lang.foreign.Arena; -import java.lang.foreign.MemorySegment; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -public interface RocksDBAPI { - - /** - * Open a transaction - * @param timeoutMs timeout in milliseconds - * @return transaction id - */ - long openTransaction(long timeoutMs) throws RocksDBException; - - /** - * Close a transaction - * - * @param transactionId transaction id to close - * @param commit true to commit the transaction, false to rollback it - * @return true if committed, if false, you should try again - */ - boolean closeTransaction(long transactionId, boolean commit) throws RocksDBException; - - /** - * Close a failed update, discarding all changes - * - * @param updateId update id to close - */ - void closeFailedUpdate(long updateId) throws RocksDBException; - - /** - * Create a column - * @param name column name - * @param schema column key-value schema - * @return column id - */ - long createColumn(String name, @NotNull ColumnSchema schema) throws RocksDBException; - - /** - * Delete a column - * @param columnId column id - */ - void deleteColumn(long columnId) throws RocksDBException; - - /** - * Get column id by name - * @param name column name - * @return column id - */ - long getColumnId(@NotNull String name) throws RocksDBException; - - /** - * Put an element into the specified position - * @param arena arena - * @param transactionOrUpdateId transaction id, update id, or 0 - * @param columnId column id - * @param keys column keys, or empty array if not needed - * @param value value, or null if not needed - * @param callback the callback will be executed on the same thread, exactly once. - */ - T put(Arena arena, - long transactionOrUpdateId, - long columnId, - @NotNull MemorySegment @NotNull[] keys, - @NotNull MemorySegment value, - PutCallback callback) throws RocksDBException; - - /** - * Get an element from the specified position - * @param arena arena - * @param transactionOrUpdateId transaction id, update id for retry operations, or 0 - * @param columnId column id - * @param keys column keys, or empty array if not needed - * @param callback the callback will be executed on the same thread, exactly once. - */ - T get(Arena arena, - long transactionOrUpdateId, - long columnId, - @NotNull MemorySegment @NotNull[] keys, - GetCallback callback) throws RocksDBException; - - /** - * Open an iterator - * @param arena arena - * @param transactionId transaction id, or 0 - * @param columnId column id - * @param startKeysInclusive start keys, inclusive. [] means "the beginning" - * @param endKeysExclusive end keys, exclusive. Null means "the end" - * @param reverse if true, seek in reverse direction - * @param timeoutMs timeout in milliseconds - * @return iterator id - */ - long openIterator(Arena arena, - long transactionId, - long columnId, - @NotNull MemorySegment @NotNull[] startKeysInclusive, - @NotNull MemorySegment @Nullable[] endKeysExclusive, - boolean reverse, - long timeoutMs) throws RocksDBException; - - /** - * Close an iterator - * @param iteratorId iterator id - */ - void closeIterator(long iteratorId) throws RocksDBException; - - /** - * Seek to the specific element during an iteration, or the subsequent one if not found - * @param arena arena - * @param iterationId iteration id - * @param keys keys, inclusive. [] means "the beginning" - */ - void seekTo(Arena arena, long iterationId, @NotNull MemorySegment @NotNull[] keys) throws RocksDBException; - - /** - * Get the subsequent element during an iteration - * @param arena arena - * @param iterationId iteration id - * @param skipCount number of elements to skip - * @param takeCount number of elements to take - * @param callback the callback will be executed on the same thread, exactly once. - */ - T subsequent(Arena arena, - long iterationId, - long skipCount, - long takeCount, - @NotNull IteratorCallback callback) throws RocksDBException; -} +public interface RocksDBAPI extends RocksDBAsyncAPI, RocksDBSyncAPI {} diff --git a/src/main/java/it/cavallium/rockserver/core/common/RocksDBAPICommand.java b/src/main/java/it/cavallium/rockserver/core/common/RocksDBAPICommand.java new file mode 100644 index 0000000..0b86035 --- /dev/null +++ b/src/main/java/it/cavallium/rockserver/core/common/RocksDBAPICommand.java @@ -0,0 +1,543 @@ +package it.cavallium.rockserver.core.common; + +import it.cavallium.buffer.BufDataInput; +import it.cavallium.buffer.BufDataOutput; +import it.cavallium.rockserver.core.common.RequestType.RequestGet; +import it.cavallium.rockserver.core.common.RequestType.RequestIterate; +import it.cavallium.rockserver.core.common.RequestType.RequestPut; +import it.cavallium.rockserver.core.common.RequestType.RequestTypeId; +import it.cavallium.rockserver.core.impl.ColumnInstance; +import it.unimi.dsi.fastutil.ints.IntArrayList; +import it.unimi.dsi.fastutil.objects.ObjectArrayList; +import it.unimi.dsi.fastutil.objects.ObjectList; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.nio.charset.StandardCharsets; +import java.util.concurrent.CompletionStage; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public sealed interface RocksDBAPICommand { + + enum CommandTypeId { + OPEN_TX, + CLOSE_TX, + CLOSE_FAILED_UPDATE, + CREATE_COLUMN, + DELETE_COLUMN, + GET_COLUMN_ID, + PUT, + GET, + OPEN_ITERATOR, + CLOSE_ITERATOR, + SEEK_TO, + SUBSEQUENT + } + + R handleSync(RocksDBSyncAPI api); + CompletionStage handleAsync(RocksDBAsyncAPI api); + void serializeToBuffer(BufDataOutput out); + CommandTypeId getCommandTypeId(); + + static RocksDBAPICommand deserializeCommand(Arena arena, BufDataInput in) { + return (RocksDBAPICommand) switch (CommandTypeId.values()[in.readUnsignedByte()]) { + case OPEN_TX -> new OpenTransaction(in.readLong()); + case CLOSE_TX -> new CloseTransaction(in.readLong(), in.readBoolean()); + case CLOSE_FAILED_UPDATE -> new CloseFailedUpdate(in.readLong()); + case CREATE_COLUMN -> { + var name = in.readShortText(StandardCharsets.UTF_8); + + var keys = new int[in.readInt()]; + for (int i = 0; i < keys.length; i++) { + keys[i] = in.readInt(); + } + ColumnHashType[] variableTailKeys = new ColumnHashType[in.readInt()]; + for (int i = 0; i < variableTailKeys.length; i++) { + variableTailKeys[i] = ColumnHashType.values()[in.readUnsignedByte()]; + } + boolean hasValue = in.readBoolean(); + var columnSchema = new ColumnSchema(IntArrayList.wrap(keys), + ObjectArrayList.wrap(variableTailKeys), + hasValue + ); + yield new CreateColumn(name, columnSchema); + } + case DELETE_COLUMN -> new DeleteColumn(in.readLong()); + case GET_COLUMN_ID -> new GetColumnId(in.readShortText(StandardCharsets.UTF_8)); + case PUT -> { + var transactionOrUpdateId = in.readLong(); + var columnId = in.readLong(); + var keys = SerializationUtils.deserializeMemorySegmentArray(in); + var value = SerializationUtils.deserializeMemorySegment(in); + //noinspection unchecked + var requestType = (RequestPut) + RequestTypeId.values()[in.readUnsignedByte()].getRequestType(); + yield new Put<>(arena, transactionOrUpdateId, columnId, keys, value, requestType); + } + case GET -> { + var transactionOrUpdateId = in.readLong(); + var columnId = in.readLong(); + var keys = SerializationUtils.deserializeMemorySegmentArray(in); + //noinspection unchecked + var requestType = (RequestGet) + RequestTypeId.values()[in.readUnsignedByte()].getRequestType(); + yield new Get<>(arena, transactionOrUpdateId, columnId, keys, requestType); + } + case OPEN_ITERATOR -> { + var transactionId = in.readLong(); + var columnId = in.readLong(); + var startKeysInclusive = SerializationUtils.deserializeMemorySegmentArray(in); + var endKeysExclusive = SerializationUtils.deserializeNullableMemorySegmentArray(in); + var reverse = in.readBoolean(); + var timeoutMs = in.readLong(); + yield new OpenIterator(arena, transactionId, columnId, startKeysInclusive, endKeysExclusive, reverse, timeoutMs); + } + case CLOSE_ITERATOR -> new CloseIterator(in.readLong()); + case SEEK_TO -> { + var iterationId = in.readLong(); + var keys = SerializationUtils.deserializeMemorySegmentArray(in); + yield new SeekTo(arena, iterationId, keys); + } + case SUBSEQUENT -> { + var iterationId = in.readLong(); + var skipCount = in.readLong(); + var takeCount = in.readLong(); + //noinspection unchecked + var requestType = (RequestIterate) + RequestTypeId.values()[in.readUnsignedByte()].getRequestType(); + yield new Subsequent<>(arena, iterationId, skipCount, takeCount, requestType); + } + }; + } + + /** + * Open a transaction + * @param timeoutMs timeout in milliseconds + * @return transaction id + */ + record OpenTransaction(long timeoutMs) implements RocksDBAPICommand { + + @Override + public Long handleSync(RocksDBSyncAPI api) { + return api.openTransaction(timeoutMs); + } + + @Override + public CompletionStage handleAsync(RocksDBAsyncAPI api) { + return api.openTransactionAsync(timeoutMs); + } + + @Override + public void serializeToBuffer(BufDataOutput out) { + out.writeLong(timeoutMs); + } + + @Override + public CommandTypeId getCommandTypeId() { + return CommandTypeId.OPEN_TX; + } + } + /** + * Close a transaction + * + * @param transactionId transaction id to close + * @param commit true to commit the transaction, false to rollback it + * @return true if committed, if false, you should try again + */ + record CloseTransaction(long transactionId, boolean commit) implements RocksDBAPICommand { + + @Override + public Boolean handleSync(RocksDBSyncAPI api) { + return api.closeTransaction(transactionId, commit); + } + + @Override + public CompletionStage handleAsync(RocksDBAsyncAPI api) { + return api.closeTransactionAsync(transactionId, commit); + } + + @Override + public void serializeToBuffer(BufDataOutput out) { + out.writeLong(transactionId); + out.writeBoolean(commit); + } + + @Override + public CommandTypeId getCommandTypeId() { + return CommandTypeId.CLOSE_TX; + } + } + /** + * Close a failed update, discarding all changes + * + * @param updateId update id to close + */ + record CloseFailedUpdate(long updateId) implements RocksDBAPICommand { + + @Override + public Void handleSync(RocksDBSyncAPI api) { + api.closeFailedUpdate(updateId); + return null; + } + + @Override + public CompletionStage handleAsync(RocksDBAsyncAPI api) { + return api.closeFailedUpdateAsync(updateId); + } + + @Override + public void serializeToBuffer(BufDataOutput out) { + out.writeLong(updateId); + } + + @Override + public CommandTypeId getCommandTypeId() { + return CommandTypeId.CLOSE_FAILED_UPDATE; + } + } + /** + * Create a column + * @param name column name + * @param schema column key-value schema + * @return column id + */ + record CreateColumn(String name, @NotNull ColumnSchema schema) implements RocksDBAPICommand { + + @Override + public Long handleSync(RocksDBSyncAPI api) { + return api.createColumn(name, schema); + } + + @Override + public CompletionStage handleAsync(RocksDBAsyncAPI api) { + return api.createColumnAsync(name, schema); + } + + @Override + public void serializeToBuffer(BufDataOutput out) { + out.writeShortText(name, StandardCharsets.UTF_8); + var keys = schema.keys(); + out.writeInt(keys.size()); + keys.forEach(out::writeInt); + var variableTailKeys = schema.variableTailKeys(); + out.writeInt(variableTailKeys.size()); + for (ColumnHashType variableTailKey : variableTailKeys) { + out.writeByte(variableTailKey.ordinal()); + } + out.writeBoolean(schema.hasValue()); + } + + @Override + public CommandTypeId getCommandTypeId() { + return CommandTypeId.CREATE_COLUMN; + } + } + /** + * Delete a column + * @param columnId column id + */ + record DeleteColumn(long columnId) implements RocksDBAPICommand { + + @Override + public Void handleSync(RocksDBSyncAPI api) { + api.deleteColumn(columnId); + return null; + } + + @Override + public CompletionStage handleAsync(RocksDBAsyncAPI api) { + return api.deleteColumnAsync(columnId); + } + + @Override + public void serializeToBuffer(BufDataOutput out) { + out.writeLong(columnId); + } + + @Override + public CommandTypeId getCommandTypeId() { + return CommandTypeId.DELETE_COLUMN; + } + } + /** + * Get column id by name + * @param name column name + * @return column id + */ + record GetColumnId(@NotNull String name) implements RocksDBAPICommand { + + @Override + public Long handleSync(RocksDBSyncAPI api) { + return api.getColumnId(name); + } + + @Override + public CompletionStage handleAsync(RocksDBAsyncAPI api) { + return api.getColumnIdAsync(name); + } + + @Override + public void serializeToBuffer(BufDataOutput out) { + out.writeShortText(name, StandardCharsets.UTF_8); + } + + @Override + public CommandTypeId getCommandTypeId() { + return CommandTypeId.GET_COLUMN_ID; + } + } + /** + * Put an element into the specified position + * @param arena arena + * @param transactionOrUpdateId transaction id, update id, or 0 + * @param columnId column id + * @param keys column keys, or empty array if not needed + * @param value value, or null if not needed + * @param requestType the request type determines which type of data will be returned. + */ + record Put(Arena arena, + long transactionOrUpdateId, + long columnId, + @NotNull MemorySegment @NotNull [] keys, + @NotNull MemorySegment value, + RequestPut requestType) implements RocksDBAPICommand { + + @Override + public T handleSync(RocksDBSyncAPI api) { + return api.put(arena, transactionOrUpdateId, columnId, keys, value, requestType); + } + + @Override + public CompletionStage handleAsync(RocksDBAsyncAPI api) { + return api.putAsync(arena, transactionOrUpdateId, columnId, keys, value, requestType); + } + + @Override + public void serializeToBuffer(BufDataOutput out) { + out.writeLong(transactionOrUpdateId); + out.writeLong(columnId); + out.writeInt(keys.length); + for (MemorySegment key : keys) { + var array = key.toArray(ColumnInstance.BIG_ENDIAN_BYTES); + out.writeInt(array.length); + out.writeBytes(array, 0, array.length); + } + var valueArray = value.toArray(ColumnInstance.BIG_ENDIAN_BYTES); + out.writeInt(valueArray.length); + out.writeBytes(valueArray, 0, valueArray.length); + out.writeByte(requestType.getRequestTypeId().ordinal()); + } + + @Override + public CommandTypeId getCommandTypeId() { + return CommandTypeId.PUT; + } + } + /** + * Get an element from the specified position + * @param arena arena + * @param transactionOrUpdateId transaction id, update id for retry operations, or 0 + * @param columnId column id + * @param keys column keys, or empty array if not needed + * @param requestType the request type determines which type of data will be returned. + */ + record Get(Arena arena, + long transactionOrUpdateId, + long columnId, + @NotNull MemorySegment @NotNull [] keys, + RequestGet requestType) implements RocksDBAPICommand { + + @Override + public T handleSync(RocksDBSyncAPI api) { + return api.get(arena, transactionOrUpdateId, columnId, keys, requestType); + } + + @Override + public CompletionStage handleAsync(RocksDBAsyncAPI api) { + return api.getAsync(arena, transactionOrUpdateId, columnId, keys, requestType); + } + + @Override + public void serializeToBuffer(BufDataOutput out) { + out.writeLong(transactionOrUpdateId); + out.writeLong(columnId); + out.writeInt(keys.length); + for (MemorySegment key : keys) { + var array = key.toArray(ColumnInstance.BIG_ENDIAN_BYTES); + out.writeInt(array.length); + out.writeBytes(array, 0, array.length); + } + out.writeByte(requestType.getRequestTypeId().ordinal()); + } + + @Override + public CommandTypeId getCommandTypeId() { + return CommandTypeId.GET; + } + } + /** + * Open an iterator + * @param arena arena + * @param transactionId transaction id, or 0 + * @param columnId column id + * @param startKeysInclusive start keys, inclusive. [] means "the beginning" + * @param endKeysExclusive end keys, exclusive. Null means "the end" + * @param reverse if true, seek in reverse direction + * @param timeoutMs timeout in milliseconds + * @return iterator id + */ + record OpenIterator(Arena arena, + long transactionId, + long columnId, + @NotNull MemorySegment @NotNull [] startKeysInclusive, + @NotNull MemorySegment @Nullable [] endKeysExclusive, + boolean reverse, + long timeoutMs) implements RocksDBAPICommand { + + @Override + public Long handleSync(RocksDBSyncAPI api) { + return api.openIterator(arena, transactionId, columnId, startKeysInclusive, endKeysExclusive, reverse, timeoutMs); + } + + @Override + public CompletionStage handleAsync(RocksDBAsyncAPI api) { + return api.openIteratorAsync(arena, + transactionId, + columnId, + startKeysInclusive, + endKeysExclusive, + reverse, + timeoutMs + ); + } + + @Override + public void serializeToBuffer(BufDataOutput out) { + out.writeLong(transactionId); + out.writeLong(columnId); + out.writeInt(startKeysInclusive.length); + SerializationUtils.serializeMemorySegmentArray(out, startKeysInclusive); + for (MemorySegment key : startKeysInclusive) { + var array = key.toArray(ColumnInstance.BIG_ENDIAN_BYTES); + out.writeInt(array.length); + out.writeBytes(array, 0, array.length); + } + out.writeInt(endKeysExclusive == null ? -1 : endKeysExclusive.length); + if (endKeysExclusive != null) { + for (MemorySegment key : endKeysExclusive) { + var array = key.toArray(ColumnInstance.BIG_ENDIAN_BYTES); + out.writeInt(array.length); + out.writeBytes(array, 0, array.length); + } + } + out.writeBoolean(reverse); + out.writeLong(timeoutMs); + } + + @Override + public CommandTypeId getCommandTypeId() { + return CommandTypeId.OPEN_ITERATOR; + } + } + /** + * Close an iterator + * @param iteratorId iterator id + */ + record CloseIterator(long iteratorId) implements RocksDBAPICommand { + + @Override + public Void handleSync(RocksDBSyncAPI api) { + api.closeIterator(iteratorId); + return null; + } + + @Override + public CompletionStage handleAsync(RocksDBAsyncAPI api) { + return api.closeIteratorAsync(iteratorId); + } + + @Override + public void serializeToBuffer(BufDataOutput out) { + out.writeLong(iteratorId); + } + + @Override + public CommandTypeId getCommandTypeId() { + return CommandTypeId.CLOSE_ITERATOR; + } + } + /** + * Seek to the specific element during an iteration, or the subsequent one if not found + * @param arena arena + * @param iterationId iteration id + * @param keys keys, inclusive. [] means "the beginning" + */ + record SeekTo(Arena arena, long iterationId, @NotNull MemorySegment @NotNull [] keys) implements + RocksDBAPICommand { + + @Override + public Void handleSync(RocksDBSyncAPI api) { + api.seekTo(arena, iterationId, keys); + return null; + } + + @Override + public CompletionStage handleAsync(RocksDBAsyncAPI api) { + return api.seekToAsync(arena, iterationId, keys); + } + + @Override + public void serializeToBuffer(BufDataOutput out) { + out.writeLong(iterationId); + out.writeInt(keys.length); + for (MemorySegment key : keys) { + var array = key.toArray(ColumnInstance.BIG_ENDIAN_BYTES); + out.writeInt(array.length); + out.writeBytes(array, 0, array.length); + } + } + + @Override + public CommandTypeId getCommandTypeId() { + return CommandTypeId.SEEK_TO; + } + } + /** + * Get the subsequent element during an iteration + * @param arena arena + * @param iterationId iteration id + * @param skipCount number of elements to skip + * @param takeCount number of elements to take + * @param requestType the request type determines which type of data will be returned. + */ + record Subsequent(Arena arena, + long iterationId, + long skipCount, + long takeCount, + @NotNull RequestType.RequestIterate requestType) + implements RocksDBAPICommand { + + @Override + public T handleSync(RocksDBSyncAPI api) { + return api.subsequent(arena, iterationId, skipCount, takeCount, requestType); + } + + @Override + public CompletionStage handleAsync(RocksDBAsyncAPI api) { + return api.subsequentAsync(arena, iterationId, skipCount, takeCount, requestType); + } + + @Override + public void serializeToBuffer(BufDataOutput out) { + out.writeLong(iterationId); + out.writeLong(skipCount); + out.writeLong(takeCount); + out.writeByte(requestType.getRequestTypeId().ordinal()); + } + + @Override + public CommandTypeId getCommandTypeId() { + return CommandTypeId.SUBSEQUENT; + } + } +} diff --git a/src/main/java/it/cavallium/rockserver/core/common/RocksDBAsyncAPI.java b/src/main/java/it/cavallium/rockserver/core/common/RocksDBAsyncAPI.java new file mode 100644 index 0000000..32db226 --- /dev/null +++ b/src/main/java/it/cavallium/rockserver/core/common/RocksDBAsyncAPI.java @@ -0,0 +1,111 @@ +package it.cavallium.rockserver.core.common; + +import it.cavallium.rockserver.core.common.RequestType.RequestGet; +import it.cavallium.rockserver.core.common.RequestType.RequestPut; +import it.cavallium.rockserver.core.common.RocksDBAPICommand.CloseFailedUpdate; +import it.cavallium.rockserver.core.common.RocksDBAPICommand.CloseIterator; +import it.cavallium.rockserver.core.common.RocksDBAPICommand.CloseTransaction; +import it.cavallium.rockserver.core.common.RocksDBAPICommand.CreateColumn; +import it.cavallium.rockserver.core.common.RocksDBAPICommand.DeleteColumn; +import it.cavallium.rockserver.core.common.RocksDBAPICommand.Get; +import it.cavallium.rockserver.core.common.RocksDBAPICommand.GetColumnId; +import it.cavallium.rockserver.core.common.RocksDBAPICommand.OpenIterator; +import it.cavallium.rockserver.core.common.RocksDBAPICommand.OpenTransaction; +import it.cavallium.rockserver.core.common.RocksDBAPICommand.Put; +import it.cavallium.rockserver.core.common.RocksDBAPICommand.SeekTo; +import it.cavallium.rockserver.core.common.RocksDBAPICommand.Subsequent; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CompletionStage; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public interface RocksDBAsyncAPI extends RocksDBAsyncAPIRequestHandler { + + /** See: {@link OpenTransaction}. */ + default CompletionStage openTransactionAsync(long timeoutMs) throws RocksDBException { + return requestAsync(new OpenTransaction(timeoutMs)); + } + + /** See: {@link CloseTransaction}. */ + default CompletionStage closeTransactionAsync(long transactionId, boolean commit) throws RocksDBException { + return requestAsync(new CloseTransaction(transactionId, commit)); + } + + /** See: {@link CloseFailedUpdate}. */ + default CompletionStage closeFailedUpdateAsync(long updateId) throws RocksDBException { + return requestAsync(new CloseFailedUpdate(updateId)); + } + + /** See: {@link CreateColumn}. */ + default CompletionStage createColumnAsync(String name, @NotNull ColumnSchema schema) throws RocksDBException { + return requestAsync(new CreateColumn(name, schema)); + } + + /** See: {@link DeleteColumn}. */ + default CompletionStage deleteColumnAsync(long columnId) throws RocksDBException { + return requestAsync(new DeleteColumn(columnId)); + } + + /** See: {@link GetColumnId}. */ + default CompletionStage getColumnIdAsync(@NotNull String name) throws RocksDBException { + return requestAsync(new GetColumnId(name)); + } + + /** See: {@link Put}. */ + default CompletionStage putAsync(Arena arena, + long transactionOrUpdateId, + long columnId, + @NotNull MemorySegment @NotNull [] keys, + @NotNull MemorySegment value, + RequestPut requestType) throws RocksDBException { + return requestAsync(new Put<>(arena, transactionOrUpdateId, columnId, keys, value, requestType)); + } + + /** See: {@link Get}. */ + default CompletionStage getAsync(Arena arena, + long transactionOrUpdateId, + long columnId, + @NotNull MemorySegment @NotNull [] keys, + RequestGet requestType) throws RocksDBException { + return requestAsync(new Get<>(arena, transactionOrUpdateId, columnId, keys, requestType)); + } + + /** See: {@link OpenIterator}. */ + default CompletionStage openIteratorAsync(Arena arena, + long transactionId, + long columnId, + @NotNull MemorySegment @NotNull [] startKeysInclusive, + @NotNull MemorySegment @Nullable [] endKeysExclusive, + boolean reverse, + long timeoutMs) throws RocksDBException { + return requestAsync(new OpenIterator(arena, + transactionId, + columnId, + startKeysInclusive, + endKeysExclusive, + reverse, + timeoutMs + )); + } + + /** See: {@link CloseIterator}. */ + default CompletionStage closeIteratorAsync(long iteratorId) throws RocksDBException { + return requestAsync(new CloseIterator(iteratorId)); + } + + /** See: {@link SeekTo}. */ + default CompletionStage seekToAsync(Arena arena, long iterationId, @NotNull MemorySegment @NotNull [] keys) throws RocksDBException { + return requestAsync(new SeekTo(arena, iterationId, keys)); + } + + /** See: {@link Subsequent}. */ + default CompletionStage subsequentAsync(Arena arena, + long iterationId, + long skipCount, + long takeCount, + @NotNull RequestType.RequestIterate requestType) throws RocksDBException { + return requestAsync(new Subsequent<>(arena, iterationId, skipCount, takeCount, requestType)); + } +} diff --git a/src/main/java/it/cavallium/rockserver/core/common/RocksDBAsyncAPIRequestHandler.java b/src/main/java/it/cavallium/rockserver/core/common/RocksDBAsyncAPIRequestHandler.java new file mode 100644 index 0000000..6efd3e5 --- /dev/null +++ b/src/main/java/it/cavallium/rockserver/core/common/RocksDBAsyncAPIRequestHandler.java @@ -0,0 +1,29 @@ +package it.cavallium.rockserver.core.common; + +import it.cavallium.rockserver.core.common.RequestType.RequestGet; +import it.cavallium.rockserver.core.common.RequestType.RequestPut; +import it.cavallium.rockserver.core.common.RocksDBAPICommand.CloseFailedUpdate; +import it.cavallium.rockserver.core.common.RocksDBAPICommand.CloseIterator; +import it.cavallium.rockserver.core.common.RocksDBAPICommand.CloseTransaction; +import it.cavallium.rockserver.core.common.RocksDBAPICommand.CreateColumn; +import it.cavallium.rockserver.core.common.RocksDBAPICommand.DeleteColumn; +import it.cavallium.rockserver.core.common.RocksDBAPICommand.Get; +import it.cavallium.rockserver.core.common.RocksDBAPICommand.GetColumnId; +import it.cavallium.rockserver.core.common.RocksDBAPICommand.OpenIterator; +import it.cavallium.rockserver.core.common.RocksDBAPICommand.OpenTransaction; +import it.cavallium.rockserver.core.common.RocksDBAPICommand.Put; +import it.cavallium.rockserver.core.common.RocksDBAPICommand.SeekTo; +import it.cavallium.rockserver.core.common.RocksDBAPICommand.Subsequent; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CompletionStage; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public interface RocksDBAsyncAPIRequestHandler { + + default CompletionStage requestAsync(RocksDBAPICommand req) { + return CompletableFuture.failedFuture(new UnsupportedOperationException("Unsupported request type: " + req)); + } +} diff --git a/src/main/java/it/cavallium/rockserver/core/common/RocksDBSyncAPI.java b/src/main/java/it/cavallium/rockserver/core/common/RocksDBSyncAPI.java new file mode 100644 index 0000000..54fc43f --- /dev/null +++ b/src/main/java/it/cavallium/rockserver/core/common/RocksDBSyncAPI.java @@ -0,0 +1,105 @@ +package it.cavallium.rockserver.core.common; + +import static java.util.concurrent.CompletableFuture.runAsync; +import static java.util.concurrent.CompletableFuture.supplyAsync; + +import it.cavallium.rockserver.core.common.RequestType.RequestGet; +import it.cavallium.rockserver.core.common.RequestType.RequestPut; +import it.cavallium.rockserver.core.common.RocksDBAPICommand.CloseFailedUpdate; +import it.cavallium.rockserver.core.common.RocksDBAPICommand.CloseIterator; +import it.cavallium.rockserver.core.common.RocksDBAPICommand.CloseTransaction; +import it.cavallium.rockserver.core.common.RocksDBAPICommand.CreateColumn; +import it.cavallium.rockserver.core.common.RocksDBAPICommand.DeleteColumn; +import it.cavallium.rockserver.core.common.RocksDBAPICommand.Get; +import it.cavallium.rockserver.core.common.RocksDBAPICommand.GetColumnId; +import it.cavallium.rockserver.core.common.RocksDBAPICommand.OpenIterator; +import it.cavallium.rockserver.core.common.RocksDBAPICommand.OpenTransaction; +import it.cavallium.rockserver.core.common.RocksDBAPICommand.Put; +import it.cavallium.rockserver.core.common.RocksDBAPICommand.SeekTo; +import it.cavallium.rockserver.core.common.RocksDBAPICommand.Subsequent; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public interface RocksDBSyncAPI extends RocksDBSyncAPIRequestHandler { + + /** See: {@link OpenTransaction}. */ + default long openTransaction(long timeoutMs) throws RocksDBException { + return requestSync(new OpenTransaction(timeoutMs)); + } + + /** See: {@link CloseTransaction}. */ + default boolean closeTransaction(long transactionId, boolean commit) throws RocksDBException { + return requestSync(new CloseTransaction(transactionId, commit)); + } + + /** See: {@link CloseFailedUpdate}. */ + default void closeFailedUpdate(long updateId) throws RocksDBException { + requestSync(new CloseFailedUpdate(updateId)); + } + + /** See: {@link CreateColumn}. */ + default long createColumn(String name, @NotNull ColumnSchema schema) throws RocksDBException { + return requestSync(new CreateColumn(name, schema)); + } + + /** See: {@link DeleteColumn}. */ + default void deleteColumn(long columnId) throws RocksDBException { + requestSync(new DeleteColumn(columnId)); + } + + /** See: {@link GetColumnId}. */ + default long getColumnId(@NotNull String name) throws RocksDBException { + return requestSync(new GetColumnId(name)); + } + + /** See: {@link Put}. */ + default T put(Arena arena, + long transactionOrUpdateId, + long columnId, + @NotNull MemorySegment @NotNull [] keys, + @NotNull MemorySegment value, + RequestPut requestType) throws RocksDBException { + return requestSync(new Put<>(arena, transactionOrUpdateId, columnId, keys, value, requestType)); + } + + /** See: {@link Get}. */ + default T get(Arena arena, + long transactionOrUpdateId, + long columnId, + @NotNull MemorySegment @NotNull [] keys, + RequestGet requestType) throws RocksDBException { + return requestSync(new Get<>(arena, transactionOrUpdateId, columnId, keys, requestType)); + } + + /** See: {@link OpenIterator}. */ + default long openIterator(Arena arena, + long transactionId, + long columnId, + @NotNull MemorySegment @NotNull [] startKeysInclusive, + @NotNull MemorySegment @Nullable [] endKeysExclusive, + boolean reverse, + long timeoutMs) throws RocksDBException { + return requestSync(new OpenIterator(arena, transactionId, columnId, startKeysInclusive, endKeysExclusive, reverse, timeoutMs)); + } + + /** See: {@link CloseIterator}. */ + default void closeIterator(long iteratorId) throws RocksDBException { + requestSync(new CloseIterator(iteratorId)); + } + + /** See: {@link SeekTo}. */ + default void seekTo(Arena arena, long iterationId, @NotNull MemorySegment @NotNull [] keys) throws RocksDBException { + requestSync(new SeekTo(arena, iterationId, keys)); + } + + /** See: {@link Subsequent}. */ + default T subsequent(Arena arena, + long iterationId, + long skipCount, + long takeCount, + @NotNull RequestType.RequestIterate requestType) throws RocksDBException { + return requestSync(new Subsequent<>(arena, iterationId, skipCount, takeCount, requestType)); + } +} diff --git a/src/main/java/it/cavallium/rockserver/core/common/RocksDBSyncAPIRequestHandler.java b/src/main/java/it/cavallium/rockserver/core/common/RocksDBSyncAPIRequestHandler.java new file mode 100644 index 0000000..a97bd4c --- /dev/null +++ b/src/main/java/it/cavallium/rockserver/core/common/RocksDBSyncAPIRequestHandler.java @@ -0,0 +1,27 @@ +package it.cavallium.rockserver.core.common; + +import it.cavallium.rockserver.core.common.RequestType.RequestGet; +import it.cavallium.rockserver.core.common.RequestType.RequestPut; +import it.cavallium.rockserver.core.common.RocksDBAPICommand.CloseFailedUpdate; +import it.cavallium.rockserver.core.common.RocksDBAPICommand.CloseIterator; +import it.cavallium.rockserver.core.common.RocksDBAPICommand.CloseTransaction; +import it.cavallium.rockserver.core.common.RocksDBAPICommand.CreateColumn; +import it.cavallium.rockserver.core.common.RocksDBAPICommand.DeleteColumn; +import it.cavallium.rockserver.core.common.RocksDBAPICommand.Get; +import it.cavallium.rockserver.core.common.RocksDBAPICommand.GetColumnId; +import it.cavallium.rockserver.core.common.RocksDBAPICommand.OpenIterator; +import it.cavallium.rockserver.core.common.RocksDBAPICommand.OpenTransaction; +import it.cavallium.rockserver.core.common.RocksDBAPICommand.Put; +import it.cavallium.rockserver.core.common.RocksDBAPICommand.SeekTo; +import it.cavallium.rockserver.core.common.RocksDBAPICommand.Subsequent; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public interface RocksDBSyncAPIRequestHandler { + + default R requestSync(RocksDBAPICommand req) { + throw new UnsupportedOperationException("Unsupported request type: " + req); + } +} diff --git a/src/main/java/it/cavallium/rockserver/core/common/SerializationUtils.java b/src/main/java/it/cavallium/rockserver/core/common/SerializationUtils.java new file mode 100644 index 0000000..aa932fd --- /dev/null +++ b/src/main/java/it/cavallium/rockserver/core/common/SerializationUtils.java @@ -0,0 +1,56 @@ +package it.cavallium.rockserver.core.common; + +import it.cavallium.buffer.BufDataInput; +import it.cavallium.buffer.BufDataOutput; +import it.cavallium.rockserver.core.impl.ColumnInstance; +import java.lang.foreign.MemorySegment; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public class SerializationUtils { + public static void serializeMemorySegment(BufDataOutput out, @NotNull MemorySegment segment) { + var array = segment.toArray(ColumnInstance.BIG_ENDIAN_BYTES); + out.writeInt(array.length); + out.writeBytes(array, 0, array.length); + } + public static MemorySegment deserializeMemorySegment(BufDataInput in) { + return MemorySegment.ofArray(in.readNBytes(in.readInt())); + } + + public static void serializeNullableMemorySegmentArray(BufDataOutput out, @NotNull MemorySegment @Nullable [] array) { + out.writeInt(array != null ? array.length : -1); + if (array != null) { + for (MemorySegment memorySegment : array) { + serializeMemorySegment(out, memorySegment); + } + } + } + + public static void serializeMemorySegmentArray(BufDataOutput out, @NotNull MemorySegment @NotNull [] array) { + out.writeInt(array.length); + for (MemorySegment memorySegment : array) { + serializeMemorySegment(out, memorySegment); + } + } + + public static @NotNull MemorySegment @Nullable [] deserializeNullableMemorySegmentArray(BufDataInput in) { + int size = in.readInt(); + if (size == -1) { + return null; + } else { + var array = new MemorySegment @NotNull[size]; + for (int i = 0; i < array.length; i++) { + array[i] = deserializeMemorySegment(in); + } + return array; + } + } + + public static @NotNull MemorySegment @NotNull [] deserializeMemorySegmentArray(BufDataInput in) { + var array = new MemorySegment @NotNull [in.readInt()]; + for (int i = 0; i < array.length; i++) { + array[i] = deserializeMemorySegment(in); + } + return array; + } +} diff --git a/src/main/java/it/cavallium/rockserver/core/common/api/ColumnHashType.java b/src/main/java/it/cavallium/rockserver/core/common/api/ColumnHashType.java new file mode 100644 index 0000000..4070c2d --- /dev/null +++ b/src/main/java/it/cavallium/rockserver/core/common/api/ColumnHashType.java @@ -0,0 +1,46 @@ +/** + * Autogenerated by Thrift Compiler (0.19.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package it.cavallium.rockserver.core.common.api; + + +public enum ColumnHashType implements org.apache.thrift.TEnum { + XXHASH32(1), + XXHASH8(2), + ALLSAME8(3); + + private final int value; + + private ColumnHashType(int value) { + this.value = value; + } + + /** + * Get the integer value of this enum value, as defined in the Thrift IDL. + */ + @Override + public int getValue() { + return value; + } + + /** + * Find a the enum type by its integer value, as defined in the Thrift IDL. + * @return null if the value is not found. + */ + @org.apache.thrift.annotation.Nullable + public static ColumnHashType findByValue(int value) { + switch (value) { + case 1: + return XXHASH32; + case 2: + return XXHASH8; + case 3: + return ALLSAME8; + default: + return null; + } + } +} diff --git a/src/main/java/it/cavallium/rockserver/core/common/api/ColumnSchema.java b/src/main/java/it/cavallium/rockserver/core/common/api/ColumnSchema.java new file mode 100644 index 0000000..0fa6203 --- /dev/null +++ b/src/main/java/it/cavallium/rockserver/core/common/api/ColumnSchema.java @@ -0,0 +1,701 @@ +/** + * Autogenerated by Thrift Compiler (0.19.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package it.cavallium.rockserver.core.common.api; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +public class ColumnSchema implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ColumnSchema"); + + private static final org.apache.thrift.protocol.TField FIXED_KEYS_FIELD_DESC = new org.apache.thrift.protocol.TField("fixedKeys", org.apache.thrift.protocol.TType.LIST, (short)1); + private static final org.apache.thrift.protocol.TField VARIABLE_TAIL_KEYS_FIELD_DESC = new org.apache.thrift.protocol.TField("variableTailKeys", org.apache.thrift.protocol.TType.LIST, (short)2); + private static final org.apache.thrift.protocol.TField HAS_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("hasValue", org.apache.thrift.protocol.TType.BOOL, (short)3); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new ColumnSchemaStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new ColumnSchemaTupleSchemeFactory(); + + public @org.apache.thrift.annotation.Nullable java.util.List fixedKeys; // required + public @org.apache.thrift.annotation.Nullable java.util.List variableTailKeys; // required + public boolean hasValue; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + FIXED_KEYS((short)1, "fixedKeys"), + VARIABLE_TAIL_KEYS((short)2, "variableTailKeys"), + HAS_VALUE((short)3, "hasValue"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // FIXED_KEYS + return FIXED_KEYS; + case 2: // VARIABLE_TAIL_KEYS + return VARIABLE_TAIL_KEYS; + case 3: // HAS_VALUE + return HAS_VALUE; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + @Override + public short getThriftFieldId() { + return _thriftId; + } + + @Override + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __HASVALUE_ISSET_ID = 0; + private byte __isset_bitfield = 0; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.FIXED_KEYS, new org.apache.thrift.meta_data.FieldMetaData("fixedKeys", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)))); + tmpMap.put(_Fields.VARIABLE_TAIL_KEYS, new org.apache.thrift.meta_data.FieldMetaData("variableTailKeys", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ColumnHashType.class)))); + tmpMap.put(_Fields.HAS_VALUE, new org.apache.thrift.meta_data.FieldMetaData("hasValue", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ColumnSchema.class, metaDataMap); + } + + public ColumnSchema() { + } + + public ColumnSchema( + java.util.List fixedKeys, + java.util.List variableTailKeys, + boolean hasValue) + { + this(); + this.fixedKeys = fixedKeys; + this.variableTailKeys = variableTailKeys; + this.hasValue = hasValue; + setHasValueIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public ColumnSchema(ColumnSchema other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetFixedKeys()) { + java.util.List __this__fixedKeys = new java.util.ArrayList(other.fixedKeys); + this.fixedKeys = __this__fixedKeys; + } + if (other.isSetVariableTailKeys()) { + java.util.List __this__variableTailKeys = new java.util.ArrayList(other.variableTailKeys.size()); + for (ColumnHashType other_element : other.variableTailKeys) { + __this__variableTailKeys.add(other_element); + } + this.variableTailKeys = __this__variableTailKeys; + } + this.hasValue = other.hasValue; + } + + @Override + public ColumnSchema deepCopy() { + return new ColumnSchema(this); + } + + @Override + public void clear() { + this.fixedKeys = null; + this.variableTailKeys = null; + setHasValueIsSet(false); + this.hasValue = false; + } + + public int getFixedKeysSize() { + return (this.fixedKeys == null) ? 0 : this.fixedKeys.size(); + } + + @org.apache.thrift.annotation.Nullable + public java.util.Iterator getFixedKeysIterator() { + return (this.fixedKeys == null) ? null : this.fixedKeys.iterator(); + } + + public void addToFixedKeys(int elem) { + if (this.fixedKeys == null) { + this.fixedKeys = new java.util.ArrayList(); + } + this.fixedKeys.add(elem); + } + + @org.apache.thrift.annotation.Nullable + public java.util.List getFixedKeys() { + return this.fixedKeys; + } + + public ColumnSchema setFixedKeys(@org.apache.thrift.annotation.Nullable java.util.List fixedKeys) { + this.fixedKeys = fixedKeys; + return this; + } + + public void unsetFixedKeys() { + this.fixedKeys = null; + } + + /** Returns true if field fixedKeys is set (has been assigned a value) and false otherwise */ + public boolean isSetFixedKeys() { + return this.fixedKeys != null; + } + + public void setFixedKeysIsSet(boolean value) { + if (!value) { + this.fixedKeys = null; + } + } + + public int getVariableTailKeysSize() { + return (this.variableTailKeys == null) ? 0 : this.variableTailKeys.size(); + } + + @org.apache.thrift.annotation.Nullable + public java.util.Iterator getVariableTailKeysIterator() { + return (this.variableTailKeys == null) ? null : this.variableTailKeys.iterator(); + } + + public void addToVariableTailKeys(ColumnHashType elem) { + if (this.variableTailKeys == null) { + this.variableTailKeys = new java.util.ArrayList(); + } + this.variableTailKeys.add(elem); + } + + @org.apache.thrift.annotation.Nullable + public java.util.List getVariableTailKeys() { + return this.variableTailKeys; + } + + public ColumnSchema setVariableTailKeys(@org.apache.thrift.annotation.Nullable java.util.List variableTailKeys) { + this.variableTailKeys = variableTailKeys; + return this; + } + + public void unsetVariableTailKeys() { + this.variableTailKeys = null; + } + + /** Returns true if field variableTailKeys is set (has been assigned a value) and false otherwise */ + public boolean isSetVariableTailKeys() { + return this.variableTailKeys != null; + } + + public void setVariableTailKeysIsSet(boolean value) { + if (!value) { + this.variableTailKeys = null; + } + } + + public boolean isHasValue() { + return this.hasValue; + } + + public ColumnSchema setHasValue(boolean hasValue) { + this.hasValue = hasValue; + setHasValueIsSet(true); + return this; + } + + public void unsetHasValue() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __HASVALUE_ISSET_ID); + } + + /** Returns true if field hasValue is set (has been assigned a value) and false otherwise */ + public boolean isSetHasValue() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __HASVALUE_ISSET_ID); + } + + public void setHasValueIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __HASVALUE_ISSET_ID, value); + } + + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case FIXED_KEYS: + if (value == null) { + unsetFixedKeys(); + } else { + setFixedKeys((java.util.List)value); + } + break; + + case VARIABLE_TAIL_KEYS: + if (value == null) { + unsetVariableTailKeys(); + } else { + setVariableTailKeys((java.util.List)value); + } + break; + + case HAS_VALUE: + if (value == null) { + unsetHasValue(); + } else { + setHasValue((java.lang.Boolean)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case FIXED_KEYS: + return getFixedKeys(); + + case VARIABLE_TAIL_KEYS: + return getVariableTailKeys(); + + case HAS_VALUE: + return isHasValue(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case FIXED_KEYS: + return isSetFixedKeys(); + case VARIABLE_TAIL_KEYS: + return isSetVariableTailKeys(); + case HAS_VALUE: + return isSetHasValue(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that instanceof ColumnSchema) + return this.equals((ColumnSchema)that); + return false; + } + + public boolean equals(ColumnSchema that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_fixedKeys = true && this.isSetFixedKeys(); + boolean that_present_fixedKeys = true && that.isSetFixedKeys(); + if (this_present_fixedKeys || that_present_fixedKeys) { + if (!(this_present_fixedKeys && that_present_fixedKeys)) + return false; + if (!this.fixedKeys.equals(that.fixedKeys)) + return false; + } + + boolean this_present_variableTailKeys = true && this.isSetVariableTailKeys(); + boolean that_present_variableTailKeys = true && that.isSetVariableTailKeys(); + if (this_present_variableTailKeys || that_present_variableTailKeys) { + if (!(this_present_variableTailKeys && that_present_variableTailKeys)) + return false; + if (!this.variableTailKeys.equals(that.variableTailKeys)) + return false; + } + + boolean this_present_hasValue = true; + boolean that_present_hasValue = true; + if (this_present_hasValue || that_present_hasValue) { + if (!(this_present_hasValue && that_present_hasValue)) + return false; + if (this.hasValue != that.hasValue) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetFixedKeys()) ? 131071 : 524287); + if (isSetFixedKeys()) + hashCode = hashCode * 8191 + fixedKeys.hashCode(); + + hashCode = hashCode * 8191 + ((isSetVariableTailKeys()) ? 131071 : 524287); + if (isSetVariableTailKeys()) + hashCode = hashCode * 8191 + variableTailKeys.hashCode(); + + hashCode = hashCode * 8191 + ((hasValue) ? 131071 : 524287); + + return hashCode; + } + + @Override + public int compareTo(ColumnSchema other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.compare(isSetFixedKeys(), other.isSetFixedKeys()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetFixedKeys()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fixedKeys, other.fixedKeys); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetVariableTailKeys(), other.isSetVariableTailKeys()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetVariableTailKeys()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.variableTailKeys, other.variableTailKeys); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetHasValue(), other.isSetHasValue()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetHasValue()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hasValue, other.hasValue); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + @Override + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("ColumnSchema("); + boolean first = true; + + sb.append("fixedKeys:"); + if (this.fixedKeys == null) { + sb.append("null"); + } else { + sb.append(this.fixedKeys); + } + first = false; + if (!first) sb.append(", "); + sb.append("variableTailKeys:"); + if (this.variableTailKeys == null) { + sb.append("null"); + } else { + sb.append(this.variableTailKeys); + } + first = false; + if (!first) sb.append(", "); + sb.append("hasValue:"); + sb.append(this.hasValue); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class ColumnSchemaStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public ColumnSchemaStandardScheme getScheme() { + return new ColumnSchemaStandardScheme(); + } + } + + private static class ColumnSchemaStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, ColumnSchema struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // FIXED_KEYS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list0 = iprot.readListBegin(); + struct.fixedKeys = new java.util.ArrayList(_list0.size); + int _elem1; + for (int _i2 = 0; _i2 < _list0.size; ++_i2) + { + _elem1 = iprot.readI32(); + struct.fixedKeys.add(_elem1); + } + iprot.readListEnd(); + } + struct.setFixedKeysIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // VARIABLE_TAIL_KEYS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list3 = iprot.readListBegin(); + struct.variableTailKeys = new java.util.ArrayList(_list3.size); + @org.apache.thrift.annotation.Nullable ColumnHashType _elem4; + for (int _i5 = 0; _i5 < _list3.size; ++_i5) + { + _elem4 = it.cavallium.rockserver.core.common.api.ColumnHashType.findByValue(iprot.readI32()); + if (_elem4 != null) + { + struct.variableTailKeys.add(_elem4); + } + } + iprot.readListEnd(); + } + struct.setVariableTailKeysIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // HAS_VALUE + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.hasValue = iprot.readBool(); + struct.setHasValueIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot, ColumnSchema struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.fixedKeys != null) { + oprot.writeFieldBegin(FIXED_KEYS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, struct.fixedKeys.size())); + for (int _iter6 : struct.fixedKeys) + { + oprot.writeI32(_iter6); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.variableTailKeys != null) { + oprot.writeFieldBegin(VARIABLE_TAIL_KEYS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, struct.variableTailKeys.size())); + for (ColumnHashType _iter7 : struct.variableTailKeys) + { + oprot.writeI32(_iter7.getValue()); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(HAS_VALUE_FIELD_DESC); + oprot.writeBool(struct.hasValue); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class ColumnSchemaTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public ColumnSchemaTupleScheme getScheme() { + return new ColumnSchemaTupleScheme(); + } + } + + private static class ColumnSchemaTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, ColumnSchema struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetFixedKeys()) { + optionals.set(0); + } + if (struct.isSetVariableTailKeys()) { + optionals.set(1); + } + if (struct.isSetHasValue()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetFixedKeys()) { + { + oprot.writeI32(struct.fixedKeys.size()); + for (int _iter8 : struct.fixedKeys) + { + oprot.writeI32(_iter8); + } + } + } + if (struct.isSetVariableTailKeys()) { + { + oprot.writeI32(struct.variableTailKeys.size()); + for (ColumnHashType _iter9 : struct.variableTailKeys) + { + oprot.writeI32(_iter9.getValue()); + } + } + } + if (struct.isSetHasValue()) { + oprot.writeBool(struct.hasValue); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, ColumnSchema struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list10 = iprot.readListBegin(org.apache.thrift.protocol.TType.I32); + struct.fixedKeys = new java.util.ArrayList(_list10.size); + int _elem11; + for (int _i12 = 0; _i12 < _list10.size; ++_i12) + { + _elem11 = iprot.readI32(); + struct.fixedKeys.add(_elem11); + } + } + struct.setFixedKeysIsSet(true); + } + if (incoming.get(1)) { + { + org.apache.thrift.protocol.TList _list13 = iprot.readListBegin(org.apache.thrift.protocol.TType.I32); + struct.variableTailKeys = new java.util.ArrayList(_list13.size); + @org.apache.thrift.annotation.Nullable ColumnHashType _elem14; + for (int _i15 = 0; _i15 < _list13.size; ++_i15) + { + _elem14 = it.cavallium.rockserver.core.common.api.ColumnHashType.findByValue(iprot.readI32()); + if (_elem14 != null) + { + struct.variableTailKeys.add(_elem14); + } + } + } + struct.setVariableTailKeysIsSet(true); + } + if (incoming.get(2)) { + struct.hasValue = iprot.readBool(); + struct.setHasValueIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/src/main/java/it/cavallium/rockserver/core/common/api/Delta.java b/src/main/java/it/cavallium/rockserver/core/common/api/Delta.java new file mode 100644 index 0000000..5ac5e61 --- /dev/null +++ b/src/main/java/it/cavallium/rockserver/core/common/api/Delta.java @@ -0,0 +1,518 @@ +/** + * Autogenerated by Thrift Compiler (0.19.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package it.cavallium.rockserver.core.common.api; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +public class Delta implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Delta"); + + private static final org.apache.thrift.protocol.TField PREVIOUS_FIELD_DESC = new org.apache.thrift.protocol.TField("previous", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField CURRENT_FIELD_DESC = new org.apache.thrift.protocol.TField("current", org.apache.thrift.protocol.TType.STRING, (short)2); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new DeltaStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new DeltaTupleSchemeFactory(); + + public @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer previous; // optional + public @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer current; // optional + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + PREVIOUS((short)1, "previous"), + CURRENT((short)2, "current"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // PREVIOUS + return PREVIOUS; + case 2: // CURRENT + return CURRENT; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + @Override + public short getThriftFieldId() { + return _thriftId; + } + + @Override + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.PREVIOUS,_Fields.CURRENT}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.PREVIOUS, new org.apache.thrift.meta_data.FieldMetaData("previous", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + tmpMap.put(_Fields.CURRENT, new org.apache.thrift.meta_data.FieldMetaData("current", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Delta.class, metaDataMap); + } + + public Delta() { + } + + /** + * Performs a deep copy on other. + */ + public Delta(Delta other) { + if (other.isSetPrevious()) { + this.previous = org.apache.thrift.TBaseHelper.copyBinary(other.previous); + } + if (other.isSetCurrent()) { + this.current = org.apache.thrift.TBaseHelper.copyBinary(other.current); + } + } + + @Override + public Delta deepCopy() { + return new Delta(this); + } + + @Override + public void clear() { + this.previous = null; + this.current = null; + } + + public byte[] getPrevious() { + setPrevious(org.apache.thrift.TBaseHelper.rightSize(previous)); + return previous == null ? null : previous.array(); + } + + public java.nio.ByteBuffer bufferForPrevious() { + return org.apache.thrift.TBaseHelper.copyBinary(previous); + } + + public Delta setPrevious(byte[] previous) { + this.previous = previous == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(previous.clone()); + return this; + } + + public Delta setPrevious(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer previous) { + this.previous = org.apache.thrift.TBaseHelper.copyBinary(previous); + return this; + } + + public void unsetPrevious() { + this.previous = null; + } + + /** Returns true if field previous is set (has been assigned a value) and false otherwise */ + public boolean isSetPrevious() { + return this.previous != null; + } + + public void setPreviousIsSet(boolean value) { + if (!value) { + this.previous = null; + } + } + + public byte[] getCurrent() { + setCurrent(org.apache.thrift.TBaseHelper.rightSize(current)); + return current == null ? null : current.array(); + } + + public java.nio.ByteBuffer bufferForCurrent() { + return org.apache.thrift.TBaseHelper.copyBinary(current); + } + + public Delta setCurrent(byte[] current) { + this.current = current == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(current.clone()); + return this; + } + + public Delta setCurrent(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer current) { + this.current = org.apache.thrift.TBaseHelper.copyBinary(current); + return this; + } + + public void unsetCurrent() { + this.current = null; + } + + /** Returns true if field current is set (has been assigned a value) and false otherwise */ + public boolean isSetCurrent() { + return this.current != null; + } + + public void setCurrentIsSet(boolean value) { + if (!value) { + this.current = null; + } + } + + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case PREVIOUS: + if (value == null) { + unsetPrevious(); + } else { + if (value instanceof byte[]) { + setPrevious((byte[])value); + } else { + setPrevious((java.nio.ByteBuffer)value); + } + } + break; + + case CURRENT: + if (value == null) { + unsetCurrent(); + } else { + if (value instanceof byte[]) { + setCurrent((byte[])value); + } else { + setCurrent((java.nio.ByteBuffer)value); + } + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case PREVIOUS: + return getPrevious(); + + case CURRENT: + return getCurrent(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case PREVIOUS: + return isSetPrevious(); + case CURRENT: + return isSetCurrent(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that instanceof Delta) + return this.equals((Delta)that); + return false; + } + + public boolean equals(Delta that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_previous = true && this.isSetPrevious(); + boolean that_present_previous = true && that.isSetPrevious(); + if (this_present_previous || that_present_previous) { + if (!(this_present_previous && that_present_previous)) + return false; + if (!this.previous.equals(that.previous)) + return false; + } + + boolean this_present_current = true && this.isSetCurrent(); + boolean that_present_current = true && that.isSetCurrent(); + if (this_present_current || that_present_current) { + if (!(this_present_current && that_present_current)) + return false; + if (!this.current.equals(that.current)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetPrevious()) ? 131071 : 524287); + if (isSetPrevious()) + hashCode = hashCode * 8191 + previous.hashCode(); + + hashCode = hashCode * 8191 + ((isSetCurrent()) ? 131071 : 524287); + if (isSetCurrent()) + hashCode = hashCode * 8191 + current.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(Delta other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.compare(isSetPrevious(), other.isSetPrevious()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetPrevious()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.previous, other.previous); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetCurrent(), other.isSetCurrent()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetCurrent()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.current, other.current); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + @Override + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("Delta("); + boolean first = true; + + if (isSetPrevious()) { + sb.append("previous:"); + if (this.previous == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.previous, sb); + } + first = false; + } + if (isSetCurrent()) { + if (!first) sb.append(", "); + sb.append("current:"); + if (this.current == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.current, sb); + } + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class DeltaStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public DeltaStandardScheme getScheme() { + return new DeltaStandardScheme(); + } + } + + private static class DeltaStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, Delta struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // PREVIOUS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.previous = iprot.readBinary(); + struct.setPreviousIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // CURRENT + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.current = iprot.readBinary(); + struct.setCurrentIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot, Delta struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.previous != null) { + if (struct.isSetPrevious()) { + oprot.writeFieldBegin(PREVIOUS_FIELD_DESC); + oprot.writeBinary(struct.previous); + oprot.writeFieldEnd(); + } + } + if (struct.current != null) { + if (struct.isSetCurrent()) { + oprot.writeFieldBegin(CURRENT_FIELD_DESC); + oprot.writeBinary(struct.current); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class DeltaTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public DeltaTupleScheme getScheme() { + return new DeltaTupleScheme(); + } + } + + private static class DeltaTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, Delta struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetPrevious()) { + optionals.set(0); + } + if (struct.isSetCurrent()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetPrevious()) { + oprot.writeBinary(struct.previous); + } + if (struct.isSetCurrent()) { + oprot.writeBinary(struct.current); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, Delta struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.previous = iprot.readBinary(); + struct.setPreviousIsSet(true); + } + if (incoming.get(1)) { + struct.current = iprot.readBinary(); + struct.setCurrentIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/src/main/java/it/cavallium/rockserver/core/common/api/InvalidOperation.java b/src/main/java/it/cavallium/rockserver/core/common/api/InvalidOperation.java new file mode 100644 index 0000000..3dee648 --- /dev/null +++ b/src/main/java/it/cavallium/rockserver/core/common/api/InvalidOperation.java @@ -0,0 +1,490 @@ +/** + * Autogenerated by Thrift Compiler (0.19.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package it.cavallium.rockserver.core.common.api; + +/** + * Structs can also be exceptions, if they are nasty. + */ +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +public class InvalidOperation extends org.apache.thrift.TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("InvalidOperation"); + + private static final org.apache.thrift.protocol.TField WHAT_OP_FIELD_DESC = new org.apache.thrift.protocol.TField("whatOp", org.apache.thrift.protocol.TType.I32, (short)1); + private static final org.apache.thrift.protocol.TField WHY_FIELD_DESC = new org.apache.thrift.protocol.TField("why", org.apache.thrift.protocol.TType.STRING, (short)2); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new InvalidOperationStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new InvalidOperationTupleSchemeFactory(); + + public int whatOp; // required + public @org.apache.thrift.annotation.Nullable java.lang.String why; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + WHAT_OP((short)1, "whatOp"), + WHY((short)2, "why"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // WHAT_OP + return WHAT_OP; + case 2: // WHY + return WHY; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + @Override + public short getThriftFieldId() { + return _thriftId; + } + + @Override + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __WHATOP_ISSET_ID = 0; + private byte __isset_bitfield = 0; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.WHAT_OP, new org.apache.thrift.meta_data.FieldMetaData("whatOp", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.WHY, new org.apache.thrift.meta_data.FieldMetaData("why", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(InvalidOperation.class, metaDataMap); + } + + public InvalidOperation() { + } + + public InvalidOperation( + int whatOp, + java.lang.String why) + { + this(); + this.whatOp = whatOp; + setWhatOpIsSet(true); + this.why = why; + } + + /** + * Performs a deep copy on other. + */ + public InvalidOperation(InvalidOperation other) { + __isset_bitfield = other.__isset_bitfield; + this.whatOp = other.whatOp; + if (other.isSetWhy()) { + this.why = other.why; + } + } + + @Override + public InvalidOperation deepCopy() { + return new InvalidOperation(this); + } + + @Override + public void clear() { + setWhatOpIsSet(false); + this.whatOp = 0; + this.why = null; + } + + public int getWhatOp() { + return this.whatOp; + } + + public InvalidOperation setWhatOp(int whatOp) { + this.whatOp = whatOp; + setWhatOpIsSet(true); + return this; + } + + public void unsetWhatOp() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __WHATOP_ISSET_ID); + } + + /** Returns true if field whatOp is set (has been assigned a value) and false otherwise */ + public boolean isSetWhatOp() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __WHATOP_ISSET_ID); + } + + public void setWhatOpIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __WHATOP_ISSET_ID, value); + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getWhy() { + return this.why; + } + + public InvalidOperation setWhy(@org.apache.thrift.annotation.Nullable java.lang.String why) { + this.why = why; + return this; + } + + public void unsetWhy() { + this.why = null; + } + + /** Returns true if field why is set (has been assigned a value) and false otherwise */ + public boolean isSetWhy() { + return this.why != null; + } + + public void setWhyIsSet(boolean value) { + if (!value) { + this.why = null; + } + } + + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case WHAT_OP: + if (value == null) { + unsetWhatOp(); + } else { + setWhatOp((java.lang.Integer)value); + } + break; + + case WHY: + if (value == null) { + unsetWhy(); + } else { + setWhy((java.lang.String)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case WHAT_OP: + return getWhatOp(); + + case WHY: + return getWhy(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case WHAT_OP: + return isSetWhatOp(); + case WHY: + return isSetWhy(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that instanceof InvalidOperation) + return this.equals((InvalidOperation)that); + return false; + } + + public boolean equals(InvalidOperation that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_whatOp = true; + boolean that_present_whatOp = true; + if (this_present_whatOp || that_present_whatOp) { + if (!(this_present_whatOp && that_present_whatOp)) + return false; + if (this.whatOp != that.whatOp) + return false; + } + + boolean this_present_why = true && this.isSetWhy(); + boolean that_present_why = true && that.isSetWhy(); + if (this_present_why || that_present_why) { + if (!(this_present_why && that_present_why)) + return false; + if (!this.why.equals(that.why)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + whatOp; + + hashCode = hashCode * 8191 + ((isSetWhy()) ? 131071 : 524287); + if (isSetWhy()) + hashCode = hashCode * 8191 + why.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(InvalidOperation other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.compare(isSetWhatOp(), other.isSetWhatOp()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetWhatOp()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.whatOp, other.whatOp); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetWhy(), other.isSetWhy()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetWhy()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.why, other.why); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + @Override + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("InvalidOperation("); + boolean first = true; + + sb.append("whatOp:"); + sb.append(this.whatOp); + first = false; + if (!first) sb.append(", "); + sb.append("why:"); + if (this.why == null) { + sb.append("null"); + } else { + sb.append(this.why); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class InvalidOperationStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public InvalidOperationStandardScheme getScheme() { + return new InvalidOperationStandardScheme(); + } + } + + private static class InvalidOperationStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, InvalidOperation struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // WHAT_OP + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.whatOp = iprot.readI32(); + struct.setWhatOpIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // WHY + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.why = iprot.readString(); + struct.setWhyIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot, InvalidOperation struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(WHAT_OP_FIELD_DESC); + oprot.writeI32(struct.whatOp); + oprot.writeFieldEnd(); + if (struct.why != null) { + oprot.writeFieldBegin(WHY_FIELD_DESC); + oprot.writeString(struct.why); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class InvalidOperationTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public InvalidOperationTupleScheme getScheme() { + return new InvalidOperationTupleScheme(); + } + } + + private static class InvalidOperationTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, InvalidOperation struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetWhatOp()) { + optionals.set(0); + } + if (struct.isSetWhy()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetWhatOp()) { + oprot.writeI32(struct.whatOp); + } + if (struct.isSetWhy()) { + oprot.writeString(struct.why); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, InvalidOperation struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.whatOp = iprot.readI32(); + struct.setWhatOpIsSet(true); + } + if (incoming.get(1)) { + struct.why = iprot.readString(); + struct.setWhyIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/src/main/java/it/cavallium/rockserver/core/common/api/Operation.java b/src/main/java/it/cavallium/rockserver/core/common/api/Operation.java new file mode 100644 index 0000000..ad5a310 --- /dev/null +++ b/src/main/java/it/cavallium/rockserver/core/common/api/Operation.java @@ -0,0 +1,64 @@ +/** + * Autogenerated by Thrift Compiler (0.19.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package it.cavallium.rockserver.core.common.api; + + +public enum Operation implements org.apache.thrift.TEnum { + NOTHING(1), + PREVIOUS(2), + CURRENT(3), + FOR_UPDATE(4), + EXISTS(5), + DELTA(6), + MULTI(7), + CHANGED(8), + PREVIOUS_PRESENCE(9); + + private final int value; + + private Operation(int value) { + this.value = value; + } + + /** + * Get the integer value of this enum value, as defined in the Thrift IDL. + */ + @Override + public int getValue() { + return value; + } + + /** + * Find a the enum type by its integer value, as defined in the Thrift IDL. + * @return null if the value is not found. + */ + @org.apache.thrift.annotation.Nullable + public static Operation findByValue(int value) { + switch (value) { + case 1: + return NOTHING; + case 2: + return PREVIOUS; + case 3: + return CURRENT; + case 4: + return FOR_UPDATE; + case 5: + return EXISTS; + case 6: + return DELTA; + case 7: + return MULTI; + case 8: + return CHANGED; + case 9: + return PREVIOUS_PRESENCE; + default: + return null; + } + } +} diff --git a/src/main/java/it/cavallium/rockserver/core/common/api/OptionalBinary.java b/src/main/java/it/cavallium/rockserver/core/common/api/OptionalBinary.java new file mode 100644 index 0000000..781aec3 --- /dev/null +++ b/src/main/java/it/cavallium/rockserver/core/common/api/OptionalBinary.java @@ -0,0 +1,398 @@ +/** + * Autogenerated by Thrift Compiler (0.19.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package it.cavallium.rockserver.core.common.api; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +public class OptionalBinary implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("OptionalBinary"); + + private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.STRING, (short)1); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new OptionalBinaryStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new OptionalBinaryTupleSchemeFactory(); + + public @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer value; // optional + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + VALUE((short)1, "value"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // VALUE + return VALUE; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + @Override + public short getThriftFieldId() { + return _thriftId; + } + + @Override + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.VALUE}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(OptionalBinary.class, metaDataMap); + } + + public OptionalBinary() { + } + + /** + * Performs a deep copy on other. + */ + public OptionalBinary(OptionalBinary other) { + if (other.isSetValue()) { + this.value = org.apache.thrift.TBaseHelper.copyBinary(other.value); + } + } + + @Override + public OptionalBinary deepCopy() { + return new OptionalBinary(this); + } + + @Override + public void clear() { + this.value = null; + } + + public byte[] getValue() { + setValue(org.apache.thrift.TBaseHelper.rightSize(value)); + return value == null ? null : value.array(); + } + + public java.nio.ByteBuffer bufferForValue() { + return org.apache.thrift.TBaseHelper.copyBinary(value); + } + + public OptionalBinary setValue(byte[] value) { + this.value = value == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(value.clone()); + return this; + } + + public OptionalBinary setValue(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer value) { + this.value = org.apache.thrift.TBaseHelper.copyBinary(value); + return this; + } + + public void unsetValue() { + this.value = null; + } + + /** Returns true if field value is set (has been assigned a value) and false otherwise */ + public boolean isSetValue() { + return this.value != null; + } + + public void setValueIsSet(boolean value) { + if (!value) { + this.value = null; + } + } + + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case VALUE: + if (value == null) { + unsetValue(); + } else { + if (value instanceof byte[]) { + setValue((byte[])value); + } else { + setValue((java.nio.ByteBuffer)value); + } + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case VALUE: + return getValue(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case VALUE: + return isSetValue(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that instanceof OptionalBinary) + return this.equals((OptionalBinary)that); + return false; + } + + public boolean equals(OptionalBinary that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_value = true && this.isSetValue(); + boolean that_present_value = true && that.isSetValue(); + if (this_present_value || that_present_value) { + if (!(this_present_value && that_present_value)) + return false; + if (!this.value.equals(that.value)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetValue()) ? 131071 : 524287); + if (isSetValue()) + hashCode = hashCode * 8191 + value.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(OptionalBinary other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.compare(isSetValue(), other.isSetValue()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValue()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + @Override + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("OptionalBinary("); + boolean first = true; + + if (isSetValue()) { + sb.append("value:"); + if (this.value == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.value, sb); + } + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class OptionalBinaryStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public OptionalBinaryStandardScheme getScheme() { + return new OptionalBinaryStandardScheme(); + } + } + + private static class OptionalBinaryStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, OptionalBinary struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // VALUE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.value = iprot.readBinary(); + struct.setValueIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot, OptionalBinary struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.value != null) { + if (struct.isSetValue()) { + oprot.writeFieldBegin(VALUE_FIELD_DESC); + oprot.writeBinary(struct.value); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class OptionalBinaryTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public OptionalBinaryTupleScheme getScheme() { + return new OptionalBinaryTupleScheme(); + } + } + + private static class OptionalBinaryTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, OptionalBinary struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetValue()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetValue()) { + oprot.writeBinary(struct.value); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, OptionalBinary struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.value = iprot.readBinary(); + struct.setValueIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/src/main/java/it/cavallium/rockserver/core/common/api/RocksDB.java b/src/main/java/it/cavallium/rockserver/core/common/api/RocksDB.java new file mode 100644 index 0000000..9943edc --- /dev/null +++ b/src/main/java/it/cavallium/rockserver/core/common/api/RocksDB.java @@ -0,0 +1,21149 @@ +/** + * Autogenerated by Thrift Compiler (0.19.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package it.cavallium.rockserver.core.common.api; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +public class RocksDB { + + public interface Iface { + + public long openTransaction(long timeoutMs) throws org.apache.thrift.TException; + + public boolean closeTransaction(long timeoutMs, boolean commit) throws org.apache.thrift.TException; + + public void closeFailedUpdate(long updateId) throws org.apache.thrift.TException; + + public long createColumn(java.lang.String name, ColumnSchema schema) throws org.apache.thrift.TException; + + public void deleteColumn(long columnId) throws org.apache.thrift.TException; + + public long getColumnId(java.lang.String name) throws org.apache.thrift.TException; + + public void put(long transactionOrUpdateId, long columnId, java.util.List keys, java.nio.ByteBuffer value) throws org.apache.thrift.TException; + + public OptionalBinary putGetPrevious(long transactionOrUpdateId, long columnId, java.util.List keys, java.nio.ByteBuffer value) throws org.apache.thrift.TException; + + public Delta putGetDelta(long transactionOrUpdateId, long columnId, java.util.List keys, java.nio.ByteBuffer value) throws org.apache.thrift.TException; + + public boolean putGetChanged(long transactionOrUpdateId, long columnId, java.util.List keys, java.nio.ByteBuffer value) throws org.apache.thrift.TException; + + public boolean putGetPreviousPresence(long transactionOrUpdateId, long columnId, java.util.List keys, java.nio.ByteBuffer value) throws org.apache.thrift.TException; + + public OptionalBinary get(long transactionOrUpdateId, long columnId, java.util.List keys) throws org.apache.thrift.TException; + + public UpdateBegin getForUpdate(long transactionOrUpdateId, long columnId, java.util.List keys) throws org.apache.thrift.TException; + + public boolean exists(long transactionOrUpdateId, long columnId, java.util.List keys) throws org.apache.thrift.TException; + + public long openIterator(long transactionId, long columnId, java.util.List startKeysInclusive, java.util.List endKeysExclusive, boolean reverse, long timeoutMs) throws org.apache.thrift.TException; + + public void closeIterator(long iteratorId) throws org.apache.thrift.TException; + + public void seekTo(long iterationId, java.util.List keys) throws org.apache.thrift.TException; + + public void subsequent(long iterationId, long skipCount, long takeCount) throws org.apache.thrift.TException; + + public boolean subsequentExists(long iterationId, long skipCount, long takeCount) throws org.apache.thrift.TException; + + public java.util.List subsequentMultiGet(long iterationId, long skipCount, long takeCount) throws org.apache.thrift.TException; + + } + + public interface AsyncIface { + + public void openTransaction(long timeoutMs, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void closeTransaction(long timeoutMs, boolean commit, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void closeFailedUpdate(long updateId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void createColumn(java.lang.String name, ColumnSchema schema, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void deleteColumn(long columnId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void getColumnId(java.lang.String name, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void put(long transactionOrUpdateId, long columnId, java.util.List keys, java.nio.ByteBuffer value, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void putGetPrevious(long transactionOrUpdateId, long columnId, java.util.List keys, java.nio.ByteBuffer value, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void putGetDelta(long transactionOrUpdateId, long columnId, java.util.List keys, java.nio.ByteBuffer value, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void putGetChanged(long transactionOrUpdateId, long columnId, java.util.List keys, java.nio.ByteBuffer value, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void putGetPreviousPresence(long transactionOrUpdateId, long columnId, java.util.List keys, java.nio.ByteBuffer value, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void get(long transactionOrUpdateId, long columnId, java.util.List keys, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void getForUpdate(long transactionOrUpdateId, long columnId, java.util.List keys, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void exists(long transactionOrUpdateId, long columnId, java.util.List keys, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void openIterator(long transactionId, long columnId, java.util.List startKeysInclusive, java.util.List endKeysExclusive, boolean reverse, long timeoutMs, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void closeIterator(long iteratorId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void seekTo(long iterationId, java.util.List keys, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void subsequent(long iterationId, long skipCount, long takeCount, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void subsequentExists(long iterationId, long skipCount, long takeCount, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void subsequentMultiGet(long iterationId, long skipCount, long takeCount, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws org.apache.thrift.TException; + + } + + public static class Client extends org.apache.thrift.TServiceClient implements Iface { + public static class Factory implements org.apache.thrift.TServiceClientFactory { + public Factory() {} + @Override + public Client getClient(org.apache.thrift.protocol.TProtocol prot) { + return new Client(prot); + } + @Override + public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { + return new Client(iprot, oprot); + } + } + + public Client(org.apache.thrift.protocol.TProtocol prot) + { + super(prot, prot); + } + + public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { + super(iprot, oprot); + } + + @Override + public long openTransaction(long timeoutMs) throws org.apache.thrift.TException + { + send_openTransaction(timeoutMs); + return recv_openTransaction(); + } + + public void send_openTransaction(long timeoutMs) throws org.apache.thrift.TException + { + openTransaction_args args = new openTransaction_args(); + args.setTimeoutMs(timeoutMs); + sendBase("openTransaction", args); + } + + public long recv_openTransaction() throws org.apache.thrift.TException + { + openTransaction_result result = new openTransaction_result(); + receiveBase(result, "openTransaction"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "openTransaction failed: unknown result"); + } + + @Override + public boolean closeTransaction(long timeoutMs, boolean commit) throws org.apache.thrift.TException + { + send_closeTransaction(timeoutMs, commit); + return recv_closeTransaction(); + } + + public void send_closeTransaction(long timeoutMs, boolean commit) throws org.apache.thrift.TException + { + closeTransaction_args args = new closeTransaction_args(); + args.setTimeoutMs(timeoutMs); + args.setCommit(commit); + sendBase("closeTransaction", args); + } + + public boolean recv_closeTransaction() throws org.apache.thrift.TException + { + closeTransaction_result result = new closeTransaction_result(); + receiveBase(result, "closeTransaction"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "closeTransaction failed: unknown result"); + } + + @Override + public void closeFailedUpdate(long updateId) throws org.apache.thrift.TException + { + send_closeFailedUpdate(updateId); + recv_closeFailedUpdate(); + } + + public void send_closeFailedUpdate(long updateId) throws org.apache.thrift.TException + { + closeFailedUpdate_args args = new closeFailedUpdate_args(); + args.setUpdateId(updateId); + sendBase("closeFailedUpdate", args); + } + + public void recv_closeFailedUpdate() throws org.apache.thrift.TException + { + closeFailedUpdate_result result = new closeFailedUpdate_result(); + receiveBase(result, "closeFailedUpdate"); + return; + } + + @Override + public long createColumn(java.lang.String name, ColumnSchema schema) throws org.apache.thrift.TException + { + send_createColumn(name, schema); + return recv_createColumn(); + } + + public void send_createColumn(java.lang.String name, ColumnSchema schema) throws org.apache.thrift.TException + { + createColumn_args args = new createColumn_args(); + args.setName(name); + args.setSchema(schema); + sendBase("createColumn", args); + } + + public long recv_createColumn() throws org.apache.thrift.TException + { + createColumn_result result = new createColumn_result(); + receiveBase(result, "createColumn"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "createColumn failed: unknown result"); + } + + @Override + public void deleteColumn(long columnId) throws org.apache.thrift.TException + { + send_deleteColumn(columnId); + recv_deleteColumn(); + } + + public void send_deleteColumn(long columnId) throws org.apache.thrift.TException + { + deleteColumn_args args = new deleteColumn_args(); + args.setColumnId(columnId); + sendBase("deleteColumn", args); + } + + public void recv_deleteColumn() throws org.apache.thrift.TException + { + deleteColumn_result result = new deleteColumn_result(); + receiveBase(result, "deleteColumn"); + return; + } + + @Override + public long getColumnId(java.lang.String name) throws org.apache.thrift.TException + { + send_getColumnId(name); + return recv_getColumnId(); + } + + public void send_getColumnId(java.lang.String name) throws org.apache.thrift.TException + { + getColumnId_args args = new getColumnId_args(); + args.setName(name); + sendBase("getColumnId", args); + } + + public long recv_getColumnId() throws org.apache.thrift.TException + { + getColumnId_result result = new getColumnId_result(); + receiveBase(result, "getColumnId"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getColumnId failed: unknown result"); + } + + @Override + public void put(long transactionOrUpdateId, long columnId, java.util.List keys, java.nio.ByteBuffer value) throws org.apache.thrift.TException + { + send_put(transactionOrUpdateId, columnId, keys, value); + } + + public void send_put(long transactionOrUpdateId, long columnId, java.util.List keys, java.nio.ByteBuffer value) throws org.apache.thrift.TException + { + put_args args = new put_args(); + args.setTransactionOrUpdateId(transactionOrUpdateId); + args.setColumnId(columnId); + args.setKeys(keys); + args.setValue(value); + sendBaseOneway("put", args); + } + + @Override + public OptionalBinary putGetPrevious(long transactionOrUpdateId, long columnId, java.util.List keys, java.nio.ByteBuffer value) throws org.apache.thrift.TException + { + send_putGetPrevious(transactionOrUpdateId, columnId, keys, value); + return recv_putGetPrevious(); + } + + public void send_putGetPrevious(long transactionOrUpdateId, long columnId, java.util.List keys, java.nio.ByteBuffer value) throws org.apache.thrift.TException + { + putGetPrevious_args args = new putGetPrevious_args(); + args.setTransactionOrUpdateId(transactionOrUpdateId); + args.setColumnId(columnId); + args.setKeys(keys); + args.setValue(value); + sendBase("putGetPrevious", args); + } + + public OptionalBinary recv_putGetPrevious() throws org.apache.thrift.TException + { + putGetPrevious_result result = new putGetPrevious_result(); + receiveBase(result, "putGetPrevious"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "putGetPrevious failed: unknown result"); + } + + @Override + public Delta putGetDelta(long transactionOrUpdateId, long columnId, java.util.List keys, java.nio.ByteBuffer value) throws org.apache.thrift.TException + { + send_putGetDelta(transactionOrUpdateId, columnId, keys, value); + return recv_putGetDelta(); + } + + public void send_putGetDelta(long transactionOrUpdateId, long columnId, java.util.List keys, java.nio.ByteBuffer value) throws org.apache.thrift.TException + { + putGetDelta_args args = new putGetDelta_args(); + args.setTransactionOrUpdateId(transactionOrUpdateId); + args.setColumnId(columnId); + args.setKeys(keys); + args.setValue(value); + sendBase("putGetDelta", args); + } + + public Delta recv_putGetDelta() throws org.apache.thrift.TException + { + putGetDelta_result result = new putGetDelta_result(); + receiveBase(result, "putGetDelta"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "putGetDelta failed: unknown result"); + } + + @Override + public boolean putGetChanged(long transactionOrUpdateId, long columnId, java.util.List keys, java.nio.ByteBuffer value) throws org.apache.thrift.TException + { + send_putGetChanged(transactionOrUpdateId, columnId, keys, value); + return recv_putGetChanged(); + } + + public void send_putGetChanged(long transactionOrUpdateId, long columnId, java.util.List keys, java.nio.ByteBuffer value) throws org.apache.thrift.TException + { + putGetChanged_args args = new putGetChanged_args(); + args.setTransactionOrUpdateId(transactionOrUpdateId); + args.setColumnId(columnId); + args.setKeys(keys); + args.setValue(value); + sendBase("putGetChanged", args); + } + + public boolean recv_putGetChanged() throws org.apache.thrift.TException + { + putGetChanged_result result = new putGetChanged_result(); + receiveBase(result, "putGetChanged"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "putGetChanged failed: unknown result"); + } + + @Override + public boolean putGetPreviousPresence(long transactionOrUpdateId, long columnId, java.util.List keys, java.nio.ByteBuffer value) throws org.apache.thrift.TException + { + send_putGetPreviousPresence(transactionOrUpdateId, columnId, keys, value); + return recv_putGetPreviousPresence(); + } + + public void send_putGetPreviousPresence(long transactionOrUpdateId, long columnId, java.util.List keys, java.nio.ByteBuffer value) throws org.apache.thrift.TException + { + putGetPreviousPresence_args args = new putGetPreviousPresence_args(); + args.setTransactionOrUpdateId(transactionOrUpdateId); + args.setColumnId(columnId); + args.setKeys(keys); + args.setValue(value); + sendBase("putGetPreviousPresence", args); + } + + public boolean recv_putGetPreviousPresence() throws org.apache.thrift.TException + { + putGetPreviousPresence_result result = new putGetPreviousPresence_result(); + receiveBase(result, "putGetPreviousPresence"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "putGetPreviousPresence failed: unknown result"); + } + + @Override + public OptionalBinary get(long transactionOrUpdateId, long columnId, java.util.List keys) throws org.apache.thrift.TException + { + send_get(transactionOrUpdateId, columnId, keys); + return recv_get(); + } + + public void send_get(long transactionOrUpdateId, long columnId, java.util.List keys) throws org.apache.thrift.TException + { + get_args args = new get_args(); + args.setTransactionOrUpdateId(transactionOrUpdateId); + args.setColumnId(columnId); + args.setKeys(keys); + sendBase("get", args); + } + + public OptionalBinary recv_get() throws org.apache.thrift.TException + { + get_result result = new get_result(); + receiveBase(result, "get"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "get failed: unknown result"); + } + + @Override + public UpdateBegin getForUpdate(long transactionOrUpdateId, long columnId, java.util.List keys) throws org.apache.thrift.TException + { + send_getForUpdate(transactionOrUpdateId, columnId, keys); + return recv_getForUpdate(); + } + + public void send_getForUpdate(long transactionOrUpdateId, long columnId, java.util.List keys) throws org.apache.thrift.TException + { + getForUpdate_args args = new getForUpdate_args(); + args.setTransactionOrUpdateId(transactionOrUpdateId); + args.setColumnId(columnId); + args.setKeys(keys); + sendBase("getForUpdate", args); + } + + public UpdateBegin recv_getForUpdate() throws org.apache.thrift.TException + { + getForUpdate_result result = new getForUpdate_result(); + receiveBase(result, "getForUpdate"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getForUpdate failed: unknown result"); + } + + @Override + public boolean exists(long transactionOrUpdateId, long columnId, java.util.List keys) throws org.apache.thrift.TException + { + send_exists(transactionOrUpdateId, columnId, keys); + return recv_exists(); + } + + public void send_exists(long transactionOrUpdateId, long columnId, java.util.List keys) throws org.apache.thrift.TException + { + exists_args args = new exists_args(); + args.setTransactionOrUpdateId(transactionOrUpdateId); + args.setColumnId(columnId); + args.setKeys(keys); + sendBase("exists", args); + } + + public boolean recv_exists() throws org.apache.thrift.TException + { + exists_result result = new exists_result(); + receiveBase(result, "exists"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "exists failed: unknown result"); + } + + @Override + public long openIterator(long transactionId, long columnId, java.util.List startKeysInclusive, java.util.List endKeysExclusive, boolean reverse, long timeoutMs) throws org.apache.thrift.TException + { + send_openIterator(transactionId, columnId, startKeysInclusive, endKeysExclusive, reverse, timeoutMs); + return recv_openIterator(); + } + + public void send_openIterator(long transactionId, long columnId, java.util.List startKeysInclusive, java.util.List endKeysExclusive, boolean reverse, long timeoutMs) throws org.apache.thrift.TException + { + openIterator_args args = new openIterator_args(); + args.setTransactionId(transactionId); + args.setColumnId(columnId); + args.setStartKeysInclusive(startKeysInclusive); + args.setEndKeysExclusive(endKeysExclusive); + args.setReverse(reverse); + args.setTimeoutMs(timeoutMs); + sendBase("openIterator", args); + } + + public long recv_openIterator() throws org.apache.thrift.TException + { + openIterator_result result = new openIterator_result(); + receiveBase(result, "openIterator"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "openIterator failed: unknown result"); + } + + @Override + public void closeIterator(long iteratorId) throws org.apache.thrift.TException + { + send_closeIterator(iteratorId); + recv_closeIterator(); + } + + public void send_closeIterator(long iteratorId) throws org.apache.thrift.TException + { + closeIterator_args args = new closeIterator_args(); + args.setIteratorId(iteratorId); + sendBase("closeIterator", args); + } + + public void recv_closeIterator() throws org.apache.thrift.TException + { + closeIterator_result result = new closeIterator_result(); + receiveBase(result, "closeIterator"); + return; + } + + @Override + public void seekTo(long iterationId, java.util.List keys) throws org.apache.thrift.TException + { + send_seekTo(iterationId, keys); + recv_seekTo(); + } + + public void send_seekTo(long iterationId, java.util.List keys) throws org.apache.thrift.TException + { + seekTo_args args = new seekTo_args(); + args.setIterationId(iterationId); + args.setKeys(keys); + sendBase("seekTo", args); + } + + public void recv_seekTo() throws org.apache.thrift.TException + { + seekTo_result result = new seekTo_result(); + receiveBase(result, "seekTo"); + return; + } + + @Override + public void subsequent(long iterationId, long skipCount, long takeCount) throws org.apache.thrift.TException + { + send_subsequent(iterationId, skipCount, takeCount); + } + + public void send_subsequent(long iterationId, long skipCount, long takeCount) throws org.apache.thrift.TException + { + subsequent_args args = new subsequent_args(); + args.setIterationId(iterationId); + args.setSkipCount(skipCount); + args.setTakeCount(takeCount); + sendBaseOneway("subsequent", args); + } + + @Override + public boolean subsequentExists(long iterationId, long skipCount, long takeCount) throws org.apache.thrift.TException + { + send_subsequentExists(iterationId, skipCount, takeCount); + return recv_subsequentExists(); + } + + public void send_subsequentExists(long iterationId, long skipCount, long takeCount) throws org.apache.thrift.TException + { + subsequentExists_args args = new subsequentExists_args(); + args.setIterationId(iterationId); + args.setSkipCount(skipCount); + args.setTakeCount(takeCount); + sendBase("subsequentExists", args); + } + + public boolean recv_subsequentExists() throws org.apache.thrift.TException + { + subsequentExists_result result = new subsequentExists_result(); + receiveBase(result, "subsequentExists"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "subsequentExists failed: unknown result"); + } + + @Override + public java.util.List subsequentMultiGet(long iterationId, long skipCount, long takeCount) throws org.apache.thrift.TException + { + send_subsequentMultiGet(iterationId, skipCount, takeCount); + return recv_subsequentMultiGet(); + } + + public void send_subsequentMultiGet(long iterationId, long skipCount, long takeCount) throws org.apache.thrift.TException + { + subsequentMultiGet_args args = new subsequentMultiGet_args(); + args.setIterationId(iterationId); + args.setSkipCount(skipCount); + args.setTakeCount(takeCount); + sendBase("subsequentMultiGet", args); + } + + public java.util.List recv_subsequentMultiGet() throws org.apache.thrift.TException + { + subsequentMultiGet_result result = new subsequentMultiGet_result(); + receiveBase(result, "subsequentMultiGet"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "subsequentMultiGet failed: unknown result"); + } + + } + public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface { + public static class Factory implements org.apache.thrift.async.TAsyncClientFactory { + private org.apache.thrift.async.TAsyncClientManager clientManager; + private org.apache.thrift.protocol.TProtocolFactory protocolFactory; + public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) { + this.clientManager = clientManager; + this.protocolFactory = protocolFactory; + } + @Override + public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) { + return new AsyncClient(protocolFactory, clientManager, transport); + } + } + + public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) { + super(protocolFactory, clientManager, transport); + } + + @Override + public void openTransaction(long timeoutMs, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + openTransaction_call method_call = new openTransaction_call(timeoutMs, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class openTransaction_call extends org.apache.thrift.async.TAsyncMethodCall { + private long timeoutMs; + public openTransaction_call(long timeoutMs, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.timeoutMs = timeoutMs; + } + + @Override + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("openTransaction", org.apache.thrift.protocol.TMessageType.CALL, 0)); + openTransaction_args args = new openTransaction_args(); + args.setTimeoutMs(timeoutMs); + args.write(prot); + prot.writeMessageEnd(); + } + + @Override + public java.lang.Long getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new java.lang.IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_openTransaction(); + } + } + + @Override + public void closeTransaction(long timeoutMs, boolean commit, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + closeTransaction_call method_call = new closeTransaction_call(timeoutMs, commit, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class closeTransaction_call extends org.apache.thrift.async.TAsyncMethodCall { + private long timeoutMs; + private boolean commit; + public closeTransaction_call(long timeoutMs, boolean commit, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.timeoutMs = timeoutMs; + this.commit = commit; + } + + @Override + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("closeTransaction", org.apache.thrift.protocol.TMessageType.CALL, 0)); + closeTransaction_args args = new closeTransaction_args(); + args.setTimeoutMs(timeoutMs); + args.setCommit(commit); + args.write(prot); + prot.writeMessageEnd(); + } + + @Override + public java.lang.Boolean getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new java.lang.IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_closeTransaction(); + } + } + + @Override + public void closeFailedUpdate(long updateId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + closeFailedUpdate_call method_call = new closeFailedUpdate_call(updateId, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class closeFailedUpdate_call extends org.apache.thrift.async.TAsyncMethodCall { + private long updateId; + public closeFailedUpdate_call(long updateId, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.updateId = updateId; + } + + @Override + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("closeFailedUpdate", org.apache.thrift.protocol.TMessageType.CALL, 0)); + closeFailedUpdate_args args = new closeFailedUpdate_args(); + args.setUpdateId(updateId); + args.write(prot); + prot.writeMessageEnd(); + } + + @Override + public Void getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new java.lang.IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_closeFailedUpdate(); + return null; + } + } + + @Override + public void createColumn(java.lang.String name, ColumnSchema schema, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + createColumn_call method_call = new createColumn_call(name, schema, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class createColumn_call extends org.apache.thrift.async.TAsyncMethodCall { + private java.lang.String name; + private ColumnSchema schema; + public createColumn_call(java.lang.String name, ColumnSchema schema, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.name = name; + this.schema = schema; + } + + @Override + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createColumn", org.apache.thrift.protocol.TMessageType.CALL, 0)); + createColumn_args args = new createColumn_args(); + args.setName(name); + args.setSchema(schema); + args.write(prot); + prot.writeMessageEnd(); + } + + @Override + public java.lang.Long getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new java.lang.IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_createColumn(); + } + } + + @Override + public void deleteColumn(long columnId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + deleteColumn_call method_call = new deleteColumn_call(columnId, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class deleteColumn_call extends org.apache.thrift.async.TAsyncMethodCall { + private long columnId; + public deleteColumn_call(long columnId, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.columnId = columnId; + } + + @Override + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("deleteColumn", org.apache.thrift.protocol.TMessageType.CALL, 0)); + deleteColumn_args args = new deleteColumn_args(); + args.setColumnId(columnId); + args.write(prot); + prot.writeMessageEnd(); + } + + @Override + public Void getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new java.lang.IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_deleteColumn(); + return null; + } + } + + @Override + public void getColumnId(java.lang.String name, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getColumnId_call method_call = new getColumnId_call(name, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getColumnId_call extends org.apache.thrift.async.TAsyncMethodCall { + private java.lang.String name; + public getColumnId_call(java.lang.String name, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.name = name; + } + + @Override + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getColumnId", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getColumnId_args args = new getColumnId_args(); + args.setName(name); + args.write(prot); + prot.writeMessageEnd(); + } + + @Override + public java.lang.Long getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new java.lang.IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getColumnId(); + } + } + + @Override + public void put(long transactionOrUpdateId, long columnId, java.util.List keys, java.nio.ByteBuffer value, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + put_call method_call = new put_call(transactionOrUpdateId, columnId, keys, value, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class put_call extends org.apache.thrift.async.TAsyncMethodCall { + private long transactionOrUpdateId; + private long columnId; + private java.util.List keys; + private java.nio.ByteBuffer value; + public put_call(long transactionOrUpdateId, long columnId, java.util.List keys, java.nio.ByteBuffer value, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, true); + this.transactionOrUpdateId = transactionOrUpdateId; + this.columnId = columnId; + this.keys = keys; + this.value = value; + } + + @Override + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("put", org.apache.thrift.protocol.TMessageType.ONEWAY, 0)); + put_args args = new put_args(); + args.setTransactionOrUpdateId(transactionOrUpdateId); + args.setColumnId(columnId); + args.setKeys(keys); + args.setValue(value); + args.write(prot); + prot.writeMessageEnd(); + } + + @Override + public Void getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new java.lang.IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return null; + } + } + + @Override + public void putGetPrevious(long transactionOrUpdateId, long columnId, java.util.List keys, java.nio.ByteBuffer value, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + putGetPrevious_call method_call = new putGetPrevious_call(transactionOrUpdateId, columnId, keys, value, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class putGetPrevious_call extends org.apache.thrift.async.TAsyncMethodCall { + private long transactionOrUpdateId; + private long columnId; + private java.util.List keys; + private java.nio.ByteBuffer value; + public putGetPrevious_call(long transactionOrUpdateId, long columnId, java.util.List keys, java.nio.ByteBuffer value, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.transactionOrUpdateId = transactionOrUpdateId; + this.columnId = columnId; + this.keys = keys; + this.value = value; + } + + @Override + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("putGetPrevious", org.apache.thrift.protocol.TMessageType.CALL, 0)); + putGetPrevious_args args = new putGetPrevious_args(); + args.setTransactionOrUpdateId(transactionOrUpdateId); + args.setColumnId(columnId); + args.setKeys(keys); + args.setValue(value); + args.write(prot); + prot.writeMessageEnd(); + } + + @Override + public OptionalBinary getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new java.lang.IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_putGetPrevious(); + } + } + + @Override + public void putGetDelta(long transactionOrUpdateId, long columnId, java.util.List keys, java.nio.ByteBuffer value, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + putGetDelta_call method_call = new putGetDelta_call(transactionOrUpdateId, columnId, keys, value, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class putGetDelta_call extends org.apache.thrift.async.TAsyncMethodCall { + private long transactionOrUpdateId; + private long columnId; + private java.util.List keys; + private java.nio.ByteBuffer value; + public putGetDelta_call(long transactionOrUpdateId, long columnId, java.util.List keys, java.nio.ByteBuffer value, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.transactionOrUpdateId = transactionOrUpdateId; + this.columnId = columnId; + this.keys = keys; + this.value = value; + } + + @Override + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("putGetDelta", org.apache.thrift.protocol.TMessageType.CALL, 0)); + putGetDelta_args args = new putGetDelta_args(); + args.setTransactionOrUpdateId(transactionOrUpdateId); + args.setColumnId(columnId); + args.setKeys(keys); + args.setValue(value); + args.write(prot); + prot.writeMessageEnd(); + } + + @Override + public Delta getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new java.lang.IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_putGetDelta(); + } + } + + @Override + public void putGetChanged(long transactionOrUpdateId, long columnId, java.util.List keys, java.nio.ByteBuffer value, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + putGetChanged_call method_call = new putGetChanged_call(transactionOrUpdateId, columnId, keys, value, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class putGetChanged_call extends org.apache.thrift.async.TAsyncMethodCall { + private long transactionOrUpdateId; + private long columnId; + private java.util.List keys; + private java.nio.ByteBuffer value; + public putGetChanged_call(long transactionOrUpdateId, long columnId, java.util.List keys, java.nio.ByteBuffer value, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.transactionOrUpdateId = transactionOrUpdateId; + this.columnId = columnId; + this.keys = keys; + this.value = value; + } + + @Override + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("putGetChanged", org.apache.thrift.protocol.TMessageType.CALL, 0)); + putGetChanged_args args = new putGetChanged_args(); + args.setTransactionOrUpdateId(transactionOrUpdateId); + args.setColumnId(columnId); + args.setKeys(keys); + args.setValue(value); + args.write(prot); + prot.writeMessageEnd(); + } + + @Override + public java.lang.Boolean getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new java.lang.IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_putGetChanged(); + } + } + + @Override + public void putGetPreviousPresence(long transactionOrUpdateId, long columnId, java.util.List keys, java.nio.ByteBuffer value, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + putGetPreviousPresence_call method_call = new putGetPreviousPresence_call(transactionOrUpdateId, columnId, keys, value, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class putGetPreviousPresence_call extends org.apache.thrift.async.TAsyncMethodCall { + private long transactionOrUpdateId; + private long columnId; + private java.util.List keys; + private java.nio.ByteBuffer value; + public putGetPreviousPresence_call(long transactionOrUpdateId, long columnId, java.util.List keys, java.nio.ByteBuffer value, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.transactionOrUpdateId = transactionOrUpdateId; + this.columnId = columnId; + this.keys = keys; + this.value = value; + } + + @Override + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("putGetPreviousPresence", org.apache.thrift.protocol.TMessageType.CALL, 0)); + putGetPreviousPresence_args args = new putGetPreviousPresence_args(); + args.setTransactionOrUpdateId(transactionOrUpdateId); + args.setColumnId(columnId); + args.setKeys(keys); + args.setValue(value); + args.write(prot); + prot.writeMessageEnd(); + } + + @Override + public java.lang.Boolean getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new java.lang.IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_putGetPreviousPresence(); + } + } + + @Override + public void get(long transactionOrUpdateId, long columnId, java.util.List keys, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + get_call method_call = new get_call(transactionOrUpdateId, columnId, keys, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class get_call extends org.apache.thrift.async.TAsyncMethodCall { + private long transactionOrUpdateId; + private long columnId; + private java.util.List keys; + public get_call(long transactionOrUpdateId, long columnId, java.util.List keys, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.transactionOrUpdateId = transactionOrUpdateId; + this.columnId = columnId; + this.keys = keys; + } + + @Override + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("get", org.apache.thrift.protocol.TMessageType.CALL, 0)); + get_args args = new get_args(); + args.setTransactionOrUpdateId(transactionOrUpdateId); + args.setColumnId(columnId); + args.setKeys(keys); + args.write(prot); + prot.writeMessageEnd(); + } + + @Override + public OptionalBinary getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new java.lang.IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_get(); + } + } + + @Override + public void getForUpdate(long transactionOrUpdateId, long columnId, java.util.List keys, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getForUpdate_call method_call = new getForUpdate_call(transactionOrUpdateId, columnId, keys, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getForUpdate_call extends org.apache.thrift.async.TAsyncMethodCall { + private long transactionOrUpdateId; + private long columnId; + private java.util.List keys; + public getForUpdate_call(long transactionOrUpdateId, long columnId, java.util.List keys, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.transactionOrUpdateId = transactionOrUpdateId; + this.columnId = columnId; + this.keys = keys; + } + + @Override + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getForUpdate", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getForUpdate_args args = new getForUpdate_args(); + args.setTransactionOrUpdateId(transactionOrUpdateId); + args.setColumnId(columnId); + args.setKeys(keys); + args.write(prot); + prot.writeMessageEnd(); + } + + @Override + public UpdateBegin getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new java.lang.IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getForUpdate(); + } + } + + @Override + public void exists(long transactionOrUpdateId, long columnId, java.util.List keys, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + exists_call method_call = new exists_call(transactionOrUpdateId, columnId, keys, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class exists_call extends org.apache.thrift.async.TAsyncMethodCall { + private long transactionOrUpdateId; + private long columnId; + private java.util.List keys; + public exists_call(long transactionOrUpdateId, long columnId, java.util.List keys, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.transactionOrUpdateId = transactionOrUpdateId; + this.columnId = columnId; + this.keys = keys; + } + + @Override + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("exists", org.apache.thrift.protocol.TMessageType.CALL, 0)); + exists_args args = new exists_args(); + args.setTransactionOrUpdateId(transactionOrUpdateId); + args.setColumnId(columnId); + args.setKeys(keys); + args.write(prot); + prot.writeMessageEnd(); + } + + @Override + public java.lang.Boolean getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new java.lang.IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_exists(); + } + } + + @Override + public void openIterator(long transactionId, long columnId, java.util.List startKeysInclusive, java.util.List endKeysExclusive, boolean reverse, long timeoutMs, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + openIterator_call method_call = new openIterator_call(transactionId, columnId, startKeysInclusive, endKeysExclusive, reverse, timeoutMs, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class openIterator_call extends org.apache.thrift.async.TAsyncMethodCall { + private long transactionId; + private long columnId; + private java.util.List startKeysInclusive; + private java.util.List endKeysExclusive; + private boolean reverse; + private long timeoutMs; + public openIterator_call(long transactionId, long columnId, java.util.List startKeysInclusive, java.util.List endKeysExclusive, boolean reverse, long timeoutMs, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.transactionId = transactionId; + this.columnId = columnId; + this.startKeysInclusive = startKeysInclusive; + this.endKeysExclusive = endKeysExclusive; + this.reverse = reverse; + this.timeoutMs = timeoutMs; + } + + @Override + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("openIterator", org.apache.thrift.protocol.TMessageType.CALL, 0)); + openIterator_args args = new openIterator_args(); + args.setTransactionId(transactionId); + args.setColumnId(columnId); + args.setStartKeysInclusive(startKeysInclusive); + args.setEndKeysExclusive(endKeysExclusive); + args.setReverse(reverse); + args.setTimeoutMs(timeoutMs); + args.write(prot); + prot.writeMessageEnd(); + } + + @Override + public java.lang.Long getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new java.lang.IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_openIterator(); + } + } + + @Override + public void closeIterator(long iteratorId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + closeIterator_call method_call = new closeIterator_call(iteratorId, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class closeIterator_call extends org.apache.thrift.async.TAsyncMethodCall { + private long iteratorId; + public closeIterator_call(long iteratorId, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.iteratorId = iteratorId; + } + + @Override + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("closeIterator", org.apache.thrift.protocol.TMessageType.CALL, 0)); + closeIterator_args args = new closeIterator_args(); + args.setIteratorId(iteratorId); + args.write(prot); + prot.writeMessageEnd(); + } + + @Override + public Void getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new java.lang.IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_closeIterator(); + return null; + } + } + + @Override + public void seekTo(long iterationId, java.util.List keys, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + seekTo_call method_call = new seekTo_call(iterationId, keys, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class seekTo_call extends org.apache.thrift.async.TAsyncMethodCall { + private long iterationId; + private java.util.List keys; + public seekTo_call(long iterationId, java.util.List keys, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.iterationId = iterationId; + this.keys = keys; + } + + @Override + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("seekTo", org.apache.thrift.protocol.TMessageType.CALL, 0)); + seekTo_args args = new seekTo_args(); + args.setIterationId(iterationId); + args.setKeys(keys); + args.write(prot); + prot.writeMessageEnd(); + } + + @Override + public Void getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new java.lang.IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_seekTo(); + return null; + } + } + + @Override + public void subsequent(long iterationId, long skipCount, long takeCount, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + subsequent_call method_call = new subsequent_call(iterationId, skipCount, takeCount, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class subsequent_call extends org.apache.thrift.async.TAsyncMethodCall { + private long iterationId; + private long skipCount; + private long takeCount; + public subsequent_call(long iterationId, long skipCount, long takeCount, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, true); + this.iterationId = iterationId; + this.skipCount = skipCount; + this.takeCount = takeCount; + } + + @Override + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("subsequent", org.apache.thrift.protocol.TMessageType.ONEWAY, 0)); + subsequent_args args = new subsequent_args(); + args.setIterationId(iterationId); + args.setSkipCount(skipCount); + args.setTakeCount(takeCount); + args.write(prot); + prot.writeMessageEnd(); + } + + @Override + public Void getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new java.lang.IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return null; + } + } + + @Override + public void subsequentExists(long iterationId, long skipCount, long takeCount, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + subsequentExists_call method_call = new subsequentExists_call(iterationId, skipCount, takeCount, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class subsequentExists_call extends org.apache.thrift.async.TAsyncMethodCall { + private long iterationId; + private long skipCount; + private long takeCount; + public subsequentExists_call(long iterationId, long skipCount, long takeCount, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.iterationId = iterationId; + this.skipCount = skipCount; + this.takeCount = takeCount; + } + + @Override + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("subsequentExists", org.apache.thrift.protocol.TMessageType.CALL, 0)); + subsequentExists_args args = new subsequentExists_args(); + args.setIterationId(iterationId); + args.setSkipCount(skipCount); + args.setTakeCount(takeCount); + args.write(prot); + prot.writeMessageEnd(); + } + + @Override + public java.lang.Boolean getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new java.lang.IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_subsequentExists(); + } + } + + @Override + public void subsequentMultiGet(long iterationId, long skipCount, long takeCount, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws org.apache.thrift.TException { + checkReady(); + subsequentMultiGet_call method_call = new subsequentMultiGet_call(iterationId, skipCount, takeCount, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class subsequentMultiGet_call extends org.apache.thrift.async.TAsyncMethodCall> { + private long iterationId; + private long skipCount; + private long takeCount; + public subsequentMultiGet_call(long iterationId, long skipCount, long takeCount, org.apache.thrift.async.AsyncMethodCallback> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.iterationId = iterationId; + this.skipCount = skipCount; + this.takeCount = takeCount; + } + + @Override + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("subsequentMultiGet", org.apache.thrift.protocol.TMessageType.CALL, 0)); + subsequentMultiGet_args args = new subsequentMultiGet_args(); + args.setIterationId(iterationId); + args.setSkipCount(skipCount); + args.setTakeCount(takeCount); + args.write(prot); + prot.writeMessageEnd(); + } + + @Override + public java.util.List getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new java.lang.IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_subsequentMultiGet(); + } + } + + } + + public static class Processor extends org.apache.thrift.TBaseProcessor implements org.apache.thrift.TProcessor { + private static final org.slf4j.Logger _LOGGER = org.slf4j.LoggerFactory.getLogger(Processor.class.getName()); + public Processor(I iface) { + super(iface, getProcessMap(new java.util.HashMap>())); + } + + protected Processor(I iface, java.util.Map> processMap) { + super(iface, getProcessMap(processMap)); + } + + private static java.util.Map> getProcessMap(java.util.Map> processMap) { + processMap.put("openTransaction", new openTransaction()); + processMap.put("closeTransaction", new closeTransaction()); + processMap.put("closeFailedUpdate", new closeFailedUpdate()); + processMap.put("createColumn", new createColumn()); + processMap.put("deleteColumn", new deleteColumn()); + processMap.put("getColumnId", new getColumnId()); + processMap.put("put", new put()); + processMap.put("putGetPrevious", new putGetPrevious()); + processMap.put("putGetDelta", new putGetDelta()); + processMap.put("putGetChanged", new putGetChanged()); + processMap.put("putGetPreviousPresence", new putGetPreviousPresence()); + processMap.put("get", new get()); + processMap.put("getForUpdate", new getForUpdate()); + processMap.put("exists", new exists()); + processMap.put("openIterator", new openIterator()); + processMap.put("closeIterator", new closeIterator()); + processMap.put("seekTo", new seekTo()); + processMap.put("subsequent", new subsequent()); + processMap.put("subsequentExists", new subsequentExists()); + processMap.put("subsequentMultiGet", new subsequentMultiGet()); + return processMap; + } + + public static class openTransaction extends org.apache.thrift.ProcessFunction { + public openTransaction() { + super("openTransaction"); + } + + @Override + public openTransaction_args getEmptyArgsInstance() { + return new openTransaction_args(); + } + + @Override + protected boolean isOneway() { + return false; + } + + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + @Override + public openTransaction_result getResult(I iface, openTransaction_args args) throws org.apache.thrift.TException { + openTransaction_result result = new openTransaction_result(); + result.success = iface.openTransaction(args.timeoutMs); + result.setSuccessIsSet(true); + return result; + } + } + + public static class closeTransaction extends org.apache.thrift.ProcessFunction { + public closeTransaction() { + super("closeTransaction"); + } + + @Override + public closeTransaction_args getEmptyArgsInstance() { + return new closeTransaction_args(); + } + + @Override + protected boolean isOneway() { + return false; + } + + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + @Override + public closeTransaction_result getResult(I iface, closeTransaction_args args) throws org.apache.thrift.TException { + closeTransaction_result result = new closeTransaction_result(); + result.success = iface.closeTransaction(args.timeoutMs, args.commit); + result.setSuccessIsSet(true); + return result; + } + } + + public static class closeFailedUpdate extends org.apache.thrift.ProcessFunction { + public closeFailedUpdate() { + super("closeFailedUpdate"); + } + + @Override + public closeFailedUpdate_args getEmptyArgsInstance() { + return new closeFailedUpdate_args(); + } + + @Override + protected boolean isOneway() { + return false; + } + + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + @Override + public closeFailedUpdate_result getResult(I iface, closeFailedUpdate_args args) throws org.apache.thrift.TException { + closeFailedUpdate_result result = new closeFailedUpdate_result(); + iface.closeFailedUpdate(args.updateId); + return result; + } + } + + public static class createColumn extends org.apache.thrift.ProcessFunction { + public createColumn() { + super("createColumn"); + } + + @Override + public createColumn_args getEmptyArgsInstance() { + return new createColumn_args(); + } + + @Override + protected boolean isOneway() { + return false; + } + + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + @Override + public createColumn_result getResult(I iface, createColumn_args args) throws org.apache.thrift.TException { + createColumn_result result = new createColumn_result(); + result.success = iface.createColumn(args.name, args.schema); + result.setSuccessIsSet(true); + return result; + } + } + + public static class deleteColumn extends org.apache.thrift.ProcessFunction { + public deleteColumn() { + super("deleteColumn"); + } + + @Override + public deleteColumn_args getEmptyArgsInstance() { + return new deleteColumn_args(); + } + + @Override + protected boolean isOneway() { + return false; + } + + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + @Override + public deleteColumn_result getResult(I iface, deleteColumn_args args) throws org.apache.thrift.TException { + deleteColumn_result result = new deleteColumn_result(); + iface.deleteColumn(args.columnId); + return result; + } + } + + public static class getColumnId extends org.apache.thrift.ProcessFunction { + public getColumnId() { + super("getColumnId"); + } + + @Override + public getColumnId_args getEmptyArgsInstance() { + return new getColumnId_args(); + } + + @Override + protected boolean isOneway() { + return false; + } + + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + @Override + public getColumnId_result getResult(I iface, getColumnId_args args) throws org.apache.thrift.TException { + getColumnId_result result = new getColumnId_result(); + result.success = iface.getColumnId(args.name); + result.setSuccessIsSet(true); + return result; + } + } + + public static class put extends org.apache.thrift.ProcessFunction { + public put() { + super("put"); + } + + @Override + public put_args getEmptyArgsInstance() { + return new put_args(); + } + + @Override + protected boolean isOneway() { + return true; + } + + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + @Override + public org.apache.thrift.TBase getResult(I iface, put_args args) throws org.apache.thrift.TException { + iface.put(args.transactionOrUpdateId, args.columnId, args.keys, args.value); + return null; + } + } + + public static class putGetPrevious extends org.apache.thrift.ProcessFunction { + public putGetPrevious() { + super("putGetPrevious"); + } + + @Override + public putGetPrevious_args getEmptyArgsInstance() { + return new putGetPrevious_args(); + } + + @Override + protected boolean isOneway() { + return false; + } + + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + @Override + public putGetPrevious_result getResult(I iface, putGetPrevious_args args) throws org.apache.thrift.TException { + putGetPrevious_result result = new putGetPrevious_result(); + result.success = iface.putGetPrevious(args.transactionOrUpdateId, args.columnId, args.keys, args.value); + return result; + } + } + + public static class putGetDelta extends org.apache.thrift.ProcessFunction { + public putGetDelta() { + super("putGetDelta"); + } + + @Override + public putGetDelta_args getEmptyArgsInstance() { + return new putGetDelta_args(); + } + + @Override + protected boolean isOneway() { + return false; + } + + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + @Override + public putGetDelta_result getResult(I iface, putGetDelta_args args) throws org.apache.thrift.TException { + putGetDelta_result result = new putGetDelta_result(); + result.success = iface.putGetDelta(args.transactionOrUpdateId, args.columnId, args.keys, args.value); + return result; + } + } + + public static class putGetChanged extends org.apache.thrift.ProcessFunction { + public putGetChanged() { + super("putGetChanged"); + } + + @Override + public putGetChanged_args getEmptyArgsInstance() { + return new putGetChanged_args(); + } + + @Override + protected boolean isOneway() { + return false; + } + + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + @Override + public putGetChanged_result getResult(I iface, putGetChanged_args args) throws org.apache.thrift.TException { + putGetChanged_result result = new putGetChanged_result(); + result.success = iface.putGetChanged(args.transactionOrUpdateId, args.columnId, args.keys, args.value); + result.setSuccessIsSet(true); + return result; + } + } + + public static class putGetPreviousPresence extends org.apache.thrift.ProcessFunction { + public putGetPreviousPresence() { + super("putGetPreviousPresence"); + } + + @Override + public putGetPreviousPresence_args getEmptyArgsInstance() { + return new putGetPreviousPresence_args(); + } + + @Override + protected boolean isOneway() { + return false; + } + + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + @Override + public putGetPreviousPresence_result getResult(I iface, putGetPreviousPresence_args args) throws org.apache.thrift.TException { + putGetPreviousPresence_result result = new putGetPreviousPresence_result(); + result.success = iface.putGetPreviousPresence(args.transactionOrUpdateId, args.columnId, args.keys, args.value); + result.setSuccessIsSet(true); + return result; + } + } + + public static class get extends org.apache.thrift.ProcessFunction { + public get() { + super("get"); + } + + @Override + public get_args getEmptyArgsInstance() { + return new get_args(); + } + + @Override + protected boolean isOneway() { + return false; + } + + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + @Override + public get_result getResult(I iface, get_args args) throws org.apache.thrift.TException { + get_result result = new get_result(); + result.success = iface.get(args.transactionOrUpdateId, args.columnId, args.keys); + return result; + } + } + + public static class getForUpdate extends org.apache.thrift.ProcessFunction { + public getForUpdate() { + super("getForUpdate"); + } + + @Override + public getForUpdate_args getEmptyArgsInstance() { + return new getForUpdate_args(); + } + + @Override + protected boolean isOneway() { + return false; + } + + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + @Override + public getForUpdate_result getResult(I iface, getForUpdate_args args) throws org.apache.thrift.TException { + getForUpdate_result result = new getForUpdate_result(); + result.success = iface.getForUpdate(args.transactionOrUpdateId, args.columnId, args.keys); + return result; + } + } + + public static class exists extends org.apache.thrift.ProcessFunction { + public exists() { + super("exists"); + } + + @Override + public exists_args getEmptyArgsInstance() { + return new exists_args(); + } + + @Override + protected boolean isOneway() { + return false; + } + + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + @Override + public exists_result getResult(I iface, exists_args args) throws org.apache.thrift.TException { + exists_result result = new exists_result(); + result.success = iface.exists(args.transactionOrUpdateId, args.columnId, args.keys); + result.setSuccessIsSet(true); + return result; + } + } + + public static class openIterator extends org.apache.thrift.ProcessFunction { + public openIterator() { + super("openIterator"); + } + + @Override + public openIterator_args getEmptyArgsInstance() { + return new openIterator_args(); + } + + @Override + protected boolean isOneway() { + return false; + } + + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + @Override + public openIterator_result getResult(I iface, openIterator_args args) throws org.apache.thrift.TException { + openIterator_result result = new openIterator_result(); + result.success = iface.openIterator(args.transactionId, args.columnId, args.startKeysInclusive, args.endKeysExclusive, args.reverse, args.timeoutMs); + result.setSuccessIsSet(true); + return result; + } + } + + public static class closeIterator extends org.apache.thrift.ProcessFunction { + public closeIterator() { + super("closeIterator"); + } + + @Override + public closeIterator_args getEmptyArgsInstance() { + return new closeIterator_args(); + } + + @Override + protected boolean isOneway() { + return false; + } + + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + @Override + public closeIterator_result getResult(I iface, closeIterator_args args) throws org.apache.thrift.TException { + closeIterator_result result = new closeIterator_result(); + iface.closeIterator(args.iteratorId); + return result; + } + } + + public static class seekTo extends org.apache.thrift.ProcessFunction { + public seekTo() { + super("seekTo"); + } + + @Override + public seekTo_args getEmptyArgsInstance() { + return new seekTo_args(); + } + + @Override + protected boolean isOneway() { + return false; + } + + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + @Override + public seekTo_result getResult(I iface, seekTo_args args) throws org.apache.thrift.TException { + seekTo_result result = new seekTo_result(); + iface.seekTo(args.iterationId, args.keys); + return result; + } + } + + public static class subsequent extends org.apache.thrift.ProcessFunction { + public subsequent() { + super("subsequent"); + } + + @Override + public subsequent_args getEmptyArgsInstance() { + return new subsequent_args(); + } + + @Override + protected boolean isOneway() { + return true; + } + + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + @Override + public org.apache.thrift.TBase getResult(I iface, subsequent_args args) throws org.apache.thrift.TException { + iface.subsequent(args.iterationId, args.skipCount, args.takeCount); + return null; + } + } + + public static class subsequentExists extends org.apache.thrift.ProcessFunction { + public subsequentExists() { + super("subsequentExists"); + } + + @Override + public subsequentExists_args getEmptyArgsInstance() { + return new subsequentExists_args(); + } + + @Override + protected boolean isOneway() { + return false; + } + + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + @Override + public subsequentExists_result getResult(I iface, subsequentExists_args args) throws org.apache.thrift.TException { + subsequentExists_result result = new subsequentExists_result(); + result.success = iface.subsequentExists(args.iterationId, args.skipCount, args.takeCount); + result.setSuccessIsSet(true); + return result; + } + } + + public static class subsequentMultiGet extends org.apache.thrift.ProcessFunction { + public subsequentMultiGet() { + super("subsequentMultiGet"); + } + + @Override + public subsequentMultiGet_args getEmptyArgsInstance() { + return new subsequentMultiGet_args(); + } + + @Override + protected boolean isOneway() { + return false; + } + + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + @Override + public subsequentMultiGet_result getResult(I iface, subsequentMultiGet_args args) throws org.apache.thrift.TException { + subsequentMultiGet_result result = new subsequentMultiGet_result(); + result.success = iface.subsequentMultiGet(args.iterationId, args.skipCount, args.takeCount); + return result; + } + } + + } + + public static class AsyncProcessor extends org.apache.thrift.TBaseAsyncProcessor { + private static final org.slf4j.Logger _LOGGER = org.slf4j.LoggerFactory.getLogger(AsyncProcessor.class.getName()); + public AsyncProcessor(I iface) { + super(iface, getProcessMap(new java.util.HashMap>())); + } + + protected AsyncProcessor(I iface, java.util.Map> processMap) { + super(iface, getProcessMap(processMap)); + } + + private static java.util.Map> getProcessMap(java.util.Map> processMap) { + processMap.put("openTransaction", new openTransaction()); + processMap.put("closeTransaction", new closeTransaction()); + processMap.put("closeFailedUpdate", new closeFailedUpdate()); + processMap.put("createColumn", new createColumn()); + processMap.put("deleteColumn", new deleteColumn()); + processMap.put("getColumnId", new getColumnId()); + processMap.put("put", new put()); + processMap.put("putGetPrevious", new putGetPrevious()); + processMap.put("putGetDelta", new putGetDelta()); + processMap.put("putGetChanged", new putGetChanged()); + processMap.put("putGetPreviousPresence", new putGetPreviousPresence()); + processMap.put("get", new get()); + processMap.put("getForUpdate", new getForUpdate()); + processMap.put("exists", new exists()); + processMap.put("openIterator", new openIterator()); + processMap.put("closeIterator", new closeIterator()); + processMap.put("seekTo", new seekTo()); + processMap.put("subsequent", new subsequent()); + processMap.put("subsequentExists", new subsequentExists()); + processMap.put("subsequentMultiGet", new subsequentMultiGet()); + return processMap; + } + + public static class openTransaction extends org.apache.thrift.AsyncProcessFunction { + public openTransaction() { + super("openTransaction"); + } + + @Override + public openTransaction_args getEmptyArgsInstance() { + return new openTransaction_args(); + } + + @Override + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new org.apache.thrift.async.AsyncMethodCallback() { + @Override + public void onComplete(java.lang.Long o) { + openTransaction_result result = new openTransaction_result(); + result.success = o; + result.setSuccessIsSet(true); + try { + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); + } + } + @Override + public void onError(java.lang.Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TSerializable msg; + openTransaction_result result = new openTransaction_result(); + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); + } + } + }; + } + + @Override + protected boolean isOneway() { + return false; + } + + @Override + public void start(I iface, openTransaction_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + iface.openTransaction(args.timeoutMs,resultHandler); + } + } + + public static class closeTransaction extends org.apache.thrift.AsyncProcessFunction { + public closeTransaction() { + super("closeTransaction"); + } + + @Override + public closeTransaction_args getEmptyArgsInstance() { + return new closeTransaction_args(); + } + + @Override + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new org.apache.thrift.async.AsyncMethodCallback() { + @Override + public void onComplete(java.lang.Boolean o) { + closeTransaction_result result = new closeTransaction_result(); + result.success = o; + result.setSuccessIsSet(true); + try { + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); + } + } + @Override + public void onError(java.lang.Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TSerializable msg; + closeTransaction_result result = new closeTransaction_result(); + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); + } + } + }; + } + + @Override + protected boolean isOneway() { + return false; + } + + @Override + public void start(I iface, closeTransaction_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + iface.closeTransaction(args.timeoutMs, args.commit,resultHandler); + } + } + + public static class closeFailedUpdate extends org.apache.thrift.AsyncProcessFunction { + public closeFailedUpdate() { + super("closeFailedUpdate"); + } + + @Override + public closeFailedUpdate_args getEmptyArgsInstance() { + return new closeFailedUpdate_args(); + } + + @Override + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new org.apache.thrift.async.AsyncMethodCallback() { + @Override + public void onComplete(Void o) { + closeFailedUpdate_result result = new closeFailedUpdate_result(); + try { + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); + } + } + @Override + public void onError(java.lang.Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TSerializable msg; + closeFailedUpdate_result result = new closeFailedUpdate_result(); + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); + } + } + }; + } + + @Override + protected boolean isOneway() { + return false; + } + + @Override + public void start(I iface, closeFailedUpdate_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + iface.closeFailedUpdate(args.updateId,resultHandler); + } + } + + public static class createColumn extends org.apache.thrift.AsyncProcessFunction { + public createColumn() { + super("createColumn"); + } + + @Override + public createColumn_args getEmptyArgsInstance() { + return new createColumn_args(); + } + + @Override + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new org.apache.thrift.async.AsyncMethodCallback() { + @Override + public void onComplete(java.lang.Long o) { + createColumn_result result = new createColumn_result(); + result.success = o; + result.setSuccessIsSet(true); + try { + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); + } + } + @Override + public void onError(java.lang.Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TSerializable msg; + createColumn_result result = new createColumn_result(); + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); + } + } + }; + } + + @Override + protected boolean isOneway() { + return false; + } + + @Override + public void start(I iface, createColumn_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + iface.createColumn(args.name, args.schema,resultHandler); + } + } + + public static class deleteColumn extends org.apache.thrift.AsyncProcessFunction { + public deleteColumn() { + super("deleteColumn"); + } + + @Override + public deleteColumn_args getEmptyArgsInstance() { + return new deleteColumn_args(); + } + + @Override + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new org.apache.thrift.async.AsyncMethodCallback() { + @Override + public void onComplete(Void o) { + deleteColumn_result result = new deleteColumn_result(); + try { + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); + } + } + @Override + public void onError(java.lang.Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TSerializable msg; + deleteColumn_result result = new deleteColumn_result(); + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); + } + } + }; + } + + @Override + protected boolean isOneway() { + return false; + } + + @Override + public void start(I iface, deleteColumn_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + iface.deleteColumn(args.columnId,resultHandler); + } + } + + public static class getColumnId extends org.apache.thrift.AsyncProcessFunction { + public getColumnId() { + super("getColumnId"); + } + + @Override + public getColumnId_args getEmptyArgsInstance() { + return new getColumnId_args(); + } + + @Override + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new org.apache.thrift.async.AsyncMethodCallback() { + @Override + public void onComplete(java.lang.Long o) { + getColumnId_result result = new getColumnId_result(); + result.success = o; + result.setSuccessIsSet(true); + try { + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); + } + } + @Override + public void onError(java.lang.Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TSerializable msg; + getColumnId_result result = new getColumnId_result(); + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); + } + } + }; + } + + @Override + protected boolean isOneway() { + return false; + } + + @Override + public void start(I iface, getColumnId_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + iface.getColumnId(args.name,resultHandler); + } + } + + public static class put extends org.apache.thrift.AsyncProcessFunction { + public put() { + super("put"); + } + + @Override + public put_args getEmptyArgsInstance() { + return new put_args(); + } + + @Override + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new org.apache.thrift.async.AsyncMethodCallback() { + @Override + public void onComplete(Void o) { + } + @Override + public void onError(java.lang.Exception e) { + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + } else { + _LOGGER.error("Exception inside oneway handler", e); + } + } + }; + } + + @Override + protected boolean isOneway() { + return true; + } + + @Override + public void start(I iface, put_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + iface.put(args.transactionOrUpdateId, args.columnId, args.keys, args.value,resultHandler); + } + } + + public static class putGetPrevious extends org.apache.thrift.AsyncProcessFunction { + public putGetPrevious() { + super("putGetPrevious"); + } + + @Override + public putGetPrevious_args getEmptyArgsInstance() { + return new putGetPrevious_args(); + } + + @Override + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new org.apache.thrift.async.AsyncMethodCallback() { + @Override + public void onComplete(OptionalBinary o) { + putGetPrevious_result result = new putGetPrevious_result(); + result.success = o; + try { + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); + } + } + @Override + public void onError(java.lang.Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TSerializable msg; + putGetPrevious_result result = new putGetPrevious_result(); + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); + } + } + }; + } + + @Override + protected boolean isOneway() { + return false; + } + + @Override + public void start(I iface, putGetPrevious_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + iface.putGetPrevious(args.transactionOrUpdateId, args.columnId, args.keys, args.value,resultHandler); + } + } + + public static class putGetDelta extends org.apache.thrift.AsyncProcessFunction { + public putGetDelta() { + super("putGetDelta"); + } + + @Override + public putGetDelta_args getEmptyArgsInstance() { + return new putGetDelta_args(); + } + + @Override + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new org.apache.thrift.async.AsyncMethodCallback() { + @Override + public void onComplete(Delta o) { + putGetDelta_result result = new putGetDelta_result(); + result.success = o; + try { + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); + } + } + @Override + public void onError(java.lang.Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TSerializable msg; + putGetDelta_result result = new putGetDelta_result(); + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); + } + } + }; + } + + @Override + protected boolean isOneway() { + return false; + } + + @Override + public void start(I iface, putGetDelta_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + iface.putGetDelta(args.transactionOrUpdateId, args.columnId, args.keys, args.value,resultHandler); + } + } + + public static class putGetChanged extends org.apache.thrift.AsyncProcessFunction { + public putGetChanged() { + super("putGetChanged"); + } + + @Override + public putGetChanged_args getEmptyArgsInstance() { + return new putGetChanged_args(); + } + + @Override + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new org.apache.thrift.async.AsyncMethodCallback() { + @Override + public void onComplete(java.lang.Boolean o) { + putGetChanged_result result = new putGetChanged_result(); + result.success = o; + result.setSuccessIsSet(true); + try { + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); + } + } + @Override + public void onError(java.lang.Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TSerializable msg; + putGetChanged_result result = new putGetChanged_result(); + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); + } + } + }; + } + + @Override + protected boolean isOneway() { + return false; + } + + @Override + public void start(I iface, putGetChanged_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + iface.putGetChanged(args.transactionOrUpdateId, args.columnId, args.keys, args.value,resultHandler); + } + } + + public static class putGetPreviousPresence extends org.apache.thrift.AsyncProcessFunction { + public putGetPreviousPresence() { + super("putGetPreviousPresence"); + } + + @Override + public putGetPreviousPresence_args getEmptyArgsInstance() { + return new putGetPreviousPresence_args(); + } + + @Override + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new org.apache.thrift.async.AsyncMethodCallback() { + @Override + public void onComplete(java.lang.Boolean o) { + putGetPreviousPresence_result result = new putGetPreviousPresence_result(); + result.success = o; + result.setSuccessIsSet(true); + try { + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); + } + } + @Override + public void onError(java.lang.Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TSerializable msg; + putGetPreviousPresence_result result = new putGetPreviousPresence_result(); + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); + } + } + }; + } + + @Override + protected boolean isOneway() { + return false; + } + + @Override + public void start(I iface, putGetPreviousPresence_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + iface.putGetPreviousPresence(args.transactionOrUpdateId, args.columnId, args.keys, args.value,resultHandler); + } + } + + public static class get extends org.apache.thrift.AsyncProcessFunction { + public get() { + super("get"); + } + + @Override + public get_args getEmptyArgsInstance() { + return new get_args(); + } + + @Override + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new org.apache.thrift.async.AsyncMethodCallback() { + @Override + public void onComplete(OptionalBinary o) { + get_result result = new get_result(); + result.success = o; + try { + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); + } + } + @Override + public void onError(java.lang.Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TSerializable msg; + get_result result = new get_result(); + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); + } + } + }; + } + + @Override + protected boolean isOneway() { + return false; + } + + @Override + public void start(I iface, get_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + iface.get(args.transactionOrUpdateId, args.columnId, args.keys,resultHandler); + } + } + + public static class getForUpdate extends org.apache.thrift.AsyncProcessFunction { + public getForUpdate() { + super("getForUpdate"); + } + + @Override + public getForUpdate_args getEmptyArgsInstance() { + return new getForUpdate_args(); + } + + @Override + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new org.apache.thrift.async.AsyncMethodCallback() { + @Override + public void onComplete(UpdateBegin o) { + getForUpdate_result result = new getForUpdate_result(); + result.success = o; + try { + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); + } + } + @Override + public void onError(java.lang.Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TSerializable msg; + getForUpdate_result result = new getForUpdate_result(); + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); + } + } + }; + } + + @Override + protected boolean isOneway() { + return false; + } + + @Override + public void start(I iface, getForUpdate_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + iface.getForUpdate(args.transactionOrUpdateId, args.columnId, args.keys,resultHandler); + } + } + + public static class exists extends org.apache.thrift.AsyncProcessFunction { + public exists() { + super("exists"); + } + + @Override + public exists_args getEmptyArgsInstance() { + return new exists_args(); + } + + @Override + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new org.apache.thrift.async.AsyncMethodCallback() { + @Override + public void onComplete(java.lang.Boolean o) { + exists_result result = new exists_result(); + result.success = o; + result.setSuccessIsSet(true); + try { + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); + } + } + @Override + public void onError(java.lang.Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TSerializable msg; + exists_result result = new exists_result(); + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); + } + } + }; + } + + @Override + protected boolean isOneway() { + return false; + } + + @Override + public void start(I iface, exists_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + iface.exists(args.transactionOrUpdateId, args.columnId, args.keys,resultHandler); + } + } + + public static class openIterator extends org.apache.thrift.AsyncProcessFunction { + public openIterator() { + super("openIterator"); + } + + @Override + public openIterator_args getEmptyArgsInstance() { + return new openIterator_args(); + } + + @Override + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new org.apache.thrift.async.AsyncMethodCallback() { + @Override + public void onComplete(java.lang.Long o) { + openIterator_result result = new openIterator_result(); + result.success = o; + result.setSuccessIsSet(true); + try { + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); + } + } + @Override + public void onError(java.lang.Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TSerializable msg; + openIterator_result result = new openIterator_result(); + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); + } + } + }; + } + + @Override + protected boolean isOneway() { + return false; + } + + @Override + public void start(I iface, openIterator_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + iface.openIterator(args.transactionId, args.columnId, args.startKeysInclusive, args.endKeysExclusive, args.reverse, args.timeoutMs,resultHandler); + } + } + + public static class closeIterator extends org.apache.thrift.AsyncProcessFunction { + public closeIterator() { + super("closeIterator"); + } + + @Override + public closeIterator_args getEmptyArgsInstance() { + return new closeIterator_args(); + } + + @Override + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new org.apache.thrift.async.AsyncMethodCallback() { + @Override + public void onComplete(Void o) { + closeIterator_result result = new closeIterator_result(); + try { + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); + } + } + @Override + public void onError(java.lang.Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TSerializable msg; + closeIterator_result result = new closeIterator_result(); + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); + } + } + }; + } + + @Override + protected boolean isOneway() { + return false; + } + + @Override + public void start(I iface, closeIterator_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + iface.closeIterator(args.iteratorId,resultHandler); + } + } + + public static class seekTo extends org.apache.thrift.AsyncProcessFunction { + public seekTo() { + super("seekTo"); + } + + @Override + public seekTo_args getEmptyArgsInstance() { + return new seekTo_args(); + } + + @Override + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new org.apache.thrift.async.AsyncMethodCallback() { + @Override + public void onComplete(Void o) { + seekTo_result result = new seekTo_result(); + try { + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); + } + } + @Override + public void onError(java.lang.Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TSerializable msg; + seekTo_result result = new seekTo_result(); + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); + } + } + }; + } + + @Override + protected boolean isOneway() { + return false; + } + + @Override + public void start(I iface, seekTo_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + iface.seekTo(args.iterationId, args.keys,resultHandler); + } + } + + public static class subsequent extends org.apache.thrift.AsyncProcessFunction { + public subsequent() { + super("subsequent"); + } + + @Override + public subsequent_args getEmptyArgsInstance() { + return new subsequent_args(); + } + + @Override + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new org.apache.thrift.async.AsyncMethodCallback() { + @Override + public void onComplete(Void o) { + } + @Override + public void onError(java.lang.Exception e) { + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + } else { + _LOGGER.error("Exception inside oneway handler", e); + } + } + }; + } + + @Override + protected boolean isOneway() { + return true; + } + + @Override + public void start(I iface, subsequent_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + iface.subsequent(args.iterationId, args.skipCount, args.takeCount,resultHandler); + } + } + + public static class subsequentExists extends org.apache.thrift.AsyncProcessFunction { + public subsequentExists() { + super("subsequentExists"); + } + + @Override + public subsequentExists_args getEmptyArgsInstance() { + return new subsequentExists_args(); + } + + @Override + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new org.apache.thrift.async.AsyncMethodCallback() { + @Override + public void onComplete(java.lang.Boolean o) { + subsequentExists_result result = new subsequentExists_result(); + result.success = o; + result.setSuccessIsSet(true); + try { + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); + } + } + @Override + public void onError(java.lang.Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TSerializable msg; + subsequentExists_result result = new subsequentExists_result(); + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); + } + } + }; + } + + @Override + protected boolean isOneway() { + return false; + } + + @Override + public void start(I iface, subsequentExists_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + iface.subsequentExists(args.iterationId, args.skipCount, args.takeCount,resultHandler); + } + } + + public static class subsequentMultiGet extends org.apache.thrift.AsyncProcessFunction> { + public subsequentMultiGet() { + super("subsequentMultiGet"); + } + + @Override + public subsequentMultiGet_args getEmptyArgsInstance() { + return new subsequentMultiGet_args(); + } + + @Override + public org.apache.thrift.async.AsyncMethodCallback> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new org.apache.thrift.async.AsyncMethodCallback>() { + @Override + public void onComplete(java.util.List o) { + subsequentMultiGet_result result = new subsequentMultiGet_result(); + result.success = o; + try { + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); + } + } + @Override + public void onError(java.lang.Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TSerializable msg; + subsequentMultiGet_result result = new subsequentMultiGet_result(); + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); + } + } + }; + } + + @Override + protected boolean isOneway() { + return false; + } + + @Override + public void start(I iface, subsequentMultiGet_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws org.apache.thrift.TException { + iface.subsequentMultiGet(args.iterationId, args.skipCount, args.takeCount,resultHandler); + } + } + + } + + @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) + public static class openTransaction_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("openTransaction_args"); + + private static final org.apache.thrift.protocol.TField TIMEOUT_MS_FIELD_DESC = new org.apache.thrift.protocol.TField("timeoutMs", org.apache.thrift.protocol.TType.I64, (short)1); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new openTransaction_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new openTransaction_argsTupleSchemeFactory(); + + public long timeoutMs; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + TIMEOUT_MS((short)1, "timeoutMs"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // TIMEOUT_MS + return TIMEOUT_MS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + @Override + public short getThriftFieldId() { + return _thriftId; + } + + @Override + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __TIMEOUTMS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.TIMEOUT_MS, new org.apache.thrift.meta_data.FieldMetaData("timeoutMs", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(openTransaction_args.class, metaDataMap); + } + + public openTransaction_args() { + } + + public openTransaction_args( + long timeoutMs) + { + this(); + this.timeoutMs = timeoutMs; + setTimeoutMsIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public openTransaction_args(openTransaction_args other) { + __isset_bitfield = other.__isset_bitfield; + this.timeoutMs = other.timeoutMs; + } + + @Override + public openTransaction_args deepCopy() { + return new openTransaction_args(this); + } + + @Override + public void clear() { + setTimeoutMsIsSet(false); + this.timeoutMs = 0; + } + + public long getTimeoutMs() { + return this.timeoutMs; + } + + public openTransaction_args setTimeoutMs(long timeoutMs) { + this.timeoutMs = timeoutMs; + setTimeoutMsIsSet(true); + return this; + } + + public void unsetTimeoutMs() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TIMEOUTMS_ISSET_ID); + } + + /** Returns true if field timeoutMs is set (has been assigned a value) and false otherwise */ + public boolean isSetTimeoutMs() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TIMEOUTMS_ISSET_ID); + } + + public void setTimeoutMsIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TIMEOUTMS_ISSET_ID, value); + } + + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case TIMEOUT_MS: + if (value == null) { + unsetTimeoutMs(); + } else { + setTimeoutMs((java.lang.Long)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case TIMEOUT_MS: + return getTimeoutMs(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case TIMEOUT_MS: + return isSetTimeoutMs(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that instanceof openTransaction_args) + return this.equals((openTransaction_args)that); + return false; + } + + public boolean equals(openTransaction_args that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_timeoutMs = true; + boolean that_present_timeoutMs = true; + if (this_present_timeoutMs || that_present_timeoutMs) { + if (!(this_present_timeoutMs && that_present_timeoutMs)) + return false; + if (this.timeoutMs != that.timeoutMs) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(timeoutMs); + + return hashCode; + } + + @Override + public int compareTo(openTransaction_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.compare(isSetTimeoutMs(), other.isSetTimeoutMs()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTimeoutMs()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timeoutMs, other.timeoutMs); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + @Override + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("openTransaction_args("); + boolean first = true; + + sb.append("timeoutMs:"); + sb.append(this.timeoutMs); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // alas, we cannot check 'timeoutMs' because it's a primitive and you chose the non-beans generator. + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class openTransaction_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public openTransaction_argsStandardScheme getScheme() { + return new openTransaction_argsStandardScheme(); + } + } + + private static class openTransaction_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, openTransaction_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // TIMEOUT_MS + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.timeoutMs = iprot.readI64(); + struct.setTimeoutMsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + if (!struct.isSetTimeoutMs()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'timeoutMs' was not found in serialized data! Struct: " + toString()); + } + struct.validate(); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot, openTransaction_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(TIMEOUT_MS_FIELD_DESC); + oprot.writeI64(struct.timeoutMs); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class openTransaction_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public openTransaction_argsTupleScheme getScheme() { + return new openTransaction_argsTupleScheme(); + } + } + + private static class openTransaction_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, openTransaction_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + oprot.writeI64(struct.timeoutMs); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, openTransaction_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.timeoutMs = iprot.readI64(); + struct.setTimeoutMsIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) + public static class openTransaction_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("openTransaction_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I64, (short)0); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new openTransaction_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new openTransaction_resultTupleSchemeFactory(); + + public long success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + @Override + public short getThriftFieldId() { + return _thriftId; + } + + @Override + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __SUCCESS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(openTransaction_result.class, metaDataMap); + } + + public openTransaction_result() { + } + + public openTransaction_result( + long success) + { + this(); + this.success = success; + setSuccessIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public openTransaction_result(openTransaction_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + } + + @Override + public openTransaction_result deepCopy() { + return new openTransaction_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = 0; + } + + public long getSuccess() { + return this.success; + } + + public openTransaction_result setSuccess(long success) { + this.success = success; + setSuccessIsSet(true); + return this; + } + + public void unsetSuccess() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + } + + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((java.lang.Long)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that instanceof openTransaction_result) + return this.equals((openTransaction_result)that); + return false; + } + + public boolean equals(openTransaction_result that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(success); + + return hashCode; + } + + @Override + public int compareTo(openTransaction_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + @Override + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("openTransaction_result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class openTransaction_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public openTransaction_resultStandardScheme getScheme() { + return new openTransaction_resultStandardScheme(); + } + } + + private static class openTransaction_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, openTransaction_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.success = iprot.readI64(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot, openTransaction_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeI64(struct.success); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class openTransaction_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public openTransaction_resultTupleScheme getScheme() { + return new openTransaction_resultTupleScheme(); + } + } + + private static class openTransaction_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, openTransaction_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + oprot.writeI64(struct.success); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, openTransaction_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = iprot.readI64(); + struct.setSuccessIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) + public static class closeTransaction_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("closeTransaction_args"); + + private static final org.apache.thrift.protocol.TField TIMEOUT_MS_FIELD_DESC = new org.apache.thrift.protocol.TField("timeoutMs", org.apache.thrift.protocol.TType.I64, (short)1); + private static final org.apache.thrift.protocol.TField COMMIT_FIELD_DESC = new org.apache.thrift.protocol.TField("commit", org.apache.thrift.protocol.TType.BOOL, (short)2); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new closeTransaction_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new closeTransaction_argsTupleSchemeFactory(); + + public long timeoutMs; // required + public boolean commit; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + TIMEOUT_MS((short)1, "timeoutMs"), + COMMIT((short)2, "commit"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // TIMEOUT_MS + return TIMEOUT_MS; + case 2: // COMMIT + return COMMIT; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + @Override + public short getThriftFieldId() { + return _thriftId; + } + + @Override + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __TIMEOUTMS_ISSET_ID = 0; + private static final int __COMMIT_ISSET_ID = 1; + private byte __isset_bitfield = 0; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.TIMEOUT_MS, new org.apache.thrift.meta_data.FieldMetaData("timeoutMs", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.COMMIT, new org.apache.thrift.meta_data.FieldMetaData("commit", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(closeTransaction_args.class, metaDataMap); + } + + public closeTransaction_args() { + } + + public closeTransaction_args( + long timeoutMs, + boolean commit) + { + this(); + this.timeoutMs = timeoutMs; + setTimeoutMsIsSet(true); + this.commit = commit; + setCommitIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public closeTransaction_args(closeTransaction_args other) { + __isset_bitfield = other.__isset_bitfield; + this.timeoutMs = other.timeoutMs; + this.commit = other.commit; + } + + @Override + public closeTransaction_args deepCopy() { + return new closeTransaction_args(this); + } + + @Override + public void clear() { + setTimeoutMsIsSet(false); + this.timeoutMs = 0; + setCommitIsSet(false); + this.commit = false; + } + + public long getTimeoutMs() { + return this.timeoutMs; + } + + public closeTransaction_args setTimeoutMs(long timeoutMs) { + this.timeoutMs = timeoutMs; + setTimeoutMsIsSet(true); + return this; + } + + public void unsetTimeoutMs() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TIMEOUTMS_ISSET_ID); + } + + /** Returns true if field timeoutMs is set (has been assigned a value) and false otherwise */ + public boolean isSetTimeoutMs() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TIMEOUTMS_ISSET_ID); + } + + public void setTimeoutMsIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TIMEOUTMS_ISSET_ID, value); + } + + public boolean isCommit() { + return this.commit; + } + + public closeTransaction_args setCommit(boolean commit) { + this.commit = commit; + setCommitIsSet(true); + return this; + } + + public void unsetCommit() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __COMMIT_ISSET_ID); + } + + /** Returns true if field commit is set (has been assigned a value) and false otherwise */ + public boolean isSetCommit() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __COMMIT_ISSET_ID); + } + + public void setCommitIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __COMMIT_ISSET_ID, value); + } + + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case TIMEOUT_MS: + if (value == null) { + unsetTimeoutMs(); + } else { + setTimeoutMs((java.lang.Long)value); + } + break; + + case COMMIT: + if (value == null) { + unsetCommit(); + } else { + setCommit((java.lang.Boolean)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case TIMEOUT_MS: + return getTimeoutMs(); + + case COMMIT: + return isCommit(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case TIMEOUT_MS: + return isSetTimeoutMs(); + case COMMIT: + return isSetCommit(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that instanceof closeTransaction_args) + return this.equals((closeTransaction_args)that); + return false; + } + + public boolean equals(closeTransaction_args that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_timeoutMs = true; + boolean that_present_timeoutMs = true; + if (this_present_timeoutMs || that_present_timeoutMs) { + if (!(this_present_timeoutMs && that_present_timeoutMs)) + return false; + if (this.timeoutMs != that.timeoutMs) + return false; + } + + boolean this_present_commit = true; + boolean that_present_commit = true; + if (this_present_commit || that_present_commit) { + if (!(this_present_commit && that_present_commit)) + return false; + if (this.commit != that.commit) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(timeoutMs); + + hashCode = hashCode * 8191 + ((commit) ? 131071 : 524287); + + return hashCode; + } + + @Override + public int compareTo(closeTransaction_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.compare(isSetTimeoutMs(), other.isSetTimeoutMs()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTimeoutMs()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timeoutMs, other.timeoutMs); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetCommit(), other.isSetCommit()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetCommit()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.commit, other.commit); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + @Override + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("closeTransaction_args("); + boolean first = true; + + sb.append("timeoutMs:"); + sb.append(this.timeoutMs); + first = false; + if (!first) sb.append(", "); + sb.append("commit:"); + sb.append(this.commit); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // alas, we cannot check 'timeoutMs' because it's a primitive and you chose the non-beans generator. + // alas, we cannot check 'commit' because it's a primitive and you chose the non-beans generator. + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class closeTransaction_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public closeTransaction_argsStandardScheme getScheme() { + return new closeTransaction_argsStandardScheme(); + } + } + + private static class closeTransaction_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, closeTransaction_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // TIMEOUT_MS + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.timeoutMs = iprot.readI64(); + struct.setTimeoutMsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // COMMIT + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.commit = iprot.readBool(); + struct.setCommitIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + if (!struct.isSetTimeoutMs()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'timeoutMs' was not found in serialized data! Struct: " + toString()); + } + if (!struct.isSetCommit()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'commit' was not found in serialized data! Struct: " + toString()); + } + struct.validate(); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot, closeTransaction_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(TIMEOUT_MS_FIELD_DESC); + oprot.writeI64(struct.timeoutMs); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(COMMIT_FIELD_DESC); + oprot.writeBool(struct.commit); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class closeTransaction_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public closeTransaction_argsTupleScheme getScheme() { + return new closeTransaction_argsTupleScheme(); + } + } + + private static class closeTransaction_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, closeTransaction_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + oprot.writeI64(struct.timeoutMs); + oprot.writeBool(struct.commit); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, closeTransaction_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.timeoutMs = iprot.readI64(); + struct.setTimeoutMsIsSet(true); + struct.commit = iprot.readBool(); + struct.setCommitIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) + public static class closeTransaction_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("closeTransaction_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new closeTransaction_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new closeTransaction_resultTupleSchemeFactory(); + + public boolean success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + @Override + public short getThriftFieldId() { + return _thriftId; + } + + @Override + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __SUCCESS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(closeTransaction_result.class, metaDataMap); + } + + public closeTransaction_result() { + } + + public closeTransaction_result( + boolean success) + { + this(); + this.success = success; + setSuccessIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public closeTransaction_result(closeTransaction_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + } + + @Override + public closeTransaction_result deepCopy() { + return new closeTransaction_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = false; + } + + public boolean isSuccess() { + return this.success; + } + + public closeTransaction_result setSuccess(boolean success) { + this.success = success; + setSuccessIsSet(true); + return this; + } + + public void unsetSuccess() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + } + + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((java.lang.Boolean)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return isSuccess(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that instanceof closeTransaction_result) + return this.equals((closeTransaction_result)that); + return false; + } + + public boolean equals(closeTransaction_result that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((success) ? 131071 : 524287); + + return hashCode; + } + + @Override + public int compareTo(closeTransaction_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + @Override + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("closeTransaction_result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class closeTransaction_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public closeTransaction_resultStandardScheme getScheme() { + return new closeTransaction_resultStandardScheme(); + } + } + + private static class closeTransaction_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, closeTransaction_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot, closeTransaction_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBool(struct.success); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class closeTransaction_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public closeTransaction_resultTupleScheme getScheme() { + return new closeTransaction_resultTupleScheme(); + } + } + + private static class closeTransaction_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, closeTransaction_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + oprot.writeBool(struct.success); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, closeTransaction_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) + public static class closeFailedUpdate_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("closeFailedUpdate_args"); + + private static final org.apache.thrift.protocol.TField UPDATE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("updateId", org.apache.thrift.protocol.TType.I64, (short)1); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new closeFailedUpdate_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new closeFailedUpdate_argsTupleSchemeFactory(); + + public long updateId; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + UPDATE_ID((short)1, "updateId"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // UPDATE_ID + return UPDATE_ID; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + @Override + public short getThriftFieldId() { + return _thriftId; + } + + @Override + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __UPDATEID_ISSET_ID = 0; + private byte __isset_bitfield = 0; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.UPDATE_ID, new org.apache.thrift.meta_data.FieldMetaData("updateId", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(closeFailedUpdate_args.class, metaDataMap); + } + + public closeFailedUpdate_args() { + } + + public closeFailedUpdate_args( + long updateId) + { + this(); + this.updateId = updateId; + setUpdateIdIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public closeFailedUpdate_args(closeFailedUpdate_args other) { + __isset_bitfield = other.__isset_bitfield; + this.updateId = other.updateId; + } + + @Override + public closeFailedUpdate_args deepCopy() { + return new closeFailedUpdate_args(this); + } + + @Override + public void clear() { + setUpdateIdIsSet(false); + this.updateId = 0; + } + + public long getUpdateId() { + return this.updateId; + } + + public closeFailedUpdate_args setUpdateId(long updateId) { + this.updateId = updateId; + setUpdateIdIsSet(true); + return this; + } + + public void unsetUpdateId() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __UPDATEID_ISSET_ID); + } + + /** Returns true if field updateId is set (has been assigned a value) and false otherwise */ + public boolean isSetUpdateId() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __UPDATEID_ISSET_ID); + } + + public void setUpdateIdIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __UPDATEID_ISSET_ID, value); + } + + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case UPDATE_ID: + if (value == null) { + unsetUpdateId(); + } else { + setUpdateId((java.lang.Long)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case UPDATE_ID: + return getUpdateId(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case UPDATE_ID: + return isSetUpdateId(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that instanceof closeFailedUpdate_args) + return this.equals((closeFailedUpdate_args)that); + return false; + } + + public boolean equals(closeFailedUpdate_args that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_updateId = true; + boolean that_present_updateId = true; + if (this_present_updateId || that_present_updateId) { + if (!(this_present_updateId && that_present_updateId)) + return false; + if (this.updateId != that.updateId) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(updateId); + + return hashCode; + } + + @Override + public int compareTo(closeFailedUpdate_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.compare(isSetUpdateId(), other.isSetUpdateId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetUpdateId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.updateId, other.updateId); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + @Override + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("closeFailedUpdate_args("); + boolean first = true; + + sb.append("updateId:"); + sb.append(this.updateId); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // alas, we cannot check 'updateId' because it's a primitive and you chose the non-beans generator. + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class closeFailedUpdate_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public closeFailedUpdate_argsStandardScheme getScheme() { + return new closeFailedUpdate_argsStandardScheme(); + } + } + + private static class closeFailedUpdate_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, closeFailedUpdate_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // UPDATE_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.updateId = iprot.readI64(); + struct.setUpdateIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + if (!struct.isSetUpdateId()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'updateId' was not found in serialized data! Struct: " + toString()); + } + struct.validate(); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot, closeFailedUpdate_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(UPDATE_ID_FIELD_DESC); + oprot.writeI64(struct.updateId); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class closeFailedUpdate_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public closeFailedUpdate_argsTupleScheme getScheme() { + return new closeFailedUpdate_argsTupleScheme(); + } + } + + private static class closeFailedUpdate_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, closeFailedUpdate_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + oprot.writeI64(struct.updateId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, closeFailedUpdate_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.updateId = iprot.readI64(); + struct.setUpdateIdIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) + public static class closeFailedUpdate_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("closeFailedUpdate_result"); + + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new closeFailedUpdate_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new closeFailedUpdate_resultTupleSchemeFactory(); + + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { +; + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + @Override + public short getThriftFieldId() { + return _thriftId; + } + + @Override + public java.lang.String getFieldName() { + return _fieldName; + } + } + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(closeFailedUpdate_result.class, metaDataMap); + } + + public closeFailedUpdate_result() { + } + + /** + * Performs a deep copy on other. + */ + public closeFailedUpdate_result(closeFailedUpdate_result other) { + } + + @Override + public closeFailedUpdate_result deepCopy() { + return new closeFailedUpdate_result(this); + } + + @Override + public void clear() { + } + + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that instanceof closeFailedUpdate_result) + return this.equals((closeFailedUpdate_result)that); + return false; + } + + public boolean equals(closeFailedUpdate_result that) { + if (that == null) + return false; + if (this == that) + return true; + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + return hashCode; + } + + @Override + public int compareTo(closeFailedUpdate_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + return 0; + } + + @org.apache.thrift.annotation.Nullable + @Override + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("closeFailedUpdate_result("); + boolean first = true; + + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class closeFailedUpdate_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public closeFailedUpdate_resultStandardScheme getScheme() { + return new closeFailedUpdate_resultStandardScheme(); + } + } + + private static class closeFailedUpdate_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, closeFailedUpdate_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot, closeFailedUpdate_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class closeFailedUpdate_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public closeFailedUpdate_resultTupleScheme getScheme() { + return new closeFailedUpdate_resultTupleScheme(); + } + } + + private static class closeFailedUpdate_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, closeFailedUpdate_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, closeFailedUpdate_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) + public static class createColumn_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createColumn_args"); + + private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField SCHEMA_FIELD_DESC = new org.apache.thrift.protocol.TField("schema", org.apache.thrift.protocol.TType.STRUCT, (short)2); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new createColumn_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new createColumn_argsTupleSchemeFactory(); + + public @org.apache.thrift.annotation.Nullable java.lang.String name; // required + public @org.apache.thrift.annotation.Nullable ColumnSchema schema; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + NAME((short)1, "name"), + SCHEMA((short)2, "schema"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // NAME + return NAME; + case 2: // SCHEMA + return SCHEMA; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + @Override + public short getThriftFieldId() { + return _thriftId; + } + + @Override + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.SCHEMA, new org.apache.thrift.meta_data.FieldMetaData("schema", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ColumnSchema.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createColumn_args.class, metaDataMap); + } + + public createColumn_args() { + } + + public createColumn_args( + java.lang.String name, + ColumnSchema schema) + { + this(); + this.name = name; + this.schema = schema; + } + + /** + * Performs a deep copy on other. + */ + public createColumn_args(createColumn_args other) { + if (other.isSetName()) { + this.name = other.name; + } + if (other.isSetSchema()) { + this.schema = new ColumnSchema(other.schema); + } + } + + @Override + public createColumn_args deepCopy() { + return new createColumn_args(this); + } + + @Override + public void clear() { + this.name = null; + this.schema = null; + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getName() { + return this.name; + } + + public createColumn_args setName(@org.apache.thrift.annotation.Nullable java.lang.String name) { + this.name = name; + return this; + } + + public void unsetName() { + this.name = null; + } + + /** Returns true if field name is set (has been assigned a value) and false otherwise */ + public boolean isSetName() { + return this.name != null; + } + + public void setNameIsSet(boolean value) { + if (!value) { + this.name = null; + } + } + + @org.apache.thrift.annotation.Nullable + public ColumnSchema getSchema() { + return this.schema; + } + + public createColumn_args setSchema(@org.apache.thrift.annotation.Nullable ColumnSchema schema) { + this.schema = schema; + return this; + } + + public void unsetSchema() { + this.schema = null; + } + + /** Returns true if field schema is set (has been assigned a value) and false otherwise */ + public boolean isSetSchema() { + return this.schema != null; + } + + public void setSchemaIsSet(boolean value) { + if (!value) { + this.schema = null; + } + } + + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case NAME: + if (value == null) { + unsetName(); + } else { + setName((java.lang.String)value); + } + break; + + case SCHEMA: + if (value == null) { + unsetSchema(); + } else { + setSchema((ColumnSchema)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case NAME: + return getName(); + + case SCHEMA: + return getSchema(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case NAME: + return isSetName(); + case SCHEMA: + return isSetSchema(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that instanceof createColumn_args) + return this.equals((createColumn_args)that); + return false; + } + + public boolean equals(createColumn_args that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_name = true && this.isSetName(); + boolean that_present_name = true && that.isSetName(); + if (this_present_name || that_present_name) { + if (!(this_present_name && that_present_name)) + return false; + if (!this.name.equals(that.name)) + return false; + } + + boolean this_present_schema = true && this.isSetSchema(); + boolean that_present_schema = true && that.isSetSchema(); + if (this_present_schema || that_present_schema) { + if (!(this_present_schema && that_present_schema)) + return false; + if (!this.schema.equals(that.schema)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetName()) ? 131071 : 524287); + if (isSetName()) + hashCode = hashCode * 8191 + name.hashCode(); + + hashCode = hashCode * 8191 + ((isSetSchema()) ? 131071 : 524287); + if (isSetSchema()) + hashCode = hashCode * 8191 + schema.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(createColumn_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.compare(isSetName(), other.isSetName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, other.name); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetSchema(), other.isSetSchema()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSchema()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.schema, other.schema); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + @Override + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("createColumn_args("); + boolean first = true; + + sb.append("name:"); + if (this.name == null) { + sb.append("null"); + } else { + sb.append(this.name); + } + first = false; + if (!first) sb.append(", "); + sb.append("schema:"); + if (this.schema == null) { + sb.append("null"); + } else { + sb.append(this.schema); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (name == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'name' was not present! Struct: " + toString()); + } + if (schema == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'schema' was not present! Struct: " + toString()); + } + // check for sub-struct validity + if (schema != null) { + schema.validate(); + } + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class createColumn_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public createColumn_argsStandardScheme getScheme() { + return new createColumn_argsStandardScheme(); + } + } + + private static class createColumn_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, createColumn_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.name = iprot.readString(); + struct.setNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // SCHEMA + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.schema = new ColumnSchema(); + struct.schema.read(iprot); + struct.setSchemaIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot, createColumn_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.name != null) { + oprot.writeFieldBegin(NAME_FIELD_DESC); + oprot.writeString(struct.name); + oprot.writeFieldEnd(); + } + if (struct.schema != null) { + oprot.writeFieldBegin(SCHEMA_FIELD_DESC); + struct.schema.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class createColumn_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public createColumn_argsTupleScheme getScheme() { + return new createColumn_argsTupleScheme(); + } + } + + private static class createColumn_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, createColumn_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + oprot.writeString(struct.name); + struct.schema.write(oprot); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, createColumn_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.name = iprot.readString(); + struct.setNameIsSet(true); + struct.schema = new ColumnSchema(); + struct.schema.read(iprot); + struct.setSchemaIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) + public static class createColumn_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createColumn_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I64, (short)0); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new createColumn_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new createColumn_resultTupleSchemeFactory(); + + public long success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + @Override + public short getThriftFieldId() { + return _thriftId; + } + + @Override + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __SUCCESS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createColumn_result.class, metaDataMap); + } + + public createColumn_result() { + } + + public createColumn_result( + long success) + { + this(); + this.success = success; + setSuccessIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public createColumn_result(createColumn_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + } + + @Override + public createColumn_result deepCopy() { + return new createColumn_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = 0; + } + + public long getSuccess() { + return this.success; + } + + public createColumn_result setSuccess(long success) { + this.success = success; + setSuccessIsSet(true); + return this; + } + + public void unsetSuccess() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + } + + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((java.lang.Long)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that instanceof createColumn_result) + return this.equals((createColumn_result)that); + return false; + } + + public boolean equals(createColumn_result that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(success); + + return hashCode; + } + + @Override + public int compareTo(createColumn_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + @Override + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("createColumn_result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class createColumn_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public createColumn_resultStandardScheme getScheme() { + return new createColumn_resultStandardScheme(); + } + } + + private static class createColumn_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, createColumn_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.success = iprot.readI64(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot, createColumn_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeI64(struct.success); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class createColumn_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public createColumn_resultTupleScheme getScheme() { + return new createColumn_resultTupleScheme(); + } + } + + private static class createColumn_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, createColumn_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + oprot.writeI64(struct.success); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, createColumn_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = iprot.readI64(); + struct.setSuccessIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) + public static class deleteColumn_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteColumn_args"); + + private static final org.apache.thrift.protocol.TField COLUMN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("columnId", org.apache.thrift.protocol.TType.I64, (short)1); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new deleteColumn_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new deleteColumn_argsTupleSchemeFactory(); + + public long columnId; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + COLUMN_ID((short)1, "columnId"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // COLUMN_ID + return COLUMN_ID; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + @Override + public short getThriftFieldId() { + return _thriftId; + } + + @Override + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __COLUMNID_ISSET_ID = 0; + private byte __isset_bitfield = 0; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.COLUMN_ID, new org.apache.thrift.meta_data.FieldMetaData("columnId", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteColumn_args.class, metaDataMap); + } + + public deleteColumn_args() { + } + + public deleteColumn_args( + long columnId) + { + this(); + this.columnId = columnId; + setColumnIdIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public deleteColumn_args(deleteColumn_args other) { + __isset_bitfield = other.__isset_bitfield; + this.columnId = other.columnId; + } + + @Override + public deleteColumn_args deepCopy() { + return new deleteColumn_args(this); + } + + @Override + public void clear() { + setColumnIdIsSet(false); + this.columnId = 0; + } + + public long getColumnId() { + return this.columnId; + } + + public deleteColumn_args setColumnId(long columnId) { + this.columnId = columnId; + setColumnIdIsSet(true); + return this; + } + + public void unsetColumnId() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __COLUMNID_ISSET_ID); + } + + /** Returns true if field columnId is set (has been assigned a value) and false otherwise */ + public boolean isSetColumnId() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __COLUMNID_ISSET_ID); + } + + public void setColumnIdIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __COLUMNID_ISSET_ID, value); + } + + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case COLUMN_ID: + if (value == null) { + unsetColumnId(); + } else { + setColumnId((java.lang.Long)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case COLUMN_ID: + return getColumnId(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case COLUMN_ID: + return isSetColumnId(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that instanceof deleteColumn_args) + return this.equals((deleteColumn_args)that); + return false; + } + + public boolean equals(deleteColumn_args that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_columnId = true; + boolean that_present_columnId = true; + if (this_present_columnId || that_present_columnId) { + if (!(this_present_columnId && that_present_columnId)) + return false; + if (this.columnId != that.columnId) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(columnId); + + return hashCode; + } + + @Override + public int compareTo(deleteColumn_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.compare(isSetColumnId(), other.isSetColumnId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetColumnId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columnId, other.columnId); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + @Override + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("deleteColumn_args("); + boolean first = true; + + sb.append("columnId:"); + sb.append(this.columnId); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // alas, we cannot check 'columnId' because it's a primitive and you chose the non-beans generator. + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class deleteColumn_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public deleteColumn_argsStandardScheme getScheme() { + return new deleteColumn_argsStandardScheme(); + } + } + + private static class deleteColumn_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, deleteColumn_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // COLUMN_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.columnId = iprot.readI64(); + struct.setColumnIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + if (!struct.isSetColumnId()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'columnId' was not found in serialized data! Struct: " + toString()); + } + struct.validate(); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot, deleteColumn_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(COLUMN_ID_FIELD_DESC); + oprot.writeI64(struct.columnId); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class deleteColumn_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public deleteColumn_argsTupleScheme getScheme() { + return new deleteColumn_argsTupleScheme(); + } + } + + private static class deleteColumn_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, deleteColumn_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + oprot.writeI64(struct.columnId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, deleteColumn_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.columnId = iprot.readI64(); + struct.setColumnIdIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) + public static class deleteColumn_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteColumn_result"); + + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new deleteColumn_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new deleteColumn_resultTupleSchemeFactory(); + + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { +; + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + @Override + public short getThriftFieldId() { + return _thriftId; + } + + @Override + public java.lang.String getFieldName() { + return _fieldName; + } + } + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteColumn_result.class, metaDataMap); + } + + public deleteColumn_result() { + } + + /** + * Performs a deep copy on other. + */ + public deleteColumn_result(deleteColumn_result other) { + } + + @Override + public deleteColumn_result deepCopy() { + return new deleteColumn_result(this); + } + + @Override + public void clear() { + } + + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that instanceof deleteColumn_result) + return this.equals((deleteColumn_result)that); + return false; + } + + public boolean equals(deleteColumn_result that) { + if (that == null) + return false; + if (this == that) + return true; + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + return hashCode; + } + + @Override + public int compareTo(deleteColumn_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + return 0; + } + + @org.apache.thrift.annotation.Nullable + @Override + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("deleteColumn_result("); + boolean first = true; + + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class deleteColumn_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public deleteColumn_resultStandardScheme getScheme() { + return new deleteColumn_resultStandardScheme(); + } + } + + private static class deleteColumn_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, deleteColumn_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot, deleteColumn_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class deleteColumn_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public deleteColumn_resultTupleScheme getScheme() { + return new deleteColumn_resultTupleScheme(); + } + } + + private static class deleteColumn_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, deleteColumn_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, deleteColumn_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) + public static class getColumnId_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getColumnId_args"); + + private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)1); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getColumnId_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getColumnId_argsTupleSchemeFactory(); + + public @org.apache.thrift.annotation.Nullable java.lang.String name; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + NAME((short)1, "name"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // NAME + return NAME; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + @Override + public short getThriftFieldId() { + return _thriftId; + } + + @Override + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getColumnId_args.class, metaDataMap); + } + + public getColumnId_args() { + } + + public getColumnId_args( + java.lang.String name) + { + this(); + this.name = name; + } + + /** + * Performs a deep copy on other. + */ + public getColumnId_args(getColumnId_args other) { + if (other.isSetName()) { + this.name = other.name; + } + } + + @Override + public getColumnId_args deepCopy() { + return new getColumnId_args(this); + } + + @Override + public void clear() { + this.name = null; + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getName() { + return this.name; + } + + public getColumnId_args setName(@org.apache.thrift.annotation.Nullable java.lang.String name) { + this.name = name; + return this; + } + + public void unsetName() { + this.name = null; + } + + /** Returns true if field name is set (has been assigned a value) and false otherwise */ + public boolean isSetName() { + return this.name != null; + } + + public void setNameIsSet(boolean value) { + if (!value) { + this.name = null; + } + } + + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case NAME: + if (value == null) { + unsetName(); + } else { + setName((java.lang.String)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case NAME: + return getName(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case NAME: + return isSetName(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that instanceof getColumnId_args) + return this.equals((getColumnId_args)that); + return false; + } + + public boolean equals(getColumnId_args that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_name = true && this.isSetName(); + boolean that_present_name = true && that.isSetName(); + if (this_present_name || that_present_name) { + if (!(this_present_name && that_present_name)) + return false; + if (!this.name.equals(that.name)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetName()) ? 131071 : 524287); + if (isSetName()) + hashCode = hashCode * 8191 + name.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(getColumnId_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.compare(isSetName(), other.isSetName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, other.name); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + @Override + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("getColumnId_args("); + boolean first = true; + + sb.append("name:"); + if (this.name == null) { + sb.append("null"); + } else { + sb.append(this.name); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (name == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'name' was not present! Struct: " + toString()); + } + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class getColumnId_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public getColumnId_argsStandardScheme getScheme() { + return new getColumnId_argsStandardScheme(); + } + } + + private static class getColumnId_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, getColumnId_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.name = iprot.readString(); + struct.setNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot, getColumnId_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.name != null) { + oprot.writeFieldBegin(NAME_FIELD_DESC); + oprot.writeString(struct.name); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getColumnId_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public getColumnId_argsTupleScheme getScheme() { + return new getColumnId_argsTupleScheme(); + } + } + + private static class getColumnId_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getColumnId_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + oprot.writeString(struct.name); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getColumnId_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.name = iprot.readString(); + struct.setNameIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) + public static class getColumnId_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getColumnId_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I64, (short)0); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getColumnId_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getColumnId_resultTupleSchemeFactory(); + + public long success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + @Override + public short getThriftFieldId() { + return _thriftId; + } + + @Override + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __SUCCESS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getColumnId_result.class, metaDataMap); + } + + public getColumnId_result() { + } + + public getColumnId_result( + long success) + { + this(); + this.success = success; + setSuccessIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public getColumnId_result(getColumnId_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + } + + @Override + public getColumnId_result deepCopy() { + return new getColumnId_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = 0; + } + + public long getSuccess() { + return this.success; + } + + public getColumnId_result setSuccess(long success) { + this.success = success; + setSuccessIsSet(true); + return this; + } + + public void unsetSuccess() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + } + + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((java.lang.Long)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that instanceof getColumnId_result) + return this.equals((getColumnId_result)that); + return false; + } + + public boolean equals(getColumnId_result that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(success); + + return hashCode; + } + + @Override + public int compareTo(getColumnId_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + @Override + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("getColumnId_result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class getColumnId_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public getColumnId_resultStandardScheme getScheme() { + return new getColumnId_resultStandardScheme(); + } + } + + private static class getColumnId_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, getColumnId_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.success = iprot.readI64(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot, getColumnId_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeI64(struct.success); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getColumnId_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public getColumnId_resultTupleScheme getScheme() { + return new getColumnId_resultTupleScheme(); + } + } + + private static class getColumnId_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getColumnId_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + oprot.writeI64(struct.success); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getColumnId_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = iprot.readI64(); + struct.setSuccessIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) + public static class put_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("put_args"); + + private static final org.apache.thrift.protocol.TField TRANSACTION_OR_UPDATE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("transactionOrUpdateId", org.apache.thrift.protocol.TType.I64, (short)1); + private static final org.apache.thrift.protocol.TField COLUMN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("columnId", org.apache.thrift.protocol.TType.I64, (short)2); + private static final org.apache.thrift.protocol.TField KEYS_FIELD_DESC = new org.apache.thrift.protocol.TField("keys", org.apache.thrift.protocol.TType.LIST, (short)3); + private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.STRING, (short)4); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new put_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new put_argsTupleSchemeFactory(); + + public long transactionOrUpdateId; // required + public long columnId; // required + public @org.apache.thrift.annotation.Nullable java.util.List keys; // required + public @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer value; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + TRANSACTION_OR_UPDATE_ID((short)1, "transactionOrUpdateId"), + COLUMN_ID((short)2, "columnId"), + KEYS((short)3, "keys"), + VALUE((short)4, "value"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // TRANSACTION_OR_UPDATE_ID + return TRANSACTION_OR_UPDATE_ID; + case 2: // COLUMN_ID + return COLUMN_ID; + case 3: // KEYS + return KEYS; + case 4: // VALUE + return VALUE; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + @Override + public short getThriftFieldId() { + return _thriftId; + } + + @Override + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __TRANSACTIONORUPDATEID_ISSET_ID = 0; + private static final int __COLUMNID_ISSET_ID = 1; + private byte __isset_bitfield = 0; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.TRANSACTION_OR_UPDATE_ID, new org.apache.thrift.meta_data.FieldMetaData("transactionOrUpdateId", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.COLUMN_ID, new org.apache.thrift.meta_data.FieldMetaData("columnId", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.KEYS, new org.apache.thrift.meta_data.FieldMetaData("keys", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)))); + tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(put_args.class, metaDataMap); + } + + public put_args() { + } + + public put_args( + long transactionOrUpdateId, + long columnId, + java.util.List keys, + java.nio.ByteBuffer value) + { + this(); + this.transactionOrUpdateId = transactionOrUpdateId; + setTransactionOrUpdateIdIsSet(true); + this.columnId = columnId; + setColumnIdIsSet(true); + this.keys = keys; + this.value = org.apache.thrift.TBaseHelper.copyBinary(value); + } + + /** + * Performs a deep copy on other. + */ + public put_args(put_args other) { + __isset_bitfield = other.__isset_bitfield; + this.transactionOrUpdateId = other.transactionOrUpdateId; + this.columnId = other.columnId; + if (other.isSetKeys()) { + java.util.List __this__keys = new java.util.ArrayList(other.keys); + this.keys = __this__keys; + } + if (other.isSetValue()) { + this.value = org.apache.thrift.TBaseHelper.copyBinary(other.value); + } + } + + @Override + public put_args deepCopy() { + return new put_args(this); + } + + @Override + public void clear() { + setTransactionOrUpdateIdIsSet(false); + this.transactionOrUpdateId = 0; + setColumnIdIsSet(false); + this.columnId = 0; + this.keys = null; + this.value = null; + } + + public long getTransactionOrUpdateId() { + return this.transactionOrUpdateId; + } + + public put_args setTransactionOrUpdateId(long transactionOrUpdateId) { + this.transactionOrUpdateId = transactionOrUpdateId; + setTransactionOrUpdateIdIsSet(true); + return this; + } + + public void unsetTransactionOrUpdateId() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TRANSACTIONORUPDATEID_ISSET_ID); + } + + /** Returns true if field transactionOrUpdateId is set (has been assigned a value) and false otherwise */ + public boolean isSetTransactionOrUpdateId() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TRANSACTIONORUPDATEID_ISSET_ID); + } + + public void setTransactionOrUpdateIdIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TRANSACTIONORUPDATEID_ISSET_ID, value); + } + + public long getColumnId() { + return this.columnId; + } + + public put_args setColumnId(long columnId) { + this.columnId = columnId; + setColumnIdIsSet(true); + return this; + } + + public void unsetColumnId() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __COLUMNID_ISSET_ID); + } + + /** Returns true if field columnId is set (has been assigned a value) and false otherwise */ + public boolean isSetColumnId() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __COLUMNID_ISSET_ID); + } + + public void setColumnIdIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __COLUMNID_ISSET_ID, value); + } + + public int getKeysSize() { + return (this.keys == null) ? 0 : this.keys.size(); + } + + @org.apache.thrift.annotation.Nullable + public java.util.Iterator getKeysIterator() { + return (this.keys == null) ? null : this.keys.iterator(); + } + + public void addToKeys(java.nio.ByteBuffer elem) { + if (this.keys == null) { + this.keys = new java.util.ArrayList(); + } + this.keys.add(elem); + } + + @org.apache.thrift.annotation.Nullable + public java.util.List getKeys() { + return this.keys; + } + + public put_args setKeys(@org.apache.thrift.annotation.Nullable java.util.List keys) { + this.keys = keys; + return this; + } + + public void unsetKeys() { + this.keys = null; + } + + /** Returns true if field keys is set (has been assigned a value) and false otherwise */ + public boolean isSetKeys() { + return this.keys != null; + } + + public void setKeysIsSet(boolean value) { + if (!value) { + this.keys = null; + } + } + + public byte[] getValue() { + setValue(org.apache.thrift.TBaseHelper.rightSize(value)); + return value == null ? null : value.array(); + } + + public java.nio.ByteBuffer bufferForValue() { + return org.apache.thrift.TBaseHelper.copyBinary(value); + } + + public put_args setValue(byte[] value) { + this.value = value == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(value.clone()); + return this; + } + + public put_args setValue(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer value) { + this.value = org.apache.thrift.TBaseHelper.copyBinary(value); + return this; + } + + public void unsetValue() { + this.value = null; + } + + /** Returns true if field value is set (has been assigned a value) and false otherwise */ + public boolean isSetValue() { + return this.value != null; + } + + public void setValueIsSet(boolean value) { + if (!value) { + this.value = null; + } + } + + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case TRANSACTION_OR_UPDATE_ID: + if (value == null) { + unsetTransactionOrUpdateId(); + } else { + setTransactionOrUpdateId((java.lang.Long)value); + } + break; + + case COLUMN_ID: + if (value == null) { + unsetColumnId(); + } else { + setColumnId((java.lang.Long)value); + } + break; + + case KEYS: + if (value == null) { + unsetKeys(); + } else { + setKeys((java.util.List)value); + } + break; + + case VALUE: + if (value == null) { + unsetValue(); + } else { + if (value instanceof byte[]) { + setValue((byte[])value); + } else { + setValue((java.nio.ByteBuffer)value); + } + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case TRANSACTION_OR_UPDATE_ID: + return getTransactionOrUpdateId(); + + case COLUMN_ID: + return getColumnId(); + + case KEYS: + return getKeys(); + + case VALUE: + return getValue(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case TRANSACTION_OR_UPDATE_ID: + return isSetTransactionOrUpdateId(); + case COLUMN_ID: + return isSetColumnId(); + case KEYS: + return isSetKeys(); + case VALUE: + return isSetValue(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that instanceof put_args) + return this.equals((put_args)that); + return false; + } + + public boolean equals(put_args that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_transactionOrUpdateId = true; + boolean that_present_transactionOrUpdateId = true; + if (this_present_transactionOrUpdateId || that_present_transactionOrUpdateId) { + if (!(this_present_transactionOrUpdateId && that_present_transactionOrUpdateId)) + return false; + if (this.transactionOrUpdateId != that.transactionOrUpdateId) + return false; + } + + boolean this_present_columnId = true; + boolean that_present_columnId = true; + if (this_present_columnId || that_present_columnId) { + if (!(this_present_columnId && that_present_columnId)) + return false; + if (this.columnId != that.columnId) + return false; + } + + boolean this_present_keys = true && this.isSetKeys(); + boolean that_present_keys = true && that.isSetKeys(); + if (this_present_keys || that_present_keys) { + if (!(this_present_keys && that_present_keys)) + return false; + if (!this.keys.equals(that.keys)) + return false; + } + + boolean this_present_value = true && this.isSetValue(); + boolean that_present_value = true && that.isSetValue(); + if (this_present_value || that_present_value) { + if (!(this_present_value && that_present_value)) + return false; + if (!this.value.equals(that.value)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(transactionOrUpdateId); + + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(columnId); + + hashCode = hashCode * 8191 + ((isSetKeys()) ? 131071 : 524287); + if (isSetKeys()) + hashCode = hashCode * 8191 + keys.hashCode(); + + hashCode = hashCode * 8191 + ((isSetValue()) ? 131071 : 524287); + if (isSetValue()) + hashCode = hashCode * 8191 + value.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(put_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.compare(isSetTransactionOrUpdateId(), other.isSetTransactionOrUpdateId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTransactionOrUpdateId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transactionOrUpdateId, other.transactionOrUpdateId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetColumnId(), other.isSetColumnId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetColumnId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columnId, other.columnId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetKeys(), other.isSetKeys()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetKeys()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.keys, other.keys); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetValue(), other.isSetValue()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValue()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + @Override + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("put_args("); + boolean first = true; + + sb.append("transactionOrUpdateId:"); + sb.append(this.transactionOrUpdateId); + first = false; + if (!first) sb.append(", "); + sb.append("columnId:"); + sb.append(this.columnId); + first = false; + if (!first) sb.append(", "); + sb.append("keys:"); + if (this.keys == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.keys, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("value:"); + if (this.value == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.value, sb); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // alas, we cannot check 'transactionOrUpdateId' because it's a primitive and you chose the non-beans generator. + // alas, we cannot check 'columnId' because it's a primitive and you chose the non-beans generator. + if (keys == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'keys' was not present! Struct: " + toString()); + } + if (value == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'value' was not present! Struct: " + toString()); + } + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class put_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public put_argsStandardScheme getScheme() { + return new put_argsStandardScheme(); + } + } + + private static class put_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, put_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // TRANSACTION_OR_UPDATE_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.transactionOrUpdateId = iprot.readI64(); + struct.setTransactionOrUpdateIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // COLUMN_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.columnId = iprot.readI64(); + struct.setColumnIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // KEYS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list16 = iprot.readListBegin(); + struct.keys = new java.util.ArrayList(_list16.size); + @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem17; + for (int _i18 = 0; _i18 < _list16.size; ++_i18) + { + _elem17 = iprot.readBinary(); + struct.keys.add(_elem17); + } + iprot.readListEnd(); + } + struct.setKeysIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // VALUE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.value = iprot.readBinary(); + struct.setValueIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + if (!struct.isSetTransactionOrUpdateId()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'transactionOrUpdateId' was not found in serialized data! Struct: " + toString()); + } + if (!struct.isSetColumnId()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'columnId' was not found in serialized data! Struct: " + toString()); + } + struct.validate(); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot, put_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(TRANSACTION_OR_UPDATE_ID_FIELD_DESC); + oprot.writeI64(struct.transactionOrUpdateId); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(COLUMN_ID_FIELD_DESC); + oprot.writeI64(struct.columnId); + oprot.writeFieldEnd(); + if (struct.keys != null) { + oprot.writeFieldBegin(KEYS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.keys.size())); + for (java.nio.ByteBuffer _iter19 : struct.keys) + { + oprot.writeBinary(_iter19); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.value != null) { + oprot.writeFieldBegin(VALUE_FIELD_DESC); + oprot.writeBinary(struct.value); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class put_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public put_argsTupleScheme getScheme() { + return new put_argsTupleScheme(); + } + } + + private static class put_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, put_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + oprot.writeI64(struct.transactionOrUpdateId); + oprot.writeI64(struct.columnId); + { + oprot.writeI32(struct.keys.size()); + for (java.nio.ByteBuffer _iter20 : struct.keys) + { + oprot.writeBinary(_iter20); + } + } + oprot.writeBinary(struct.value); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, put_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.transactionOrUpdateId = iprot.readI64(); + struct.setTransactionOrUpdateIdIsSet(true); + struct.columnId = iprot.readI64(); + struct.setColumnIdIsSet(true); + { + org.apache.thrift.protocol.TList _list21 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRING); + struct.keys = new java.util.ArrayList(_list21.size); + @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem22; + for (int _i23 = 0; _i23 < _list21.size; ++_i23) + { + _elem22 = iprot.readBinary(); + struct.keys.add(_elem22); + } + } + struct.setKeysIsSet(true); + struct.value = iprot.readBinary(); + struct.setValueIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) + public static class putGetPrevious_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("putGetPrevious_args"); + + private static final org.apache.thrift.protocol.TField TRANSACTION_OR_UPDATE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("transactionOrUpdateId", org.apache.thrift.protocol.TType.I64, (short)1); + private static final org.apache.thrift.protocol.TField COLUMN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("columnId", org.apache.thrift.protocol.TType.I64, (short)2); + private static final org.apache.thrift.protocol.TField KEYS_FIELD_DESC = new org.apache.thrift.protocol.TField("keys", org.apache.thrift.protocol.TType.LIST, (short)3); + private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.STRING, (short)4); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new putGetPrevious_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new putGetPrevious_argsTupleSchemeFactory(); + + public long transactionOrUpdateId; // required + public long columnId; // required + public @org.apache.thrift.annotation.Nullable java.util.List keys; // required + public @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer value; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + TRANSACTION_OR_UPDATE_ID((short)1, "transactionOrUpdateId"), + COLUMN_ID((short)2, "columnId"), + KEYS((short)3, "keys"), + VALUE((short)4, "value"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // TRANSACTION_OR_UPDATE_ID + return TRANSACTION_OR_UPDATE_ID; + case 2: // COLUMN_ID + return COLUMN_ID; + case 3: // KEYS + return KEYS; + case 4: // VALUE + return VALUE; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + @Override + public short getThriftFieldId() { + return _thriftId; + } + + @Override + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __TRANSACTIONORUPDATEID_ISSET_ID = 0; + private static final int __COLUMNID_ISSET_ID = 1; + private byte __isset_bitfield = 0; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.TRANSACTION_OR_UPDATE_ID, new org.apache.thrift.meta_data.FieldMetaData("transactionOrUpdateId", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.COLUMN_ID, new org.apache.thrift.meta_data.FieldMetaData("columnId", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.KEYS, new org.apache.thrift.meta_data.FieldMetaData("keys", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)))); + tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(putGetPrevious_args.class, metaDataMap); + } + + public putGetPrevious_args() { + } + + public putGetPrevious_args( + long transactionOrUpdateId, + long columnId, + java.util.List keys, + java.nio.ByteBuffer value) + { + this(); + this.transactionOrUpdateId = transactionOrUpdateId; + setTransactionOrUpdateIdIsSet(true); + this.columnId = columnId; + setColumnIdIsSet(true); + this.keys = keys; + this.value = org.apache.thrift.TBaseHelper.copyBinary(value); + } + + /** + * Performs a deep copy on other. + */ + public putGetPrevious_args(putGetPrevious_args other) { + __isset_bitfield = other.__isset_bitfield; + this.transactionOrUpdateId = other.transactionOrUpdateId; + this.columnId = other.columnId; + if (other.isSetKeys()) { + java.util.List __this__keys = new java.util.ArrayList(other.keys); + this.keys = __this__keys; + } + if (other.isSetValue()) { + this.value = org.apache.thrift.TBaseHelper.copyBinary(other.value); + } + } + + @Override + public putGetPrevious_args deepCopy() { + return new putGetPrevious_args(this); + } + + @Override + public void clear() { + setTransactionOrUpdateIdIsSet(false); + this.transactionOrUpdateId = 0; + setColumnIdIsSet(false); + this.columnId = 0; + this.keys = null; + this.value = null; + } + + public long getTransactionOrUpdateId() { + return this.transactionOrUpdateId; + } + + public putGetPrevious_args setTransactionOrUpdateId(long transactionOrUpdateId) { + this.transactionOrUpdateId = transactionOrUpdateId; + setTransactionOrUpdateIdIsSet(true); + return this; + } + + public void unsetTransactionOrUpdateId() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TRANSACTIONORUPDATEID_ISSET_ID); + } + + /** Returns true if field transactionOrUpdateId is set (has been assigned a value) and false otherwise */ + public boolean isSetTransactionOrUpdateId() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TRANSACTIONORUPDATEID_ISSET_ID); + } + + public void setTransactionOrUpdateIdIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TRANSACTIONORUPDATEID_ISSET_ID, value); + } + + public long getColumnId() { + return this.columnId; + } + + public putGetPrevious_args setColumnId(long columnId) { + this.columnId = columnId; + setColumnIdIsSet(true); + return this; + } + + public void unsetColumnId() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __COLUMNID_ISSET_ID); + } + + /** Returns true if field columnId is set (has been assigned a value) and false otherwise */ + public boolean isSetColumnId() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __COLUMNID_ISSET_ID); + } + + public void setColumnIdIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __COLUMNID_ISSET_ID, value); + } + + public int getKeysSize() { + return (this.keys == null) ? 0 : this.keys.size(); + } + + @org.apache.thrift.annotation.Nullable + public java.util.Iterator getKeysIterator() { + return (this.keys == null) ? null : this.keys.iterator(); + } + + public void addToKeys(java.nio.ByteBuffer elem) { + if (this.keys == null) { + this.keys = new java.util.ArrayList(); + } + this.keys.add(elem); + } + + @org.apache.thrift.annotation.Nullable + public java.util.List getKeys() { + return this.keys; + } + + public putGetPrevious_args setKeys(@org.apache.thrift.annotation.Nullable java.util.List keys) { + this.keys = keys; + return this; + } + + public void unsetKeys() { + this.keys = null; + } + + /** Returns true if field keys is set (has been assigned a value) and false otherwise */ + public boolean isSetKeys() { + return this.keys != null; + } + + public void setKeysIsSet(boolean value) { + if (!value) { + this.keys = null; + } + } + + public byte[] getValue() { + setValue(org.apache.thrift.TBaseHelper.rightSize(value)); + return value == null ? null : value.array(); + } + + public java.nio.ByteBuffer bufferForValue() { + return org.apache.thrift.TBaseHelper.copyBinary(value); + } + + public putGetPrevious_args setValue(byte[] value) { + this.value = value == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(value.clone()); + return this; + } + + public putGetPrevious_args setValue(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer value) { + this.value = org.apache.thrift.TBaseHelper.copyBinary(value); + return this; + } + + public void unsetValue() { + this.value = null; + } + + /** Returns true if field value is set (has been assigned a value) and false otherwise */ + public boolean isSetValue() { + return this.value != null; + } + + public void setValueIsSet(boolean value) { + if (!value) { + this.value = null; + } + } + + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case TRANSACTION_OR_UPDATE_ID: + if (value == null) { + unsetTransactionOrUpdateId(); + } else { + setTransactionOrUpdateId((java.lang.Long)value); + } + break; + + case COLUMN_ID: + if (value == null) { + unsetColumnId(); + } else { + setColumnId((java.lang.Long)value); + } + break; + + case KEYS: + if (value == null) { + unsetKeys(); + } else { + setKeys((java.util.List)value); + } + break; + + case VALUE: + if (value == null) { + unsetValue(); + } else { + if (value instanceof byte[]) { + setValue((byte[])value); + } else { + setValue((java.nio.ByteBuffer)value); + } + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case TRANSACTION_OR_UPDATE_ID: + return getTransactionOrUpdateId(); + + case COLUMN_ID: + return getColumnId(); + + case KEYS: + return getKeys(); + + case VALUE: + return getValue(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case TRANSACTION_OR_UPDATE_ID: + return isSetTransactionOrUpdateId(); + case COLUMN_ID: + return isSetColumnId(); + case KEYS: + return isSetKeys(); + case VALUE: + return isSetValue(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that instanceof putGetPrevious_args) + return this.equals((putGetPrevious_args)that); + return false; + } + + public boolean equals(putGetPrevious_args that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_transactionOrUpdateId = true; + boolean that_present_transactionOrUpdateId = true; + if (this_present_transactionOrUpdateId || that_present_transactionOrUpdateId) { + if (!(this_present_transactionOrUpdateId && that_present_transactionOrUpdateId)) + return false; + if (this.transactionOrUpdateId != that.transactionOrUpdateId) + return false; + } + + boolean this_present_columnId = true; + boolean that_present_columnId = true; + if (this_present_columnId || that_present_columnId) { + if (!(this_present_columnId && that_present_columnId)) + return false; + if (this.columnId != that.columnId) + return false; + } + + boolean this_present_keys = true && this.isSetKeys(); + boolean that_present_keys = true && that.isSetKeys(); + if (this_present_keys || that_present_keys) { + if (!(this_present_keys && that_present_keys)) + return false; + if (!this.keys.equals(that.keys)) + return false; + } + + boolean this_present_value = true && this.isSetValue(); + boolean that_present_value = true && that.isSetValue(); + if (this_present_value || that_present_value) { + if (!(this_present_value && that_present_value)) + return false; + if (!this.value.equals(that.value)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(transactionOrUpdateId); + + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(columnId); + + hashCode = hashCode * 8191 + ((isSetKeys()) ? 131071 : 524287); + if (isSetKeys()) + hashCode = hashCode * 8191 + keys.hashCode(); + + hashCode = hashCode * 8191 + ((isSetValue()) ? 131071 : 524287); + if (isSetValue()) + hashCode = hashCode * 8191 + value.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(putGetPrevious_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.compare(isSetTransactionOrUpdateId(), other.isSetTransactionOrUpdateId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTransactionOrUpdateId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transactionOrUpdateId, other.transactionOrUpdateId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetColumnId(), other.isSetColumnId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetColumnId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columnId, other.columnId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetKeys(), other.isSetKeys()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetKeys()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.keys, other.keys); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetValue(), other.isSetValue()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValue()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + @Override + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("putGetPrevious_args("); + boolean first = true; + + sb.append("transactionOrUpdateId:"); + sb.append(this.transactionOrUpdateId); + first = false; + if (!first) sb.append(", "); + sb.append("columnId:"); + sb.append(this.columnId); + first = false; + if (!first) sb.append(", "); + sb.append("keys:"); + if (this.keys == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.keys, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("value:"); + if (this.value == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.value, sb); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // alas, we cannot check 'transactionOrUpdateId' because it's a primitive and you chose the non-beans generator. + // alas, we cannot check 'columnId' because it's a primitive and you chose the non-beans generator. + if (keys == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'keys' was not present! Struct: " + toString()); + } + if (value == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'value' was not present! Struct: " + toString()); + } + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class putGetPrevious_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public putGetPrevious_argsStandardScheme getScheme() { + return new putGetPrevious_argsStandardScheme(); + } + } + + private static class putGetPrevious_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, putGetPrevious_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // TRANSACTION_OR_UPDATE_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.transactionOrUpdateId = iprot.readI64(); + struct.setTransactionOrUpdateIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // COLUMN_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.columnId = iprot.readI64(); + struct.setColumnIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // KEYS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list24 = iprot.readListBegin(); + struct.keys = new java.util.ArrayList(_list24.size); + @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem25; + for (int _i26 = 0; _i26 < _list24.size; ++_i26) + { + _elem25 = iprot.readBinary(); + struct.keys.add(_elem25); + } + iprot.readListEnd(); + } + struct.setKeysIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // VALUE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.value = iprot.readBinary(); + struct.setValueIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + if (!struct.isSetTransactionOrUpdateId()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'transactionOrUpdateId' was not found in serialized data! Struct: " + toString()); + } + if (!struct.isSetColumnId()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'columnId' was not found in serialized data! Struct: " + toString()); + } + struct.validate(); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot, putGetPrevious_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(TRANSACTION_OR_UPDATE_ID_FIELD_DESC); + oprot.writeI64(struct.transactionOrUpdateId); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(COLUMN_ID_FIELD_DESC); + oprot.writeI64(struct.columnId); + oprot.writeFieldEnd(); + if (struct.keys != null) { + oprot.writeFieldBegin(KEYS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.keys.size())); + for (java.nio.ByteBuffer _iter27 : struct.keys) + { + oprot.writeBinary(_iter27); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.value != null) { + oprot.writeFieldBegin(VALUE_FIELD_DESC); + oprot.writeBinary(struct.value); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class putGetPrevious_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public putGetPrevious_argsTupleScheme getScheme() { + return new putGetPrevious_argsTupleScheme(); + } + } + + private static class putGetPrevious_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, putGetPrevious_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + oprot.writeI64(struct.transactionOrUpdateId); + oprot.writeI64(struct.columnId); + { + oprot.writeI32(struct.keys.size()); + for (java.nio.ByteBuffer _iter28 : struct.keys) + { + oprot.writeBinary(_iter28); + } + } + oprot.writeBinary(struct.value); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, putGetPrevious_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.transactionOrUpdateId = iprot.readI64(); + struct.setTransactionOrUpdateIdIsSet(true); + struct.columnId = iprot.readI64(); + struct.setColumnIdIsSet(true); + { + org.apache.thrift.protocol.TList _list29 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRING); + struct.keys = new java.util.ArrayList(_list29.size); + @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem30; + for (int _i31 = 0; _i31 < _list29.size; ++_i31) + { + _elem30 = iprot.readBinary(); + struct.keys.add(_elem30); + } + } + struct.setKeysIsSet(true); + struct.value = iprot.readBinary(); + struct.setValueIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) + public static class putGetPrevious_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("putGetPrevious_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new putGetPrevious_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new putGetPrevious_resultTupleSchemeFactory(); + + public @org.apache.thrift.annotation.Nullable OptionalBinary success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + @Override + public short getThriftFieldId() { + return _thriftId; + } + + @Override + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, OptionalBinary.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(putGetPrevious_result.class, metaDataMap); + } + + public putGetPrevious_result() { + } + + public putGetPrevious_result( + OptionalBinary success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public putGetPrevious_result(putGetPrevious_result other) { + if (other.isSetSuccess()) { + this.success = new OptionalBinary(other.success); + } + } + + @Override + public putGetPrevious_result deepCopy() { + return new putGetPrevious_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + @org.apache.thrift.annotation.Nullable + public OptionalBinary getSuccess() { + return this.success; + } + + public putGetPrevious_result setSuccess(@org.apache.thrift.annotation.Nullable OptionalBinary success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((OptionalBinary)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that instanceof putGetPrevious_result) + return this.equals((putGetPrevious_result)that); + return false; + } + + public boolean equals(putGetPrevious_result that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(putGetPrevious_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + @Override + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("putGetPrevious_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + if (success != null) { + success.validate(); + } + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class putGetPrevious_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public putGetPrevious_resultStandardScheme getScheme() { + return new putGetPrevious_resultStandardScheme(); + } + } + + private static class putGetPrevious_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, putGetPrevious_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.success = new OptionalBinary(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot, putGetPrevious_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + struct.success.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class putGetPrevious_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public putGetPrevious_resultTupleScheme getScheme() { + return new putGetPrevious_resultTupleScheme(); + } + } + + private static class putGetPrevious_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, putGetPrevious_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + struct.success.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, putGetPrevious_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new OptionalBinary(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) + public static class putGetDelta_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("putGetDelta_args"); + + private static final org.apache.thrift.protocol.TField TRANSACTION_OR_UPDATE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("transactionOrUpdateId", org.apache.thrift.protocol.TType.I64, (short)1); + private static final org.apache.thrift.protocol.TField COLUMN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("columnId", org.apache.thrift.protocol.TType.I64, (short)2); + private static final org.apache.thrift.protocol.TField KEYS_FIELD_DESC = new org.apache.thrift.protocol.TField("keys", org.apache.thrift.protocol.TType.LIST, (short)3); + private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.STRING, (short)4); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new putGetDelta_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new putGetDelta_argsTupleSchemeFactory(); + + public long transactionOrUpdateId; // required + public long columnId; // required + public @org.apache.thrift.annotation.Nullable java.util.List keys; // required + public @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer value; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + TRANSACTION_OR_UPDATE_ID((short)1, "transactionOrUpdateId"), + COLUMN_ID((short)2, "columnId"), + KEYS((short)3, "keys"), + VALUE((short)4, "value"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // TRANSACTION_OR_UPDATE_ID + return TRANSACTION_OR_UPDATE_ID; + case 2: // COLUMN_ID + return COLUMN_ID; + case 3: // KEYS + return KEYS; + case 4: // VALUE + return VALUE; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + @Override + public short getThriftFieldId() { + return _thriftId; + } + + @Override + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __TRANSACTIONORUPDATEID_ISSET_ID = 0; + private static final int __COLUMNID_ISSET_ID = 1; + private byte __isset_bitfield = 0; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.TRANSACTION_OR_UPDATE_ID, new org.apache.thrift.meta_data.FieldMetaData("transactionOrUpdateId", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.COLUMN_ID, new org.apache.thrift.meta_data.FieldMetaData("columnId", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.KEYS, new org.apache.thrift.meta_data.FieldMetaData("keys", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)))); + tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(putGetDelta_args.class, metaDataMap); + } + + public putGetDelta_args() { + } + + public putGetDelta_args( + long transactionOrUpdateId, + long columnId, + java.util.List keys, + java.nio.ByteBuffer value) + { + this(); + this.transactionOrUpdateId = transactionOrUpdateId; + setTransactionOrUpdateIdIsSet(true); + this.columnId = columnId; + setColumnIdIsSet(true); + this.keys = keys; + this.value = org.apache.thrift.TBaseHelper.copyBinary(value); + } + + /** + * Performs a deep copy on other. + */ + public putGetDelta_args(putGetDelta_args other) { + __isset_bitfield = other.__isset_bitfield; + this.transactionOrUpdateId = other.transactionOrUpdateId; + this.columnId = other.columnId; + if (other.isSetKeys()) { + java.util.List __this__keys = new java.util.ArrayList(other.keys); + this.keys = __this__keys; + } + if (other.isSetValue()) { + this.value = org.apache.thrift.TBaseHelper.copyBinary(other.value); + } + } + + @Override + public putGetDelta_args deepCopy() { + return new putGetDelta_args(this); + } + + @Override + public void clear() { + setTransactionOrUpdateIdIsSet(false); + this.transactionOrUpdateId = 0; + setColumnIdIsSet(false); + this.columnId = 0; + this.keys = null; + this.value = null; + } + + public long getTransactionOrUpdateId() { + return this.transactionOrUpdateId; + } + + public putGetDelta_args setTransactionOrUpdateId(long transactionOrUpdateId) { + this.transactionOrUpdateId = transactionOrUpdateId; + setTransactionOrUpdateIdIsSet(true); + return this; + } + + public void unsetTransactionOrUpdateId() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TRANSACTIONORUPDATEID_ISSET_ID); + } + + /** Returns true if field transactionOrUpdateId is set (has been assigned a value) and false otherwise */ + public boolean isSetTransactionOrUpdateId() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TRANSACTIONORUPDATEID_ISSET_ID); + } + + public void setTransactionOrUpdateIdIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TRANSACTIONORUPDATEID_ISSET_ID, value); + } + + public long getColumnId() { + return this.columnId; + } + + public putGetDelta_args setColumnId(long columnId) { + this.columnId = columnId; + setColumnIdIsSet(true); + return this; + } + + public void unsetColumnId() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __COLUMNID_ISSET_ID); + } + + /** Returns true if field columnId is set (has been assigned a value) and false otherwise */ + public boolean isSetColumnId() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __COLUMNID_ISSET_ID); + } + + public void setColumnIdIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __COLUMNID_ISSET_ID, value); + } + + public int getKeysSize() { + return (this.keys == null) ? 0 : this.keys.size(); + } + + @org.apache.thrift.annotation.Nullable + public java.util.Iterator getKeysIterator() { + return (this.keys == null) ? null : this.keys.iterator(); + } + + public void addToKeys(java.nio.ByteBuffer elem) { + if (this.keys == null) { + this.keys = new java.util.ArrayList(); + } + this.keys.add(elem); + } + + @org.apache.thrift.annotation.Nullable + public java.util.List getKeys() { + return this.keys; + } + + public putGetDelta_args setKeys(@org.apache.thrift.annotation.Nullable java.util.List keys) { + this.keys = keys; + return this; + } + + public void unsetKeys() { + this.keys = null; + } + + /** Returns true if field keys is set (has been assigned a value) and false otherwise */ + public boolean isSetKeys() { + return this.keys != null; + } + + public void setKeysIsSet(boolean value) { + if (!value) { + this.keys = null; + } + } + + public byte[] getValue() { + setValue(org.apache.thrift.TBaseHelper.rightSize(value)); + return value == null ? null : value.array(); + } + + public java.nio.ByteBuffer bufferForValue() { + return org.apache.thrift.TBaseHelper.copyBinary(value); + } + + public putGetDelta_args setValue(byte[] value) { + this.value = value == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(value.clone()); + return this; + } + + public putGetDelta_args setValue(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer value) { + this.value = org.apache.thrift.TBaseHelper.copyBinary(value); + return this; + } + + public void unsetValue() { + this.value = null; + } + + /** Returns true if field value is set (has been assigned a value) and false otherwise */ + public boolean isSetValue() { + return this.value != null; + } + + public void setValueIsSet(boolean value) { + if (!value) { + this.value = null; + } + } + + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case TRANSACTION_OR_UPDATE_ID: + if (value == null) { + unsetTransactionOrUpdateId(); + } else { + setTransactionOrUpdateId((java.lang.Long)value); + } + break; + + case COLUMN_ID: + if (value == null) { + unsetColumnId(); + } else { + setColumnId((java.lang.Long)value); + } + break; + + case KEYS: + if (value == null) { + unsetKeys(); + } else { + setKeys((java.util.List)value); + } + break; + + case VALUE: + if (value == null) { + unsetValue(); + } else { + if (value instanceof byte[]) { + setValue((byte[])value); + } else { + setValue((java.nio.ByteBuffer)value); + } + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case TRANSACTION_OR_UPDATE_ID: + return getTransactionOrUpdateId(); + + case COLUMN_ID: + return getColumnId(); + + case KEYS: + return getKeys(); + + case VALUE: + return getValue(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case TRANSACTION_OR_UPDATE_ID: + return isSetTransactionOrUpdateId(); + case COLUMN_ID: + return isSetColumnId(); + case KEYS: + return isSetKeys(); + case VALUE: + return isSetValue(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that instanceof putGetDelta_args) + return this.equals((putGetDelta_args)that); + return false; + } + + public boolean equals(putGetDelta_args that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_transactionOrUpdateId = true; + boolean that_present_transactionOrUpdateId = true; + if (this_present_transactionOrUpdateId || that_present_transactionOrUpdateId) { + if (!(this_present_transactionOrUpdateId && that_present_transactionOrUpdateId)) + return false; + if (this.transactionOrUpdateId != that.transactionOrUpdateId) + return false; + } + + boolean this_present_columnId = true; + boolean that_present_columnId = true; + if (this_present_columnId || that_present_columnId) { + if (!(this_present_columnId && that_present_columnId)) + return false; + if (this.columnId != that.columnId) + return false; + } + + boolean this_present_keys = true && this.isSetKeys(); + boolean that_present_keys = true && that.isSetKeys(); + if (this_present_keys || that_present_keys) { + if (!(this_present_keys && that_present_keys)) + return false; + if (!this.keys.equals(that.keys)) + return false; + } + + boolean this_present_value = true && this.isSetValue(); + boolean that_present_value = true && that.isSetValue(); + if (this_present_value || that_present_value) { + if (!(this_present_value && that_present_value)) + return false; + if (!this.value.equals(that.value)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(transactionOrUpdateId); + + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(columnId); + + hashCode = hashCode * 8191 + ((isSetKeys()) ? 131071 : 524287); + if (isSetKeys()) + hashCode = hashCode * 8191 + keys.hashCode(); + + hashCode = hashCode * 8191 + ((isSetValue()) ? 131071 : 524287); + if (isSetValue()) + hashCode = hashCode * 8191 + value.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(putGetDelta_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.compare(isSetTransactionOrUpdateId(), other.isSetTransactionOrUpdateId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTransactionOrUpdateId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transactionOrUpdateId, other.transactionOrUpdateId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetColumnId(), other.isSetColumnId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetColumnId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columnId, other.columnId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetKeys(), other.isSetKeys()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetKeys()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.keys, other.keys); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetValue(), other.isSetValue()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValue()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + @Override + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("putGetDelta_args("); + boolean first = true; + + sb.append("transactionOrUpdateId:"); + sb.append(this.transactionOrUpdateId); + first = false; + if (!first) sb.append(", "); + sb.append("columnId:"); + sb.append(this.columnId); + first = false; + if (!first) sb.append(", "); + sb.append("keys:"); + if (this.keys == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.keys, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("value:"); + if (this.value == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.value, sb); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // alas, we cannot check 'transactionOrUpdateId' because it's a primitive and you chose the non-beans generator. + // alas, we cannot check 'columnId' because it's a primitive and you chose the non-beans generator. + if (keys == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'keys' was not present! Struct: " + toString()); + } + if (value == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'value' was not present! Struct: " + toString()); + } + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class putGetDelta_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public putGetDelta_argsStandardScheme getScheme() { + return new putGetDelta_argsStandardScheme(); + } + } + + private static class putGetDelta_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, putGetDelta_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // TRANSACTION_OR_UPDATE_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.transactionOrUpdateId = iprot.readI64(); + struct.setTransactionOrUpdateIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // COLUMN_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.columnId = iprot.readI64(); + struct.setColumnIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // KEYS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list32 = iprot.readListBegin(); + struct.keys = new java.util.ArrayList(_list32.size); + @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem33; + for (int _i34 = 0; _i34 < _list32.size; ++_i34) + { + _elem33 = iprot.readBinary(); + struct.keys.add(_elem33); + } + iprot.readListEnd(); + } + struct.setKeysIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // VALUE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.value = iprot.readBinary(); + struct.setValueIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + if (!struct.isSetTransactionOrUpdateId()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'transactionOrUpdateId' was not found in serialized data! Struct: " + toString()); + } + if (!struct.isSetColumnId()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'columnId' was not found in serialized data! Struct: " + toString()); + } + struct.validate(); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot, putGetDelta_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(TRANSACTION_OR_UPDATE_ID_FIELD_DESC); + oprot.writeI64(struct.transactionOrUpdateId); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(COLUMN_ID_FIELD_DESC); + oprot.writeI64(struct.columnId); + oprot.writeFieldEnd(); + if (struct.keys != null) { + oprot.writeFieldBegin(KEYS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.keys.size())); + for (java.nio.ByteBuffer _iter35 : struct.keys) + { + oprot.writeBinary(_iter35); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.value != null) { + oprot.writeFieldBegin(VALUE_FIELD_DESC); + oprot.writeBinary(struct.value); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class putGetDelta_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public putGetDelta_argsTupleScheme getScheme() { + return new putGetDelta_argsTupleScheme(); + } + } + + private static class putGetDelta_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, putGetDelta_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + oprot.writeI64(struct.transactionOrUpdateId); + oprot.writeI64(struct.columnId); + { + oprot.writeI32(struct.keys.size()); + for (java.nio.ByteBuffer _iter36 : struct.keys) + { + oprot.writeBinary(_iter36); + } + } + oprot.writeBinary(struct.value); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, putGetDelta_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.transactionOrUpdateId = iprot.readI64(); + struct.setTransactionOrUpdateIdIsSet(true); + struct.columnId = iprot.readI64(); + struct.setColumnIdIsSet(true); + { + org.apache.thrift.protocol.TList _list37 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRING); + struct.keys = new java.util.ArrayList(_list37.size); + @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem38; + for (int _i39 = 0; _i39 < _list37.size; ++_i39) + { + _elem38 = iprot.readBinary(); + struct.keys.add(_elem38); + } + } + struct.setKeysIsSet(true); + struct.value = iprot.readBinary(); + struct.setValueIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) + public static class putGetDelta_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("putGetDelta_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new putGetDelta_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new putGetDelta_resultTupleSchemeFactory(); + + public @org.apache.thrift.annotation.Nullable Delta success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + @Override + public short getThriftFieldId() { + return _thriftId; + } + + @Override + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Delta.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(putGetDelta_result.class, metaDataMap); + } + + public putGetDelta_result() { + } + + public putGetDelta_result( + Delta success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public putGetDelta_result(putGetDelta_result other) { + if (other.isSetSuccess()) { + this.success = new Delta(other.success); + } + } + + @Override + public putGetDelta_result deepCopy() { + return new putGetDelta_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + @org.apache.thrift.annotation.Nullable + public Delta getSuccess() { + return this.success; + } + + public putGetDelta_result setSuccess(@org.apache.thrift.annotation.Nullable Delta success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Delta)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that instanceof putGetDelta_result) + return this.equals((putGetDelta_result)that); + return false; + } + + public boolean equals(putGetDelta_result that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(putGetDelta_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + @Override + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("putGetDelta_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + if (success != null) { + success.validate(); + } + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class putGetDelta_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public putGetDelta_resultStandardScheme getScheme() { + return new putGetDelta_resultStandardScheme(); + } + } + + private static class putGetDelta_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, putGetDelta_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.success = new Delta(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot, putGetDelta_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + struct.success.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class putGetDelta_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public putGetDelta_resultTupleScheme getScheme() { + return new putGetDelta_resultTupleScheme(); + } + } + + private static class putGetDelta_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, putGetDelta_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + struct.success.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, putGetDelta_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new Delta(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) + public static class putGetChanged_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("putGetChanged_args"); + + private static final org.apache.thrift.protocol.TField TRANSACTION_OR_UPDATE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("transactionOrUpdateId", org.apache.thrift.protocol.TType.I64, (short)1); + private static final org.apache.thrift.protocol.TField COLUMN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("columnId", org.apache.thrift.protocol.TType.I64, (short)2); + private static final org.apache.thrift.protocol.TField KEYS_FIELD_DESC = new org.apache.thrift.protocol.TField("keys", org.apache.thrift.protocol.TType.LIST, (short)3); + private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.STRING, (short)4); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new putGetChanged_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new putGetChanged_argsTupleSchemeFactory(); + + public long transactionOrUpdateId; // required + public long columnId; // required + public @org.apache.thrift.annotation.Nullable java.util.List keys; // required + public @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer value; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + TRANSACTION_OR_UPDATE_ID((short)1, "transactionOrUpdateId"), + COLUMN_ID((short)2, "columnId"), + KEYS((short)3, "keys"), + VALUE((short)4, "value"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // TRANSACTION_OR_UPDATE_ID + return TRANSACTION_OR_UPDATE_ID; + case 2: // COLUMN_ID + return COLUMN_ID; + case 3: // KEYS + return KEYS; + case 4: // VALUE + return VALUE; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + @Override + public short getThriftFieldId() { + return _thriftId; + } + + @Override + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __TRANSACTIONORUPDATEID_ISSET_ID = 0; + private static final int __COLUMNID_ISSET_ID = 1; + private byte __isset_bitfield = 0; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.TRANSACTION_OR_UPDATE_ID, new org.apache.thrift.meta_data.FieldMetaData("transactionOrUpdateId", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.COLUMN_ID, new org.apache.thrift.meta_data.FieldMetaData("columnId", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.KEYS, new org.apache.thrift.meta_data.FieldMetaData("keys", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)))); + tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(putGetChanged_args.class, metaDataMap); + } + + public putGetChanged_args() { + } + + public putGetChanged_args( + long transactionOrUpdateId, + long columnId, + java.util.List keys, + java.nio.ByteBuffer value) + { + this(); + this.transactionOrUpdateId = transactionOrUpdateId; + setTransactionOrUpdateIdIsSet(true); + this.columnId = columnId; + setColumnIdIsSet(true); + this.keys = keys; + this.value = org.apache.thrift.TBaseHelper.copyBinary(value); + } + + /** + * Performs a deep copy on other. + */ + public putGetChanged_args(putGetChanged_args other) { + __isset_bitfield = other.__isset_bitfield; + this.transactionOrUpdateId = other.transactionOrUpdateId; + this.columnId = other.columnId; + if (other.isSetKeys()) { + java.util.List __this__keys = new java.util.ArrayList(other.keys); + this.keys = __this__keys; + } + if (other.isSetValue()) { + this.value = org.apache.thrift.TBaseHelper.copyBinary(other.value); + } + } + + @Override + public putGetChanged_args deepCopy() { + return new putGetChanged_args(this); + } + + @Override + public void clear() { + setTransactionOrUpdateIdIsSet(false); + this.transactionOrUpdateId = 0; + setColumnIdIsSet(false); + this.columnId = 0; + this.keys = null; + this.value = null; + } + + public long getTransactionOrUpdateId() { + return this.transactionOrUpdateId; + } + + public putGetChanged_args setTransactionOrUpdateId(long transactionOrUpdateId) { + this.transactionOrUpdateId = transactionOrUpdateId; + setTransactionOrUpdateIdIsSet(true); + return this; + } + + public void unsetTransactionOrUpdateId() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TRANSACTIONORUPDATEID_ISSET_ID); + } + + /** Returns true if field transactionOrUpdateId is set (has been assigned a value) and false otherwise */ + public boolean isSetTransactionOrUpdateId() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TRANSACTIONORUPDATEID_ISSET_ID); + } + + public void setTransactionOrUpdateIdIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TRANSACTIONORUPDATEID_ISSET_ID, value); + } + + public long getColumnId() { + return this.columnId; + } + + public putGetChanged_args setColumnId(long columnId) { + this.columnId = columnId; + setColumnIdIsSet(true); + return this; + } + + public void unsetColumnId() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __COLUMNID_ISSET_ID); + } + + /** Returns true if field columnId is set (has been assigned a value) and false otherwise */ + public boolean isSetColumnId() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __COLUMNID_ISSET_ID); + } + + public void setColumnIdIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __COLUMNID_ISSET_ID, value); + } + + public int getKeysSize() { + return (this.keys == null) ? 0 : this.keys.size(); + } + + @org.apache.thrift.annotation.Nullable + public java.util.Iterator getKeysIterator() { + return (this.keys == null) ? null : this.keys.iterator(); + } + + public void addToKeys(java.nio.ByteBuffer elem) { + if (this.keys == null) { + this.keys = new java.util.ArrayList(); + } + this.keys.add(elem); + } + + @org.apache.thrift.annotation.Nullable + public java.util.List getKeys() { + return this.keys; + } + + public putGetChanged_args setKeys(@org.apache.thrift.annotation.Nullable java.util.List keys) { + this.keys = keys; + return this; + } + + public void unsetKeys() { + this.keys = null; + } + + /** Returns true if field keys is set (has been assigned a value) and false otherwise */ + public boolean isSetKeys() { + return this.keys != null; + } + + public void setKeysIsSet(boolean value) { + if (!value) { + this.keys = null; + } + } + + public byte[] getValue() { + setValue(org.apache.thrift.TBaseHelper.rightSize(value)); + return value == null ? null : value.array(); + } + + public java.nio.ByteBuffer bufferForValue() { + return org.apache.thrift.TBaseHelper.copyBinary(value); + } + + public putGetChanged_args setValue(byte[] value) { + this.value = value == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(value.clone()); + return this; + } + + public putGetChanged_args setValue(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer value) { + this.value = org.apache.thrift.TBaseHelper.copyBinary(value); + return this; + } + + public void unsetValue() { + this.value = null; + } + + /** Returns true if field value is set (has been assigned a value) and false otherwise */ + public boolean isSetValue() { + return this.value != null; + } + + public void setValueIsSet(boolean value) { + if (!value) { + this.value = null; + } + } + + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case TRANSACTION_OR_UPDATE_ID: + if (value == null) { + unsetTransactionOrUpdateId(); + } else { + setTransactionOrUpdateId((java.lang.Long)value); + } + break; + + case COLUMN_ID: + if (value == null) { + unsetColumnId(); + } else { + setColumnId((java.lang.Long)value); + } + break; + + case KEYS: + if (value == null) { + unsetKeys(); + } else { + setKeys((java.util.List)value); + } + break; + + case VALUE: + if (value == null) { + unsetValue(); + } else { + if (value instanceof byte[]) { + setValue((byte[])value); + } else { + setValue((java.nio.ByteBuffer)value); + } + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case TRANSACTION_OR_UPDATE_ID: + return getTransactionOrUpdateId(); + + case COLUMN_ID: + return getColumnId(); + + case KEYS: + return getKeys(); + + case VALUE: + return getValue(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case TRANSACTION_OR_UPDATE_ID: + return isSetTransactionOrUpdateId(); + case COLUMN_ID: + return isSetColumnId(); + case KEYS: + return isSetKeys(); + case VALUE: + return isSetValue(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that instanceof putGetChanged_args) + return this.equals((putGetChanged_args)that); + return false; + } + + public boolean equals(putGetChanged_args that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_transactionOrUpdateId = true; + boolean that_present_transactionOrUpdateId = true; + if (this_present_transactionOrUpdateId || that_present_transactionOrUpdateId) { + if (!(this_present_transactionOrUpdateId && that_present_transactionOrUpdateId)) + return false; + if (this.transactionOrUpdateId != that.transactionOrUpdateId) + return false; + } + + boolean this_present_columnId = true; + boolean that_present_columnId = true; + if (this_present_columnId || that_present_columnId) { + if (!(this_present_columnId && that_present_columnId)) + return false; + if (this.columnId != that.columnId) + return false; + } + + boolean this_present_keys = true && this.isSetKeys(); + boolean that_present_keys = true && that.isSetKeys(); + if (this_present_keys || that_present_keys) { + if (!(this_present_keys && that_present_keys)) + return false; + if (!this.keys.equals(that.keys)) + return false; + } + + boolean this_present_value = true && this.isSetValue(); + boolean that_present_value = true && that.isSetValue(); + if (this_present_value || that_present_value) { + if (!(this_present_value && that_present_value)) + return false; + if (!this.value.equals(that.value)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(transactionOrUpdateId); + + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(columnId); + + hashCode = hashCode * 8191 + ((isSetKeys()) ? 131071 : 524287); + if (isSetKeys()) + hashCode = hashCode * 8191 + keys.hashCode(); + + hashCode = hashCode * 8191 + ((isSetValue()) ? 131071 : 524287); + if (isSetValue()) + hashCode = hashCode * 8191 + value.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(putGetChanged_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.compare(isSetTransactionOrUpdateId(), other.isSetTransactionOrUpdateId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTransactionOrUpdateId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transactionOrUpdateId, other.transactionOrUpdateId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetColumnId(), other.isSetColumnId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetColumnId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columnId, other.columnId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetKeys(), other.isSetKeys()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetKeys()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.keys, other.keys); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetValue(), other.isSetValue()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValue()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + @Override + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("putGetChanged_args("); + boolean first = true; + + sb.append("transactionOrUpdateId:"); + sb.append(this.transactionOrUpdateId); + first = false; + if (!first) sb.append(", "); + sb.append("columnId:"); + sb.append(this.columnId); + first = false; + if (!first) sb.append(", "); + sb.append("keys:"); + if (this.keys == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.keys, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("value:"); + if (this.value == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.value, sb); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // alas, we cannot check 'transactionOrUpdateId' because it's a primitive and you chose the non-beans generator. + // alas, we cannot check 'columnId' because it's a primitive and you chose the non-beans generator. + if (keys == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'keys' was not present! Struct: " + toString()); + } + if (value == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'value' was not present! Struct: " + toString()); + } + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class putGetChanged_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public putGetChanged_argsStandardScheme getScheme() { + return new putGetChanged_argsStandardScheme(); + } + } + + private static class putGetChanged_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, putGetChanged_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // TRANSACTION_OR_UPDATE_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.transactionOrUpdateId = iprot.readI64(); + struct.setTransactionOrUpdateIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // COLUMN_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.columnId = iprot.readI64(); + struct.setColumnIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // KEYS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list40 = iprot.readListBegin(); + struct.keys = new java.util.ArrayList(_list40.size); + @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem41; + for (int _i42 = 0; _i42 < _list40.size; ++_i42) + { + _elem41 = iprot.readBinary(); + struct.keys.add(_elem41); + } + iprot.readListEnd(); + } + struct.setKeysIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // VALUE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.value = iprot.readBinary(); + struct.setValueIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + if (!struct.isSetTransactionOrUpdateId()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'transactionOrUpdateId' was not found in serialized data! Struct: " + toString()); + } + if (!struct.isSetColumnId()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'columnId' was not found in serialized data! Struct: " + toString()); + } + struct.validate(); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot, putGetChanged_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(TRANSACTION_OR_UPDATE_ID_FIELD_DESC); + oprot.writeI64(struct.transactionOrUpdateId); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(COLUMN_ID_FIELD_DESC); + oprot.writeI64(struct.columnId); + oprot.writeFieldEnd(); + if (struct.keys != null) { + oprot.writeFieldBegin(KEYS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.keys.size())); + for (java.nio.ByteBuffer _iter43 : struct.keys) + { + oprot.writeBinary(_iter43); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.value != null) { + oprot.writeFieldBegin(VALUE_FIELD_DESC); + oprot.writeBinary(struct.value); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class putGetChanged_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public putGetChanged_argsTupleScheme getScheme() { + return new putGetChanged_argsTupleScheme(); + } + } + + private static class putGetChanged_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, putGetChanged_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + oprot.writeI64(struct.transactionOrUpdateId); + oprot.writeI64(struct.columnId); + { + oprot.writeI32(struct.keys.size()); + for (java.nio.ByteBuffer _iter44 : struct.keys) + { + oprot.writeBinary(_iter44); + } + } + oprot.writeBinary(struct.value); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, putGetChanged_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.transactionOrUpdateId = iprot.readI64(); + struct.setTransactionOrUpdateIdIsSet(true); + struct.columnId = iprot.readI64(); + struct.setColumnIdIsSet(true); + { + org.apache.thrift.protocol.TList _list45 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRING); + struct.keys = new java.util.ArrayList(_list45.size); + @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem46; + for (int _i47 = 0; _i47 < _list45.size; ++_i47) + { + _elem46 = iprot.readBinary(); + struct.keys.add(_elem46); + } + } + struct.setKeysIsSet(true); + struct.value = iprot.readBinary(); + struct.setValueIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) + public static class putGetChanged_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("putGetChanged_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new putGetChanged_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new putGetChanged_resultTupleSchemeFactory(); + + public boolean success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + @Override + public short getThriftFieldId() { + return _thriftId; + } + + @Override + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __SUCCESS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(putGetChanged_result.class, metaDataMap); + } + + public putGetChanged_result() { + } + + public putGetChanged_result( + boolean success) + { + this(); + this.success = success; + setSuccessIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public putGetChanged_result(putGetChanged_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + } + + @Override + public putGetChanged_result deepCopy() { + return new putGetChanged_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = false; + } + + public boolean isSuccess() { + return this.success; + } + + public putGetChanged_result setSuccess(boolean success) { + this.success = success; + setSuccessIsSet(true); + return this; + } + + public void unsetSuccess() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + } + + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((java.lang.Boolean)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return isSuccess(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that instanceof putGetChanged_result) + return this.equals((putGetChanged_result)that); + return false; + } + + public boolean equals(putGetChanged_result that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((success) ? 131071 : 524287); + + return hashCode; + } + + @Override + public int compareTo(putGetChanged_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + @Override + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("putGetChanged_result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class putGetChanged_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public putGetChanged_resultStandardScheme getScheme() { + return new putGetChanged_resultStandardScheme(); + } + } + + private static class putGetChanged_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, putGetChanged_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot, putGetChanged_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBool(struct.success); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class putGetChanged_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public putGetChanged_resultTupleScheme getScheme() { + return new putGetChanged_resultTupleScheme(); + } + } + + private static class putGetChanged_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, putGetChanged_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + oprot.writeBool(struct.success); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, putGetChanged_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) + public static class putGetPreviousPresence_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("putGetPreviousPresence_args"); + + private static final org.apache.thrift.protocol.TField TRANSACTION_OR_UPDATE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("transactionOrUpdateId", org.apache.thrift.protocol.TType.I64, (short)1); + private static final org.apache.thrift.protocol.TField COLUMN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("columnId", org.apache.thrift.protocol.TType.I64, (short)2); + private static final org.apache.thrift.protocol.TField KEYS_FIELD_DESC = new org.apache.thrift.protocol.TField("keys", org.apache.thrift.protocol.TType.LIST, (short)3); + private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.STRING, (short)4); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new putGetPreviousPresence_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new putGetPreviousPresence_argsTupleSchemeFactory(); + + public long transactionOrUpdateId; // required + public long columnId; // required + public @org.apache.thrift.annotation.Nullable java.util.List keys; // required + public @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer value; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + TRANSACTION_OR_UPDATE_ID((short)1, "transactionOrUpdateId"), + COLUMN_ID((short)2, "columnId"), + KEYS((short)3, "keys"), + VALUE((short)4, "value"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // TRANSACTION_OR_UPDATE_ID + return TRANSACTION_OR_UPDATE_ID; + case 2: // COLUMN_ID + return COLUMN_ID; + case 3: // KEYS + return KEYS; + case 4: // VALUE + return VALUE; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + @Override + public short getThriftFieldId() { + return _thriftId; + } + + @Override + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __TRANSACTIONORUPDATEID_ISSET_ID = 0; + private static final int __COLUMNID_ISSET_ID = 1; + private byte __isset_bitfield = 0; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.TRANSACTION_OR_UPDATE_ID, new org.apache.thrift.meta_data.FieldMetaData("transactionOrUpdateId", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.COLUMN_ID, new org.apache.thrift.meta_data.FieldMetaData("columnId", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.KEYS, new org.apache.thrift.meta_data.FieldMetaData("keys", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)))); + tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(putGetPreviousPresence_args.class, metaDataMap); + } + + public putGetPreviousPresence_args() { + } + + public putGetPreviousPresence_args( + long transactionOrUpdateId, + long columnId, + java.util.List keys, + java.nio.ByteBuffer value) + { + this(); + this.transactionOrUpdateId = transactionOrUpdateId; + setTransactionOrUpdateIdIsSet(true); + this.columnId = columnId; + setColumnIdIsSet(true); + this.keys = keys; + this.value = org.apache.thrift.TBaseHelper.copyBinary(value); + } + + /** + * Performs a deep copy on other. + */ + public putGetPreviousPresence_args(putGetPreviousPresence_args other) { + __isset_bitfield = other.__isset_bitfield; + this.transactionOrUpdateId = other.transactionOrUpdateId; + this.columnId = other.columnId; + if (other.isSetKeys()) { + java.util.List __this__keys = new java.util.ArrayList(other.keys); + this.keys = __this__keys; + } + if (other.isSetValue()) { + this.value = org.apache.thrift.TBaseHelper.copyBinary(other.value); + } + } + + @Override + public putGetPreviousPresence_args deepCopy() { + return new putGetPreviousPresence_args(this); + } + + @Override + public void clear() { + setTransactionOrUpdateIdIsSet(false); + this.transactionOrUpdateId = 0; + setColumnIdIsSet(false); + this.columnId = 0; + this.keys = null; + this.value = null; + } + + public long getTransactionOrUpdateId() { + return this.transactionOrUpdateId; + } + + public putGetPreviousPresence_args setTransactionOrUpdateId(long transactionOrUpdateId) { + this.transactionOrUpdateId = transactionOrUpdateId; + setTransactionOrUpdateIdIsSet(true); + return this; + } + + public void unsetTransactionOrUpdateId() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TRANSACTIONORUPDATEID_ISSET_ID); + } + + /** Returns true if field transactionOrUpdateId is set (has been assigned a value) and false otherwise */ + public boolean isSetTransactionOrUpdateId() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TRANSACTIONORUPDATEID_ISSET_ID); + } + + public void setTransactionOrUpdateIdIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TRANSACTIONORUPDATEID_ISSET_ID, value); + } + + public long getColumnId() { + return this.columnId; + } + + public putGetPreviousPresence_args setColumnId(long columnId) { + this.columnId = columnId; + setColumnIdIsSet(true); + return this; + } + + public void unsetColumnId() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __COLUMNID_ISSET_ID); + } + + /** Returns true if field columnId is set (has been assigned a value) and false otherwise */ + public boolean isSetColumnId() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __COLUMNID_ISSET_ID); + } + + public void setColumnIdIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __COLUMNID_ISSET_ID, value); + } + + public int getKeysSize() { + return (this.keys == null) ? 0 : this.keys.size(); + } + + @org.apache.thrift.annotation.Nullable + public java.util.Iterator getKeysIterator() { + return (this.keys == null) ? null : this.keys.iterator(); + } + + public void addToKeys(java.nio.ByteBuffer elem) { + if (this.keys == null) { + this.keys = new java.util.ArrayList(); + } + this.keys.add(elem); + } + + @org.apache.thrift.annotation.Nullable + public java.util.List getKeys() { + return this.keys; + } + + public putGetPreviousPresence_args setKeys(@org.apache.thrift.annotation.Nullable java.util.List keys) { + this.keys = keys; + return this; + } + + public void unsetKeys() { + this.keys = null; + } + + /** Returns true if field keys is set (has been assigned a value) and false otherwise */ + public boolean isSetKeys() { + return this.keys != null; + } + + public void setKeysIsSet(boolean value) { + if (!value) { + this.keys = null; + } + } + + public byte[] getValue() { + setValue(org.apache.thrift.TBaseHelper.rightSize(value)); + return value == null ? null : value.array(); + } + + public java.nio.ByteBuffer bufferForValue() { + return org.apache.thrift.TBaseHelper.copyBinary(value); + } + + public putGetPreviousPresence_args setValue(byte[] value) { + this.value = value == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(value.clone()); + return this; + } + + public putGetPreviousPresence_args setValue(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer value) { + this.value = org.apache.thrift.TBaseHelper.copyBinary(value); + return this; + } + + public void unsetValue() { + this.value = null; + } + + /** Returns true if field value is set (has been assigned a value) and false otherwise */ + public boolean isSetValue() { + return this.value != null; + } + + public void setValueIsSet(boolean value) { + if (!value) { + this.value = null; + } + } + + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case TRANSACTION_OR_UPDATE_ID: + if (value == null) { + unsetTransactionOrUpdateId(); + } else { + setTransactionOrUpdateId((java.lang.Long)value); + } + break; + + case COLUMN_ID: + if (value == null) { + unsetColumnId(); + } else { + setColumnId((java.lang.Long)value); + } + break; + + case KEYS: + if (value == null) { + unsetKeys(); + } else { + setKeys((java.util.List)value); + } + break; + + case VALUE: + if (value == null) { + unsetValue(); + } else { + if (value instanceof byte[]) { + setValue((byte[])value); + } else { + setValue((java.nio.ByteBuffer)value); + } + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case TRANSACTION_OR_UPDATE_ID: + return getTransactionOrUpdateId(); + + case COLUMN_ID: + return getColumnId(); + + case KEYS: + return getKeys(); + + case VALUE: + return getValue(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case TRANSACTION_OR_UPDATE_ID: + return isSetTransactionOrUpdateId(); + case COLUMN_ID: + return isSetColumnId(); + case KEYS: + return isSetKeys(); + case VALUE: + return isSetValue(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that instanceof putGetPreviousPresence_args) + return this.equals((putGetPreviousPresence_args)that); + return false; + } + + public boolean equals(putGetPreviousPresence_args that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_transactionOrUpdateId = true; + boolean that_present_transactionOrUpdateId = true; + if (this_present_transactionOrUpdateId || that_present_transactionOrUpdateId) { + if (!(this_present_transactionOrUpdateId && that_present_transactionOrUpdateId)) + return false; + if (this.transactionOrUpdateId != that.transactionOrUpdateId) + return false; + } + + boolean this_present_columnId = true; + boolean that_present_columnId = true; + if (this_present_columnId || that_present_columnId) { + if (!(this_present_columnId && that_present_columnId)) + return false; + if (this.columnId != that.columnId) + return false; + } + + boolean this_present_keys = true && this.isSetKeys(); + boolean that_present_keys = true && that.isSetKeys(); + if (this_present_keys || that_present_keys) { + if (!(this_present_keys && that_present_keys)) + return false; + if (!this.keys.equals(that.keys)) + return false; + } + + boolean this_present_value = true && this.isSetValue(); + boolean that_present_value = true && that.isSetValue(); + if (this_present_value || that_present_value) { + if (!(this_present_value && that_present_value)) + return false; + if (!this.value.equals(that.value)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(transactionOrUpdateId); + + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(columnId); + + hashCode = hashCode * 8191 + ((isSetKeys()) ? 131071 : 524287); + if (isSetKeys()) + hashCode = hashCode * 8191 + keys.hashCode(); + + hashCode = hashCode * 8191 + ((isSetValue()) ? 131071 : 524287); + if (isSetValue()) + hashCode = hashCode * 8191 + value.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(putGetPreviousPresence_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.compare(isSetTransactionOrUpdateId(), other.isSetTransactionOrUpdateId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTransactionOrUpdateId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transactionOrUpdateId, other.transactionOrUpdateId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetColumnId(), other.isSetColumnId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetColumnId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columnId, other.columnId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetKeys(), other.isSetKeys()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetKeys()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.keys, other.keys); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetValue(), other.isSetValue()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValue()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + @Override + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("putGetPreviousPresence_args("); + boolean first = true; + + sb.append("transactionOrUpdateId:"); + sb.append(this.transactionOrUpdateId); + first = false; + if (!first) sb.append(", "); + sb.append("columnId:"); + sb.append(this.columnId); + first = false; + if (!first) sb.append(", "); + sb.append("keys:"); + if (this.keys == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.keys, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("value:"); + if (this.value == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.value, sb); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // alas, we cannot check 'transactionOrUpdateId' because it's a primitive and you chose the non-beans generator. + // alas, we cannot check 'columnId' because it's a primitive and you chose the non-beans generator. + if (keys == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'keys' was not present! Struct: " + toString()); + } + if (value == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'value' was not present! Struct: " + toString()); + } + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class putGetPreviousPresence_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public putGetPreviousPresence_argsStandardScheme getScheme() { + return new putGetPreviousPresence_argsStandardScheme(); + } + } + + private static class putGetPreviousPresence_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, putGetPreviousPresence_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // TRANSACTION_OR_UPDATE_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.transactionOrUpdateId = iprot.readI64(); + struct.setTransactionOrUpdateIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // COLUMN_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.columnId = iprot.readI64(); + struct.setColumnIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // KEYS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list48 = iprot.readListBegin(); + struct.keys = new java.util.ArrayList(_list48.size); + @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem49; + for (int _i50 = 0; _i50 < _list48.size; ++_i50) + { + _elem49 = iprot.readBinary(); + struct.keys.add(_elem49); + } + iprot.readListEnd(); + } + struct.setKeysIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // VALUE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.value = iprot.readBinary(); + struct.setValueIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + if (!struct.isSetTransactionOrUpdateId()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'transactionOrUpdateId' was not found in serialized data! Struct: " + toString()); + } + if (!struct.isSetColumnId()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'columnId' was not found in serialized data! Struct: " + toString()); + } + struct.validate(); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot, putGetPreviousPresence_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(TRANSACTION_OR_UPDATE_ID_FIELD_DESC); + oprot.writeI64(struct.transactionOrUpdateId); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(COLUMN_ID_FIELD_DESC); + oprot.writeI64(struct.columnId); + oprot.writeFieldEnd(); + if (struct.keys != null) { + oprot.writeFieldBegin(KEYS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.keys.size())); + for (java.nio.ByteBuffer _iter51 : struct.keys) + { + oprot.writeBinary(_iter51); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.value != null) { + oprot.writeFieldBegin(VALUE_FIELD_DESC); + oprot.writeBinary(struct.value); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class putGetPreviousPresence_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public putGetPreviousPresence_argsTupleScheme getScheme() { + return new putGetPreviousPresence_argsTupleScheme(); + } + } + + private static class putGetPreviousPresence_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, putGetPreviousPresence_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + oprot.writeI64(struct.transactionOrUpdateId); + oprot.writeI64(struct.columnId); + { + oprot.writeI32(struct.keys.size()); + for (java.nio.ByteBuffer _iter52 : struct.keys) + { + oprot.writeBinary(_iter52); + } + } + oprot.writeBinary(struct.value); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, putGetPreviousPresence_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.transactionOrUpdateId = iprot.readI64(); + struct.setTransactionOrUpdateIdIsSet(true); + struct.columnId = iprot.readI64(); + struct.setColumnIdIsSet(true); + { + org.apache.thrift.protocol.TList _list53 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRING); + struct.keys = new java.util.ArrayList(_list53.size); + @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem54; + for (int _i55 = 0; _i55 < _list53.size; ++_i55) + { + _elem54 = iprot.readBinary(); + struct.keys.add(_elem54); + } + } + struct.setKeysIsSet(true); + struct.value = iprot.readBinary(); + struct.setValueIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) + public static class putGetPreviousPresence_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("putGetPreviousPresence_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new putGetPreviousPresence_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new putGetPreviousPresence_resultTupleSchemeFactory(); + + public boolean success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + @Override + public short getThriftFieldId() { + return _thriftId; + } + + @Override + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __SUCCESS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(putGetPreviousPresence_result.class, metaDataMap); + } + + public putGetPreviousPresence_result() { + } + + public putGetPreviousPresence_result( + boolean success) + { + this(); + this.success = success; + setSuccessIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public putGetPreviousPresence_result(putGetPreviousPresence_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + } + + @Override + public putGetPreviousPresence_result deepCopy() { + return new putGetPreviousPresence_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = false; + } + + public boolean isSuccess() { + return this.success; + } + + public putGetPreviousPresence_result setSuccess(boolean success) { + this.success = success; + setSuccessIsSet(true); + return this; + } + + public void unsetSuccess() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + } + + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((java.lang.Boolean)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return isSuccess(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that instanceof putGetPreviousPresence_result) + return this.equals((putGetPreviousPresence_result)that); + return false; + } + + public boolean equals(putGetPreviousPresence_result that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((success) ? 131071 : 524287); + + return hashCode; + } + + @Override + public int compareTo(putGetPreviousPresence_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + @Override + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("putGetPreviousPresence_result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class putGetPreviousPresence_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public putGetPreviousPresence_resultStandardScheme getScheme() { + return new putGetPreviousPresence_resultStandardScheme(); + } + } + + private static class putGetPreviousPresence_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, putGetPreviousPresence_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot, putGetPreviousPresence_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBool(struct.success); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class putGetPreviousPresence_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public putGetPreviousPresence_resultTupleScheme getScheme() { + return new putGetPreviousPresence_resultTupleScheme(); + } + } + + private static class putGetPreviousPresence_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, putGetPreviousPresence_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + oprot.writeBool(struct.success); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, putGetPreviousPresence_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) + public static class get_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("get_args"); + + private static final org.apache.thrift.protocol.TField TRANSACTION_OR_UPDATE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("transactionOrUpdateId", org.apache.thrift.protocol.TType.I64, (short)1); + private static final org.apache.thrift.protocol.TField COLUMN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("columnId", org.apache.thrift.protocol.TType.I64, (short)2); + private static final org.apache.thrift.protocol.TField KEYS_FIELD_DESC = new org.apache.thrift.protocol.TField("keys", org.apache.thrift.protocol.TType.LIST, (short)3); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new get_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new get_argsTupleSchemeFactory(); + + public long transactionOrUpdateId; // required + public long columnId; // required + public @org.apache.thrift.annotation.Nullable java.util.List keys; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + TRANSACTION_OR_UPDATE_ID((short)1, "transactionOrUpdateId"), + COLUMN_ID((short)2, "columnId"), + KEYS((short)3, "keys"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // TRANSACTION_OR_UPDATE_ID + return TRANSACTION_OR_UPDATE_ID; + case 2: // COLUMN_ID + return COLUMN_ID; + case 3: // KEYS + return KEYS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + @Override + public short getThriftFieldId() { + return _thriftId; + } + + @Override + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __TRANSACTIONORUPDATEID_ISSET_ID = 0; + private static final int __COLUMNID_ISSET_ID = 1; + private byte __isset_bitfield = 0; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.TRANSACTION_OR_UPDATE_ID, new org.apache.thrift.meta_data.FieldMetaData("transactionOrUpdateId", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.COLUMN_ID, new org.apache.thrift.meta_data.FieldMetaData("columnId", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.KEYS, new org.apache.thrift.meta_data.FieldMetaData("keys", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(get_args.class, metaDataMap); + } + + public get_args() { + } + + public get_args( + long transactionOrUpdateId, + long columnId, + java.util.List keys) + { + this(); + this.transactionOrUpdateId = transactionOrUpdateId; + setTransactionOrUpdateIdIsSet(true); + this.columnId = columnId; + setColumnIdIsSet(true); + this.keys = keys; + } + + /** + * Performs a deep copy on other. + */ + public get_args(get_args other) { + __isset_bitfield = other.__isset_bitfield; + this.transactionOrUpdateId = other.transactionOrUpdateId; + this.columnId = other.columnId; + if (other.isSetKeys()) { + java.util.List __this__keys = new java.util.ArrayList(other.keys); + this.keys = __this__keys; + } + } + + @Override + public get_args deepCopy() { + return new get_args(this); + } + + @Override + public void clear() { + setTransactionOrUpdateIdIsSet(false); + this.transactionOrUpdateId = 0; + setColumnIdIsSet(false); + this.columnId = 0; + this.keys = null; + } + + public long getTransactionOrUpdateId() { + return this.transactionOrUpdateId; + } + + public get_args setTransactionOrUpdateId(long transactionOrUpdateId) { + this.transactionOrUpdateId = transactionOrUpdateId; + setTransactionOrUpdateIdIsSet(true); + return this; + } + + public void unsetTransactionOrUpdateId() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TRANSACTIONORUPDATEID_ISSET_ID); + } + + /** Returns true if field transactionOrUpdateId is set (has been assigned a value) and false otherwise */ + public boolean isSetTransactionOrUpdateId() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TRANSACTIONORUPDATEID_ISSET_ID); + } + + public void setTransactionOrUpdateIdIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TRANSACTIONORUPDATEID_ISSET_ID, value); + } + + public long getColumnId() { + return this.columnId; + } + + public get_args setColumnId(long columnId) { + this.columnId = columnId; + setColumnIdIsSet(true); + return this; + } + + public void unsetColumnId() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __COLUMNID_ISSET_ID); + } + + /** Returns true if field columnId is set (has been assigned a value) and false otherwise */ + public boolean isSetColumnId() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __COLUMNID_ISSET_ID); + } + + public void setColumnIdIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __COLUMNID_ISSET_ID, value); + } + + public int getKeysSize() { + return (this.keys == null) ? 0 : this.keys.size(); + } + + @org.apache.thrift.annotation.Nullable + public java.util.Iterator getKeysIterator() { + return (this.keys == null) ? null : this.keys.iterator(); + } + + public void addToKeys(java.nio.ByteBuffer elem) { + if (this.keys == null) { + this.keys = new java.util.ArrayList(); + } + this.keys.add(elem); + } + + @org.apache.thrift.annotation.Nullable + public java.util.List getKeys() { + return this.keys; + } + + public get_args setKeys(@org.apache.thrift.annotation.Nullable java.util.List keys) { + this.keys = keys; + return this; + } + + public void unsetKeys() { + this.keys = null; + } + + /** Returns true if field keys is set (has been assigned a value) and false otherwise */ + public boolean isSetKeys() { + return this.keys != null; + } + + public void setKeysIsSet(boolean value) { + if (!value) { + this.keys = null; + } + } + + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case TRANSACTION_OR_UPDATE_ID: + if (value == null) { + unsetTransactionOrUpdateId(); + } else { + setTransactionOrUpdateId((java.lang.Long)value); + } + break; + + case COLUMN_ID: + if (value == null) { + unsetColumnId(); + } else { + setColumnId((java.lang.Long)value); + } + break; + + case KEYS: + if (value == null) { + unsetKeys(); + } else { + setKeys((java.util.List)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case TRANSACTION_OR_UPDATE_ID: + return getTransactionOrUpdateId(); + + case COLUMN_ID: + return getColumnId(); + + case KEYS: + return getKeys(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case TRANSACTION_OR_UPDATE_ID: + return isSetTransactionOrUpdateId(); + case COLUMN_ID: + return isSetColumnId(); + case KEYS: + return isSetKeys(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that instanceof get_args) + return this.equals((get_args)that); + return false; + } + + public boolean equals(get_args that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_transactionOrUpdateId = true; + boolean that_present_transactionOrUpdateId = true; + if (this_present_transactionOrUpdateId || that_present_transactionOrUpdateId) { + if (!(this_present_transactionOrUpdateId && that_present_transactionOrUpdateId)) + return false; + if (this.transactionOrUpdateId != that.transactionOrUpdateId) + return false; + } + + boolean this_present_columnId = true; + boolean that_present_columnId = true; + if (this_present_columnId || that_present_columnId) { + if (!(this_present_columnId && that_present_columnId)) + return false; + if (this.columnId != that.columnId) + return false; + } + + boolean this_present_keys = true && this.isSetKeys(); + boolean that_present_keys = true && that.isSetKeys(); + if (this_present_keys || that_present_keys) { + if (!(this_present_keys && that_present_keys)) + return false; + if (!this.keys.equals(that.keys)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(transactionOrUpdateId); + + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(columnId); + + hashCode = hashCode * 8191 + ((isSetKeys()) ? 131071 : 524287); + if (isSetKeys()) + hashCode = hashCode * 8191 + keys.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(get_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.compare(isSetTransactionOrUpdateId(), other.isSetTransactionOrUpdateId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTransactionOrUpdateId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transactionOrUpdateId, other.transactionOrUpdateId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetColumnId(), other.isSetColumnId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetColumnId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columnId, other.columnId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetKeys(), other.isSetKeys()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetKeys()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.keys, other.keys); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + @Override + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("get_args("); + boolean first = true; + + sb.append("transactionOrUpdateId:"); + sb.append(this.transactionOrUpdateId); + first = false; + if (!first) sb.append(", "); + sb.append("columnId:"); + sb.append(this.columnId); + first = false; + if (!first) sb.append(", "); + sb.append("keys:"); + if (this.keys == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.keys, sb); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // alas, we cannot check 'transactionOrUpdateId' because it's a primitive and you chose the non-beans generator. + // alas, we cannot check 'columnId' because it's a primitive and you chose the non-beans generator. + if (keys == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'keys' was not present! Struct: " + toString()); + } + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class get_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public get_argsStandardScheme getScheme() { + return new get_argsStandardScheme(); + } + } + + private static class get_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, get_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // TRANSACTION_OR_UPDATE_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.transactionOrUpdateId = iprot.readI64(); + struct.setTransactionOrUpdateIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // COLUMN_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.columnId = iprot.readI64(); + struct.setColumnIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // KEYS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list56 = iprot.readListBegin(); + struct.keys = new java.util.ArrayList(_list56.size); + @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem57; + for (int _i58 = 0; _i58 < _list56.size; ++_i58) + { + _elem57 = iprot.readBinary(); + struct.keys.add(_elem57); + } + iprot.readListEnd(); + } + struct.setKeysIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + if (!struct.isSetTransactionOrUpdateId()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'transactionOrUpdateId' was not found in serialized data! Struct: " + toString()); + } + if (!struct.isSetColumnId()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'columnId' was not found in serialized data! Struct: " + toString()); + } + struct.validate(); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot, get_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(TRANSACTION_OR_UPDATE_ID_FIELD_DESC); + oprot.writeI64(struct.transactionOrUpdateId); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(COLUMN_ID_FIELD_DESC); + oprot.writeI64(struct.columnId); + oprot.writeFieldEnd(); + if (struct.keys != null) { + oprot.writeFieldBegin(KEYS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.keys.size())); + for (java.nio.ByteBuffer _iter59 : struct.keys) + { + oprot.writeBinary(_iter59); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class get_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public get_argsTupleScheme getScheme() { + return new get_argsTupleScheme(); + } + } + + private static class get_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, get_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + oprot.writeI64(struct.transactionOrUpdateId); + oprot.writeI64(struct.columnId); + { + oprot.writeI32(struct.keys.size()); + for (java.nio.ByteBuffer _iter60 : struct.keys) + { + oprot.writeBinary(_iter60); + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, get_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.transactionOrUpdateId = iprot.readI64(); + struct.setTransactionOrUpdateIdIsSet(true); + struct.columnId = iprot.readI64(); + struct.setColumnIdIsSet(true); + { + org.apache.thrift.protocol.TList _list61 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRING); + struct.keys = new java.util.ArrayList(_list61.size); + @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem62; + for (int _i63 = 0; _i63 < _list61.size; ++_i63) + { + _elem62 = iprot.readBinary(); + struct.keys.add(_elem62); + } + } + struct.setKeysIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) + public static class get_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("get_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new get_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new get_resultTupleSchemeFactory(); + + public @org.apache.thrift.annotation.Nullable OptionalBinary success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + @Override + public short getThriftFieldId() { + return _thriftId; + } + + @Override + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, OptionalBinary.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(get_result.class, metaDataMap); + } + + public get_result() { + } + + public get_result( + OptionalBinary success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public get_result(get_result other) { + if (other.isSetSuccess()) { + this.success = new OptionalBinary(other.success); + } + } + + @Override + public get_result deepCopy() { + return new get_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + @org.apache.thrift.annotation.Nullable + public OptionalBinary getSuccess() { + return this.success; + } + + public get_result setSuccess(@org.apache.thrift.annotation.Nullable OptionalBinary success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((OptionalBinary)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that instanceof get_result) + return this.equals((get_result)that); + return false; + } + + public boolean equals(get_result that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(get_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + @Override + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("get_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + if (success != null) { + success.validate(); + } + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class get_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public get_resultStandardScheme getScheme() { + return new get_resultStandardScheme(); + } + } + + private static class get_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, get_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.success = new OptionalBinary(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot, get_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + struct.success.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class get_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public get_resultTupleScheme getScheme() { + return new get_resultTupleScheme(); + } + } + + private static class get_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, get_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + struct.success.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, get_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new OptionalBinary(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) + public static class getForUpdate_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getForUpdate_args"); + + private static final org.apache.thrift.protocol.TField TRANSACTION_OR_UPDATE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("transactionOrUpdateId", org.apache.thrift.protocol.TType.I64, (short)1); + private static final org.apache.thrift.protocol.TField COLUMN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("columnId", org.apache.thrift.protocol.TType.I64, (short)2); + private static final org.apache.thrift.protocol.TField KEYS_FIELD_DESC = new org.apache.thrift.protocol.TField("keys", org.apache.thrift.protocol.TType.LIST, (short)3); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getForUpdate_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getForUpdate_argsTupleSchemeFactory(); + + public long transactionOrUpdateId; // required + public long columnId; // required + public @org.apache.thrift.annotation.Nullable java.util.List keys; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + TRANSACTION_OR_UPDATE_ID((short)1, "transactionOrUpdateId"), + COLUMN_ID((short)2, "columnId"), + KEYS((short)3, "keys"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // TRANSACTION_OR_UPDATE_ID + return TRANSACTION_OR_UPDATE_ID; + case 2: // COLUMN_ID + return COLUMN_ID; + case 3: // KEYS + return KEYS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + @Override + public short getThriftFieldId() { + return _thriftId; + } + + @Override + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __TRANSACTIONORUPDATEID_ISSET_ID = 0; + private static final int __COLUMNID_ISSET_ID = 1; + private byte __isset_bitfield = 0; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.TRANSACTION_OR_UPDATE_ID, new org.apache.thrift.meta_data.FieldMetaData("transactionOrUpdateId", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.COLUMN_ID, new org.apache.thrift.meta_data.FieldMetaData("columnId", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.KEYS, new org.apache.thrift.meta_data.FieldMetaData("keys", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getForUpdate_args.class, metaDataMap); + } + + public getForUpdate_args() { + } + + public getForUpdate_args( + long transactionOrUpdateId, + long columnId, + java.util.List keys) + { + this(); + this.transactionOrUpdateId = transactionOrUpdateId; + setTransactionOrUpdateIdIsSet(true); + this.columnId = columnId; + setColumnIdIsSet(true); + this.keys = keys; + } + + /** + * Performs a deep copy on other. + */ + public getForUpdate_args(getForUpdate_args other) { + __isset_bitfield = other.__isset_bitfield; + this.transactionOrUpdateId = other.transactionOrUpdateId; + this.columnId = other.columnId; + if (other.isSetKeys()) { + java.util.List __this__keys = new java.util.ArrayList(other.keys); + this.keys = __this__keys; + } + } + + @Override + public getForUpdate_args deepCopy() { + return new getForUpdate_args(this); + } + + @Override + public void clear() { + setTransactionOrUpdateIdIsSet(false); + this.transactionOrUpdateId = 0; + setColumnIdIsSet(false); + this.columnId = 0; + this.keys = null; + } + + public long getTransactionOrUpdateId() { + return this.transactionOrUpdateId; + } + + public getForUpdate_args setTransactionOrUpdateId(long transactionOrUpdateId) { + this.transactionOrUpdateId = transactionOrUpdateId; + setTransactionOrUpdateIdIsSet(true); + return this; + } + + public void unsetTransactionOrUpdateId() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TRANSACTIONORUPDATEID_ISSET_ID); + } + + /** Returns true if field transactionOrUpdateId is set (has been assigned a value) and false otherwise */ + public boolean isSetTransactionOrUpdateId() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TRANSACTIONORUPDATEID_ISSET_ID); + } + + public void setTransactionOrUpdateIdIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TRANSACTIONORUPDATEID_ISSET_ID, value); + } + + public long getColumnId() { + return this.columnId; + } + + public getForUpdate_args setColumnId(long columnId) { + this.columnId = columnId; + setColumnIdIsSet(true); + return this; + } + + public void unsetColumnId() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __COLUMNID_ISSET_ID); + } + + /** Returns true if field columnId is set (has been assigned a value) and false otherwise */ + public boolean isSetColumnId() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __COLUMNID_ISSET_ID); + } + + public void setColumnIdIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __COLUMNID_ISSET_ID, value); + } + + public int getKeysSize() { + return (this.keys == null) ? 0 : this.keys.size(); + } + + @org.apache.thrift.annotation.Nullable + public java.util.Iterator getKeysIterator() { + return (this.keys == null) ? null : this.keys.iterator(); + } + + public void addToKeys(java.nio.ByteBuffer elem) { + if (this.keys == null) { + this.keys = new java.util.ArrayList(); + } + this.keys.add(elem); + } + + @org.apache.thrift.annotation.Nullable + public java.util.List getKeys() { + return this.keys; + } + + public getForUpdate_args setKeys(@org.apache.thrift.annotation.Nullable java.util.List keys) { + this.keys = keys; + return this; + } + + public void unsetKeys() { + this.keys = null; + } + + /** Returns true if field keys is set (has been assigned a value) and false otherwise */ + public boolean isSetKeys() { + return this.keys != null; + } + + public void setKeysIsSet(boolean value) { + if (!value) { + this.keys = null; + } + } + + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case TRANSACTION_OR_UPDATE_ID: + if (value == null) { + unsetTransactionOrUpdateId(); + } else { + setTransactionOrUpdateId((java.lang.Long)value); + } + break; + + case COLUMN_ID: + if (value == null) { + unsetColumnId(); + } else { + setColumnId((java.lang.Long)value); + } + break; + + case KEYS: + if (value == null) { + unsetKeys(); + } else { + setKeys((java.util.List)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case TRANSACTION_OR_UPDATE_ID: + return getTransactionOrUpdateId(); + + case COLUMN_ID: + return getColumnId(); + + case KEYS: + return getKeys(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case TRANSACTION_OR_UPDATE_ID: + return isSetTransactionOrUpdateId(); + case COLUMN_ID: + return isSetColumnId(); + case KEYS: + return isSetKeys(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that instanceof getForUpdate_args) + return this.equals((getForUpdate_args)that); + return false; + } + + public boolean equals(getForUpdate_args that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_transactionOrUpdateId = true; + boolean that_present_transactionOrUpdateId = true; + if (this_present_transactionOrUpdateId || that_present_transactionOrUpdateId) { + if (!(this_present_transactionOrUpdateId && that_present_transactionOrUpdateId)) + return false; + if (this.transactionOrUpdateId != that.transactionOrUpdateId) + return false; + } + + boolean this_present_columnId = true; + boolean that_present_columnId = true; + if (this_present_columnId || that_present_columnId) { + if (!(this_present_columnId && that_present_columnId)) + return false; + if (this.columnId != that.columnId) + return false; + } + + boolean this_present_keys = true && this.isSetKeys(); + boolean that_present_keys = true && that.isSetKeys(); + if (this_present_keys || that_present_keys) { + if (!(this_present_keys && that_present_keys)) + return false; + if (!this.keys.equals(that.keys)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(transactionOrUpdateId); + + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(columnId); + + hashCode = hashCode * 8191 + ((isSetKeys()) ? 131071 : 524287); + if (isSetKeys()) + hashCode = hashCode * 8191 + keys.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(getForUpdate_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.compare(isSetTransactionOrUpdateId(), other.isSetTransactionOrUpdateId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTransactionOrUpdateId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transactionOrUpdateId, other.transactionOrUpdateId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetColumnId(), other.isSetColumnId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetColumnId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columnId, other.columnId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetKeys(), other.isSetKeys()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetKeys()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.keys, other.keys); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + @Override + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("getForUpdate_args("); + boolean first = true; + + sb.append("transactionOrUpdateId:"); + sb.append(this.transactionOrUpdateId); + first = false; + if (!first) sb.append(", "); + sb.append("columnId:"); + sb.append(this.columnId); + first = false; + if (!first) sb.append(", "); + sb.append("keys:"); + if (this.keys == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.keys, sb); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // alas, we cannot check 'transactionOrUpdateId' because it's a primitive and you chose the non-beans generator. + // alas, we cannot check 'columnId' because it's a primitive and you chose the non-beans generator. + if (keys == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'keys' was not present! Struct: " + toString()); + } + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class getForUpdate_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public getForUpdate_argsStandardScheme getScheme() { + return new getForUpdate_argsStandardScheme(); + } + } + + private static class getForUpdate_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, getForUpdate_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // TRANSACTION_OR_UPDATE_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.transactionOrUpdateId = iprot.readI64(); + struct.setTransactionOrUpdateIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // COLUMN_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.columnId = iprot.readI64(); + struct.setColumnIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // KEYS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list64 = iprot.readListBegin(); + struct.keys = new java.util.ArrayList(_list64.size); + @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem65; + for (int _i66 = 0; _i66 < _list64.size; ++_i66) + { + _elem65 = iprot.readBinary(); + struct.keys.add(_elem65); + } + iprot.readListEnd(); + } + struct.setKeysIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + if (!struct.isSetTransactionOrUpdateId()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'transactionOrUpdateId' was not found in serialized data! Struct: " + toString()); + } + if (!struct.isSetColumnId()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'columnId' was not found in serialized data! Struct: " + toString()); + } + struct.validate(); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot, getForUpdate_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(TRANSACTION_OR_UPDATE_ID_FIELD_DESC); + oprot.writeI64(struct.transactionOrUpdateId); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(COLUMN_ID_FIELD_DESC); + oprot.writeI64(struct.columnId); + oprot.writeFieldEnd(); + if (struct.keys != null) { + oprot.writeFieldBegin(KEYS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.keys.size())); + for (java.nio.ByteBuffer _iter67 : struct.keys) + { + oprot.writeBinary(_iter67); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getForUpdate_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public getForUpdate_argsTupleScheme getScheme() { + return new getForUpdate_argsTupleScheme(); + } + } + + private static class getForUpdate_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getForUpdate_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + oprot.writeI64(struct.transactionOrUpdateId); + oprot.writeI64(struct.columnId); + { + oprot.writeI32(struct.keys.size()); + for (java.nio.ByteBuffer _iter68 : struct.keys) + { + oprot.writeBinary(_iter68); + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getForUpdate_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.transactionOrUpdateId = iprot.readI64(); + struct.setTransactionOrUpdateIdIsSet(true); + struct.columnId = iprot.readI64(); + struct.setColumnIdIsSet(true); + { + org.apache.thrift.protocol.TList _list69 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRING); + struct.keys = new java.util.ArrayList(_list69.size); + @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem70; + for (int _i71 = 0; _i71 < _list69.size; ++_i71) + { + _elem70 = iprot.readBinary(); + struct.keys.add(_elem70); + } + } + struct.setKeysIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) + public static class getForUpdate_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getForUpdate_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getForUpdate_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getForUpdate_resultTupleSchemeFactory(); + + public @org.apache.thrift.annotation.Nullable UpdateBegin success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + @Override + public short getThriftFieldId() { + return _thriftId; + } + + @Override + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, UpdateBegin.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getForUpdate_result.class, metaDataMap); + } + + public getForUpdate_result() { + } + + public getForUpdate_result( + UpdateBegin success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public getForUpdate_result(getForUpdate_result other) { + if (other.isSetSuccess()) { + this.success = new UpdateBegin(other.success); + } + } + + @Override + public getForUpdate_result deepCopy() { + return new getForUpdate_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + @org.apache.thrift.annotation.Nullable + public UpdateBegin getSuccess() { + return this.success; + } + + public getForUpdate_result setSuccess(@org.apache.thrift.annotation.Nullable UpdateBegin success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((UpdateBegin)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that instanceof getForUpdate_result) + return this.equals((getForUpdate_result)that); + return false; + } + + public boolean equals(getForUpdate_result that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(getForUpdate_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + @Override + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("getForUpdate_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + if (success != null) { + success.validate(); + } + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class getForUpdate_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public getForUpdate_resultStandardScheme getScheme() { + return new getForUpdate_resultStandardScheme(); + } + } + + private static class getForUpdate_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, getForUpdate_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.success = new UpdateBegin(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot, getForUpdate_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + struct.success.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getForUpdate_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public getForUpdate_resultTupleScheme getScheme() { + return new getForUpdate_resultTupleScheme(); + } + } + + private static class getForUpdate_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getForUpdate_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + struct.success.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getForUpdate_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new UpdateBegin(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) + public static class exists_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("exists_args"); + + private static final org.apache.thrift.protocol.TField TRANSACTION_OR_UPDATE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("transactionOrUpdateId", org.apache.thrift.protocol.TType.I64, (short)1); + private static final org.apache.thrift.protocol.TField COLUMN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("columnId", org.apache.thrift.protocol.TType.I64, (short)3); + private static final org.apache.thrift.protocol.TField KEYS_FIELD_DESC = new org.apache.thrift.protocol.TField("keys", org.apache.thrift.protocol.TType.LIST, (short)4); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new exists_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new exists_argsTupleSchemeFactory(); + + public long transactionOrUpdateId; // required + public long columnId; // required + public @org.apache.thrift.annotation.Nullable java.util.List keys; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + TRANSACTION_OR_UPDATE_ID((short)1, "transactionOrUpdateId"), + COLUMN_ID((short)3, "columnId"), + KEYS((short)4, "keys"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // TRANSACTION_OR_UPDATE_ID + return TRANSACTION_OR_UPDATE_ID; + case 3: // COLUMN_ID + return COLUMN_ID; + case 4: // KEYS + return KEYS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + @Override + public short getThriftFieldId() { + return _thriftId; + } + + @Override + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __TRANSACTIONORUPDATEID_ISSET_ID = 0; + private static final int __COLUMNID_ISSET_ID = 1; + private byte __isset_bitfield = 0; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.TRANSACTION_OR_UPDATE_ID, new org.apache.thrift.meta_data.FieldMetaData("transactionOrUpdateId", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.COLUMN_ID, new org.apache.thrift.meta_data.FieldMetaData("columnId", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.KEYS, new org.apache.thrift.meta_data.FieldMetaData("keys", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(exists_args.class, metaDataMap); + } + + public exists_args() { + } + + public exists_args( + long transactionOrUpdateId, + long columnId, + java.util.List keys) + { + this(); + this.transactionOrUpdateId = transactionOrUpdateId; + setTransactionOrUpdateIdIsSet(true); + this.columnId = columnId; + setColumnIdIsSet(true); + this.keys = keys; + } + + /** + * Performs a deep copy on other. + */ + public exists_args(exists_args other) { + __isset_bitfield = other.__isset_bitfield; + this.transactionOrUpdateId = other.transactionOrUpdateId; + this.columnId = other.columnId; + if (other.isSetKeys()) { + java.util.List __this__keys = new java.util.ArrayList(other.keys); + this.keys = __this__keys; + } + } + + @Override + public exists_args deepCopy() { + return new exists_args(this); + } + + @Override + public void clear() { + setTransactionOrUpdateIdIsSet(false); + this.transactionOrUpdateId = 0; + setColumnIdIsSet(false); + this.columnId = 0; + this.keys = null; + } + + public long getTransactionOrUpdateId() { + return this.transactionOrUpdateId; + } + + public exists_args setTransactionOrUpdateId(long transactionOrUpdateId) { + this.transactionOrUpdateId = transactionOrUpdateId; + setTransactionOrUpdateIdIsSet(true); + return this; + } + + public void unsetTransactionOrUpdateId() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TRANSACTIONORUPDATEID_ISSET_ID); + } + + /** Returns true if field transactionOrUpdateId is set (has been assigned a value) and false otherwise */ + public boolean isSetTransactionOrUpdateId() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TRANSACTIONORUPDATEID_ISSET_ID); + } + + public void setTransactionOrUpdateIdIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TRANSACTIONORUPDATEID_ISSET_ID, value); + } + + public long getColumnId() { + return this.columnId; + } + + public exists_args setColumnId(long columnId) { + this.columnId = columnId; + setColumnIdIsSet(true); + return this; + } + + public void unsetColumnId() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __COLUMNID_ISSET_ID); + } + + /** Returns true if field columnId is set (has been assigned a value) and false otherwise */ + public boolean isSetColumnId() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __COLUMNID_ISSET_ID); + } + + public void setColumnIdIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __COLUMNID_ISSET_ID, value); + } + + public int getKeysSize() { + return (this.keys == null) ? 0 : this.keys.size(); + } + + @org.apache.thrift.annotation.Nullable + public java.util.Iterator getKeysIterator() { + return (this.keys == null) ? null : this.keys.iterator(); + } + + public void addToKeys(java.nio.ByteBuffer elem) { + if (this.keys == null) { + this.keys = new java.util.ArrayList(); + } + this.keys.add(elem); + } + + @org.apache.thrift.annotation.Nullable + public java.util.List getKeys() { + return this.keys; + } + + public exists_args setKeys(@org.apache.thrift.annotation.Nullable java.util.List keys) { + this.keys = keys; + return this; + } + + public void unsetKeys() { + this.keys = null; + } + + /** Returns true if field keys is set (has been assigned a value) and false otherwise */ + public boolean isSetKeys() { + return this.keys != null; + } + + public void setKeysIsSet(boolean value) { + if (!value) { + this.keys = null; + } + } + + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case TRANSACTION_OR_UPDATE_ID: + if (value == null) { + unsetTransactionOrUpdateId(); + } else { + setTransactionOrUpdateId((java.lang.Long)value); + } + break; + + case COLUMN_ID: + if (value == null) { + unsetColumnId(); + } else { + setColumnId((java.lang.Long)value); + } + break; + + case KEYS: + if (value == null) { + unsetKeys(); + } else { + setKeys((java.util.List)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case TRANSACTION_OR_UPDATE_ID: + return getTransactionOrUpdateId(); + + case COLUMN_ID: + return getColumnId(); + + case KEYS: + return getKeys(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case TRANSACTION_OR_UPDATE_ID: + return isSetTransactionOrUpdateId(); + case COLUMN_ID: + return isSetColumnId(); + case KEYS: + return isSetKeys(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that instanceof exists_args) + return this.equals((exists_args)that); + return false; + } + + public boolean equals(exists_args that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_transactionOrUpdateId = true; + boolean that_present_transactionOrUpdateId = true; + if (this_present_transactionOrUpdateId || that_present_transactionOrUpdateId) { + if (!(this_present_transactionOrUpdateId && that_present_transactionOrUpdateId)) + return false; + if (this.transactionOrUpdateId != that.transactionOrUpdateId) + return false; + } + + boolean this_present_columnId = true; + boolean that_present_columnId = true; + if (this_present_columnId || that_present_columnId) { + if (!(this_present_columnId && that_present_columnId)) + return false; + if (this.columnId != that.columnId) + return false; + } + + boolean this_present_keys = true && this.isSetKeys(); + boolean that_present_keys = true && that.isSetKeys(); + if (this_present_keys || that_present_keys) { + if (!(this_present_keys && that_present_keys)) + return false; + if (!this.keys.equals(that.keys)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(transactionOrUpdateId); + + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(columnId); + + hashCode = hashCode * 8191 + ((isSetKeys()) ? 131071 : 524287); + if (isSetKeys()) + hashCode = hashCode * 8191 + keys.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(exists_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.compare(isSetTransactionOrUpdateId(), other.isSetTransactionOrUpdateId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTransactionOrUpdateId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transactionOrUpdateId, other.transactionOrUpdateId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetColumnId(), other.isSetColumnId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetColumnId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columnId, other.columnId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetKeys(), other.isSetKeys()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetKeys()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.keys, other.keys); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + @Override + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("exists_args("); + boolean first = true; + + sb.append("transactionOrUpdateId:"); + sb.append(this.transactionOrUpdateId); + first = false; + if (!first) sb.append(", "); + sb.append("columnId:"); + sb.append(this.columnId); + first = false; + if (!first) sb.append(", "); + sb.append("keys:"); + if (this.keys == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.keys, sb); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // alas, we cannot check 'transactionOrUpdateId' because it's a primitive and you chose the non-beans generator. + // alas, we cannot check 'columnId' because it's a primitive and you chose the non-beans generator. + if (keys == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'keys' was not present! Struct: " + toString()); + } + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class exists_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public exists_argsStandardScheme getScheme() { + return new exists_argsStandardScheme(); + } + } + + private static class exists_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, exists_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // TRANSACTION_OR_UPDATE_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.transactionOrUpdateId = iprot.readI64(); + struct.setTransactionOrUpdateIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // COLUMN_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.columnId = iprot.readI64(); + struct.setColumnIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // KEYS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list72 = iprot.readListBegin(); + struct.keys = new java.util.ArrayList(_list72.size); + @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem73; + for (int _i74 = 0; _i74 < _list72.size; ++_i74) + { + _elem73 = iprot.readBinary(); + struct.keys.add(_elem73); + } + iprot.readListEnd(); + } + struct.setKeysIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + if (!struct.isSetTransactionOrUpdateId()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'transactionOrUpdateId' was not found in serialized data! Struct: " + toString()); + } + if (!struct.isSetColumnId()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'columnId' was not found in serialized data! Struct: " + toString()); + } + struct.validate(); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot, exists_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(TRANSACTION_OR_UPDATE_ID_FIELD_DESC); + oprot.writeI64(struct.transactionOrUpdateId); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(COLUMN_ID_FIELD_DESC); + oprot.writeI64(struct.columnId); + oprot.writeFieldEnd(); + if (struct.keys != null) { + oprot.writeFieldBegin(KEYS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.keys.size())); + for (java.nio.ByteBuffer _iter75 : struct.keys) + { + oprot.writeBinary(_iter75); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class exists_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public exists_argsTupleScheme getScheme() { + return new exists_argsTupleScheme(); + } + } + + private static class exists_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, exists_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + oprot.writeI64(struct.transactionOrUpdateId); + oprot.writeI64(struct.columnId); + { + oprot.writeI32(struct.keys.size()); + for (java.nio.ByteBuffer _iter76 : struct.keys) + { + oprot.writeBinary(_iter76); + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, exists_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.transactionOrUpdateId = iprot.readI64(); + struct.setTransactionOrUpdateIdIsSet(true); + struct.columnId = iprot.readI64(); + struct.setColumnIdIsSet(true); + { + org.apache.thrift.protocol.TList _list77 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRING); + struct.keys = new java.util.ArrayList(_list77.size); + @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem78; + for (int _i79 = 0; _i79 < _list77.size; ++_i79) + { + _elem78 = iprot.readBinary(); + struct.keys.add(_elem78); + } + } + struct.setKeysIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) + public static class exists_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("exists_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new exists_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new exists_resultTupleSchemeFactory(); + + public boolean success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + @Override + public short getThriftFieldId() { + return _thriftId; + } + + @Override + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __SUCCESS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(exists_result.class, metaDataMap); + } + + public exists_result() { + } + + public exists_result( + boolean success) + { + this(); + this.success = success; + setSuccessIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public exists_result(exists_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + } + + @Override + public exists_result deepCopy() { + return new exists_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = false; + } + + public boolean isSuccess() { + return this.success; + } + + public exists_result setSuccess(boolean success) { + this.success = success; + setSuccessIsSet(true); + return this; + } + + public void unsetSuccess() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + } + + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((java.lang.Boolean)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return isSuccess(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that instanceof exists_result) + return this.equals((exists_result)that); + return false; + } + + public boolean equals(exists_result that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((success) ? 131071 : 524287); + + return hashCode; + } + + @Override + public int compareTo(exists_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + @Override + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("exists_result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class exists_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public exists_resultStandardScheme getScheme() { + return new exists_resultStandardScheme(); + } + } + + private static class exists_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, exists_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot, exists_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBool(struct.success); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class exists_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public exists_resultTupleScheme getScheme() { + return new exists_resultTupleScheme(); + } + } + + private static class exists_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, exists_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + oprot.writeBool(struct.success); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, exists_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) + public static class openIterator_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("openIterator_args"); + + private static final org.apache.thrift.protocol.TField TRANSACTION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("transactionId", org.apache.thrift.protocol.TType.I64, (short)1); + private static final org.apache.thrift.protocol.TField COLUMN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("columnId", org.apache.thrift.protocol.TType.I64, (short)2); + private static final org.apache.thrift.protocol.TField START_KEYS_INCLUSIVE_FIELD_DESC = new org.apache.thrift.protocol.TField("startKeysInclusive", org.apache.thrift.protocol.TType.LIST, (short)3); + private static final org.apache.thrift.protocol.TField END_KEYS_EXCLUSIVE_FIELD_DESC = new org.apache.thrift.protocol.TField("endKeysExclusive", org.apache.thrift.protocol.TType.LIST, (short)4); + private static final org.apache.thrift.protocol.TField REVERSE_FIELD_DESC = new org.apache.thrift.protocol.TField("reverse", org.apache.thrift.protocol.TType.BOOL, (short)5); + private static final org.apache.thrift.protocol.TField TIMEOUT_MS_FIELD_DESC = new org.apache.thrift.protocol.TField("timeoutMs", org.apache.thrift.protocol.TType.I64, (short)6); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new openIterator_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new openIterator_argsTupleSchemeFactory(); + + public long transactionId; // required + public long columnId; // required + public @org.apache.thrift.annotation.Nullable java.util.List startKeysInclusive; // required + public @org.apache.thrift.annotation.Nullable java.util.List endKeysExclusive; // required + public boolean reverse; // required + public long timeoutMs; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + TRANSACTION_ID((short)1, "transactionId"), + COLUMN_ID((short)2, "columnId"), + START_KEYS_INCLUSIVE((short)3, "startKeysInclusive"), + END_KEYS_EXCLUSIVE((short)4, "endKeysExclusive"), + REVERSE((short)5, "reverse"), + TIMEOUT_MS((short)6, "timeoutMs"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // TRANSACTION_ID + return TRANSACTION_ID; + case 2: // COLUMN_ID + return COLUMN_ID; + case 3: // START_KEYS_INCLUSIVE + return START_KEYS_INCLUSIVE; + case 4: // END_KEYS_EXCLUSIVE + return END_KEYS_EXCLUSIVE; + case 5: // REVERSE + return REVERSE; + case 6: // TIMEOUT_MS + return TIMEOUT_MS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + @Override + public short getThriftFieldId() { + return _thriftId; + } + + @Override + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __TRANSACTIONID_ISSET_ID = 0; + private static final int __COLUMNID_ISSET_ID = 1; + private static final int __REVERSE_ISSET_ID = 2; + private static final int __TIMEOUTMS_ISSET_ID = 3; + private byte __isset_bitfield = 0; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.TRANSACTION_ID, new org.apache.thrift.meta_data.FieldMetaData("transactionId", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.COLUMN_ID, new org.apache.thrift.meta_data.FieldMetaData("columnId", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.START_KEYS_INCLUSIVE, new org.apache.thrift.meta_data.FieldMetaData("startKeysInclusive", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)))); + tmpMap.put(_Fields.END_KEYS_EXCLUSIVE, new org.apache.thrift.meta_data.FieldMetaData("endKeysExclusive", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)))); + tmpMap.put(_Fields.REVERSE, new org.apache.thrift.meta_data.FieldMetaData("reverse", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + tmpMap.put(_Fields.TIMEOUT_MS, new org.apache.thrift.meta_data.FieldMetaData("timeoutMs", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(openIterator_args.class, metaDataMap); + } + + public openIterator_args() { + } + + public openIterator_args( + long transactionId, + long columnId, + java.util.List startKeysInclusive, + java.util.List endKeysExclusive, + boolean reverse, + long timeoutMs) + { + this(); + this.transactionId = transactionId; + setTransactionIdIsSet(true); + this.columnId = columnId; + setColumnIdIsSet(true); + this.startKeysInclusive = startKeysInclusive; + this.endKeysExclusive = endKeysExclusive; + this.reverse = reverse; + setReverseIsSet(true); + this.timeoutMs = timeoutMs; + setTimeoutMsIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public openIterator_args(openIterator_args other) { + __isset_bitfield = other.__isset_bitfield; + this.transactionId = other.transactionId; + this.columnId = other.columnId; + if (other.isSetStartKeysInclusive()) { + java.util.List __this__startKeysInclusive = new java.util.ArrayList(other.startKeysInclusive); + this.startKeysInclusive = __this__startKeysInclusive; + } + if (other.isSetEndKeysExclusive()) { + java.util.List __this__endKeysExclusive = new java.util.ArrayList(other.endKeysExclusive); + this.endKeysExclusive = __this__endKeysExclusive; + } + this.reverse = other.reverse; + this.timeoutMs = other.timeoutMs; + } + + @Override + public openIterator_args deepCopy() { + return new openIterator_args(this); + } + + @Override + public void clear() { + setTransactionIdIsSet(false); + this.transactionId = 0; + setColumnIdIsSet(false); + this.columnId = 0; + this.startKeysInclusive = null; + this.endKeysExclusive = null; + setReverseIsSet(false); + this.reverse = false; + setTimeoutMsIsSet(false); + this.timeoutMs = 0; + } + + public long getTransactionId() { + return this.transactionId; + } + + public openIterator_args setTransactionId(long transactionId) { + this.transactionId = transactionId; + setTransactionIdIsSet(true); + return this; + } + + public void unsetTransactionId() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TRANSACTIONID_ISSET_ID); + } + + /** Returns true if field transactionId is set (has been assigned a value) and false otherwise */ + public boolean isSetTransactionId() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TRANSACTIONID_ISSET_ID); + } + + public void setTransactionIdIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TRANSACTIONID_ISSET_ID, value); + } + + public long getColumnId() { + return this.columnId; + } + + public openIterator_args setColumnId(long columnId) { + this.columnId = columnId; + setColumnIdIsSet(true); + return this; + } + + public void unsetColumnId() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __COLUMNID_ISSET_ID); + } + + /** Returns true if field columnId is set (has been assigned a value) and false otherwise */ + public boolean isSetColumnId() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __COLUMNID_ISSET_ID); + } + + public void setColumnIdIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __COLUMNID_ISSET_ID, value); + } + + public int getStartKeysInclusiveSize() { + return (this.startKeysInclusive == null) ? 0 : this.startKeysInclusive.size(); + } + + @org.apache.thrift.annotation.Nullable + public java.util.Iterator getStartKeysInclusiveIterator() { + return (this.startKeysInclusive == null) ? null : this.startKeysInclusive.iterator(); + } + + public void addToStartKeysInclusive(java.nio.ByteBuffer elem) { + if (this.startKeysInclusive == null) { + this.startKeysInclusive = new java.util.ArrayList(); + } + this.startKeysInclusive.add(elem); + } + + @org.apache.thrift.annotation.Nullable + public java.util.List getStartKeysInclusive() { + return this.startKeysInclusive; + } + + public openIterator_args setStartKeysInclusive(@org.apache.thrift.annotation.Nullable java.util.List startKeysInclusive) { + this.startKeysInclusive = startKeysInclusive; + return this; + } + + public void unsetStartKeysInclusive() { + this.startKeysInclusive = null; + } + + /** Returns true if field startKeysInclusive is set (has been assigned a value) and false otherwise */ + public boolean isSetStartKeysInclusive() { + return this.startKeysInclusive != null; + } + + public void setStartKeysInclusiveIsSet(boolean value) { + if (!value) { + this.startKeysInclusive = null; + } + } + + public int getEndKeysExclusiveSize() { + return (this.endKeysExclusive == null) ? 0 : this.endKeysExclusive.size(); + } + + @org.apache.thrift.annotation.Nullable + public java.util.Iterator getEndKeysExclusiveIterator() { + return (this.endKeysExclusive == null) ? null : this.endKeysExclusive.iterator(); + } + + public void addToEndKeysExclusive(java.nio.ByteBuffer elem) { + if (this.endKeysExclusive == null) { + this.endKeysExclusive = new java.util.ArrayList(); + } + this.endKeysExclusive.add(elem); + } + + @org.apache.thrift.annotation.Nullable + public java.util.List getEndKeysExclusive() { + return this.endKeysExclusive; + } + + public openIterator_args setEndKeysExclusive(@org.apache.thrift.annotation.Nullable java.util.List endKeysExclusive) { + this.endKeysExclusive = endKeysExclusive; + return this; + } + + public void unsetEndKeysExclusive() { + this.endKeysExclusive = null; + } + + /** Returns true if field endKeysExclusive is set (has been assigned a value) and false otherwise */ + public boolean isSetEndKeysExclusive() { + return this.endKeysExclusive != null; + } + + public void setEndKeysExclusiveIsSet(boolean value) { + if (!value) { + this.endKeysExclusive = null; + } + } + + public boolean isReverse() { + return this.reverse; + } + + public openIterator_args setReverse(boolean reverse) { + this.reverse = reverse; + setReverseIsSet(true); + return this; + } + + public void unsetReverse() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __REVERSE_ISSET_ID); + } + + /** Returns true if field reverse is set (has been assigned a value) and false otherwise */ + public boolean isSetReverse() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __REVERSE_ISSET_ID); + } + + public void setReverseIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __REVERSE_ISSET_ID, value); + } + + public long getTimeoutMs() { + return this.timeoutMs; + } + + public openIterator_args setTimeoutMs(long timeoutMs) { + this.timeoutMs = timeoutMs; + setTimeoutMsIsSet(true); + return this; + } + + public void unsetTimeoutMs() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TIMEOUTMS_ISSET_ID); + } + + /** Returns true if field timeoutMs is set (has been assigned a value) and false otherwise */ + public boolean isSetTimeoutMs() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TIMEOUTMS_ISSET_ID); + } + + public void setTimeoutMsIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TIMEOUTMS_ISSET_ID, value); + } + + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case TRANSACTION_ID: + if (value == null) { + unsetTransactionId(); + } else { + setTransactionId((java.lang.Long)value); + } + break; + + case COLUMN_ID: + if (value == null) { + unsetColumnId(); + } else { + setColumnId((java.lang.Long)value); + } + break; + + case START_KEYS_INCLUSIVE: + if (value == null) { + unsetStartKeysInclusive(); + } else { + setStartKeysInclusive((java.util.List)value); + } + break; + + case END_KEYS_EXCLUSIVE: + if (value == null) { + unsetEndKeysExclusive(); + } else { + setEndKeysExclusive((java.util.List)value); + } + break; + + case REVERSE: + if (value == null) { + unsetReverse(); + } else { + setReverse((java.lang.Boolean)value); + } + break; + + case TIMEOUT_MS: + if (value == null) { + unsetTimeoutMs(); + } else { + setTimeoutMs((java.lang.Long)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case TRANSACTION_ID: + return getTransactionId(); + + case COLUMN_ID: + return getColumnId(); + + case START_KEYS_INCLUSIVE: + return getStartKeysInclusive(); + + case END_KEYS_EXCLUSIVE: + return getEndKeysExclusive(); + + case REVERSE: + return isReverse(); + + case TIMEOUT_MS: + return getTimeoutMs(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case TRANSACTION_ID: + return isSetTransactionId(); + case COLUMN_ID: + return isSetColumnId(); + case START_KEYS_INCLUSIVE: + return isSetStartKeysInclusive(); + case END_KEYS_EXCLUSIVE: + return isSetEndKeysExclusive(); + case REVERSE: + return isSetReverse(); + case TIMEOUT_MS: + return isSetTimeoutMs(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that instanceof openIterator_args) + return this.equals((openIterator_args)that); + return false; + } + + public boolean equals(openIterator_args that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_transactionId = true; + boolean that_present_transactionId = true; + if (this_present_transactionId || that_present_transactionId) { + if (!(this_present_transactionId && that_present_transactionId)) + return false; + if (this.transactionId != that.transactionId) + return false; + } + + boolean this_present_columnId = true; + boolean that_present_columnId = true; + if (this_present_columnId || that_present_columnId) { + if (!(this_present_columnId && that_present_columnId)) + return false; + if (this.columnId != that.columnId) + return false; + } + + boolean this_present_startKeysInclusive = true && this.isSetStartKeysInclusive(); + boolean that_present_startKeysInclusive = true && that.isSetStartKeysInclusive(); + if (this_present_startKeysInclusive || that_present_startKeysInclusive) { + if (!(this_present_startKeysInclusive && that_present_startKeysInclusive)) + return false; + if (!this.startKeysInclusive.equals(that.startKeysInclusive)) + return false; + } + + boolean this_present_endKeysExclusive = true && this.isSetEndKeysExclusive(); + boolean that_present_endKeysExclusive = true && that.isSetEndKeysExclusive(); + if (this_present_endKeysExclusive || that_present_endKeysExclusive) { + if (!(this_present_endKeysExclusive && that_present_endKeysExclusive)) + return false; + if (!this.endKeysExclusive.equals(that.endKeysExclusive)) + return false; + } + + boolean this_present_reverse = true; + boolean that_present_reverse = true; + if (this_present_reverse || that_present_reverse) { + if (!(this_present_reverse && that_present_reverse)) + return false; + if (this.reverse != that.reverse) + return false; + } + + boolean this_present_timeoutMs = true; + boolean that_present_timeoutMs = true; + if (this_present_timeoutMs || that_present_timeoutMs) { + if (!(this_present_timeoutMs && that_present_timeoutMs)) + return false; + if (this.timeoutMs != that.timeoutMs) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(transactionId); + + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(columnId); + + hashCode = hashCode * 8191 + ((isSetStartKeysInclusive()) ? 131071 : 524287); + if (isSetStartKeysInclusive()) + hashCode = hashCode * 8191 + startKeysInclusive.hashCode(); + + hashCode = hashCode * 8191 + ((isSetEndKeysExclusive()) ? 131071 : 524287); + if (isSetEndKeysExclusive()) + hashCode = hashCode * 8191 + endKeysExclusive.hashCode(); + + hashCode = hashCode * 8191 + ((reverse) ? 131071 : 524287); + + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(timeoutMs); + + return hashCode; + } + + @Override + public int compareTo(openIterator_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.compare(isSetTransactionId(), other.isSetTransactionId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTransactionId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transactionId, other.transactionId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetColumnId(), other.isSetColumnId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetColumnId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columnId, other.columnId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetStartKeysInclusive(), other.isSetStartKeysInclusive()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStartKeysInclusive()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startKeysInclusive, other.startKeysInclusive); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetEndKeysExclusive(), other.isSetEndKeysExclusive()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEndKeysExclusive()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endKeysExclusive, other.endKeysExclusive); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetReverse(), other.isSetReverse()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReverse()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.reverse, other.reverse); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetTimeoutMs(), other.isSetTimeoutMs()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTimeoutMs()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timeoutMs, other.timeoutMs); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + @Override + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("openIterator_args("); + boolean first = true; + + sb.append("transactionId:"); + sb.append(this.transactionId); + first = false; + if (!first) sb.append(", "); + sb.append("columnId:"); + sb.append(this.columnId); + first = false; + if (!first) sb.append(", "); + sb.append("startKeysInclusive:"); + if (this.startKeysInclusive == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.startKeysInclusive, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("endKeysExclusive:"); + if (this.endKeysExclusive == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.endKeysExclusive, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("reverse:"); + sb.append(this.reverse); + first = false; + if (!first) sb.append(", "); + sb.append("timeoutMs:"); + sb.append(this.timeoutMs); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // alas, we cannot check 'transactionId' because it's a primitive and you chose the non-beans generator. + // alas, we cannot check 'columnId' because it's a primitive and you chose the non-beans generator. + if (startKeysInclusive == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'startKeysInclusive' was not present! Struct: " + toString()); + } + // alas, we cannot check 'reverse' because it's a primitive and you chose the non-beans generator. + // alas, we cannot check 'timeoutMs' because it's a primitive and you chose the non-beans generator. + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class openIterator_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public openIterator_argsStandardScheme getScheme() { + return new openIterator_argsStandardScheme(); + } + } + + private static class openIterator_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, openIterator_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // TRANSACTION_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.transactionId = iprot.readI64(); + struct.setTransactionIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // COLUMN_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.columnId = iprot.readI64(); + struct.setColumnIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // START_KEYS_INCLUSIVE + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list80 = iprot.readListBegin(); + struct.startKeysInclusive = new java.util.ArrayList(_list80.size); + @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem81; + for (int _i82 = 0; _i82 < _list80.size; ++_i82) + { + _elem81 = iprot.readBinary(); + struct.startKeysInclusive.add(_elem81); + } + iprot.readListEnd(); + } + struct.setStartKeysInclusiveIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // END_KEYS_EXCLUSIVE + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list83 = iprot.readListBegin(); + struct.endKeysExclusive = new java.util.ArrayList(_list83.size); + @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem84; + for (int _i85 = 0; _i85 < _list83.size; ++_i85) + { + _elem84 = iprot.readBinary(); + struct.endKeysExclusive.add(_elem84); + } + iprot.readListEnd(); + } + struct.setEndKeysExclusiveIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // REVERSE + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.reverse = iprot.readBool(); + struct.setReverseIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 6: // TIMEOUT_MS + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.timeoutMs = iprot.readI64(); + struct.setTimeoutMsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + if (!struct.isSetTransactionId()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'transactionId' was not found in serialized data! Struct: " + toString()); + } + if (!struct.isSetColumnId()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'columnId' was not found in serialized data! Struct: " + toString()); + } + if (!struct.isSetReverse()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'reverse' was not found in serialized data! Struct: " + toString()); + } + if (!struct.isSetTimeoutMs()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'timeoutMs' was not found in serialized data! Struct: " + toString()); + } + struct.validate(); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot, openIterator_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(TRANSACTION_ID_FIELD_DESC); + oprot.writeI64(struct.transactionId); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(COLUMN_ID_FIELD_DESC); + oprot.writeI64(struct.columnId); + oprot.writeFieldEnd(); + if (struct.startKeysInclusive != null) { + oprot.writeFieldBegin(START_KEYS_INCLUSIVE_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.startKeysInclusive.size())); + for (java.nio.ByteBuffer _iter86 : struct.startKeysInclusive) + { + oprot.writeBinary(_iter86); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.endKeysExclusive != null) { + oprot.writeFieldBegin(END_KEYS_EXCLUSIVE_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.endKeysExclusive.size())); + for (java.nio.ByteBuffer _iter87 : struct.endKeysExclusive) + { + oprot.writeBinary(_iter87); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(REVERSE_FIELD_DESC); + oprot.writeBool(struct.reverse); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(TIMEOUT_MS_FIELD_DESC); + oprot.writeI64(struct.timeoutMs); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class openIterator_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public openIterator_argsTupleScheme getScheme() { + return new openIterator_argsTupleScheme(); + } + } + + private static class openIterator_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, openIterator_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + oprot.writeI64(struct.transactionId); + oprot.writeI64(struct.columnId); + { + oprot.writeI32(struct.startKeysInclusive.size()); + for (java.nio.ByteBuffer _iter88 : struct.startKeysInclusive) + { + oprot.writeBinary(_iter88); + } + } + oprot.writeBool(struct.reverse); + oprot.writeI64(struct.timeoutMs); + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetEndKeysExclusive()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetEndKeysExclusive()) { + { + oprot.writeI32(struct.endKeysExclusive.size()); + for (java.nio.ByteBuffer _iter89 : struct.endKeysExclusive) + { + oprot.writeBinary(_iter89); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, openIterator_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.transactionId = iprot.readI64(); + struct.setTransactionIdIsSet(true); + struct.columnId = iprot.readI64(); + struct.setColumnIdIsSet(true); + { + org.apache.thrift.protocol.TList _list90 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRING); + struct.startKeysInclusive = new java.util.ArrayList(_list90.size); + @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem91; + for (int _i92 = 0; _i92 < _list90.size; ++_i92) + { + _elem91 = iprot.readBinary(); + struct.startKeysInclusive.add(_elem91); + } + } + struct.setStartKeysInclusiveIsSet(true); + struct.reverse = iprot.readBool(); + struct.setReverseIsSet(true); + struct.timeoutMs = iprot.readI64(); + struct.setTimeoutMsIsSet(true); + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list93 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRING); + struct.endKeysExclusive = new java.util.ArrayList(_list93.size); + @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem94; + for (int _i95 = 0; _i95 < _list93.size; ++_i95) + { + _elem94 = iprot.readBinary(); + struct.endKeysExclusive.add(_elem94); + } + } + struct.setEndKeysExclusiveIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) + public static class openIterator_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("openIterator_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I64, (short)0); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new openIterator_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new openIterator_resultTupleSchemeFactory(); + + public long success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + @Override + public short getThriftFieldId() { + return _thriftId; + } + + @Override + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __SUCCESS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(openIterator_result.class, metaDataMap); + } + + public openIterator_result() { + } + + public openIterator_result( + long success) + { + this(); + this.success = success; + setSuccessIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public openIterator_result(openIterator_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + } + + @Override + public openIterator_result deepCopy() { + return new openIterator_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = 0; + } + + public long getSuccess() { + return this.success; + } + + public openIterator_result setSuccess(long success) { + this.success = success; + setSuccessIsSet(true); + return this; + } + + public void unsetSuccess() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + } + + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((java.lang.Long)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that instanceof openIterator_result) + return this.equals((openIterator_result)that); + return false; + } + + public boolean equals(openIterator_result that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(success); + + return hashCode; + } + + @Override + public int compareTo(openIterator_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + @Override + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("openIterator_result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class openIterator_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public openIterator_resultStandardScheme getScheme() { + return new openIterator_resultStandardScheme(); + } + } + + private static class openIterator_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, openIterator_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.success = iprot.readI64(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot, openIterator_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeI64(struct.success); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class openIterator_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public openIterator_resultTupleScheme getScheme() { + return new openIterator_resultTupleScheme(); + } + } + + private static class openIterator_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, openIterator_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + oprot.writeI64(struct.success); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, openIterator_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = iprot.readI64(); + struct.setSuccessIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) + public static class closeIterator_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("closeIterator_args"); + + private static final org.apache.thrift.protocol.TField ITERATOR_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("iteratorId", org.apache.thrift.protocol.TType.I64, (short)1); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new closeIterator_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new closeIterator_argsTupleSchemeFactory(); + + public long iteratorId; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + ITERATOR_ID((short)1, "iteratorId"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // ITERATOR_ID + return ITERATOR_ID; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + @Override + public short getThriftFieldId() { + return _thriftId; + } + + @Override + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __ITERATORID_ISSET_ID = 0; + private byte __isset_bitfield = 0; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.ITERATOR_ID, new org.apache.thrift.meta_data.FieldMetaData("iteratorId", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(closeIterator_args.class, metaDataMap); + } + + public closeIterator_args() { + } + + public closeIterator_args( + long iteratorId) + { + this(); + this.iteratorId = iteratorId; + setIteratorIdIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public closeIterator_args(closeIterator_args other) { + __isset_bitfield = other.__isset_bitfield; + this.iteratorId = other.iteratorId; + } + + @Override + public closeIterator_args deepCopy() { + return new closeIterator_args(this); + } + + @Override + public void clear() { + setIteratorIdIsSet(false); + this.iteratorId = 0; + } + + public long getIteratorId() { + return this.iteratorId; + } + + public closeIterator_args setIteratorId(long iteratorId) { + this.iteratorId = iteratorId; + setIteratorIdIsSet(true); + return this; + } + + public void unsetIteratorId() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ITERATORID_ISSET_ID); + } + + /** Returns true if field iteratorId is set (has been assigned a value) and false otherwise */ + public boolean isSetIteratorId() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ITERATORID_ISSET_ID); + } + + public void setIteratorIdIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ITERATORID_ISSET_ID, value); + } + + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case ITERATOR_ID: + if (value == null) { + unsetIteratorId(); + } else { + setIteratorId((java.lang.Long)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case ITERATOR_ID: + return getIteratorId(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case ITERATOR_ID: + return isSetIteratorId(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that instanceof closeIterator_args) + return this.equals((closeIterator_args)that); + return false; + } + + public boolean equals(closeIterator_args that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_iteratorId = true; + boolean that_present_iteratorId = true; + if (this_present_iteratorId || that_present_iteratorId) { + if (!(this_present_iteratorId && that_present_iteratorId)) + return false; + if (this.iteratorId != that.iteratorId) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(iteratorId); + + return hashCode; + } + + @Override + public int compareTo(closeIterator_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.compare(isSetIteratorId(), other.isSetIteratorId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIteratorId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.iteratorId, other.iteratorId); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + @Override + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("closeIterator_args("); + boolean first = true; + + sb.append("iteratorId:"); + sb.append(this.iteratorId); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // alas, we cannot check 'iteratorId' because it's a primitive and you chose the non-beans generator. + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class closeIterator_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public closeIterator_argsStandardScheme getScheme() { + return new closeIterator_argsStandardScheme(); + } + } + + private static class closeIterator_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, closeIterator_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // ITERATOR_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.iteratorId = iprot.readI64(); + struct.setIteratorIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + if (!struct.isSetIteratorId()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'iteratorId' was not found in serialized data! Struct: " + toString()); + } + struct.validate(); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot, closeIterator_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(ITERATOR_ID_FIELD_DESC); + oprot.writeI64(struct.iteratorId); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class closeIterator_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public closeIterator_argsTupleScheme getScheme() { + return new closeIterator_argsTupleScheme(); + } + } + + private static class closeIterator_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, closeIterator_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + oprot.writeI64(struct.iteratorId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, closeIterator_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.iteratorId = iprot.readI64(); + struct.setIteratorIdIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) + public static class closeIterator_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("closeIterator_result"); + + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new closeIterator_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new closeIterator_resultTupleSchemeFactory(); + + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { +; + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + @Override + public short getThriftFieldId() { + return _thriftId; + } + + @Override + public java.lang.String getFieldName() { + return _fieldName; + } + } + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(closeIterator_result.class, metaDataMap); + } + + public closeIterator_result() { + } + + /** + * Performs a deep copy on other. + */ + public closeIterator_result(closeIterator_result other) { + } + + @Override + public closeIterator_result deepCopy() { + return new closeIterator_result(this); + } + + @Override + public void clear() { + } + + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that instanceof closeIterator_result) + return this.equals((closeIterator_result)that); + return false; + } + + public boolean equals(closeIterator_result that) { + if (that == null) + return false; + if (this == that) + return true; + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + return hashCode; + } + + @Override + public int compareTo(closeIterator_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + return 0; + } + + @org.apache.thrift.annotation.Nullable + @Override + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("closeIterator_result("); + boolean first = true; + + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class closeIterator_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public closeIterator_resultStandardScheme getScheme() { + return new closeIterator_resultStandardScheme(); + } + } + + private static class closeIterator_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, closeIterator_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot, closeIterator_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class closeIterator_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public closeIterator_resultTupleScheme getScheme() { + return new closeIterator_resultTupleScheme(); + } + } + + private static class closeIterator_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, closeIterator_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, closeIterator_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) + public static class seekTo_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("seekTo_args"); + + private static final org.apache.thrift.protocol.TField ITERATION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("iterationId", org.apache.thrift.protocol.TType.I64, (short)1); + private static final org.apache.thrift.protocol.TField KEYS_FIELD_DESC = new org.apache.thrift.protocol.TField("keys", org.apache.thrift.protocol.TType.LIST, (short)2); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new seekTo_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new seekTo_argsTupleSchemeFactory(); + + public long iterationId; // required + public @org.apache.thrift.annotation.Nullable java.util.List keys; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + ITERATION_ID((short)1, "iterationId"), + KEYS((short)2, "keys"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // ITERATION_ID + return ITERATION_ID; + case 2: // KEYS + return KEYS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + @Override + public short getThriftFieldId() { + return _thriftId; + } + + @Override + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __ITERATIONID_ISSET_ID = 0; + private byte __isset_bitfield = 0; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.ITERATION_ID, new org.apache.thrift.meta_data.FieldMetaData("iterationId", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.KEYS, new org.apache.thrift.meta_data.FieldMetaData("keys", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(seekTo_args.class, metaDataMap); + } + + public seekTo_args() { + } + + public seekTo_args( + long iterationId, + java.util.List keys) + { + this(); + this.iterationId = iterationId; + setIterationIdIsSet(true); + this.keys = keys; + } + + /** + * Performs a deep copy on other. + */ + public seekTo_args(seekTo_args other) { + __isset_bitfield = other.__isset_bitfield; + this.iterationId = other.iterationId; + if (other.isSetKeys()) { + java.util.List __this__keys = new java.util.ArrayList(other.keys); + this.keys = __this__keys; + } + } + + @Override + public seekTo_args deepCopy() { + return new seekTo_args(this); + } + + @Override + public void clear() { + setIterationIdIsSet(false); + this.iterationId = 0; + this.keys = null; + } + + public long getIterationId() { + return this.iterationId; + } + + public seekTo_args setIterationId(long iterationId) { + this.iterationId = iterationId; + setIterationIdIsSet(true); + return this; + } + + public void unsetIterationId() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ITERATIONID_ISSET_ID); + } + + /** Returns true if field iterationId is set (has been assigned a value) and false otherwise */ + public boolean isSetIterationId() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ITERATIONID_ISSET_ID); + } + + public void setIterationIdIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ITERATIONID_ISSET_ID, value); + } + + public int getKeysSize() { + return (this.keys == null) ? 0 : this.keys.size(); + } + + @org.apache.thrift.annotation.Nullable + public java.util.Iterator getKeysIterator() { + return (this.keys == null) ? null : this.keys.iterator(); + } + + public void addToKeys(java.nio.ByteBuffer elem) { + if (this.keys == null) { + this.keys = new java.util.ArrayList(); + } + this.keys.add(elem); + } + + @org.apache.thrift.annotation.Nullable + public java.util.List getKeys() { + return this.keys; + } + + public seekTo_args setKeys(@org.apache.thrift.annotation.Nullable java.util.List keys) { + this.keys = keys; + return this; + } + + public void unsetKeys() { + this.keys = null; + } + + /** Returns true if field keys is set (has been assigned a value) and false otherwise */ + public boolean isSetKeys() { + return this.keys != null; + } + + public void setKeysIsSet(boolean value) { + if (!value) { + this.keys = null; + } + } + + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case ITERATION_ID: + if (value == null) { + unsetIterationId(); + } else { + setIterationId((java.lang.Long)value); + } + break; + + case KEYS: + if (value == null) { + unsetKeys(); + } else { + setKeys((java.util.List)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case ITERATION_ID: + return getIterationId(); + + case KEYS: + return getKeys(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case ITERATION_ID: + return isSetIterationId(); + case KEYS: + return isSetKeys(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that instanceof seekTo_args) + return this.equals((seekTo_args)that); + return false; + } + + public boolean equals(seekTo_args that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_iterationId = true; + boolean that_present_iterationId = true; + if (this_present_iterationId || that_present_iterationId) { + if (!(this_present_iterationId && that_present_iterationId)) + return false; + if (this.iterationId != that.iterationId) + return false; + } + + boolean this_present_keys = true && this.isSetKeys(); + boolean that_present_keys = true && that.isSetKeys(); + if (this_present_keys || that_present_keys) { + if (!(this_present_keys && that_present_keys)) + return false; + if (!this.keys.equals(that.keys)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(iterationId); + + hashCode = hashCode * 8191 + ((isSetKeys()) ? 131071 : 524287); + if (isSetKeys()) + hashCode = hashCode * 8191 + keys.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(seekTo_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.compare(isSetIterationId(), other.isSetIterationId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIterationId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.iterationId, other.iterationId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetKeys(), other.isSetKeys()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetKeys()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.keys, other.keys); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + @Override + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("seekTo_args("); + boolean first = true; + + sb.append("iterationId:"); + sb.append(this.iterationId); + first = false; + if (!first) sb.append(", "); + sb.append("keys:"); + if (this.keys == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.keys, sb); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // alas, we cannot check 'iterationId' because it's a primitive and you chose the non-beans generator. + if (keys == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'keys' was not present! Struct: " + toString()); + } + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class seekTo_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public seekTo_argsStandardScheme getScheme() { + return new seekTo_argsStandardScheme(); + } + } + + private static class seekTo_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, seekTo_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // ITERATION_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.iterationId = iprot.readI64(); + struct.setIterationIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // KEYS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list96 = iprot.readListBegin(); + struct.keys = new java.util.ArrayList(_list96.size); + @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem97; + for (int _i98 = 0; _i98 < _list96.size; ++_i98) + { + _elem97 = iprot.readBinary(); + struct.keys.add(_elem97); + } + iprot.readListEnd(); + } + struct.setKeysIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + if (!struct.isSetIterationId()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'iterationId' was not found in serialized data! Struct: " + toString()); + } + struct.validate(); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot, seekTo_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(ITERATION_ID_FIELD_DESC); + oprot.writeI64(struct.iterationId); + oprot.writeFieldEnd(); + if (struct.keys != null) { + oprot.writeFieldBegin(KEYS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.keys.size())); + for (java.nio.ByteBuffer _iter99 : struct.keys) + { + oprot.writeBinary(_iter99); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class seekTo_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public seekTo_argsTupleScheme getScheme() { + return new seekTo_argsTupleScheme(); + } + } + + private static class seekTo_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, seekTo_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + oprot.writeI64(struct.iterationId); + { + oprot.writeI32(struct.keys.size()); + for (java.nio.ByteBuffer _iter100 : struct.keys) + { + oprot.writeBinary(_iter100); + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, seekTo_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.iterationId = iprot.readI64(); + struct.setIterationIdIsSet(true); + { + org.apache.thrift.protocol.TList _list101 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRING); + struct.keys = new java.util.ArrayList(_list101.size); + @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem102; + for (int _i103 = 0; _i103 < _list101.size; ++_i103) + { + _elem102 = iprot.readBinary(); + struct.keys.add(_elem102); + } + } + struct.setKeysIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) + public static class seekTo_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("seekTo_result"); + + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new seekTo_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new seekTo_resultTupleSchemeFactory(); + + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { +; + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + @Override + public short getThriftFieldId() { + return _thriftId; + } + + @Override + public java.lang.String getFieldName() { + return _fieldName; + } + } + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(seekTo_result.class, metaDataMap); + } + + public seekTo_result() { + } + + /** + * Performs a deep copy on other. + */ + public seekTo_result(seekTo_result other) { + } + + @Override + public seekTo_result deepCopy() { + return new seekTo_result(this); + } + + @Override + public void clear() { + } + + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that instanceof seekTo_result) + return this.equals((seekTo_result)that); + return false; + } + + public boolean equals(seekTo_result that) { + if (that == null) + return false; + if (this == that) + return true; + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + return hashCode; + } + + @Override + public int compareTo(seekTo_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + return 0; + } + + @org.apache.thrift.annotation.Nullable + @Override + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("seekTo_result("); + boolean first = true; + + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class seekTo_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public seekTo_resultStandardScheme getScheme() { + return new seekTo_resultStandardScheme(); + } + } + + private static class seekTo_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, seekTo_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot, seekTo_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class seekTo_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public seekTo_resultTupleScheme getScheme() { + return new seekTo_resultTupleScheme(); + } + } + + private static class seekTo_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, seekTo_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, seekTo_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) + public static class subsequent_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("subsequent_args"); + + private static final org.apache.thrift.protocol.TField ITERATION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("iterationId", org.apache.thrift.protocol.TType.I64, (short)1); + private static final org.apache.thrift.protocol.TField SKIP_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("skipCount", org.apache.thrift.protocol.TType.I64, (short)2); + private static final org.apache.thrift.protocol.TField TAKE_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("takeCount", org.apache.thrift.protocol.TType.I64, (short)3); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new subsequent_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new subsequent_argsTupleSchemeFactory(); + + public long iterationId; // required + public long skipCount; // required + public long takeCount; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + ITERATION_ID((short)1, "iterationId"), + SKIP_COUNT((short)2, "skipCount"), + TAKE_COUNT((short)3, "takeCount"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // ITERATION_ID + return ITERATION_ID; + case 2: // SKIP_COUNT + return SKIP_COUNT; + case 3: // TAKE_COUNT + return TAKE_COUNT; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + @Override + public short getThriftFieldId() { + return _thriftId; + } + + @Override + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __ITERATIONID_ISSET_ID = 0; + private static final int __SKIPCOUNT_ISSET_ID = 1; + private static final int __TAKECOUNT_ISSET_ID = 2; + private byte __isset_bitfield = 0; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.ITERATION_ID, new org.apache.thrift.meta_data.FieldMetaData("iterationId", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.SKIP_COUNT, new org.apache.thrift.meta_data.FieldMetaData("skipCount", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.TAKE_COUNT, new org.apache.thrift.meta_data.FieldMetaData("takeCount", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(subsequent_args.class, metaDataMap); + } + + public subsequent_args() { + } + + public subsequent_args( + long iterationId, + long skipCount, + long takeCount) + { + this(); + this.iterationId = iterationId; + setIterationIdIsSet(true); + this.skipCount = skipCount; + setSkipCountIsSet(true); + this.takeCount = takeCount; + setTakeCountIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public subsequent_args(subsequent_args other) { + __isset_bitfield = other.__isset_bitfield; + this.iterationId = other.iterationId; + this.skipCount = other.skipCount; + this.takeCount = other.takeCount; + } + + @Override + public subsequent_args deepCopy() { + return new subsequent_args(this); + } + + @Override + public void clear() { + setIterationIdIsSet(false); + this.iterationId = 0; + setSkipCountIsSet(false); + this.skipCount = 0; + setTakeCountIsSet(false); + this.takeCount = 0; + } + + public long getIterationId() { + return this.iterationId; + } + + public subsequent_args setIterationId(long iterationId) { + this.iterationId = iterationId; + setIterationIdIsSet(true); + return this; + } + + public void unsetIterationId() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ITERATIONID_ISSET_ID); + } + + /** Returns true if field iterationId is set (has been assigned a value) and false otherwise */ + public boolean isSetIterationId() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ITERATIONID_ISSET_ID); + } + + public void setIterationIdIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ITERATIONID_ISSET_ID, value); + } + + public long getSkipCount() { + return this.skipCount; + } + + public subsequent_args setSkipCount(long skipCount) { + this.skipCount = skipCount; + setSkipCountIsSet(true); + return this; + } + + public void unsetSkipCount() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SKIPCOUNT_ISSET_ID); + } + + /** Returns true if field skipCount is set (has been assigned a value) and false otherwise */ + public boolean isSetSkipCount() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SKIPCOUNT_ISSET_ID); + } + + public void setSkipCountIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SKIPCOUNT_ISSET_ID, value); + } + + public long getTakeCount() { + return this.takeCount; + } + + public subsequent_args setTakeCount(long takeCount) { + this.takeCount = takeCount; + setTakeCountIsSet(true); + return this; + } + + public void unsetTakeCount() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TAKECOUNT_ISSET_ID); + } + + /** Returns true if field takeCount is set (has been assigned a value) and false otherwise */ + public boolean isSetTakeCount() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TAKECOUNT_ISSET_ID); + } + + public void setTakeCountIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TAKECOUNT_ISSET_ID, value); + } + + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case ITERATION_ID: + if (value == null) { + unsetIterationId(); + } else { + setIterationId((java.lang.Long)value); + } + break; + + case SKIP_COUNT: + if (value == null) { + unsetSkipCount(); + } else { + setSkipCount((java.lang.Long)value); + } + break; + + case TAKE_COUNT: + if (value == null) { + unsetTakeCount(); + } else { + setTakeCount((java.lang.Long)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case ITERATION_ID: + return getIterationId(); + + case SKIP_COUNT: + return getSkipCount(); + + case TAKE_COUNT: + return getTakeCount(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case ITERATION_ID: + return isSetIterationId(); + case SKIP_COUNT: + return isSetSkipCount(); + case TAKE_COUNT: + return isSetTakeCount(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that instanceof subsequent_args) + return this.equals((subsequent_args)that); + return false; + } + + public boolean equals(subsequent_args that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_iterationId = true; + boolean that_present_iterationId = true; + if (this_present_iterationId || that_present_iterationId) { + if (!(this_present_iterationId && that_present_iterationId)) + return false; + if (this.iterationId != that.iterationId) + return false; + } + + boolean this_present_skipCount = true; + boolean that_present_skipCount = true; + if (this_present_skipCount || that_present_skipCount) { + if (!(this_present_skipCount && that_present_skipCount)) + return false; + if (this.skipCount != that.skipCount) + return false; + } + + boolean this_present_takeCount = true; + boolean that_present_takeCount = true; + if (this_present_takeCount || that_present_takeCount) { + if (!(this_present_takeCount && that_present_takeCount)) + return false; + if (this.takeCount != that.takeCount) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(iterationId); + + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(skipCount); + + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(takeCount); + + return hashCode; + } + + @Override + public int compareTo(subsequent_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.compare(isSetIterationId(), other.isSetIterationId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIterationId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.iterationId, other.iterationId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetSkipCount(), other.isSetSkipCount()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSkipCount()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.skipCount, other.skipCount); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetTakeCount(), other.isSetTakeCount()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTakeCount()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.takeCount, other.takeCount); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + @Override + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("subsequent_args("); + boolean first = true; + + sb.append("iterationId:"); + sb.append(this.iterationId); + first = false; + if (!first) sb.append(", "); + sb.append("skipCount:"); + sb.append(this.skipCount); + first = false; + if (!first) sb.append(", "); + sb.append("takeCount:"); + sb.append(this.takeCount); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // alas, we cannot check 'iterationId' because it's a primitive and you chose the non-beans generator. + // alas, we cannot check 'skipCount' because it's a primitive and you chose the non-beans generator. + // alas, we cannot check 'takeCount' because it's a primitive and you chose the non-beans generator. + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class subsequent_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public subsequent_argsStandardScheme getScheme() { + return new subsequent_argsStandardScheme(); + } + } + + private static class subsequent_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, subsequent_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // ITERATION_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.iterationId = iprot.readI64(); + struct.setIterationIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // SKIP_COUNT + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.skipCount = iprot.readI64(); + struct.setSkipCountIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // TAKE_COUNT + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.takeCount = iprot.readI64(); + struct.setTakeCountIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + if (!struct.isSetIterationId()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'iterationId' was not found in serialized data! Struct: " + toString()); + } + if (!struct.isSetSkipCount()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'skipCount' was not found in serialized data! Struct: " + toString()); + } + if (!struct.isSetTakeCount()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'takeCount' was not found in serialized data! Struct: " + toString()); + } + struct.validate(); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot, subsequent_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(ITERATION_ID_FIELD_DESC); + oprot.writeI64(struct.iterationId); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(SKIP_COUNT_FIELD_DESC); + oprot.writeI64(struct.skipCount); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(TAKE_COUNT_FIELD_DESC); + oprot.writeI64(struct.takeCount); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class subsequent_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public subsequent_argsTupleScheme getScheme() { + return new subsequent_argsTupleScheme(); + } + } + + private static class subsequent_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, subsequent_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + oprot.writeI64(struct.iterationId); + oprot.writeI64(struct.skipCount); + oprot.writeI64(struct.takeCount); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, subsequent_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.iterationId = iprot.readI64(); + struct.setIterationIdIsSet(true); + struct.skipCount = iprot.readI64(); + struct.setSkipCountIsSet(true); + struct.takeCount = iprot.readI64(); + struct.setTakeCountIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) + public static class subsequentExists_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("subsequentExists_args"); + + private static final org.apache.thrift.protocol.TField ITERATION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("iterationId", org.apache.thrift.protocol.TType.I64, (short)1); + private static final org.apache.thrift.protocol.TField SKIP_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("skipCount", org.apache.thrift.protocol.TType.I64, (short)2); + private static final org.apache.thrift.protocol.TField TAKE_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("takeCount", org.apache.thrift.protocol.TType.I64, (short)3); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new subsequentExists_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new subsequentExists_argsTupleSchemeFactory(); + + public long iterationId; // required + public long skipCount; // required + public long takeCount; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + ITERATION_ID((short)1, "iterationId"), + SKIP_COUNT((short)2, "skipCount"), + TAKE_COUNT((short)3, "takeCount"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // ITERATION_ID + return ITERATION_ID; + case 2: // SKIP_COUNT + return SKIP_COUNT; + case 3: // TAKE_COUNT + return TAKE_COUNT; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + @Override + public short getThriftFieldId() { + return _thriftId; + } + + @Override + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __ITERATIONID_ISSET_ID = 0; + private static final int __SKIPCOUNT_ISSET_ID = 1; + private static final int __TAKECOUNT_ISSET_ID = 2; + private byte __isset_bitfield = 0; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.ITERATION_ID, new org.apache.thrift.meta_data.FieldMetaData("iterationId", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.SKIP_COUNT, new org.apache.thrift.meta_data.FieldMetaData("skipCount", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.TAKE_COUNT, new org.apache.thrift.meta_data.FieldMetaData("takeCount", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(subsequentExists_args.class, metaDataMap); + } + + public subsequentExists_args() { + } + + public subsequentExists_args( + long iterationId, + long skipCount, + long takeCount) + { + this(); + this.iterationId = iterationId; + setIterationIdIsSet(true); + this.skipCount = skipCount; + setSkipCountIsSet(true); + this.takeCount = takeCount; + setTakeCountIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public subsequentExists_args(subsequentExists_args other) { + __isset_bitfield = other.__isset_bitfield; + this.iterationId = other.iterationId; + this.skipCount = other.skipCount; + this.takeCount = other.takeCount; + } + + @Override + public subsequentExists_args deepCopy() { + return new subsequentExists_args(this); + } + + @Override + public void clear() { + setIterationIdIsSet(false); + this.iterationId = 0; + setSkipCountIsSet(false); + this.skipCount = 0; + setTakeCountIsSet(false); + this.takeCount = 0; + } + + public long getIterationId() { + return this.iterationId; + } + + public subsequentExists_args setIterationId(long iterationId) { + this.iterationId = iterationId; + setIterationIdIsSet(true); + return this; + } + + public void unsetIterationId() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ITERATIONID_ISSET_ID); + } + + /** Returns true if field iterationId is set (has been assigned a value) and false otherwise */ + public boolean isSetIterationId() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ITERATIONID_ISSET_ID); + } + + public void setIterationIdIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ITERATIONID_ISSET_ID, value); + } + + public long getSkipCount() { + return this.skipCount; + } + + public subsequentExists_args setSkipCount(long skipCount) { + this.skipCount = skipCount; + setSkipCountIsSet(true); + return this; + } + + public void unsetSkipCount() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SKIPCOUNT_ISSET_ID); + } + + /** Returns true if field skipCount is set (has been assigned a value) and false otherwise */ + public boolean isSetSkipCount() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SKIPCOUNT_ISSET_ID); + } + + public void setSkipCountIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SKIPCOUNT_ISSET_ID, value); + } + + public long getTakeCount() { + return this.takeCount; + } + + public subsequentExists_args setTakeCount(long takeCount) { + this.takeCount = takeCount; + setTakeCountIsSet(true); + return this; + } + + public void unsetTakeCount() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TAKECOUNT_ISSET_ID); + } + + /** Returns true if field takeCount is set (has been assigned a value) and false otherwise */ + public boolean isSetTakeCount() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TAKECOUNT_ISSET_ID); + } + + public void setTakeCountIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TAKECOUNT_ISSET_ID, value); + } + + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case ITERATION_ID: + if (value == null) { + unsetIterationId(); + } else { + setIterationId((java.lang.Long)value); + } + break; + + case SKIP_COUNT: + if (value == null) { + unsetSkipCount(); + } else { + setSkipCount((java.lang.Long)value); + } + break; + + case TAKE_COUNT: + if (value == null) { + unsetTakeCount(); + } else { + setTakeCount((java.lang.Long)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case ITERATION_ID: + return getIterationId(); + + case SKIP_COUNT: + return getSkipCount(); + + case TAKE_COUNT: + return getTakeCount(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case ITERATION_ID: + return isSetIterationId(); + case SKIP_COUNT: + return isSetSkipCount(); + case TAKE_COUNT: + return isSetTakeCount(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that instanceof subsequentExists_args) + return this.equals((subsequentExists_args)that); + return false; + } + + public boolean equals(subsequentExists_args that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_iterationId = true; + boolean that_present_iterationId = true; + if (this_present_iterationId || that_present_iterationId) { + if (!(this_present_iterationId && that_present_iterationId)) + return false; + if (this.iterationId != that.iterationId) + return false; + } + + boolean this_present_skipCount = true; + boolean that_present_skipCount = true; + if (this_present_skipCount || that_present_skipCount) { + if (!(this_present_skipCount && that_present_skipCount)) + return false; + if (this.skipCount != that.skipCount) + return false; + } + + boolean this_present_takeCount = true; + boolean that_present_takeCount = true; + if (this_present_takeCount || that_present_takeCount) { + if (!(this_present_takeCount && that_present_takeCount)) + return false; + if (this.takeCount != that.takeCount) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(iterationId); + + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(skipCount); + + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(takeCount); + + return hashCode; + } + + @Override + public int compareTo(subsequentExists_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.compare(isSetIterationId(), other.isSetIterationId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIterationId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.iterationId, other.iterationId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetSkipCount(), other.isSetSkipCount()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSkipCount()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.skipCount, other.skipCount); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetTakeCount(), other.isSetTakeCount()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTakeCount()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.takeCount, other.takeCount); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + @Override + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("subsequentExists_args("); + boolean first = true; + + sb.append("iterationId:"); + sb.append(this.iterationId); + first = false; + if (!first) sb.append(", "); + sb.append("skipCount:"); + sb.append(this.skipCount); + first = false; + if (!first) sb.append(", "); + sb.append("takeCount:"); + sb.append(this.takeCount); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // alas, we cannot check 'iterationId' because it's a primitive and you chose the non-beans generator. + // alas, we cannot check 'skipCount' because it's a primitive and you chose the non-beans generator. + // alas, we cannot check 'takeCount' because it's a primitive and you chose the non-beans generator. + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class subsequentExists_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public subsequentExists_argsStandardScheme getScheme() { + return new subsequentExists_argsStandardScheme(); + } + } + + private static class subsequentExists_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, subsequentExists_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // ITERATION_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.iterationId = iprot.readI64(); + struct.setIterationIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // SKIP_COUNT + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.skipCount = iprot.readI64(); + struct.setSkipCountIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // TAKE_COUNT + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.takeCount = iprot.readI64(); + struct.setTakeCountIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + if (!struct.isSetIterationId()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'iterationId' was not found in serialized data! Struct: " + toString()); + } + if (!struct.isSetSkipCount()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'skipCount' was not found in serialized data! Struct: " + toString()); + } + if (!struct.isSetTakeCount()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'takeCount' was not found in serialized data! Struct: " + toString()); + } + struct.validate(); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot, subsequentExists_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(ITERATION_ID_FIELD_DESC); + oprot.writeI64(struct.iterationId); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(SKIP_COUNT_FIELD_DESC); + oprot.writeI64(struct.skipCount); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(TAKE_COUNT_FIELD_DESC); + oprot.writeI64(struct.takeCount); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class subsequentExists_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public subsequentExists_argsTupleScheme getScheme() { + return new subsequentExists_argsTupleScheme(); + } + } + + private static class subsequentExists_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, subsequentExists_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + oprot.writeI64(struct.iterationId); + oprot.writeI64(struct.skipCount); + oprot.writeI64(struct.takeCount); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, subsequentExists_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.iterationId = iprot.readI64(); + struct.setIterationIdIsSet(true); + struct.skipCount = iprot.readI64(); + struct.setSkipCountIsSet(true); + struct.takeCount = iprot.readI64(); + struct.setTakeCountIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) + public static class subsequentExists_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("subsequentExists_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new subsequentExists_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new subsequentExists_resultTupleSchemeFactory(); + + public boolean success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + @Override + public short getThriftFieldId() { + return _thriftId; + } + + @Override + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __SUCCESS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(subsequentExists_result.class, metaDataMap); + } + + public subsequentExists_result() { + } + + public subsequentExists_result( + boolean success) + { + this(); + this.success = success; + setSuccessIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public subsequentExists_result(subsequentExists_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + } + + @Override + public subsequentExists_result deepCopy() { + return new subsequentExists_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = false; + } + + public boolean isSuccess() { + return this.success; + } + + public subsequentExists_result setSuccess(boolean success) { + this.success = success; + setSuccessIsSet(true); + return this; + } + + public void unsetSuccess() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + } + + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((java.lang.Boolean)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return isSuccess(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that instanceof subsequentExists_result) + return this.equals((subsequentExists_result)that); + return false; + } + + public boolean equals(subsequentExists_result that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((success) ? 131071 : 524287); + + return hashCode; + } + + @Override + public int compareTo(subsequentExists_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + @Override + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("subsequentExists_result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class subsequentExists_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public subsequentExists_resultStandardScheme getScheme() { + return new subsequentExists_resultStandardScheme(); + } + } + + private static class subsequentExists_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, subsequentExists_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot, subsequentExists_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBool(struct.success); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class subsequentExists_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public subsequentExists_resultTupleScheme getScheme() { + return new subsequentExists_resultTupleScheme(); + } + } + + private static class subsequentExists_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, subsequentExists_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + oprot.writeBool(struct.success); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, subsequentExists_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) + public static class subsequentMultiGet_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("subsequentMultiGet_args"); + + private static final org.apache.thrift.protocol.TField ITERATION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("iterationId", org.apache.thrift.protocol.TType.I64, (short)1); + private static final org.apache.thrift.protocol.TField SKIP_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("skipCount", org.apache.thrift.protocol.TType.I64, (short)2); + private static final org.apache.thrift.protocol.TField TAKE_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("takeCount", org.apache.thrift.protocol.TType.I64, (short)3); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new subsequentMultiGet_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new subsequentMultiGet_argsTupleSchemeFactory(); + + public long iterationId; // required + public long skipCount; // required + public long takeCount; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + ITERATION_ID((short)1, "iterationId"), + SKIP_COUNT((short)2, "skipCount"), + TAKE_COUNT((short)3, "takeCount"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // ITERATION_ID + return ITERATION_ID; + case 2: // SKIP_COUNT + return SKIP_COUNT; + case 3: // TAKE_COUNT + return TAKE_COUNT; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + @Override + public short getThriftFieldId() { + return _thriftId; + } + + @Override + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __ITERATIONID_ISSET_ID = 0; + private static final int __SKIPCOUNT_ISSET_ID = 1; + private static final int __TAKECOUNT_ISSET_ID = 2; + private byte __isset_bitfield = 0; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.ITERATION_ID, new org.apache.thrift.meta_data.FieldMetaData("iterationId", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.SKIP_COUNT, new org.apache.thrift.meta_data.FieldMetaData("skipCount", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.TAKE_COUNT, new org.apache.thrift.meta_data.FieldMetaData("takeCount", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(subsequentMultiGet_args.class, metaDataMap); + } + + public subsequentMultiGet_args() { + } + + public subsequentMultiGet_args( + long iterationId, + long skipCount, + long takeCount) + { + this(); + this.iterationId = iterationId; + setIterationIdIsSet(true); + this.skipCount = skipCount; + setSkipCountIsSet(true); + this.takeCount = takeCount; + setTakeCountIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public subsequentMultiGet_args(subsequentMultiGet_args other) { + __isset_bitfield = other.__isset_bitfield; + this.iterationId = other.iterationId; + this.skipCount = other.skipCount; + this.takeCount = other.takeCount; + } + + @Override + public subsequentMultiGet_args deepCopy() { + return new subsequentMultiGet_args(this); + } + + @Override + public void clear() { + setIterationIdIsSet(false); + this.iterationId = 0; + setSkipCountIsSet(false); + this.skipCount = 0; + setTakeCountIsSet(false); + this.takeCount = 0; + } + + public long getIterationId() { + return this.iterationId; + } + + public subsequentMultiGet_args setIterationId(long iterationId) { + this.iterationId = iterationId; + setIterationIdIsSet(true); + return this; + } + + public void unsetIterationId() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ITERATIONID_ISSET_ID); + } + + /** Returns true if field iterationId is set (has been assigned a value) and false otherwise */ + public boolean isSetIterationId() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ITERATIONID_ISSET_ID); + } + + public void setIterationIdIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ITERATIONID_ISSET_ID, value); + } + + public long getSkipCount() { + return this.skipCount; + } + + public subsequentMultiGet_args setSkipCount(long skipCount) { + this.skipCount = skipCount; + setSkipCountIsSet(true); + return this; + } + + public void unsetSkipCount() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SKIPCOUNT_ISSET_ID); + } + + /** Returns true if field skipCount is set (has been assigned a value) and false otherwise */ + public boolean isSetSkipCount() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SKIPCOUNT_ISSET_ID); + } + + public void setSkipCountIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SKIPCOUNT_ISSET_ID, value); + } + + public long getTakeCount() { + return this.takeCount; + } + + public subsequentMultiGet_args setTakeCount(long takeCount) { + this.takeCount = takeCount; + setTakeCountIsSet(true); + return this; + } + + public void unsetTakeCount() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TAKECOUNT_ISSET_ID); + } + + /** Returns true if field takeCount is set (has been assigned a value) and false otherwise */ + public boolean isSetTakeCount() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TAKECOUNT_ISSET_ID); + } + + public void setTakeCountIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TAKECOUNT_ISSET_ID, value); + } + + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case ITERATION_ID: + if (value == null) { + unsetIterationId(); + } else { + setIterationId((java.lang.Long)value); + } + break; + + case SKIP_COUNT: + if (value == null) { + unsetSkipCount(); + } else { + setSkipCount((java.lang.Long)value); + } + break; + + case TAKE_COUNT: + if (value == null) { + unsetTakeCount(); + } else { + setTakeCount((java.lang.Long)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case ITERATION_ID: + return getIterationId(); + + case SKIP_COUNT: + return getSkipCount(); + + case TAKE_COUNT: + return getTakeCount(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case ITERATION_ID: + return isSetIterationId(); + case SKIP_COUNT: + return isSetSkipCount(); + case TAKE_COUNT: + return isSetTakeCount(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that instanceof subsequentMultiGet_args) + return this.equals((subsequentMultiGet_args)that); + return false; + } + + public boolean equals(subsequentMultiGet_args that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_iterationId = true; + boolean that_present_iterationId = true; + if (this_present_iterationId || that_present_iterationId) { + if (!(this_present_iterationId && that_present_iterationId)) + return false; + if (this.iterationId != that.iterationId) + return false; + } + + boolean this_present_skipCount = true; + boolean that_present_skipCount = true; + if (this_present_skipCount || that_present_skipCount) { + if (!(this_present_skipCount && that_present_skipCount)) + return false; + if (this.skipCount != that.skipCount) + return false; + } + + boolean this_present_takeCount = true; + boolean that_present_takeCount = true; + if (this_present_takeCount || that_present_takeCount) { + if (!(this_present_takeCount && that_present_takeCount)) + return false; + if (this.takeCount != that.takeCount) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(iterationId); + + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(skipCount); + + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(takeCount); + + return hashCode; + } + + @Override + public int compareTo(subsequentMultiGet_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.compare(isSetIterationId(), other.isSetIterationId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIterationId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.iterationId, other.iterationId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetSkipCount(), other.isSetSkipCount()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSkipCount()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.skipCount, other.skipCount); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetTakeCount(), other.isSetTakeCount()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTakeCount()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.takeCount, other.takeCount); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + @Override + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("subsequentMultiGet_args("); + boolean first = true; + + sb.append("iterationId:"); + sb.append(this.iterationId); + first = false; + if (!first) sb.append(", "); + sb.append("skipCount:"); + sb.append(this.skipCount); + first = false; + if (!first) sb.append(", "); + sb.append("takeCount:"); + sb.append(this.takeCount); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // alas, we cannot check 'iterationId' because it's a primitive and you chose the non-beans generator. + // alas, we cannot check 'skipCount' because it's a primitive and you chose the non-beans generator. + // alas, we cannot check 'takeCount' because it's a primitive and you chose the non-beans generator. + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class subsequentMultiGet_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public subsequentMultiGet_argsStandardScheme getScheme() { + return new subsequentMultiGet_argsStandardScheme(); + } + } + + private static class subsequentMultiGet_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, subsequentMultiGet_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // ITERATION_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.iterationId = iprot.readI64(); + struct.setIterationIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // SKIP_COUNT + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.skipCount = iprot.readI64(); + struct.setSkipCountIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // TAKE_COUNT + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.takeCount = iprot.readI64(); + struct.setTakeCountIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + if (!struct.isSetIterationId()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'iterationId' was not found in serialized data! Struct: " + toString()); + } + if (!struct.isSetSkipCount()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'skipCount' was not found in serialized data! Struct: " + toString()); + } + if (!struct.isSetTakeCount()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'takeCount' was not found in serialized data! Struct: " + toString()); + } + struct.validate(); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot, subsequentMultiGet_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(ITERATION_ID_FIELD_DESC); + oprot.writeI64(struct.iterationId); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(SKIP_COUNT_FIELD_DESC); + oprot.writeI64(struct.skipCount); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(TAKE_COUNT_FIELD_DESC); + oprot.writeI64(struct.takeCount); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class subsequentMultiGet_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public subsequentMultiGet_argsTupleScheme getScheme() { + return new subsequentMultiGet_argsTupleScheme(); + } + } + + private static class subsequentMultiGet_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, subsequentMultiGet_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + oprot.writeI64(struct.iterationId); + oprot.writeI64(struct.skipCount); + oprot.writeI64(struct.takeCount); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, subsequentMultiGet_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.iterationId = iprot.readI64(); + struct.setIterationIdIsSet(true); + struct.skipCount = iprot.readI64(); + struct.setSkipCountIsSet(true); + struct.takeCount = iprot.readI64(); + struct.setTakeCountIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) + public static class subsequentMultiGet_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("subsequentMultiGet_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new subsequentMultiGet_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new subsequentMultiGet_resultTupleSchemeFactory(); + + public @org.apache.thrift.annotation.Nullable java.util.List success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + @Override + public short getThriftFieldId() { + return _thriftId; + } + + @Override + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, OptionalBinary.class)))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(subsequentMultiGet_result.class, metaDataMap); + } + + public subsequentMultiGet_result() { + } + + public subsequentMultiGet_result( + java.util.List success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public subsequentMultiGet_result(subsequentMultiGet_result other) { + if (other.isSetSuccess()) { + java.util.List __this__success = new java.util.ArrayList(other.success.size()); + for (OptionalBinary other_element : other.success) { + __this__success.add(new OptionalBinary(other_element)); + } + this.success = __this__success; + } + } + + @Override + public subsequentMultiGet_result deepCopy() { + return new subsequentMultiGet_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + @org.apache.thrift.annotation.Nullable + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(OptionalBinary elem) { + if (this.success == null) { + this.success = new java.util.ArrayList(); + } + this.success.add(elem); + } + + @org.apache.thrift.annotation.Nullable + public java.util.List getSuccess() { + return this.success; + } + + public subsequentMultiGet_result setSuccess(@org.apache.thrift.annotation.Nullable java.util.List success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((java.util.List)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that instanceof subsequentMultiGet_result) + return this.equals((subsequentMultiGet_result)that); + return false; + } + + public boolean equals(subsequentMultiGet_result that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(subsequentMultiGet_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + @Override + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("subsequentMultiGet_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class subsequentMultiGet_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public subsequentMultiGet_resultStandardScheme getScheme() { + return new subsequentMultiGet_resultStandardScheme(); + } + } + + private static class subsequentMultiGet_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, subsequentMultiGet_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list104 = iprot.readListBegin(); + struct.success = new java.util.ArrayList(_list104.size); + @org.apache.thrift.annotation.Nullable OptionalBinary _elem105; + for (int _i106 = 0; _i106 < _list104.size; ++_i106) + { + _elem105 = new OptionalBinary(); + _elem105.read(iprot); + struct.success.add(_elem105); + } + iprot.readListEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot, subsequentMultiGet_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); + for (OptionalBinary _iter107 : struct.success) + { + _iter107.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class subsequentMultiGet_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public subsequentMultiGet_resultTupleScheme getScheme() { + return new subsequentMultiGet_resultTupleScheme(); + } + } + + private static class subsequentMultiGet_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, subsequentMultiGet_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (OptionalBinary _iter108 : struct.success) + { + _iter108.write(oprot); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, subsequentMultiGet_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list109 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT); + struct.success = new java.util.ArrayList(_list109.size); + @org.apache.thrift.annotation.Nullable OptionalBinary _elem110; + for (int _i111 = 0; _i111 < _list109.size; ++_i111) + { + _elem110 = new OptionalBinary(); + _elem110.read(iprot); + struct.success.add(_elem110); + } + } + struct.setSuccessIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + +} diff --git a/src/main/java/it/cavallium/rockserver/core/common/api/UpdateBegin.java b/src/main/java/it/cavallium/rockserver/core/common/api/UpdateBegin.java new file mode 100644 index 0000000..c9ff4a1 --- /dev/null +++ b/src/main/java/it/cavallium/rockserver/core/common/api/UpdateBegin.java @@ -0,0 +1,501 @@ +/** + * Autogenerated by Thrift Compiler (0.19.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package it.cavallium.rockserver.core.common.api; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +public class UpdateBegin implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("UpdateBegin"); + + private static final org.apache.thrift.protocol.TField PREVIOUS_FIELD_DESC = new org.apache.thrift.protocol.TField("previous", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField UPDATE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("updateId", org.apache.thrift.protocol.TType.I64, (short)2); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new UpdateBeginStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new UpdateBeginTupleSchemeFactory(); + + public @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer previous; // optional + public long updateId; // optional + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + PREVIOUS((short)1, "previous"), + UPDATE_ID((short)2, "updateId"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // PREVIOUS + return PREVIOUS; + case 2: // UPDATE_ID + return UPDATE_ID; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + @Override + public short getThriftFieldId() { + return _thriftId; + } + + @Override + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __UPDATEID_ISSET_ID = 0; + private byte __isset_bitfield = 0; + private static final _Fields optionals[] = {_Fields.PREVIOUS,_Fields.UPDATE_ID}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.PREVIOUS, new org.apache.thrift.meta_data.FieldMetaData("previous", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + tmpMap.put(_Fields.UPDATE_ID, new org.apache.thrift.meta_data.FieldMetaData("updateId", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(UpdateBegin.class, metaDataMap); + } + + public UpdateBegin() { + } + + /** + * Performs a deep copy on other. + */ + public UpdateBegin(UpdateBegin other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetPrevious()) { + this.previous = org.apache.thrift.TBaseHelper.copyBinary(other.previous); + } + this.updateId = other.updateId; + } + + @Override + public UpdateBegin deepCopy() { + return new UpdateBegin(this); + } + + @Override + public void clear() { + this.previous = null; + setUpdateIdIsSet(false); + this.updateId = 0; + } + + public byte[] getPrevious() { + setPrevious(org.apache.thrift.TBaseHelper.rightSize(previous)); + return previous == null ? null : previous.array(); + } + + public java.nio.ByteBuffer bufferForPrevious() { + return org.apache.thrift.TBaseHelper.copyBinary(previous); + } + + public UpdateBegin setPrevious(byte[] previous) { + this.previous = previous == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(previous.clone()); + return this; + } + + public UpdateBegin setPrevious(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer previous) { + this.previous = org.apache.thrift.TBaseHelper.copyBinary(previous); + return this; + } + + public void unsetPrevious() { + this.previous = null; + } + + /** Returns true if field previous is set (has been assigned a value) and false otherwise */ + public boolean isSetPrevious() { + return this.previous != null; + } + + public void setPreviousIsSet(boolean value) { + if (!value) { + this.previous = null; + } + } + + public long getUpdateId() { + return this.updateId; + } + + public UpdateBegin setUpdateId(long updateId) { + this.updateId = updateId; + setUpdateIdIsSet(true); + return this; + } + + public void unsetUpdateId() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __UPDATEID_ISSET_ID); + } + + /** Returns true if field updateId is set (has been assigned a value) and false otherwise */ + public boolean isSetUpdateId() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __UPDATEID_ISSET_ID); + } + + public void setUpdateIdIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __UPDATEID_ISSET_ID, value); + } + + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case PREVIOUS: + if (value == null) { + unsetPrevious(); + } else { + if (value instanceof byte[]) { + setPrevious((byte[])value); + } else { + setPrevious((java.nio.ByteBuffer)value); + } + } + break; + + case UPDATE_ID: + if (value == null) { + unsetUpdateId(); + } else { + setUpdateId((java.lang.Long)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case PREVIOUS: + return getPrevious(); + + case UPDATE_ID: + return getUpdateId(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case PREVIOUS: + return isSetPrevious(); + case UPDATE_ID: + return isSetUpdateId(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that instanceof UpdateBegin) + return this.equals((UpdateBegin)that); + return false; + } + + public boolean equals(UpdateBegin that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_previous = true && this.isSetPrevious(); + boolean that_present_previous = true && that.isSetPrevious(); + if (this_present_previous || that_present_previous) { + if (!(this_present_previous && that_present_previous)) + return false; + if (!this.previous.equals(that.previous)) + return false; + } + + boolean this_present_updateId = true && this.isSetUpdateId(); + boolean that_present_updateId = true && that.isSetUpdateId(); + if (this_present_updateId || that_present_updateId) { + if (!(this_present_updateId && that_present_updateId)) + return false; + if (this.updateId != that.updateId) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetPrevious()) ? 131071 : 524287); + if (isSetPrevious()) + hashCode = hashCode * 8191 + previous.hashCode(); + + hashCode = hashCode * 8191 + ((isSetUpdateId()) ? 131071 : 524287); + if (isSetUpdateId()) + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(updateId); + + return hashCode; + } + + @Override + public int compareTo(UpdateBegin other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.compare(isSetPrevious(), other.isSetPrevious()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetPrevious()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.previous, other.previous); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetUpdateId(), other.isSetUpdateId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetUpdateId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.updateId, other.updateId); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + @Override + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("UpdateBegin("); + boolean first = true; + + if (isSetPrevious()) { + sb.append("previous:"); + if (this.previous == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.previous, sb); + } + first = false; + } + if (isSetUpdateId()) { + if (!first) sb.append(", "); + sb.append("updateId:"); + sb.append(this.updateId); + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class UpdateBeginStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public UpdateBeginStandardScheme getScheme() { + return new UpdateBeginStandardScheme(); + } + } + + private static class UpdateBeginStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, UpdateBegin struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // PREVIOUS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.previous = iprot.readBinary(); + struct.setPreviousIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // UPDATE_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.updateId = iprot.readI64(); + struct.setUpdateIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot, UpdateBegin struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.previous != null) { + if (struct.isSetPrevious()) { + oprot.writeFieldBegin(PREVIOUS_FIELD_DESC); + oprot.writeBinary(struct.previous); + oprot.writeFieldEnd(); + } + } + if (struct.isSetUpdateId()) { + oprot.writeFieldBegin(UPDATE_ID_FIELD_DESC); + oprot.writeI64(struct.updateId); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class UpdateBeginTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public UpdateBeginTupleScheme getScheme() { + return new UpdateBeginTupleScheme(); + } + } + + private static class UpdateBeginTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, UpdateBegin struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetPrevious()) { + optionals.set(0); + } + if (struct.isSetUpdateId()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetPrevious()) { + oprot.writeBinary(struct.previous); + } + if (struct.isSetUpdateId()) { + oprot.writeI64(struct.updateId); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, UpdateBegin struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.previous = iprot.readBinary(); + struct.setPreviousIsSet(true); + } + if (incoming.get(1)) { + struct.updateId = iprot.readI64(); + struct.setUpdateIdIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/src/main/java/it/cavallium/rockserver/core/impl/DataSizeDecoder.java b/src/main/java/it/cavallium/rockserver/core/impl/DataSizeDecoder.java index de3969f..da796ee 100644 --- a/src/main/java/it/cavallium/rockserver/core/impl/DataSizeDecoder.java +++ b/src/main/java/it/cavallium/rockserver/core/impl/DataSizeDecoder.java @@ -9,7 +9,7 @@ import org.github.gestalt.config.entity.ValidationError; import org.github.gestalt.config.node.ConfigNode; import org.github.gestalt.config.reflect.TypeCapture; import org.github.gestalt.config.tag.Tags; -import org.github.gestalt.config.utils.ValidateOf; +import org.github.gestalt.config.utils.GResultOf; public class DataSizeDecoder implements Decoder { @@ -29,15 +29,19 @@ public class DataSizeDecoder implements Decoder { } @Override - public ValidateOf decode(String path, + public GResultOf decode(String path, Tags tags, ConfigNode node, TypeCapture type, DecoderContext decoderContext) { try { - return ValidateOf.validateOf(new DataSize(node.getValue().orElseThrow()), List.of()); + return GResultOf.resultOf(new DataSize(node.getValue().orElseThrow()), List.of()); } catch (Exception ex) { - return ValidateOf.inValid(new ValidationError.DecodingNumberFormatException(path, node, name())); + return GResultOf.errors(new ValidationError.DecodingNumberFormatException(path, + node, + name(), + decoderContext.getSecretConcealer() + )); } } } diff --git a/src/main/java/it/cavallium/rockserver/core/impl/DbCompressionDecoder.java b/src/main/java/it/cavallium/rockserver/core/impl/DbCompressionDecoder.java index c603439..6cd5702 100644 --- a/src/main/java/it/cavallium/rockserver/core/impl/DbCompressionDecoder.java +++ b/src/main/java/it/cavallium/rockserver/core/impl/DbCompressionDecoder.java @@ -9,7 +9,7 @@ import org.github.gestalt.config.entity.ValidationError; import org.github.gestalt.config.node.ConfigNode; import org.github.gestalt.config.reflect.TypeCapture; import org.github.gestalt.config.tag.Tags; -import org.github.gestalt.config.utils.ValidateOf; +import org.github.gestalt.config.utils.GResultOf; import org.rocksdb.CompressionType; public class DbCompressionDecoder implements Decoder { @@ -30,15 +30,19 @@ public class DbCompressionDecoder implements Decoder { } @Override - public ValidateOf decode(String path, + public GResultOf decode(String path, Tags tags, ConfigNode node, TypeCapture type, DecoderContext decoderContext) { try { - return ValidateOf.validateOf(DatabaseCompression.valueOf(node.getValue().orElseThrow()).compressionType(), List.of()); + return GResultOf.resultOf(DatabaseCompression.valueOf(node.getValue().orElseThrow()).compressionType(), List.of()); } catch (Exception ex) { - return ValidateOf.inValid(new ValidationError.DecodingNumberFormatException(path, node, name())); + return GResultOf.errors(new ValidationError.DecodingNumberFormatException(path, + node, + name(), + decoderContext.getSecretConcealer() + )); } } } diff --git a/src/main/java/it/cavallium/rockserver/core/impl/EmbeddedDB.java b/src/main/java/it/cavallium/rockserver/core/impl/EmbeddedDB.java index 6e04b99..5e135cc 100644 --- a/src/main/java/it/cavallium/rockserver/core/impl/EmbeddedDB.java +++ b/src/main/java/it/cavallium/rockserver/core/impl/EmbeddedDB.java @@ -5,15 +5,12 @@ import static it.cavallium.rockserver.core.impl.ColumnInstance.BIG_ENDIAN_BYTES; import static org.rocksdb.KeyMayExist.KeyMayExistEnum.kExistsWithValue; import static org.rocksdb.KeyMayExist.KeyMayExistEnum.kExistsWithoutValue; -import it.cavallium.rockserver.core.common.Callback; -import it.cavallium.rockserver.core.common.Callback.CallbackExists; -import it.cavallium.rockserver.core.common.Callback.CallbackForUpdate; -import it.cavallium.rockserver.core.common.Callback.GetCallback; -import it.cavallium.rockserver.core.common.Callback.IteratorCallback; -import it.cavallium.rockserver.core.common.Callback.PutCallback; +import it.cavallium.rockserver.core.common.RequestType; +import it.cavallium.rockserver.core.common.RequestType.RequestGet; +import it.cavallium.rockserver.core.common.RequestType.RequestPut; import it.cavallium.rockserver.core.common.ColumnSchema; import it.cavallium.rockserver.core.common.Delta; -import it.cavallium.rockserver.core.common.RocksDBAPI; +import it.cavallium.rockserver.core.common.RocksDBSyncAPI; import it.cavallium.rockserver.core.common.RocksDBException.RocksDBErrorType; import it.cavallium.rockserver.core.common.RocksDBRetryException; import it.cavallium.rockserver.core.common.UpdateContext; @@ -51,10 +48,9 @@ import org.rocksdb.RocksDB; import org.rocksdb.RocksDBException; import org.rocksdb.RocksIterator; import org.rocksdb.Status.Code; -import org.rocksdb.Transaction; import org.rocksdb.WriteOptions; -public class EmbeddedDB implements RocksDBAPI, Closeable { +public class EmbeddedDB implements RocksDBSyncAPI, Closeable { private static final int INITIAL_DIRECT_READ_BYTE_BUF_SIZE_BYTES = 4096; public static final long MAX_TRANSACTION_DURATION_MS = 10_000L; @@ -308,7 +304,7 @@ public class EmbeddedDB implements RocksDBAPI, Closeable { long columnId, @NotNull MemorySegment @NotNull [] keys, @NotNull MemorySegment value, - PutCallback callback) throws it.cavallium.rockserver.core.common.RocksDBException { + RequestPut requestType) throws it.cavallium.rockserver.core.common.RocksDBException { ops.beginOp(); try { // Column id @@ -320,7 +316,7 @@ public class EmbeddedDB implements RocksDBAPI, Closeable { tx = null; } long updateId = tx != null && tx.isFromGetForUpdate() ? transactionOrUpdateId : 0L; - return put(arena, tx, col, updateId, keys, value, callback); + return put(arena, tx, col, updateId, keys, value, requestType); } catch (it.cavallium.rockserver.core.common.RocksDBException ex) { throw ex; } catch (Exception ex) { @@ -376,12 +372,12 @@ public class EmbeddedDB implements RocksDBAPI, Closeable { long updateId, @NotNull MemorySegment @NotNull[] keys, @NotNull MemorySegment value, - PutCallback callback) throws it.cavallium.rockserver.core.common.RocksDBException { + RequestPut callback) throws it.cavallium.rockserver.core.common.RocksDBException { // Check for null value col.checkNullableValue(value); try { - boolean requirePreviousValue = Callback.requiresGettingPreviousValue(callback); - boolean requirePreviousPresence = Callback.requiresGettingPreviousPresence(callback); + boolean requirePreviousValue = RequestType.requiresGettingPreviousValue(callback); + boolean requirePreviousPresence = RequestType.requiresGettingPreviousPresence(callback); boolean needsTx = col.hasBuckets() || requirePreviousValue || requirePreviousPresence; @@ -413,7 +409,7 @@ public class EmbeddedDB implements RocksDBAPI, Closeable { throw it.cavallium.rockserver.core.common.RocksDBException.of(RocksDBErrorType.PUT_1, e); } } else { - if (Callback.requiresGettingPreviousValue(callback)) { + if (RequestType.requiresGettingPreviousValue(callback)) { assert tx != null; try (var readOptions = new ReadOptions()) { byte[] previousValueByteArray; @@ -422,7 +418,7 @@ public class EmbeddedDB implements RocksDBAPI, Closeable { } catch (RocksDBException e) { throw it.cavallium.rockserver.core.common.RocksDBException.of(RocksDBErrorType.PUT_2, e); } - } else if (Callback.requiresGettingPreviousPresence(callback)) { + } else if (RequestType.requiresGettingPreviousPresence(callback)) { // todo: in the future this should be replaced with just keyExists assert tx != null; try (var readOptions = new ReadOptions()) { @@ -445,12 +441,12 @@ public class EmbeddedDB implements RocksDBAPI, Closeable { } } } - U result = Callback.safeCast(switch (callback) { - case Callback.CallbackVoid ignored -> null; - case Callback.CallbackPrevious ignored -> previousValue; - case Callback.CallbackPreviousPresence ignored -> previousValue != null; - case Callback.CallbackChanged ignored -> !Utils.valueEquals(previousValue, value); - case Callback.CallbackDelta ignored -> new Delta<>(previousValue, value); + U result = RequestType.safeCast(switch (callback) { + case RequestType.RequestNothing ignored -> null; + case RequestType.RequestPrevious ignored -> previousValue; + case RequestType.RequestPreviousPresence ignored -> previousValue != null; + case RequestType.RequestChanged ignored -> !Utils.valueEquals(previousValue, value); + case RequestType.RequestDelta ignored -> new Delta<>(previousValue, value); }); if (updateId != 0L) { @@ -484,12 +480,12 @@ public class EmbeddedDB implements RocksDBAPI, Closeable { long transactionOrUpdateId, long columnId, MemorySegment @NotNull [] keys, - GetCallback callback) throws it.cavallium.rockserver.core.common.RocksDBException { + RequestGet requestType) throws it.cavallium.rockserver.core.common.RocksDBException { // Column id var col = getColumn(columnId); Tx tx = transactionOrUpdateId != 0 ? getTransaction(transactionOrUpdateId, true) : null; long updateId; - if (callback instanceof Callback.CallbackForUpdate) { + if (requestType instanceof RequestType.RequestForUpdate) { if (tx == null) { tx = openTransactionInternal(MAX_TRANSACTION_DURATION_MS, true); updateId = allocateTransactionInternal(tx); @@ -501,7 +497,7 @@ public class EmbeddedDB implements RocksDBAPI, Closeable { } try { - return get(arena, tx, updateId, col, keys, callback); + return get(arena, tx, updateId, col, keys, requestType); } catch (Throwable ex) { if (updateId != 0 && tx.isFromGetForUpdate()) { closeTransaction(updateId, false); @@ -515,10 +511,10 @@ public class EmbeddedDB implements RocksDBAPI, Closeable { long updateId, ColumnInstance col, MemorySegment @NotNull [] keys, - GetCallback callback) throws it.cavallium.rockserver.core.common.RocksDBException { + RequestGet callback) throws it.cavallium.rockserver.core.common.RocksDBException { ops.beginOp(); try { - if (!col.schema().hasValue() && Callback.requiresGettingCurrentValue(callback)) { + if (!col.schema().hasValue() && RequestType.requiresGettingCurrentValue(callback)) { throw it.cavallium.rockserver.core.common.RocksDBException.of(RocksDBErrorType.VALUE_MUST_BE_NULL, "The specified callback requires a return value, but this column does not have values!"); } @@ -541,8 +537,8 @@ public class EmbeddedDB implements RocksDBAPI, Closeable { throw it.cavallium.rockserver.core.common.RocksDBException.of(RocksDBErrorType.GET_1, e); } } else { - boolean shouldGetCurrent = Callback.requiresGettingCurrentValue(callback) - || (tx != null && callback instanceof Callback.CallbackExists); + boolean shouldGetCurrent = RequestType.requiresGettingCurrentValue(callback) + || (tx != null && callback instanceof RequestType.RequestExists); if (shouldGetCurrent) { try (var readOptions = new ReadOptions()) { foundValue = dbGet(tx, col, arena, readOptions, calculatedKey); @@ -550,7 +546,7 @@ public class EmbeddedDB implements RocksDBAPI, Closeable { } catch (RocksDBException e) { throw it.cavallium.rockserver.core.common.RocksDBException.of(RocksDBErrorType.PUT_2, e); } - } else if (callback instanceof Callback.CallbackExists) { + } else if (callback instanceof RequestType.RequestExists) { // tx is always null here //noinspection ConstantValue assert tx == null; @@ -561,14 +557,14 @@ public class EmbeddedDB implements RocksDBAPI, Closeable { existsValue = false; } } - return Callback.safeCast(switch (callback) { - case Callback.CallbackVoid ignored -> null; - case Callback.CallbackCurrent ignored -> foundValue; - case Callback.CallbackForUpdate ignored -> { + return RequestType.safeCast(switch (callback) { + case RequestType.RequestNothing ignored -> null; + case RequestType.RequestCurrent ignored -> foundValue; + case RequestType.RequestForUpdate ignored -> { assert updateId != 0; yield new UpdateContext<>(foundValue, updateId); } - case Callback.CallbackExists ignored -> existsValue; + case RequestType.RequestExists ignored -> existsValue; }); } catch (it.cavallium.rockserver.core.common.RocksDBException ex) { throw ex; @@ -634,7 +630,7 @@ public class EmbeddedDB implements RocksDBAPI, Closeable { long iterationId, long skipCount, long takeCount, - @NotNull IteratorCallback callback) throws it.cavallium.rockserver.core.common.RocksDBException { + @NotNull RequestType.RequestIterate requestType) throws it.cavallium.rockserver.core.common.RocksDBException { ops.beginOp(); try { throw new UnsupportedOperationException(); diff --git a/src/main/java/it/cavallium/rockserver/core/server/Server.java b/src/main/java/it/cavallium/rockserver/core/server/Server.java new file mode 100644 index 0000000..6509102 --- /dev/null +++ b/src/main/java/it/cavallium/rockserver/core/server/Server.java @@ -0,0 +1,19 @@ +package it.cavallium.rockserver.core.server; + +import it.cavallium.rockserver.core.client.RocksDBConnection; +import java.io.Closeable; +import java.io.IOException; + +public class Server implements Closeable { + + private final RocksDBConnection client; + + public Server(RocksDBConnection client) { + this.client = client; + } + + @Override + public void close() throws IOException { + + } +} diff --git a/src/main/java/it/cavallium/rockserver/core/server/ServerBuilder.java b/src/main/java/it/cavallium/rockserver/core/server/ServerBuilder.java new file mode 100644 index 0000000..840c23a --- /dev/null +++ b/src/main/java/it/cavallium/rockserver/core/server/ServerBuilder.java @@ -0,0 +1,47 @@ +package it.cavallium.rockserver.core.server; + +import it.cavallium.rockserver.core.client.ClientBuilder; +import it.cavallium.rockserver.core.client.EmbeddedConnection; +import it.cavallium.rockserver.core.client.RocksDBConnection; +import java.io.IOException; +import java.net.InetSocketAddress; +import java.net.UnixDomainSocketAddress; +import java.nio.file.Path; + +public class ServerBuilder { + + private InetSocketAddress iNetAddress; + private UnixDomainSocketAddress unixAddress; + private String http2Host; + private int http2Port; + private RocksDBConnection client; + + public void setUnixSocket(UnixDomainSocketAddress address) { + this.unixAddress = address; + } + + public void setAddress(InetSocketAddress address) { + this.iNetAddress = address; + } + + public void setHttpAddress(String host, int port) { + this.http2Host = host; + this.http2Port = port; + } + + public void setClient(RocksDBConnection client) { + this.client = client; + } + + public Server build() throws IOException { + if (http2Host != null) { + return new ThriftServer(client, http2Host, http2Port); + } else if (unixAddress != null) { + throw new UnsupportedOperationException("Not implemented: unix socket"); + } else if (iNetAddress != null) { + throw new UnsupportedOperationException("Not implemented: inet address"); + } else { + throw new UnsupportedOperationException("Please set a connection type"); + } + } +} diff --git a/src/main/java/it/cavallium/rockserver/core/server/ThriftServer.java b/src/main/java/it/cavallium/rockserver/core/server/ThriftServer.java new file mode 100644 index 0000000..8b92fd8 --- /dev/null +++ b/src/main/java/it/cavallium/rockserver/core/server/ThriftServer.java @@ -0,0 +1,322 @@ +package it.cavallium.rockserver.core.server; + +import it.cavallium.rockserver.core.client.RocksDBConnection; +import it.cavallium.rockserver.core.common.RequestType; +import it.cavallium.rockserver.core.common.UpdateContext; +import it.cavallium.rockserver.core.common.api.ColumnHashType; +import it.cavallium.rockserver.core.common.api.ColumnSchema; +import it.cavallium.rockserver.core.common.api.Delta; +import it.cavallium.rockserver.core.common.api.OptionalBinary; +import it.cavallium.rockserver.core.common.api.RocksDB; +import it.cavallium.rockserver.core.common.api.RocksDB.AsyncIface; +import it.cavallium.rockserver.core.common.api.RocksDB.AsyncProcessor; +import it.cavallium.rockserver.core.common.api.UpdateBegin; +import it.unimi.dsi.fastutil.ints.IntArrayList; +import it.unimi.dsi.fastutil.objects.ObjectArrayList; +import java.io.IOException; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.net.InetSocketAddress; +import java.nio.ByteBuffer; +import java.util.List; +import java.util.function.BiConsumer; +import org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.TNonblockingServer; +import org.apache.thrift.server.TNonblockingServer.Args; +import org.apache.thrift.transport.TNonblockingServerSocket; +import org.apache.thrift.transport.TTransportException; +import org.jetbrains.annotations.NotNull; + +public class ThriftServer extends Server { + + private final AsyncIface handler; + + public ThriftServer(RocksDBConnection client, String http2Host, int http2Port) throws IOException { + super(client); + this.handler = new RocksDB.AsyncIface() { + @Override + public void openTransaction(long timeoutMs, AsyncMethodCallback resultHandler) { + client.getAsyncApi().openTransactionAsync(timeoutMs).whenComplete(handleResult(resultHandler)); + } + + @Override + public void closeTransaction(long timeoutMs, boolean commit, AsyncMethodCallback resultHandler) { + client.getAsyncApi().closeTransactionAsync(timeoutMs, commit).whenComplete(handleResult(resultHandler)); + } + + @Override + public void closeFailedUpdate(long updateId, AsyncMethodCallback resultHandler) { + client.getAsyncApi().closeFailedUpdateAsync(updateId).whenComplete(handleResult(resultHandler)); + } + + @Override + public void createColumn(String name, ColumnSchema schema, AsyncMethodCallback resultHandler) { + client.getAsyncApi().createColumnAsync(name, columnSchemaToRecord(schema)) + .whenComplete(handleResult(resultHandler)); + } + + @Override + public void deleteColumn(long columnId, AsyncMethodCallback resultHandler) { + client.getAsyncApi().deleteColumnAsync(columnId).whenComplete(handleResult(resultHandler)); + } + + @Override + public void getColumnId(String name, AsyncMethodCallback resultHandler) { + client.getAsyncApi().getColumnIdAsync(name).whenComplete(handleResult(resultHandler)); + } + + @Override + public void put(long transactionOrUpdateId, + long columnId, + List keys, + ByteBuffer value, + AsyncMethodCallback resultHandler) { + var arena = Arena.ofShared(); + client.getAsyncApi() + .putAsync(arena, transactionOrUpdateId, columnId, keysToRecord(keys), keyToRecord(value), RequestType.none()) + .whenComplete(handleResultWithArena(arena, resultHandler)); + } + + @Override + public void putGetPrevious(long transactionOrUpdateId, + long columnId, + List keys, + ByteBuffer value, + AsyncMethodCallback resultHandler) { + var arena = Arena.ofShared(); + client.getAsyncApi() + .putAsync(arena, transactionOrUpdateId, columnId, keysToRecord(keys), keyToRecord(value), RequestType.previous()) + .thenApply(ThriftServer::mapResult) + .whenComplete(handleResultWithArena(arena, resultHandler)); + } + + @Override + public void putGetDelta(long transactionOrUpdateId, + long columnId, + List keys, + ByteBuffer value, + AsyncMethodCallback resultHandler) { + var arena = Arena.ofShared(); + client.getAsyncApi() + .putAsync(arena, transactionOrUpdateId, columnId, keysToRecord(keys), keyToRecord(value), RequestType.delta()) + .thenApply(ThriftServer::mapResult) + .whenComplete(handleResultWithArena(arena, resultHandler)); + } + + @Override + public void putGetChanged(long transactionOrUpdateId, + long columnId, + List keys, + ByteBuffer value, + AsyncMethodCallback resultHandler) { + var arena = Arena.ofShared(); + client.getAsyncApi() + .putAsync(arena, transactionOrUpdateId, columnId, keysToRecord(keys), keyToRecord(value), RequestType.changed()) + .whenComplete(handleResultWithArena(arena, resultHandler)); + } + + @Override + public void putGetPreviousPresence(long transactionOrUpdateId, + long columnId, + List keys, + ByteBuffer value, + AsyncMethodCallback resultHandler) { + var arena = Arena.ofShared(); + client.getAsyncApi() + .putAsync(arena, transactionOrUpdateId, columnId, keysToRecord(keys), keyToRecord(value), RequestType.previousPresence()) + .whenComplete(handleResultWithArena(arena, resultHandler)); + } + + @Override + public void get(long transactionOrUpdateId, + long columnId, + List keys, + AsyncMethodCallback resultHandler) { + var arena = Arena.ofShared(); + client.getAsyncApi() + .getAsync(arena, transactionOrUpdateId, columnId, keysToRecord(keys), RequestType.current()) + .thenApply(ThriftServer::mapResult) + .whenComplete(handleResultWithArena(arena, resultHandler)); + } + + @Override + public void getForUpdate(long transactionOrUpdateId, + long columnId, + List keys, + AsyncMethodCallback resultHandler) { + var arena = Arena.ofShared(); + client.getAsyncApi() + .getAsync(arena, transactionOrUpdateId, columnId, keysToRecord(keys), RequestType.forUpdate()) + .thenApply(ThriftServer::mapResult) + .whenComplete(handleResultWithArena(arena, resultHandler)); + } + + @Override + public void exists(long transactionOrUpdateId, + long columnId, + List keys, + AsyncMethodCallback resultHandler) { + var arena = Arena.ofShared(); + client.getAsyncApi() + .getAsync(arena, transactionOrUpdateId, columnId, keysToRecord(keys), RequestType.exists()) + .whenComplete(handleResultWithArena(arena, resultHandler)); + } + + @Override + public void openIterator(long transactionId, + long columnId, + List startKeysInclusive, + List endKeysExclusive, + boolean reverse, + long timeoutMs, + AsyncMethodCallback resultHandler) { + var arena = Arena.ofShared(); + client.getAsyncApi() + .openIteratorAsync(arena, transactionId, columnId, keysToRecord(startKeysInclusive), keysToRecord(endKeysExclusive), reverse, timeoutMs) + .whenComplete(handleResultWithArena(arena, resultHandler)); + } + + @Override + public void closeIterator(long iteratorId, AsyncMethodCallback resultHandler) { + client.getAsyncApi() + .closeIteratorAsync(iteratorId) + .whenComplete(handleResult(resultHandler)); + } + + @Override + public void seekTo(long iterationId, List keys, AsyncMethodCallback resultHandler) { + var arena = Arena.ofShared(); + client.getAsyncApi() + .seekToAsync(arena, iterationId, keysToRecord(keys)) + .whenComplete(handleResultWithArena(arena, resultHandler)); + } + + @Override + public void subsequent(long iterationId, long skipCount, long takeCount, AsyncMethodCallback resultHandler) { + var arena = Arena.ofShared(); + client.getAsyncApi() + .subsequentAsync(arena, iterationId, skipCount, takeCount, RequestType.none()) + .whenComplete(handleResultWithArena(arena, resultHandler)); + } + + @Override + public void subsequentExists(long iterationId, + long skipCount, + long takeCount, + AsyncMethodCallback resultHandler) { + var arena = Arena.ofShared(); + client.getAsyncApi() + .subsequentAsync(arena, iterationId, skipCount, takeCount, RequestType.exists()) + .whenComplete(handleResultWithArena(arena, resultHandler)); + } + + @Override + public void subsequentMultiGet(long iterationId, + long skipCount, + long takeCount, + AsyncMethodCallback> resultHandler) { + var arena = Arena.ofShared(); + client.getAsyncApi() + .subsequentAsync(arena, iterationId, skipCount, takeCount, RequestType.multi()) + .thenApply(ThriftServer::mapResult) + .whenComplete(handleResultWithArena(arena, resultHandler)); + } + }; + + try { + var serverTransport = new TNonblockingServerSocket(new InetSocketAddress(http2Host, http2Port)); + var server = new TNonblockingServer(new Args(serverTransport).processor(new AsyncProcessor<>(handler))); + + server.serve(); + } catch (TTransportException e) { + throw new IOException("Can't open server socket", e); + } + + } + + private @NotNull MemorySegment [] keysToRecord(List<@NotNull ByteBuffer> keys) { + if (keys == null) { + return null; + } + var result = new MemorySegment[keys.size()]; + int i = 0; + for (ByteBuffer key : keys) { + result[i] = keyToRecord(key); + i++; + } + return result; + } + + private @NotNull MemorySegment keyToRecord(@NotNull ByteBuffer key) { + return MemorySegment.ofBuffer(key); + } + + private it.cavallium.rockserver.core.common.ColumnSchema columnSchemaToRecord(ColumnSchema schema) { + return it.cavallium.rockserver.core.common.ColumnSchema.of(new IntArrayList(schema.getFixedKeys()), + hashTypesToRecord(schema.getVariableTailKeys()), + schema.isHasValue() + ); + } + + private ObjectArrayList hashTypesToRecord(List variableTailKeys) { + var result = new ObjectArrayList(); + for (ColumnHashType variableTailKey : variableTailKeys) { + result.add(hashTypeToRecord(variableTailKey)); + } + return result; + } + + private it.cavallium.rockserver.core.common.ColumnHashType hashTypeToRecord(ColumnHashType variableTailKey) { + return it.cavallium.rockserver.core.common.ColumnHashType.valueOf(variableTailKey.name()); + } + + private static BiConsumer handleResult(AsyncMethodCallback resultHandler) { + return (result, error) -> { + if (error != null) { + if (error instanceof Exception ex) { + resultHandler.onError(ex); + } else { + resultHandler.onError(new Exception(error)); + } + } else { + resultHandler.onComplete(result); + } + }; + } + + private static BiConsumer handleResultWithArena(Arena arena, + AsyncMethodCallback resultHandler) { + return (result, error) -> { + arena.close(); + if (error != null) { + if (error instanceof Exception ex) { + resultHandler.onError(ex); + } else { + resultHandler.onError(new Exception(error)); + } + } else { + resultHandler.onComplete(result); + } + }; + } + + private static OptionalBinary mapResult(MemorySegment memorySegment) { + return memorySegment != null ? new OptionalBinary().setValue(memorySegment.asByteBuffer()) : null; + } + + private static UpdateBegin mapResult(UpdateContext context) { + return new UpdateBegin() + .setUpdateId(context.updateId()) + .setPrevious(context.previous() != null ? context.previous().asByteBuffer() : null); + } + + private static Delta mapResult(it.cavallium.rockserver.core.common.Delta delta) { + return new Delta() + .setPrevious(delta.previous() != null ? delta.previous().asByteBuffer() : null) + .setCurrent(delta.current() != null ? delta.current().asByteBuffer() : null); + } + + private static List mapResult(List multi) { + return multi.stream().map(ThriftServer::mapResult).toList(); + } +} diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java index 457dc21..036599f 100644 --- a/src/main/java/module-info.java +++ b/src/main/java/module-info.java @@ -7,7 +7,18 @@ module rockserver.core { requires high.scale.lib; requires org.github.gestalt.core; requires org.github.gestalt.hocon; - requires it.unimi.dsi.fastutil.core; + requires it.unimi.dsi.fastutil; + requires io.netty5.buffer; + requires io.netty5.codec; + requires io.netty5.codec.http2; + requires io.netty5.common; + requires io.netty5.handler; + requires io.netty5.transport; + requires io.netty5.transport.classes.io_uring; + requires io.netty5.transport.io_uring; + requires io.netty5.transport.unix.common; + requires io.netty5.codec.http; + requires org.apache.thrift; exports it.cavallium.rockserver.core.client; exports it.cavallium.rockserver.core.common; diff --git a/src/main/resources/it/cavallium/rockserver/core/resources/rocksdb.thrift b/src/main/resources/it/cavallium/rockserver/core/resources/rocksdb.thrift new file mode 100644 index 0000000..7de750b --- /dev/null +++ b/src/main/resources/it/cavallium/rockserver/core/resources/rocksdb.thrift @@ -0,0 +1,83 @@ +namespace java it.cavallium.rockserver.core.common.api + +struct ColumnSchema { + 1: list fixedKeys, + 2: list variableTailKeys, + 3: bool hasValue +} + +enum ColumnHashType { + XXHASH32 = 1, + XXHASH8 = 2, + ALLSAME8 = 3 +} + +enum Operation { + NOTHING = 1, + PREVIOUS = 2, + CURRENT = 3, + FOR_UPDATE = 4, + EXISTS = 5, + DELTA = 6, + MULTI = 7, + CHANGED = 8, + PREVIOUS_PRESENCE = 9 +} + +struct Delta { + 1: optional binary previous, + 2: optional binary current +} + +struct OptionalBinary { + 1: optional binary value +} + +struct UpdateBegin { + 1: optional binary previous, + 2: optional i64 updateId +} + +service RocksDB { + + i64 openTransaction(1: required i64 timeoutMs), + + bool closeTransaction(1: required i64 timeoutMs, 2: required bool commit), + + void closeFailedUpdate(1: required i64 updateId), + + i64 createColumn(1: required string name, 2: required ColumnSchema schema), + + void deleteColumn(1: required i64 columnId), + + i64 getColumnId(1: required string name), + + oneway void put(1: required i64 transactionOrUpdateId, 2: required i64 columnId, 3: required list keys, 4: required binary value), + + OptionalBinary putGetPrevious(1: required i64 transactionOrUpdateId, 2: required i64 columnId, 3: required list keys, 4: required binary value), + + Delta putGetDelta(1: required i64 transactionOrUpdateId, 2: required i64 columnId, 3: required list keys, 4: required binary value), + + bool putGetChanged(1: required i64 transactionOrUpdateId, 2: required i64 columnId, 3: required list keys, 4: required binary value), + + bool putGetPreviousPresence(1: required i64 transactionOrUpdateId, 2: required i64 columnId, 3: required list keys, 4: required binary value), + + OptionalBinary get(1: required i64 transactionOrUpdateId, 2: required i64 columnId, 3: required list keys), + + UpdateBegin getForUpdate(1: required i64 transactionOrUpdateId, 2: required i64 columnId, 3: required list keys), + + bool exists(1: required i64 transactionOrUpdateId, 3: required i64 columnId, 4: required list keys), + + i64 openIterator(1: required i64 transactionId, 2: required i64 columnId, 3: required list startKeysInclusive, 4: list endKeysExclusive, 5: required bool reverse, 6: required i64 timeoutMs), + + void closeIterator(1: required i64 iteratorId), + + void seekTo(1: required i64 iterationId, 2: required list keys), + + oneway void subsequent(1: required i64 iterationId, 2: required i64 skipCount, 3: required i64 takeCount), + + bool subsequentExists(1: required i64 iterationId, 2: required i64 skipCount, 3: required i64 takeCount), + + list subsequentMultiGet(1: required i64 iterationId, 2: required i64 skipCount, 3: required i64 takeCount), + +} diff --git a/src/test/java/it/cavallium/rockserver/core/impl/test/EmbeddedDBTest.java b/src/test/java/it/cavallium/rockserver/core/impl/test/EmbeddedDBTest.java index ceb3c93..e99684d 100644 --- a/src/test/java/it/cavallium/rockserver/core/impl/test/EmbeddedDBTest.java +++ b/src/test/java/it/cavallium/rockserver/core/impl/test/EmbeddedDBTest.java @@ -3,11 +3,10 @@ package it.cavallium.rockserver.core.impl.test; import static it.cavallium.rockserver.core.common.Utils.toMemorySegmentSimple; import it.cavallium.rockserver.core.client.EmbeddedConnection; -import it.cavallium.rockserver.core.common.Callback; +import it.cavallium.rockserver.core.common.RequestType; import it.cavallium.rockserver.core.common.ColumnHashType; import it.cavallium.rockserver.core.common.ColumnSchema; import it.cavallium.rockserver.core.common.Delta; -import it.cavallium.rockserver.core.common.RocksDBException; import it.cavallium.rockserver.core.common.RocksDBRetryException; import it.cavallium.rockserver.core.common.Utils; import it.unimi.dsi.fastutil.ints.IntList; @@ -111,13 +110,13 @@ abstract class EmbeddedDBTest { } void fillSomeKeys() { - Assertions.assertNull(db.put(arena, 0, colId, key1, value1, Callback.none())); - Assertions.assertNull(db.put(arena, 0, colId, collidingKey1, value2, Callback.none())); - Assertions.assertNull(db.put(arena, 0, colId, key2, bigValue, Callback.none())); + Assertions.assertNull(db.put(arena, 0, colId, key1, value1, RequestType.none())); + Assertions.assertNull(db.put(arena, 0, colId, collidingKey1, value2, RequestType.none())); + Assertions.assertNull(db.put(arena, 0, colId, key2, bigValue, RequestType.none())); for (int i = 0; i < Byte.MAX_VALUE; i++) { var keyI = getKeyI(i); var valueI = getValueI(i); - Assertions.assertNull(db.put(arena, 0, colId, keyI, valueI, Callback.none())); + Assertions.assertNull(db.put(arena, 0, colId, keyI, valueI, RequestType.none())); } } @@ -158,17 +157,17 @@ abstract class EmbeddedDBTest { var key = getKey1(); if (!getHasValues()) { - Assertions.assertThrows(Exception.class, () -> db.put(arena, 0, colId, key, toMemorySegmentSimple(arena, 123), Callback.delta())); + Assertions.assertThrows(Exception.class, () -> db.put(arena, 0, colId, key, toMemorySegmentSimple(arena, 123), RequestType.delta())); } else { - Assertions.assertThrows(Exception.class, () -> db.put(arena, 0, colId, key, MemorySegment.NULL, Callback.delta())); + Assertions.assertThrows(Exception.class, () -> db.put(arena, 0, colId, key, MemorySegment.NULL, RequestType.delta())); } - Assertions.assertThrows(Exception.class, () -> db.put(arena, 0, colId, key, null, Callback.delta())); - Assertions.assertThrows(Exception.class, () -> db.put(arena, 0, colId, null, value1, Callback.delta())); - Assertions.assertThrows(Exception.class, () -> db.put(arena, 0, colId, null, null, Callback.delta())); + Assertions.assertThrows(Exception.class, () -> db.put(arena, 0, colId, key, null, RequestType.delta())); + Assertions.assertThrows(Exception.class, () -> db.put(arena, 0, colId, null, value1, RequestType.delta())); + Assertions.assertThrows(Exception.class, () -> db.put(arena, 0, colId, null, null, RequestType.delta())); Assertions.assertThrows(Exception.class, () -> db.put(arena, 0, colId, key, value1, null)); - Assertions.assertThrows(Exception.class, () -> db.put(arena, 1, colId, key, value1, Callback.delta())); - Assertions.assertThrows(Exception.class, () -> db.put(arena, 0, 21203, key, value1, Callback.delta())); + Assertions.assertThrows(Exception.class, () -> db.put(arena, 1, colId, key, value1, RequestType.delta())); + Assertions.assertThrows(Exception.class, () -> db.put(arena, 0, 21203, key, value1, RequestType.delta())); } @Test @@ -179,11 +178,11 @@ abstract class EmbeddedDBTest { Delta delta; - delta = db.put(arena, 0, colId, key, value1, Callback.delta()); + delta = db.put(arena, 0, colId, key, value1, RequestType.delta()); Assertions.assertNull(delta.previous()); assertSegmentEquals(value1, delta.current()); - delta = db.put(arena, 0, colId, key, value2, Callback.delta()); + delta = db.put(arena, 0, colId, key, value2, RequestType.delta()); assertSegmentEquals(value1, delta.previous()); assertSegmentEquals(value2, delta.current()); } @@ -203,61 +202,61 @@ abstract class EmbeddedDBTest { Delta delta; - Assertions.assertFalse(db.put(arena, 0, colId, getKeyI(3), value2, Callback.previousPresence())); - Assertions.assertFalse(db.put(arena, 0, colId, getKeyI(4), value2, Callback.previousPresence())); + Assertions.assertFalse(db.put(arena, 0, colId, getKeyI(3), value2, RequestType.previousPresence())); + Assertions.assertFalse(db.put(arena, 0, colId, getKeyI(4), value2, RequestType.previousPresence())); - delta = db.put(arena, 0, colId, key1, value1, Callback.delta()); + delta = db.put(arena, 0, colId, key1, value1, RequestType.delta()); Assertions.assertNull(delta.previous()); assertSegmentEquals(value1, delta.current()); - delta = db.put(arena, 0, colId, key2, value2, Callback.delta()); + delta = db.put(arena, 0, colId, key2, value2, RequestType.delta()); Assertions.assertNull(delta.previous()); assertSegmentEquals(value2, delta.current()); - delta = db.put(arena, 0, colId, key2, value1, Callback.delta()); + delta = db.put(arena, 0, colId, key2, value1, RequestType.delta()); assertSegmentEquals(value2, delta.previous()); assertSegmentEquals(value1, delta.current()); - delta = db.put(arena, 0, colId, key2, value1, Callback.delta()); + delta = db.put(arena, 0, colId, key2, value1, RequestType.delta()); assertSegmentEquals(value1, delta.previous()); assertSegmentEquals(value1, delta.current()); - Assertions.assertTrue(db.put(arena, 0, colId, key1, value2, Callback.previousPresence())); - Assertions.assertTrue(db.put(arena, 0, colId, key2, value2, Callback.previousPresence())); + Assertions.assertTrue(db.put(arena, 0, colId, key1, value2, RequestType.previousPresence())); + Assertions.assertTrue(db.put(arena, 0, colId, key2, value2, RequestType.previousPresence())); - delta = db.put(arena, 0, colId, key1, value1, Callback.delta()); + delta = db.put(arena, 0, colId, key1, value1, RequestType.delta()); assertSegmentEquals(value2, delta.previous()); assertSegmentEquals(value1, delta.current()); - delta = db.put(arena, 0, colId, key2, value1, Callback.delta()); + delta = db.put(arena, 0, colId, key2, value1, RequestType.delta()); assertSegmentEquals(value2, delta.previous()); assertSegmentEquals(value1, delta.current()); - Assertions.assertNull(db.put(arena, 0, colId, key1, value2, Callback.none())); - Assertions.assertNull(db.put(arena, 0, colId, key2, value2, Callback.none())); + Assertions.assertNull(db.put(arena, 0, colId, key1, value2, RequestType.none())); + Assertions.assertNull(db.put(arena, 0, colId, key2, value2, RequestType.none())); - assertSegmentEquals(value2, db.put(arena, 0, colId, key1, value1, Callback.previous())); - assertSegmentEquals(value2, db.put(arena, 0, colId, key2, value1, Callback.previous())); + assertSegmentEquals(value2, db.put(arena, 0, colId, key1, value1, RequestType.previous())); + assertSegmentEquals(value2, db.put(arena, 0, colId, key2, value1, RequestType.previous())); - assertSegmentEquals(value1, db.put(arena, 0, colId, key1, value1, Callback.previous())); - assertSegmentEquals(value1, db.put(arena, 0, colId, key2, value1, Callback.previous())); + assertSegmentEquals(value1, db.put(arena, 0, colId, key1, value1, RequestType.previous())); + assertSegmentEquals(value1, db.put(arena, 0, colId, key2, value1, RequestType.previous())); if (!Utils.valueEquals(value1, value2)) { - Assertions.assertTrue(db.put(arena, 0, colId, key1, value2, Callback.changed())); - Assertions.assertTrue(db.put(arena, 0, colId, key2, value2, Callback.changed())); + Assertions.assertTrue(db.put(arena, 0, colId, key1, value2, RequestType.changed())); + Assertions.assertTrue(db.put(arena, 0, colId, key2, value2, RequestType.changed())); } - Assertions.assertFalse(db.put(arena, 0, colId, key1, value2, Callback.changed())); - Assertions.assertFalse(db.put(arena, 0, colId, key2, value2, Callback.changed())); + Assertions.assertFalse(db.put(arena, 0, colId, key1, value2, RequestType.changed())); + Assertions.assertFalse(db.put(arena, 0, colId, key2, value2, RequestType.changed())); - assertSegmentEquals(value2, db.put(arena, 0, colId, key1, value1, Callback.previous())); - assertSegmentEquals(value2, db.put(arena, 0, colId, key2, value1, Callback.previous())); + assertSegmentEquals(value2, db.put(arena, 0, colId, key1, value1, RequestType.previous())); + assertSegmentEquals(value2, db.put(arena, 0, colId, key2, value1, RequestType.previous())); } protected ColumnSchema getSchema() { @@ -284,23 +283,23 @@ abstract class EmbeddedDBTest { var value1 = getValue1(); var value2 = getValue2(); - var delta = db.put(arena, 0, colId, key1, value1, Callback.delta()); + var delta = db.put(arena, 0, colId, key1, value1, RequestType.delta()); Assertions.assertNull(delta.previous()); assertSegmentEquals(value1, delta.current()); - delta = db.put(arena, 0, colId, collidingKey1, value2, Callback.delta()); + delta = db.put(arena, 0, colId, collidingKey1, value2, RequestType.delta()); Assertions.assertNull(delta.previous()); assertSegmentEquals(value2, delta.current()); - delta = db.put(arena, 0, colId, collidingKey1, value1, Callback.delta()); + delta = db.put(arena, 0, colId, collidingKey1, value1, RequestType.delta()); assertSegmentEquals(value2, delta.previous()); assertSegmentEquals(value1, delta.current()); - delta = db.put(arena, 0, colId, key2, value1, Callback.delta()); + delta = db.put(arena, 0, colId, key2, value1, RequestType.delta()); Assertions.assertNull(delta.previous()); assertSegmentEquals(value1, delta.current()); - delta = db.put(arena, 0, colId, key2, value2, Callback.delta()); + delta = db.put(arena, 0, colId, key2, value2, RequestType.delta()); assertSegmentEquals(value1, delta.previous()); assertSegmentEquals(value2, delta.current()); } @@ -308,38 +307,38 @@ abstract class EmbeddedDBTest { @Test void get() { if (getHasValues()) { - Assertions.assertNull(db.get(arena, 0, colId, key1, Callback.current())); - Assertions.assertNull(db.get(arena, 0, colId, collidingKey1, Callback.current())); - Assertions.assertNull(db.get(arena, 0, colId, key2, Callback.current())); + Assertions.assertNull(db.get(arena, 0, colId, key1, RequestType.current())); + Assertions.assertNull(db.get(arena, 0, colId, collidingKey1, RequestType.current())); + Assertions.assertNull(db.get(arena, 0, colId, key2, RequestType.current())); } - Assertions.assertFalse(db.get(arena, 0, colId, key1, Callback.exists())); - Assertions.assertFalse(db.get(arena, 0, colId, collidingKey1, Callback.exists())); - Assertions.assertFalse(db.get(arena, 0, colId, key2, Callback.exists())); + Assertions.assertFalse(db.get(arena, 0, colId, key1, RequestType.exists())); + Assertions.assertFalse(db.get(arena, 0, colId, collidingKey1, RequestType.exists())); + Assertions.assertFalse(db.get(arena, 0, colId, key2, RequestType.exists())); fillSomeKeys(); if (getHasValues()) { - assertSegmentEquals(value1, db.get(arena, 0, colId, key1, Callback.current())); - Assertions.assertNull(db.get(arena, 0, colId, getNotFoundKeyI(0), Callback.current())); - assertSegmentEquals(value2, db.get(arena, 0, colId, collidingKey1, Callback.current())); - assertSegmentEquals(bigValue, db.get(arena, 0, colId, key2, Callback.current())); + assertSegmentEquals(value1, db.get(arena, 0, colId, key1, RequestType.current())); + Assertions.assertNull(db.get(arena, 0, colId, getNotFoundKeyI(0), RequestType.current())); + assertSegmentEquals(value2, db.get(arena, 0, colId, collidingKey1, RequestType.current())); + assertSegmentEquals(bigValue, db.get(arena, 0, colId, key2, RequestType.current())); } - Assertions.assertTrue(db.get(arena, 0, colId, key1, Callback.exists())); - Assertions.assertFalse(db.get(arena, 0, colId, getNotFoundKeyI(0), Callback.exists())); - Assertions.assertTrue(db.get(arena, 0, colId, collidingKey1, Callback.exists())); - Assertions.assertTrue(db.get(arena, 0, colId, key2, Callback.exists())); + Assertions.assertTrue(db.get(arena, 0, colId, key1, RequestType.exists())); + Assertions.assertFalse(db.get(arena, 0, colId, getNotFoundKeyI(0), RequestType.exists())); + Assertions.assertTrue(db.get(arena, 0, colId, collidingKey1, RequestType.exists())); + Assertions.assertTrue(db.get(arena, 0, colId, key2, RequestType.exists())); } @Test void update() { if (getHasValues()) { - var forUpdate = db.get(arena, 0, colId, key1, Callback.forUpdate()); + var forUpdate = db.get(arena, 0, colId, key1, RequestType.forUpdate()); Assertions.assertNull(forUpdate.previous()); Assertions.assertTrue(forUpdate.updateId() != 0); - db.put(arena, forUpdate.updateId(), colId, key1, value1, Callback.none()); + db.put(arena, forUpdate.updateId(), colId, key1, value1, RequestType.none()); - Assertions.assertThrows(Exception.class, () -> db.put(arena, forUpdate.updateId(), colId, key1, value2, Callback.none())); + Assertions.assertThrows(Exception.class, () -> db.put(arena, forUpdate.updateId(), colId, key1, value2, RequestType.none())); } } @@ -347,17 +346,17 @@ abstract class EmbeddedDBTest { void concurrentUpdate() { if (getHasValues()) { { - var forUpdate1 = db.get(arena, 0, colId, key1, Callback.forUpdate()); + var forUpdate1 = db.get(arena, 0, colId, key1, RequestType.forUpdate()); try { - var forUpdate2 = db.get(arena, 0, colId, key1, Callback.forUpdate()); + var forUpdate2 = db.get(arena, 0, colId, key1, RequestType.forUpdate()); try { - db.put(arena, forUpdate1.updateId(), colId, key1, value1, Callback.none()); - Assertions.assertThrowsExactly(RocksDBRetryException.class, () -> db.put(arena, forUpdate2.updateId(), colId, key1, value2, Callback.none())); + db.put(arena, forUpdate1.updateId(), colId, key1, value1, RequestType.none()); + Assertions.assertThrowsExactly(RocksDBRetryException.class, () -> db.put(arena, forUpdate2.updateId(), colId, key1, value2, RequestType.none())); // Retrying - var forUpdate3 = db.get(arena, forUpdate2.updateId(), colId, key1, Callback.forUpdate()); + var forUpdate3 = db.get(arena, forUpdate2.updateId(), colId, key1, RequestType.forUpdate()); try { assertSegmentEquals(value1, forUpdate3.previous()); - db.put(arena, forUpdate3.updateId(), colId, key1, value2, Callback.none()); + db.put(arena, forUpdate3.updateId(), colId, key1, value2, RequestType.none()); } catch (Throwable ex3) { db.closeFailedUpdate(forUpdate3.updateId()); throw ex3; @@ -386,9 +385,9 @@ abstract class EmbeddedDBTest { @Test void getTestError() { fillSomeKeys(); - Assertions.assertThrows(Exception.class, () -> Utils.valueEquals(value1, db.get(arena, 0, colId, null, Callback.current()))); - Assertions.assertThrows(Exception.class, () -> Utils.valueEquals(value1, db.get(arena, 0, 18239, key1, Callback.current()))); - Assertions.assertThrows(Exception.class, () -> Utils.valueEquals(value1, db.get(arena, 1, colId, key1, Callback.current()))); + Assertions.assertThrows(Exception.class, () -> Utils.valueEquals(value1, db.get(arena, 0, colId, null, RequestType.current()))); + Assertions.assertThrows(Exception.class, () -> Utils.valueEquals(value1, db.get(arena, 0, 18239, key1, RequestType.current()))); + Assertions.assertThrows(Exception.class, () -> Utils.valueEquals(value1, db.get(arena, 1, colId, key1, RequestType.current()))); Assertions.assertThrows(Exception.class, () -> Utils.valueEquals(value1, db.get(arena, 0, colId, key1, null))); } } \ No newline at end of file diff --git a/src/test/java/module-info.java b/src/test/java/module-info.java index 1e6f645..042f488 100644 --- a/src/test/java/module-info.java +++ b/src/test/java/module-info.java @@ -2,7 +2,7 @@ module rockserver.core.test { requires org.lz4.java; requires rockserver.core; requires org.junit.jupiter.api; - requires it.unimi.dsi.fastutil.core; + requires it.unimi.dsi.fastutil; opens it.cavallium.rockserver.core.test; opens it.cavallium.rockserver.core.impl.test; } \ No newline at end of file