From 51cd3d22fa9368fe3630b1011fdb2ea751c284c0 Mon Sep 17 00:00:00 2001 From: Jeff Nelson Date: Sat, 14 Mar 2026 15:34:41 -0400 Subject: [PATCH 01/13] Initial implementation of Command builder to support new CCL syntax --- concourse-driver-java/build.gradle | 3 +- .../concourse/lang/ConcourseCompiler.java | 10 +- .../concourse/lang/command/AddCommand.java | 279 ++++++++ .../concourse/lang/command/AuditCommand.java | 541 ++++++++++++++ .../concourse/lang/command/BrowseCommand.java | 115 +++ .../concourse/lang/command/BuiltCommand.java | 51 ++ .../lang/command/CalculateCommand.java | 271 +++++++ .../concourse/lang/command/CclRenderer.java | 254 +++++++ .../lang/command/ChronicleCommand.java | 336 +++++++++ .../concourse/lang/command/ClearCommand.java | 200 ++++++ .../concourse/lang/command/Command.java | 668 ++++++++++++++++++ .../lang/command/ConsolidateCommand.java | 92 +++ .../lang/command/DescribeCommand.java | 115 +++ .../concourse/lang/command/DiffCommand.java | 484 +++++++++++++ .../concourse/lang/command/FindCommand.java | 192 +++++ .../lang/command/FindOrAddCommand.java | 128 ++++ .../lang/command/FindOrInsertCommand.java | 168 +++++ .../concourse/lang/command/GetCommand.java | 444 ++++++++++++ .../concourse/lang/command/HoldsCommand.java | 81 +++ .../concourse/lang/command/InsertCommand.java | 238 +++++++ .../lang/command/JsonifyCommand.java | 146 ++++ .../concourse/lang/command/LinkCommand.java | 201 ++++++ .../lang/command/NavigateCommand.java | 277 ++++++++ .../lang/command/ReconcileCommand.java | 204 ++++++ .../concourse/lang/command/RemoveCommand.java | 324 +++++++++ .../concourse/lang/command/RevertCommand.java | 247 +++++++ .../concourse/lang/command/SearchCommand.java | 127 ++++ .../concourse/lang/command/SelectCommand.java | 444 ++++++++++++ .../concourse/lang/command/SetCommand.java | 225 ++++++ .../concourse/lang/command/TraceCommand.java | 115 +++ .../concourse/lang/command/UnlinkCommand.java | 184 +++++ .../lang/command/VerifyAndSwapCommand.java | 259 +++++++ .../concourse/lang/command/VerifyCommand.java | 305 ++++++++ .../lang/command/VerifyOrSetCommand.java | 194 +++++ .../lang/command/CclRendererTest.java | 254 +++++++ .../lang/command/InspectionCommandTest.java | 409 +++++++++++ .../lang/command/LinkCommandTest.java | 308 ++++++++ .../lang/command/QueryCommandTest.java | 553 +++++++++++++++ .../lang/command/TemporalCommandTest.java | 637 +++++++++++++++++ .../lang/command/WriteCommandTest.java | 536 ++++++++++++++ 40 files changed, 10617 insertions(+), 2 deletions(-) create mode 100644 concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/AddCommand.java create mode 100644 concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/AuditCommand.java create mode 100644 concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/BrowseCommand.java create mode 100644 concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/BuiltCommand.java create mode 100644 concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/CalculateCommand.java create mode 100644 concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/CclRenderer.java create mode 100644 concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/ChronicleCommand.java create mode 100644 concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/ClearCommand.java create mode 100644 concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/Command.java create mode 100644 concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/ConsolidateCommand.java create mode 100644 concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/DescribeCommand.java create mode 100644 concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/DiffCommand.java create mode 100644 concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/FindCommand.java create mode 100644 concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/FindOrAddCommand.java create mode 100644 concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/FindOrInsertCommand.java create mode 100644 concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/GetCommand.java create mode 100644 concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/HoldsCommand.java create mode 100644 concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/InsertCommand.java create mode 100644 concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/JsonifyCommand.java create mode 100644 concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/LinkCommand.java create mode 100644 concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/NavigateCommand.java create mode 100644 concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/ReconcileCommand.java create mode 100644 concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/RemoveCommand.java create mode 100644 concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/RevertCommand.java create mode 100644 concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/SearchCommand.java create mode 100644 concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/SelectCommand.java create mode 100644 concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/SetCommand.java create mode 100644 concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/TraceCommand.java create mode 100644 concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/UnlinkCommand.java create mode 100644 concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/VerifyAndSwapCommand.java create mode 100644 concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/VerifyCommand.java create mode 100644 concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/VerifyOrSetCommand.java create mode 100644 concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/CclRendererTest.java create mode 100644 concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/InspectionCommandTest.java create mode 100644 concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/LinkCommandTest.java create mode 100644 concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/QueryCommandTest.java create mode 100644 concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/TemporalCommandTest.java create mode 100644 concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/WriteCommandTest.java diff --git a/concourse-driver-java/build.gradle b/concourse-driver-java/build.gradle index ce4368380..6b5f43ffa 100644 --- a/concourse-driver-java/build.gradle +++ b/concourse-driver-java/build.gradle @@ -18,7 +18,8 @@ dependencies { api "org.slf4j:log4j-over-slf4j:${slf4jVersion}" api "org.slf4j:jcl-over-slf4j:${slf4jVersion}" api 'com.google.code.gson:gson:2.5' - api 'com.cinchapi:ccl:3.2.1' + // api 'com.cinchapi:ccl:4.0.0-SNAPSHOT' + api group: 'com.cinchapi', name: 'ccl', version: '4.0.0-SNAPSHOT', changing:true testImplementation project(':concourse-unit-test-core') testImplementation 'com.github.marschall:memoryfilesystem:0.9.0' diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/ConcourseCompiler.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/ConcourseCompiler.java index 97c08d81a..6698ab76f 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/ConcourseCompiler.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/ConcourseCompiler.java @@ -15,6 +15,8 @@ */ package com.cinchapi.concourse.lang; +import java.util.List; + import com.cinchapi.ccl.Compiler; import com.cinchapi.ccl.syntax.AbstractSyntaxTree; import com.cinchapi.ccl.syntax.ConditionTree; @@ -99,9 +101,15 @@ public AbstractSyntaxTree parse(String ccl, Multimap data) { return delegate.parse(ccl, data); } + @Override + public List compile(String ccl, + Multimap data) { + return delegate.compile(ccl, data); + } + /** * {@link #parse(String) Parse} the {@code criteria}. - * + * * @param criteria * @return an {@link AbstractSyntaxTree} representing the {@code criteria} */ diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/AddCommand.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/AddCommand.java new file mode 100644 index 000000000..310dda985 --- /dev/null +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/AddCommand.java @@ -0,0 +1,279 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.lang.command; + +import java.util.Collections; +import java.util.List; + +/** + * A {@link Command} builder for {@code add} commands. + *

+ * {@code add} associates a value with a key in one or more records. + *

+ * + *
+ * add <key> as <value>
+ * add <key> as <value> in <record>
+ * add <key> as <value> in [<records>]
+ * 
+ * + * @author Jeff Nelson + */ +public final class AddCommand { + + /** + * The state after specifying the key for the {@code add} command. + */ + public static final class KeyState { + + /** + * The key to add. + */ + private final String key; + + /** + * Construct a new instance. + * + * @param key the key to add + */ + KeyState(String key) { + this.key = key; + } + + /** + * Specify the value to add for this key. + * + * @param value the value to add + * @return the next builder state + */ + public ValueState as(Object value) { + return new ValueState(key, value); + } + + } + + /** + * The state after specifying the key and value for the {@code add} command. + * This is a terminal state that produces CCL without a record target, but + * can optionally be narrowed to specific records via + * {@link #in(long, long...)}. + */ + public static final class ValueState implements Command { + + /** + * The key to add. + */ + private final String key; + + /** + * The value to add. + */ + private final Object value; + + /** + * Construct a new instance. + * + * @param key the key + * @param value the value + */ + ValueState(String key, Object value) { + this.key = key; + this.value = value; + } + + /** + * Add into the specified {@code record}. + * + * @param record the target record + * @return the next builder state + */ + public RecordState in(long record) { + return new RecordState(key, value, + CclRenderer.collectRecords(record)); + } + + /** + * Add into the specified {@code records}. + * + * @param first the first record + * @param more additional records + * @return the next builder state + */ + public RecordState in(long first, long... more) { + return new RecordState(key, value, + CclRenderer.collectRecords(first, more)); + } + + /** + * Alias for {@link #in(long)} to support alternate CCL dialects. + * + * @param record the target record + * @return the next builder state + */ + public RecordState to(long record) { + return in(record); + } + + /** + * Alias for {@link #in(long, long...)} to support alternate CCL + * dialects. + * + * @param first the first record + * @param more additional records + * @return the next builder state + */ + public RecordState to(long first, long... more) { + return in(first, more); + } + + /** + * Alias for {@link #in(long)} to support alternate CCL dialects. + * + * @param record the target record + * @return the next builder state + */ + public RecordState within(long record) { + return in(record); + } + + /** + * Alias for {@link #in(long, long...)} to support alternate CCL + * dialects. + * + * @param first the first record + * @param more additional records + * @return the next builder state + */ + public RecordState within(long first, long... more) { + return in(first, more); + } + + /** + * Return the key for this command. + * + * @return the key + */ + public String key() { + return key; + } + + /** + * Return the value for this command. + * + * @return the value + */ + public Object value() { + return value; + } + + @Override + public String ccl() { + StringBuilder sb = new StringBuilder("add "); + sb.append(key); + sb.append(" as "); + sb.append(CclRenderer.value(value)); + return sb.toString(); + } + + @Override + public String toString() { + return ccl(); + } + + } + + /** + * The terminal state for an {@code add} command that targets specific + * records. + */ + public static final class RecordState implements Command { + + /** + * The key to add. + */ + private final String key; + + /** + * The value to add. + */ + private final Object value; + + /** + * The target records. + */ + private final List records; + + /** + * Construct a new instance. + * + * @param key the key + * @param value the value + * @param records the target records + */ + RecordState(String key, Object value, List records) { + this.key = key; + this.value = value; + this.records = records; + } + + /** + * Return the key for this command. + * + * @return the key + */ + public String key() { + return key; + } + + /** + * Return the value for this command. + * + * @return the value + */ + public Object value() { + return value; + } + + /** + * Return the target records for this command. + * + * @return the records + */ + public List records() { + return Collections.unmodifiableList(records); + } + + @Override + public String ccl() { + StringBuilder sb = new StringBuilder("add "); + sb.append(key); + sb.append(" as "); + sb.append(CclRenderer.value(value)); + sb.append(" in "); + sb.append(CclRenderer.records(records)); + return sb.toString(); + } + + @Override + public String toString() { + return ccl(); + } + + } + + private AddCommand() {/* no-init */} + +} diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/AuditCommand.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/AuditCommand.java new file mode 100644 index 000000000..2ae961224 --- /dev/null +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/AuditCommand.java @@ -0,0 +1,541 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.lang.command; + +import com.cinchapi.concourse.Timestamp; + +/** + * A {@link Command} builder for {@code audit} commands. + *

+ * {@code audit} retrieves the log of changes to a record or a key within a + * record, optionally bounded by one or two timestamps. + *

+ * + *
+ * audit <record>
+ * audit <record> at <start>
+ * audit <record> at <start> at <end>
+ * audit <key> in <record>
+ * audit <key> in <record> at <start>
+ * audit <key> in <record> at <start> at <end>
+ * 
+ * + * @author Jeff Nelson + */ +public final class AuditCommand { + + /** + * The terminal state for a record-scoped {@code audit} command. Supports an + * optional {@code at} clause for a start timestamp. + */ + public static final class RecordState implements Command { + + /** + * The target record. + */ + private final long record; + + /** + * Construct a new instance. + * + * @param record the target record + */ + RecordState(long record) { + this.record = record; + } + + /** + * Specify the start {@link Timestamp} for the audit. + * + * @param start the start {@link Timestamp} + * @return the next builder state + */ + public RecordTimestampState at(Timestamp start) { + return new RecordTimestampState(record, start); + } + + /** + * Return the target record for this command. + * + * @return the record + */ + public long record() { + return record; + } + + @Override + public String ccl() { + StringBuilder sb = new StringBuilder("audit "); + sb.append(Long.toString(record)); + return sb.toString(); + } + + @Override + public String toString() { + return ccl(); + } + + } + + /** + * The state after specifying the key for the {@code audit} command. + */ + public static final class KeyState { + + /** + * The key to audit. + */ + private final String key; + + /** + * Construct a new instance. + * + * @param key the key to audit + */ + KeyState(String key) { + this.key = key; + } + + /** + * Specify the record in which to audit the key. + * + * @param record the target record + * @return the next builder state + */ + public KeyRecordState in(long record) { + return new KeyRecordState(key, record); + } + + /** + * Alias for {@link #in(long)} to support alternate CCL dialects. + * + * @param record the target record + * @return the next builder state + */ + public KeyRecordState within(long record) { + return in(record); + } + + } + + /** + * The terminal state for a key-scoped {@code audit} command after + * specifying the key and record. Supports an optional {@code at} clause for + * a start timestamp. + */ + public static final class KeyRecordState implements Command { + + /** + * The key to audit. + */ + private final String key; + + /** + * The target record. + */ + private final long record; + + /** + * Construct a new instance. + * + * @param key the key + * @param record the target record + */ + KeyRecordState(String key, long record) { + this.key = key; + this.record = record; + } + + /** + * Specify the start {@link Timestamp} for the audit. + * + * @param start the start {@link Timestamp} + * @return the next builder state + */ + public KeyRecordTimestampState at(Timestamp start) { + return new KeyRecordTimestampState(key, record, start); + } + + /** + * Return the key for this command. + * + * @return the key + */ + public String key() { + return key; + } + + /** + * Return the target record for this command. + * + * @return the record + */ + public long record() { + return record; + } + + @Override + public String ccl() { + StringBuilder sb = new StringBuilder("audit "); + sb.append(key); + sb.append(" in "); + sb.append(Long.toString(record)); + return sb.toString(); + } + + @Override + public String toString() { + return ccl(); + } + + } + + /** + * The terminal state for a record-scoped {@code audit} command that + * includes a start {@link Timestamp}. Supports an optional second + * {@code at} clause for an end timestamp. + */ + public static final class RecordTimestampState implements Command { + + /** + * The target record. + */ + private final long record; + + /** + * The start {@link Timestamp}. + */ + private final Timestamp start; + + /** + * Construct a new instance. + * + * @param record the target record + * @param start the start {@link Timestamp} + */ + RecordTimestampState(long record, Timestamp start) { + this.record = record; + this.start = start; + } + + /** + * Specify the end {@link Timestamp} for this command. + * + * @param end the end {@link Timestamp} + * @return the next builder state + */ + public RecordRangeState at(Timestamp end) { + return new RecordRangeState(record, start, end); + } + + /** + * Return the target record for this command. + * + * @return the record + */ + public long record() { + return record; + } + + /** + * Return the start {@link Timestamp} for this command. + * + * @return the start {@link Timestamp} + */ + public Timestamp start() { + return start; + } + + @Override + public String ccl() { + StringBuilder sb = new StringBuilder("audit "); + sb.append(Long.toString(record)); + CclRenderer.appendTimestamp(sb, start); + return sb.toString(); + } + + @Override + public String toString() { + return ccl(); + } + + } + + /** + * The terminal state for a record-scoped {@code audit} command that + * includes both a start and end {@link Timestamp}. + */ + public static final class RecordRangeState implements Command { + + /** + * The target record. + */ + private final long record; + + /** + * The start {@link Timestamp}. + */ + private final Timestamp start; + + /** + * The end {@link Timestamp}. + */ + private final Timestamp end; + + /** + * Construct a new instance. + * + * @param record the target record + * @param start the start {@link Timestamp} + * @param end the end {@link Timestamp} + */ + RecordRangeState(long record, Timestamp start, Timestamp end) { + this.record = record; + this.start = start; + this.end = end; + } + + /** + * Return the target record for this command. + * + * @return the record + */ + public long record() { + return record; + } + + /** + * Return the start {@link Timestamp} for this command. + * + * @return the start {@link Timestamp} + */ + public Timestamp start() { + return start; + } + + /** + * Return the end {@link Timestamp} for this command. + * + * @return the end {@link Timestamp} + */ + public Timestamp end() { + return end; + } + + @Override + public String ccl() { + StringBuilder sb = new StringBuilder("audit "); + sb.append(Long.toString(record)); + CclRenderer.appendTimestamp(sb, start); + CclRenderer.appendTimestamp(sb, end); + return sb.toString(); + } + + @Override + public String toString() { + return ccl(); + } + + } + + /** + * The terminal state for a key-scoped {@code audit} command that includes a + * start {@link Timestamp}. Supports an optional second {@code at} clause + * for an end timestamp. + */ + public static final class KeyRecordTimestampState implements Command { + + /** + * The key to audit. + */ + private final String key; + + /** + * The target record. + */ + private final long record; + + /** + * The start {@link Timestamp}. + */ + private final Timestamp start; + + /** + * Construct a new instance. + * + * @param key the key + * @param record the target record + * @param start the start {@link Timestamp} + */ + KeyRecordTimestampState(String key, long record, Timestamp start) { + this.key = key; + this.record = record; + this.start = start; + } + + /** + * Specify the end {@link Timestamp} for this command. + * + * @param end the end {@link Timestamp} + * @return the next builder state + */ + public KeyRecordRangeState at(Timestamp end) { + return new KeyRecordRangeState(key, record, start, end); + } + + /** + * Return the key for this command. + * + * @return the key + */ + public String key() { + return key; + } + + /** + * Return the target record for this command. + * + * @return the record + */ + public long record() { + return record; + } + + /** + * Return the start {@link Timestamp} for this command. + * + * @return the start {@link Timestamp} + */ + public Timestamp start() { + return start; + } + + @Override + public String ccl() { + StringBuilder sb = new StringBuilder("audit "); + sb.append(key); + sb.append(" in "); + sb.append(Long.toString(record)); + CclRenderer.appendTimestamp(sb, start); + return sb.toString(); + } + + @Override + public String toString() { + return ccl(); + } + + } + + /** + * The terminal state for a key-scoped {@code audit} command that includes + * both a start and end {@link Timestamp}. + */ + public static final class KeyRecordRangeState implements Command { + + /** + * The key to audit. + */ + private final String key; + + /** + * The target record. + */ + private final long record; + + /** + * The start {@link Timestamp}. + */ + private final Timestamp start; + + /** + * The end {@link Timestamp}. + */ + private final Timestamp end; + + /** + * Construct a new instance. + * + * @param key the key + * @param record the target record + * @param start the start {@link Timestamp} + * @param end the end {@link Timestamp} + */ + KeyRecordRangeState(String key, long record, Timestamp start, + Timestamp end) { + this.key = key; + this.record = record; + this.start = start; + this.end = end; + } + + /** + * Return the key for this command. + * + * @return the key + */ + public String key() { + return key; + } + + /** + * Return the target record for this command. + * + * @return the record + */ + public long record() { + return record; + } + + /** + * Return the start {@link Timestamp} for this command. + * + * @return the start {@link Timestamp} + */ + public Timestamp start() { + return start; + } + + /** + * Return the end {@link Timestamp} for this command. + * + * @return the end {@link Timestamp} + */ + public Timestamp end() { + return end; + } + + @Override + public String ccl() { + StringBuilder sb = new StringBuilder("audit "); + sb.append(key); + sb.append(" in "); + sb.append(Long.toString(record)); + CclRenderer.appendTimestamp(sb, start); + CclRenderer.appendTimestamp(sb, end); + return sb.toString(); + } + + @Override + public String toString() { + return ccl(); + } + + } + + private AuditCommand() {/* no-init */} + +} diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/BrowseCommand.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/BrowseCommand.java new file mode 100644 index 000000000..8930c932b --- /dev/null +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/BrowseCommand.java @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.lang.command; + +import java.util.Collections; +import java.util.List; + +import javax.annotation.Nullable; + +import com.cinchapi.concourse.Timestamp; + +/** + * A {@link Command} builder for {@code browse} commands. + *

+ * {@code browse} retrieves the values indexed for one or more keys, optionally + * at a historical timestamp. + *

+ * + *
+ * browse <keys> [at timestamp]
+ * 
+ * + * @author Jeff Nelson + */ +public final class BrowseCommand { + + /** + * The terminal state for a {@code browse} command. This state is reached + * after specifying the keys to browse and supports an optional {@code at} + * clause for historical browsing. + */ + public static final class State implements Command { + + /** + * The keys to browse. + */ + private final List keys; + + /** + * The optional historical {@link Timestamp}. + */ + @Nullable + private Timestamp timestamp; + + /** + * Construct a new instance. + * + * @param key the first key to browse + * @param moreKeys additional keys + */ + State(String key, String... moreKeys) { + this.keys = CclRenderer.collectKeys(key, moreKeys); + } + + /** + * Pin this command to a historical {@link Timestamp}. + * + * @param timestamp the {@link Timestamp} + * @return this state for further chaining + */ + public State at(Timestamp timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Return the keys for this command. + * + * @return the keys + */ + public List keys() { + return Collections.unmodifiableList(keys); + } + + /** + * Return the historical {@link Timestamp}. + * + * @return the {@link Timestamp}, or {@code null} + */ + @Nullable + public Timestamp timestamp() { + return timestamp; + } + + @Override + public String ccl() { + StringBuilder sb = new StringBuilder("browse "); + sb.append(CclRenderer.keys(keys)); + CclRenderer.appendTimestamp(sb, timestamp); + return sb.toString(); + } + + @Override + public String toString() { + return ccl(); + } + + } + + private BrowseCommand() {/* no-init */} + +} diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/BuiltCommand.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/BuiltCommand.java new file mode 100644 index 000000000..e6bdc106b --- /dev/null +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/BuiltCommand.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.lang.command; + +/** + * A simple {@link Command} implementation for nullary commands that have no + * parameters (e.g., {@code ping}, {@code stage}, {@code commit}, {@code abort}, + * {@code inventory}). + * + * @author Jeff Nelson + */ +final class BuiltCommand implements Command { + + /** + * The command verb. + */ + private final String verb; + + /** + * Construct a new instance. + * + * @param verb the command verb + */ + BuiltCommand(String verb) { + this.verb = verb; + } + + @Override + public String ccl() { + return verb; + } + + @Override + public String toString() { + return ccl(); + } + +} diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/CalculateCommand.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/CalculateCommand.java new file mode 100644 index 000000000..d7cd65b3f --- /dev/null +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/CalculateCommand.java @@ -0,0 +1,271 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.lang.command; + +import java.util.Collections; +import java.util.List; + +import javax.annotation.Nullable; + +import com.cinchapi.concourse.Timestamp; +import com.cinchapi.concourse.lang.Criteria; + +/** + * A {@link Command} builder for {@code calculate} commands. + *

+ * {@code calculate} applies an aggregation function to a key, optionally scoped + * to specific records or a condition, and optionally pinned to a historical + * timestamp. + *

+ * + *
+ * calculate <function> <key>
+ * calculate <function> <key> in <records>
+ * calculate <function> <key> where <condition>
+ * calculate <function> <key> [in|where] ... at <timestamp>
+ * 
+ * + * @author Jeff Nelson + */ +public final class CalculateCommand { + + /** + * The terminal state for a {@code calculate} command. Supports optional + * {@code in}, {@code where}, and {@code at} clauses that can be chained + * fluently. + */ + public static final class State implements Command { + + /** + * The aggregation function name. + */ + private final String function; + + /** + * The key to calculate. + */ + private final String key; + + /** + * The target records, or {@code null} if unscoped or condition-scoped. + */ + @Nullable + private List records; + + /** + * The structured {@link Criteria}, or {@code null}. + */ + @Nullable + private Criteria criteria; + + /** + * The raw CCL condition string, or {@code null}. + */ + @Nullable + private String condition; + + /** + * The optional historical {@link Timestamp}. + */ + @Nullable + private Timestamp timestamp; + + /** + * Construct a new instance. + * + * @param function the aggregation function + * @param key the key to calculate + */ + State(String function, String key) { + this.function = function; + this.key = key; + } + + /** + * Scope this calculation to the specified {@code record}. + * + * @param record the target record + * @return this state for further chaining + */ + public State in(long record) { + return in(record, new long[0]); + } + + /** + * Scope this calculation to the specified records. + * + * @param record the first record + * @param moreRecords additional records + * @return this state for further chaining + */ + public State in(long record, long... moreRecords) { + this.records = CclRenderer.collectRecords(record, moreRecords); + return this; + } + + /** + * Alias for {@link #in(long)} to support alternate CCL dialects. + * + * @param record the target record + * @return this state for further chaining + */ + public State from(long record) { + return in(record); + } + + /** + * Alias for {@link #in(long, long...)} to support alternate CCL + * dialects. + * + * @param record the first record + * @param moreRecords additional records + * @return this state for further chaining + */ + public State from(long record, long... moreRecords) { + return in(record, moreRecords); + } + + /** + * Alias for {@link #in(long)} to support alternate CCL dialects. + * + * @param record the target record + * @return this state for further chaining + */ + public State within(long record) { + return in(record); + } + + /** + * Alias for {@link #in(long, long...)} to support alternate CCL + * dialects. + * + * @param record the first record + * @param moreRecords additional records + * @return this state for further chaining + */ + public State within(long record, long... moreRecords) { + return in(record, moreRecords); + } + + /** + * Scope this calculation to records matching the {@link Criteria}. + * + * @param criteria the {@link Criteria} + * @return this state for further chaining + */ + public State where(Criteria criteria) { + this.criteria = criteria; + return this; + } + + /** + * Scope this calculation to records matching the CCL condition string. + * + * @param ccl the CCL condition + * @return this state for further chaining + */ + public State where(String ccl) { + this.condition = ccl; + return this; + } + + /** + * Pin this calculation to a historical {@link Timestamp}. + * + * @param timestamp the {@link Timestamp} + * @return this state for further chaining + */ + public State at(Timestamp timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Return the aggregation function for this command. + * + * @return the function name + */ + public String function() { + return function; + } + + /** + * Return the key for this command. + * + * @return the key + */ + public String key() { + return key; + } + + /** + * Return the target records for this command. + * + * @return the records, or {@code null} + */ + @Nullable + public List records() { + return records != null ? Collections.unmodifiableList(records) + : null; + } + + /** + * Return the {@link Criteria} for this command. + * + * @return the {@link Criteria}, or {@code null} + */ + @Nullable + public Criteria criteria() { + return criteria; + } + + /** + * Return the historical {@link Timestamp} for this command. + * + * @return the {@link Timestamp}, or {@code null} + */ + @Nullable + public Timestamp timestamp() { + return timestamp; + } + + @Override + public String ccl() { + StringBuilder sb = new StringBuilder("calculate "); + sb.append(function); + sb.append(" "); + sb.append(key); + if(records != null) { + sb.append(" in "); + sb.append(CclRenderer.records(records)); + } + else { + CclRenderer.appendWhereClause(sb, criteria, condition); + } + CclRenderer.appendTimestamp(sb, timestamp); + return sb.toString(); + } + + @Override + public String toString() { + return ccl(); + } + + } + + private CalculateCommand() {/* no-init */} + +} diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/CclRenderer.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/CclRenderer.java new file mode 100644 index 000000000..eca1a46b4 --- /dev/null +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/CclRenderer.java @@ -0,0 +1,254 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.lang.command; + +import java.util.List; + +import javax.annotation.Nullable; + +import com.cinchapi.concourse.Timestamp; +import com.cinchapi.concourse.lang.Criteria; +import com.cinchapi.concourse.lang.paginate.Page; +import com.cinchapi.concourse.lang.sort.Direction; +import com.cinchapi.concourse.lang.sort.Order; +import com.cinchapi.concourse.lang.sort.OrderComponent; +import com.google.common.collect.Lists; + +/** + * Shared utilities for rendering {@link Command} components as CCL string + * fragments. + * + * @author Jeff Nelson + */ +public final class CclRenderer { + + /** + * Render a list of keys as a CCL fragment. A single key is rendered bare; + * multiple keys are rendered as a bracketed, comma-separated list. + * + * @param keys the keys to render + * @return the CCL fragment + */ + public static String keys(List keys) { + if(keys.size() == 1) { + return keys.get(0); + } + else { + return "[" + String.join(", ", keys) + "]"; + } + } + + /** + * Render a list of record identifiers as a CCL fragment. A single record is + * rendered bare; multiple records are rendered as a bracketed, + * comma-separated list. + * + * @param records the records to render + * @return the CCL fragment + */ + public static String records(List records) { + if(records.size() == 1) { + return Long.toString(records.get(0)); + } + else { + StringBuilder sb = new StringBuilder("["); + for (int i = 0; i < records.size(); ++i) { + if(i > 0) { + sb.append(", "); + } + sb.append(records.get(i)); + } + sb.append("]"); + return sb.toString(); + } + } + + /** + * Render a value as a CCL fragment. Strings are double-quoted with internal + * double quotes escaped; numbers and other types are rendered as their + * string representation. + * + * @param value the value to render + * @return the CCL fragment + */ + public static String value(Object value) { + if(value instanceof String) { + String escaped = ((String) value).replace("\\", "\\\\") + .replace("\"", "\\\""); + return "\"" + escaped + "\""; + } + else { + return value.toString(); + } + } + + /** + * Render a list of values as a CCL fragment, enclosed in brackets. + * + * @param values the values to render + * @return the CCL fragment + */ + public static String values(List values) { + StringBuilder sb = new StringBuilder("["); + for (int i = 0; i < values.size(); ++i) { + if(i > 0) { + sb.append(", "); + } + sb.append(value(values.get(i))); + } + sb.append("]"); + return sb.toString(); + } + + /** + * Append a condition clause to the {@link StringBuilder} using either a + * {@link Criteria} object or a raw CCL string. + * + * @param sb the builder to append to + * @param criteria the {@link Criteria}, or {@code null} + * @param condition the raw CCL string, or {@code null} + */ + public static void appendCondition(StringBuilder sb, + @Nullable Criteria criteria, @Nullable String condition) { + if(criteria != null) { + sb.append(criteria.ccl()); + } + else if(condition != null) { + sb.append(condition); + } + } + + /** + * Append a {@code where} clause to the {@link StringBuilder}. + * + * @param sb the builder to append to + * @param criteria the {@link Criteria}, or {@code null} + * @param condition the raw CCL string, or {@code null} + */ + public static void appendWhereClause(StringBuilder sb, + @Nullable Criteria criteria, @Nullable String condition) { + if(criteria != null || condition != null) { + sb.append(" where "); + appendCondition(sb, criteria, condition); + } + } + + /** + * Append a timestamp clause to the {@link StringBuilder}, if the + * {@code timestamp} is not {@code null}. + * + * @param sb the builder to append to + * @param timestamp the {@link Timestamp}, or {@code null} + */ + public static void appendTimestamp(StringBuilder sb, + @Nullable Timestamp timestamp) { + if(timestamp != null) { + sb.append(" at ").append(timestamp.getMicros()); + } + } + + /** + * Append an {@code order by} clause to the {@link StringBuilder}, if the + * {@code order} is not {@code null}. + * + * @param sb the builder to append to + * @param order the {@link Order}, or {@code null} + */ + public static void appendOrder(StringBuilder sb, @Nullable Order order) { + if(order != null) { + List spec = order.spec(); + if(!spec.isEmpty()) { + sb.append(" order by "); + for (int i = 0; i < spec.size(); ++i) { + if(i > 0) { + sb.append(", "); + } + OrderComponent component = spec.get(i); + sb.append(component.key()); + if(component.direction() == Direction.DESCENDING) { + sb.append(" desc"); + } + if(component.timestamp() != null) { + sb.append(" at ") + .append(component.timestamp().getMicros()); + } + } + } + } + } + + /** + * Append a {@code page} clause to the {@link StringBuilder}, if the + * {@code page} is not {@code null}. + *

+ * The rendered format uses {@code page size } when the + * offset is page-aligned, or {@code offset size } when the + * offset is not evenly divisible by the limit. + *

+ * + * @param sb the builder to append to + * @param page the {@link Page}, or {@code null} + */ + public static void appendPage(StringBuilder sb, @Nullable Page page) { + if(page != null) { + int limit = page.limit(); + int offset = page.offset(); + if(limit > 0 && offset % limit == 0) { + int number = (offset / limit) + 1; + sb.append(" page ").append(number); + } + else { + sb.append(" offset ").append(offset); + } + sb.append(" size ").append(limit); + } + } + + /** + * Collect a primary value and additional varargs values into a single list. + * + * @param first the first value + * @param more additional values + * @return the combined list + */ + public static List collectRecords(long first, long... more) { + List records = Lists.newArrayListWithCapacity(1 + more.length); + records.add(first); + for (long r : more) { + records.add(r); + } + return records; + } + + /** + * Collect a primary key and additional varargs keys into a single list. + * + * @param first the first key + * @param more additional keys + * @return the combined list + */ + public static List collectKeys(String first, String... more) { + List keys = Lists.newArrayListWithCapacity(1 + more.length); + keys.add(first); + for (String k : more) { + keys.add(k); + } + return keys; + } + + private CclRenderer() {/* no-init */} + +} diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/ChronicleCommand.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/ChronicleCommand.java new file mode 100644 index 000000000..1c4a29e0c --- /dev/null +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/ChronicleCommand.java @@ -0,0 +1,336 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.lang.command; + +import com.cinchapi.concourse.Timestamp; + +/** + * A {@link Command} builder for {@code chronicle} commands. + *

+ * {@code chronicle} retrieves the history of changes to a key in a record, + * optionally bounded by one or two timestamps. + *

+ * + *
+ * chronicle <key> in <record>
+ * chronicle <key> in <record> at <start>
+ * chronicle <key> in <record> at <start> at <end>
+ * 
+ * + * @author Jeff Nelson + */ +public final class ChronicleCommand { + + /** + * The state after specifying the key for the {@code chronicle} command. + */ + public static final class KeyState { + + /** + * The key to chronicle. + */ + private final String key; + + /** + * Construct a new instance. + * + * @param key the key to chronicle + */ + KeyState(String key) { + this.key = key; + } + + /** + * Specify the record in which to chronicle the key. + * + * @param record the target record + * @return the next builder state + */ + public RecordState in(long record) { + return new RecordState(key, record); + } + + /** + * Alias for {@link #in(long)} to support alternate CCL dialects. + * + * @param record the target record + * @return the next builder state + */ + public RecordState within(long record) { + return in(record); + } + + } + + /** + * The terminal state for a {@code chronicle} command after specifying the + * key and record. Supports an optional {@code at} clause for a start + * timestamp. + */ + public static final class RecordState implements Command { + + /** + * The key to chronicle. + */ + private final String key; + + /** + * The target record. + */ + private final long record; + + /** + * Construct a new instance. + * + * @param key the key + * @param record the target record + */ + RecordState(String key, long record) { + this.key = key; + this.record = record; + } + + /** + * Pin this command to a start {@link Timestamp}. + * + * @param start the start {@link Timestamp} + * @return the next builder state + */ + public TimestampState at(Timestamp start) { + return new TimestampState(key, record, start); + } + + /** + * Return the key for this command. + * + * @return the key + */ + public String key() { + return key; + } + + /** + * Return the target record for this command. + * + * @return the record + */ + public long record() { + return record; + } + + @Override + public String ccl() { + StringBuilder sb = new StringBuilder("chronicle "); + sb.append(key); + sb.append(" in "); + sb.append(Long.toString(record)); + return sb.toString(); + } + + @Override + public String toString() { + return ccl(); + } + + } + + /** + * The terminal state for a {@code chronicle} command that includes a start + * {@link Timestamp}. Supports an optional second {@code at} clause for an + * end timestamp. + */ + public static final class TimestampState implements Command { + + /** + * The key to chronicle. + */ + private final String key; + + /** + * The target record. + */ + private final long record; + + /** + * The start {@link Timestamp}. + */ + private final Timestamp start; + + /** + * Construct a new instance. + * + * @param key the key + * @param record the target record + * @param start the start {@link Timestamp} + */ + TimestampState(String key, long record, Timestamp start) { + this.key = key; + this.record = record; + this.start = start; + } + + /** + * Specify the end {@link Timestamp} for this command. + * + * @param end the end {@link Timestamp} + * @return the next builder state + */ + public RangeState at(Timestamp end) { + return new RangeState(key, record, start, end); + } + + /** + * Return the key for this command. + * + * @return the key + */ + public String key() { + return key; + } + + /** + * Return the target record for this command. + * + * @return the record + */ + public long record() { + return record; + } + + /** + * Return the start {@link Timestamp} for this command. + * + * @return the start {@link Timestamp} + */ + public Timestamp start() { + return start; + } + + @Override + public String ccl() { + StringBuilder sb = new StringBuilder("chronicle "); + sb.append(key); + sb.append(" in "); + sb.append(Long.toString(record)); + CclRenderer.appendTimestamp(sb, start); + return sb.toString(); + } + + @Override + public String toString() { + return ccl(); + } + + } + + /** + * The terminal state for a {@code chronicle} command that includes both a + * start and end {@link Timestamp}. + */ + public static final class RangeState implements Command { + + /** + * The key to chronicle. + */ + private final String key; + + /** + * The target record. + */ + private final long record; + + /** + * The start {@link Timestamp}. + */ + private final Timestamp start; + + /** + * The end {@link Timestamp}. + */ + private final Timestamp end; + + /** + * Construct a new instance. + * + * @param key the key + * @param record the target record + * @param start the start {@link Timestamp} + * @param end the end {@link Timestamp} + */ + RangeState(String key, long record, Timestamp start, Timestamp end) { + this.key = key; + this.record = record; + this.start = start; + this.end = end; + } + + /** + * Return the key for this command. + * + * @return the key + */ + public String key() { + return key; + } + + /** + * Return the target record for this command. + * + * @return the record + */ + public long record() { + return record; + } + + /** + * Return the start {@link Timestamp} for this command. + * + * @return the start {@link Timestamp} + */ + public Timestamp start() { + return start; + } + + /** + * Return the end {@link Timestamp} for this command. + * + * @return the end {@link Timestamp} + */ + public Timestamp end() { + return end; + } + + @Override + public String ccl() { + StringBuilder sb = new StringBuilder("chronicle "); + sb.append(key); + sb.append(" in "); + sb.append(Long.toString(record)); + CclRenderer.appendTimestamp(sb, start); + CclRenderer.appendTimestamp(sb, end); + return sb.toString(); + } + + @Override + public String toString() { + return ccl(); + } + + } + + private ChronicleCommand() {/* no-init */} + +} diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/ClearCommand.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/ClearCommand.java new file mode 100644 index 000000000..ec1b31d13 --- /dev/null +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/ClearCommand.java @@ -0,0 +1,200 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.lang.command; + +import java.util.Collections; +import java.util.List; + +import javax.annotation.Nullable; + +/** + * A {@link Command} builder for {@code clear} commands. + *

+ * {@code clear} removes all values for specified keys from records, or removes + * all data from entire records. + *

+ * + *
+ * clear <record>
+ * clear [<records>]
+ * clear <key> from <record>
+ * clear [<keys>] from [<records>]
+ * 
+ * + * @author Jeff Nelson + */ +public final class ClearCommand { + + /** + * The state after specifying keys for the {@code clear} command. The caller + * must specify target records via {@link #from(long)} or + * {@link #from(long, long...)}. + */ + public static final class KeyState { + + /** + * The keys to clear. + */ + private final List keys; + + /** + * Construct a new instance. + * + * @param key the first key + * @param moreKeys additional keys + */ + KeyState(String key, String... moreKeys) { + this.keys = CclRenderer.collectKeys(key, moreKeys); + } + + /** + * Clear from the specified {@code record}. + * + * @param record the target record + * @return the next builder state + */ + public RecordState from(long record) { + return new RecordState(keys, record); + } + + /** + * Clear from the specified {@code records}. + * + * @param record the first record + * @param more additional records + * @return the next builder state + */ + public RecordState from(long record, long... more) { + return new RecordState(keys, record, more); + } + + /** + * Alias for {@link #from(long)} to support alternate CCL dialects. + * + * @param record the target record + * @return the next builder state + */ + public RecordState in(long record) { + return from(record); + } + + /** + * Alias for {@link #from(long, long...)} to support alternate CCL + * dialects. + * + * @param record the first record + * @param more additional records + * @return the next builder state + */ + public RecordState in(long record, long... more) { + return from(record, more); + } + + /** + * Alias for {@link #from(long)} to support alternate CCL dialects. + * + * @param record the target record + * @return the next builder state + */ + public RecordState within(long record) { + return from(record); + } + + /** + * Alias for {@link #from(long, long...)} to support alternate CCL + * dialects. + * + * @param record the first record + * @param more additional records + * @return the next builder state + */ + public RecordState within(long record, long... more) { + return from(record, more); + } + + } + + /** + * The terminal state for a {@code clear} command, reached after specifying + * target records and optionally keys. + */ + public static final class RecordState implements Command { + + /** + * The keys to clear, or {@code null} to clear all keys from the target + * records. + */ + @Nullable + private final List keys; + + /** + * The target records. + */ + private final List records; + + /** + * Construct a new instance. + * + * @param keys the keys, or {@code null} to clear all + * @param record the first record + * @param moreRecords additional records + */ + RecordState(@Nullable List keys, long record, + long... moreRecords) { + this.keys = keys; + this.records = CclRenderer.collectRecords(record, moreRecords); + } + + /** + * Return the keys for this command. + * + * @return the keys, or {@code null} if all keys should be cleared + */ + @Nullable + public List keys() { + return keys != null ? Collections.unmodifiableList(keys) : null; + } + + /** + * Return the target records for this command. + * + * @return the records + */ + public List records() { + return Collections.unmodifiableList(records); + } + + @Override + public String ccl() { + StringBuilder sb = new StringBuilder("clear "); + if(keys != null) { + sb.append(CclRenderer.keys(keys)); + sb.append(" from "); + } + sb.append(CclRenderer.records(records)); + return sb.toString(); + } + + @Override + public String toString() { + return ccl(); + } + + } + + private ClearCommand() {/* no-init */} + +} diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/Command.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/Command.java new file mode 100644 index 000000000..76637eb7d --- /dev/null +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/Command.java @@ -0,0 +1,668 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.lang.command; + +import com.cinchapi.concourse.lang.Criteria; + +/** + * A {@link Command} encapsulates a complete CCL (Concourse Command Language) + * statement that can be rendered as a CCL string and, in the future, serialized + * for wire transport. + *

+ * {@link Command Commands} are constructed using the fluent static factory + * methods on this interface. Each factory returns a state object whose methods + * guide the caller through the valid parameter sequence for that command. + * Terminal states implement {@link Command}, so the result can be used directly + * without an explicit {@code build()} call. + *

+ *

Usage

+ * + *
+ * // Query
+ * Command cmd = Command.find(criteria).order(order).page(page);
+ *
+ * // Write
+ * Command cmd = Command.add("name").as("jeff").in(1);
+ *
+ * // Simple
+ * Command cmd = Command.ping();
+ *
+ * // Render
+ * String ccl = cmd.ccl();
+ * 
+ * + * @author Jeff Nelson + */ +public interface Command { + + /** + * Return a CCL string equivalent to this {@link Command}. + * + * @return the CCL string + */ + public String ccl(); + + // ---- QUERY COMMANDS ---- + + /** + * Start building a {@code find} {@link Command} using the provided + * {@link Criteria}. + * + * @param criteria the {@link Criteria} to find + * @return the next builder state + */ + public static FindCommand.ConditionState find(Criteria criteria) { + return new FindCommand.ConditionState(criteria, null); + } + + /** + * Start building a {@code find} {@link Command} using a raw CCL condition + * string. + * + * @param ccl the CCL condition + * @return the next builder state + */ + public static FindCommand.ConditionState find(String ccl) { + return new FindCommand.ConditionState(null, ccl); + } + + /** + * Start building a {@code select} {@link Command} for the specified + * {@code key}. + * + * @param key the key to select + * @return the next builder state + */ + public static SelectCommand.KeyState select(String key) { + return new SelectCommand.KeyState(key); + } + + /** + * Start building a {@code select} {@link Command} for the specified + * {@code keys}. + * + * @param key the first key to select + * @param moreKeys additional keys + * @return the next builder state + */ + public static SelectCommand.KeyState select(String key, + String... moreKeys) { + return new SelectCommand.KeyState(key, moreKeys); + } + + /** + * Start building a {@code select} {@link Command} for all keys. + * + * @return the next builder state + */ + public static SelectCommand.AllKeysState selectAll() { + return new SelectCommand.AllKeysState(); + } + + /** + * Start building a {@code get} {@link Command} for the specified + * {@code key}. + * + * @param key the key to get + * @return the next builder state + */ + public static GetCommand.KeyState get(String key) { + return new GetCommand.KeyState(key); + } + + /** + * Start building a {@code get} {@link Command} for the specified + * {@code keys}. + * + * @param key the first key to get + * @param moreKeys additional keys + * @return the next builder state + */ + public static GetCommand.KeyState get(String key, String... moreKeys) { + return new GetCommand.KeyState(key, moreKeys); + } + + /** + * Start building a {@code get} {@link Command} for all keys. + * + * @return the next builder state + */ + public static GetCommand.AllKeysState getAll() { + return new GetCommand.AllKeysState(); + } + + /** + * Start building a {@code navigate} {@link Command} for the specified + * navigation {@code key}. + * + * @param key the key to navigate + * @return the next builder state + */ + public static NavigateCommand.KeyState navigate(String key) { + return new NavigateCommand.KeyState(key); + } + + /** + * Start building a {@code navigate} {@link Command} for the specified + * navigation {@code keys}. + * + * @param key the first key to navigate + * @param moreKeys additional keys + * @return the next builder state + */ + public static NavigateCommand.KeyState navigate(String key, + String... moreKeys) { + return new NavigateCommand.KeyState(key, moreKeys); + } + + // ---- WRITE COMMANDS ---- + + /** + * Start building an {@code add} {@link Command} for the specified + * {@code key}. + * + * @param key the key to add + * @return the next builder state + */ + public static AddCommand.KeyState add(String key) { + return new AddCommand.KeyState(key); + } + + /** + * Start building a {@code set} {@link Command} for the specified + * {@code key}. + * + * @param key the key to set + * @return the next builder state + */ + public static SetCommand.KeyState set(String key) { + return new SetCommand.KeyState(key); + } + + /** + * Start building a {@code remove} {@link Command} for the specified + * {@code key}. + * + * @param key the key to remove + * @return the next builder state + */ + public static RemoveCommand.KeyState remove(String key) { + return new RemoveCommand.KeyState(key); + } + + /** + * Start building a {@code clear} {@link Command} for the specified + * {@code key}. + * + * @param key the key to clear + * @return the next builder state + */ + public static ClearCommand.KeyState clear(String key) { + return new ClearCommand.KeyState(key); + } + + /** + * Start building a {@code clear} {@link Command} for the specified + * {@code keys}. + * + * @param key the first key to clear + * @param moreKeys additional keys + * @return the next builder state + */ + public static ClearCommand.KeyState clear(String key, String... moreKeys) { + return new ClearCommand.KeyState(key, moreKeys); + } + + /** + * Return a {@code clear} {@link Command} for the specified {@code record}. + * + * @param record the record to clear + * @return the {@link Command} + */ + public static ClearCommand.RecordState clear(long record) { + return new ClearCommand.RecordState(null, record); + } + + /** + * Return a {@code clear} {@link Command} for the specified {@code records}. + * + * @param record the first record to clear + * @param moreRecords additional records + * @return the {@link Command} + */ + public static ClearCommand.RecordState clear(long record, + long... moreRecords) { + return new ClearCommand.RecordState(null, record, moreRecords); + } + + /** + * Start building an {@code insert} {@link Command} with the provided JSON + * data. + * + * @param json the JSON string to insert + * @return the next builder state + */ + public static InsertCommand.JsonState insert(String json) { + return new InsertCommand.JsonState(json); + } + + // ---- LINK COMMANDS ---- + + /** + * Start building a {@code link} {@link Command} for the specified + * {@code key}. + * + * @param key the link key + * @return the next builder state + */ + public static LinkCommand.KeyState link(String key) { + return new LinkCommand.KeyState(key); + } + + /** + * Start building an {@code unlink} {@link Command} for the specified + * {@code key}. + * + * @param key the link key + * @return the next builder state + */ + public static UnlinkCommand.KeyState unlink(String key) { + return new UnlinkCommand.KeyState(key); + } + + // ---- VERIFY COMMANDS ---- + + /** + * Start building a {@code verify} {@link Command} for the specified + * {@code key}. + * + * @param key the key to verify + * @return the next builder state + */ + public static VerifyCommand.KeyState verify(String key) { + return new VerifyCommand.KeyState(key); + } + + /** + * Start building a {@code verifyAndSwap} {@link Command} for the specified + * {@code key}. + * + * @param key the key to verify and swap + * @return the next builder state + */ + public static VerifyAndSwapCommand.KeyState verifyAndSwap(String key) { + return new VerifyAndSwapCommand.KeyState(key); + } + + /** + * Start building a {@code verifyOrSet} {@link Command} for the specified + * {@code key}. + * + * @param key the key to verify or set + * @return the next builder state + */ + public static VerifyOrSetCommand.KeyState verifyOrSet(String key) { + return new VerifyOrSetCommand.KeyState(key); + } + + // ---- FIND-OR COMMANDS ---- + + /** + * Start building a {@code findOrAdd} {@link Command} for the specified + * {@code key}. + * + * @param key the key to find or add + * @return the next builder state + */ + public static FindOrAddCommand.KeyState findOrAdd(String key) { + return new FindOrAddCommand.KeyState(key); + } + + /** + * Start building a {@code findOrInsert} {@link Command} using the provided + * {@link Criteria}. + * + * @param criteria the {@link Criteria} to search + * @return the next builder state + */ + public static FindOrInsertCommand.ConditionState findOrInsert( + Criteria criteria) { + return new FindOrInsertCommand.ConditionState(criteria, null); + } + + /** + * Start building a {@code findOrInsert} {@link Command} using a raw CCL + * condition string. + * + * @param ccl the CCL condition + * @return the next builder state + */ + public static FindOrInsertCommand.ConditionState findOrInsert(String ccl) { + return new FindOrInsertCommand.ConditionState(null, ccl); + } + + // ---- SEARCH / BROWSE ---- + + /** + * Start building a {@code search} {@link Command} for the specified + * {@code key}. + * + * @param key the key to search + * @return the next builder state + */ + public static SearchCommand.KeyState search(String key) { + return new SearchCommand.KeyState(key); + } + + /** + * Start building a {@code browse} {@link Command} for the specified + * {@code key}. + * + * @param key the key to browse + * @return the next builder state + */ + public static BrowseCommand.State browse(String key) { + return new BrowseCommand.State(key); + } + + /** + * Start building a {@code browse} {@link Command} for the specified + * {@code keys}. + * + * @param key the first key to browse + * @param moreKeys additional keys + * @return the next builder state + */ + public static BrowseCommand.State browse(String key, String... moreKeys) { + return new BrowseCommand.State(key, moreKeys); + } + + // ---- RECORD INSPECTION ---- + + /** + * Start building a {@code describe} {@link Command} for the specified + * {@code record}. + * + * @param record the record to describe + * @return the next builder state + */ + public static DescribeCommand.State describe(long record) { + return new DescribeCommand.State(record); + } + + /** + * Start building a {@code describe} {@link Command} for the specified + * {@code records}. + * + * @param record the first record to describe + * @param moreRecords additional records + * @return the next builder state + */ + public static DescribeCommand.State describe(long record, + long... moreRecords) { + return new DescribeCommand.State(record, moreRecords); + } + + /** + * Return a {@code describe} {@link Command} that describes all records. + * + * @return the {@link Command} + */ + public static Command describeAll() { + return new BuiltCommand("describe"); + } + + /** + * Start building a {@code trace} {@link Command} for the specified + * {@code record}. + * + * @param record the record to trace + * @return the next builder state + */ + public static TraceCommand.State trace(long record) { + return new TraceCommand.State(record); + } + + /** + * Start building a {@code trace} {@link Command} for the specified + * {@code records}. + * + * @param record the first record to trace + * @param moreRecords additional records + * @return the next builder state + */ + public static TraceCommand.State trace(long record, long... moreRecords) { + return new TraceCommand.State(record, moreRecords); + } + + /** + * Start building a {@code holds} {@link Command} for the specified + * {@code record}. + * + * @param record the record to check + * @return the next builder state + */ + public static HoldsCommand.State holds(long record) { + return new HoldsCommand.State(record); + } + + /** + * Start building a {@code holds} {@link Command} for the specified + * {@code records}. + * + * @param record the first record to check + * @param moreRecords additional records + * @return the next builder state + */ + public static HoldsCommand.State holds(long record, long... moreRecords) { + return new HoldsCommand.State(record, moreRecords); + } + + /** + * Start building a {@code jsonify} {@link Command} for the specified + * {@code record}. + * + * @param record the record to jsonify + * @return the next builder state + */ + public static JsonifyCommand.State jsonify(long record) { + return new JsonifyCommand.State(record); + } + + /** + * Start building a {@code jsonify} {@link Command} for the specified + * {@code records}. + * + * @param record the first record to jsonify + * @param moreRecords additional records + * @return the next builder state + */ + public static JsonifyCommand.State jsonify(long record, + long... moreRecords) { + return new JsonifyCommand.State(record, moreRecords); + } + + // ---- HISTORY / TEMPORAL ---- + + /** + * Start building a {@code chronicle} {@link Command} for the specified + * {@code key}. + * + * @param key the key to chronicle + * @return the next builder state + */ + public static ChronicleCommand.KeyState chronicle(String key) { + return new ChronicleCommand.KeyState(key); + } + + /** + * Start building a {@code diff} {@link Command} for the specified + * {@code record}. + * + * @param record the record to diff + * @return the next builder state + */ + public static DiffCommand.RecordState diff(long record) { + return new DiffCommand.RecordState(record); + } + + /** + * Start building a {@code diff} {@link Command} for the specified + * {@code key}. + * + * @param key the key to diff + * @return the next builder state + */ + public static DiffCommand.KeyState diff(String key) { + return new DiffCommand.KeyState(key); + } + + /** + * Start building an {@code audit} {@link Command} for the specified + * {@code record}. + * + * @param record the record to audit + * @return the next builder state + */ + public static AuditCommand.RecordState audit(long record) { + return new AuditCommand.RecordState(record); + } + + /** + * Start building an {@code audit} {@link Command} for the specified + * {@code key}. + * + * @param key the key to audit + * @return the next builder state + */ + public static AuditCommand.KeyState audit(String key) { + return new AuditCommand.KeyState(key); + } + + /** + * Start building a {@code revert} {@link Command} for the specified + * {@code key}. + * + * @param key the key to revert + * @return the next builder state + */ + public static RevertCommand.KeyState revert(String key) { + return new RevertCommand.KeyState(key); + } + + /** + * Start building a {@code revert} {@link Command} for the specified + * {@code keys}. + * + * @param key the first key to revert + * @param moreKeys additional keys + * @return the next builder state + */ + public static RevertCommand.KeyState revert(String key, + String... moreKeys) { + return new RevertCommand.KeyState(key, moreKeys); + } + + // ---- OTHER ---- + + /** + * Start building a {@code reconcile} {@link Command} for the specified + * {@code key}. + * + * @param key the key to reconcile + * @return the next builder state + */ + public static ReconcileCommand.KeyState reconcile(String key) { + return new ReconcileCommand.KeyState(key); + } + + /** + * Return a {@code consolidate} {@link Command} that merges the specified + * records into the {@code first}. + * + * @param first the target record + * @param second the first record to merge + * @param remaining additional records to merge + * @return the {@link Command} + */ + public static ConsolidateCommand.State consolidate(long first, long second, + long... remaining) { + return new ConsolidateCommand.State(first, second, remaining); + } + + /** + * Start building a {@code calculate} {@link Command} with the specified + * aggregation {@code function} and {@code key}. + * + * @param function the calculation function (e.g., sum, avg) + * @param key the key to calculate + * @return the next builder state + */ + public static CalculateCommand.State calculate(String function, + String key) { + return new CalculateCommand.State(function, key); + } + + // ---- TRANSACTION ---- + + /** + * Return a {@code stage} {@link Command}. + * + * @return the {@link Command} + */ + public static Command stage() { + return new BuiltCommand("stage"); + } + + /** + * Return a {@code commit} {@link Command}. + * + * @return the {@link Command} + */ + public static Command commit() { + return new BuiltCommand("commit"); + } + + /** + * Return an {@code abort} {@link Command}. + * + * @return the {@link Command} + */ + public static Command abort() { + return new BuiltCommand("abort"); + } + + // ---- UTILITY ---- + + /** + * Return a {@code ping} {@link Command}. + * + * @return the {@link Command} + */ + public static Command ping() { + return new BuiltCommand("ping"); + } + + /** + * Return an {@code inventory} {@link Command}. + * + * @return the {@link Command} + */ + public static Command inventory() { + return new BuiltCommand("inventory"); + } + +} diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/ConsolidateCommand.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/ConsolidateCommand.java new file mode 100644 index 000000000..507cb2fd0 --- /dev/null +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/ConsolidateCommand.java @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.lang.command; + +import java.util.Collections; +import java.util.List; + +import com.google.common.collect.Lists; + +/** + * A {@link Command} builder for {@code consolidate} commands. + *

+ * {@code consolidate} merges the data from multiple records into a single + * target record. The first record in the list is the target; all remaining + * records are merged into it. + *

+ * + *
+ * consolidate <records>
+ * 
+ * + * @author Jeff Nelson + */ +public final class ConsolidateCommand { + + /** + * The terminal state for a {@code consolidate} command. + */ + public static final class State implements Command { + + /** + * The records to consolidate, where the first record is the target. + */ + private final List records; + + /** + * Construct a new instance. + * + * @param first the target record + * @param second the first record to merge + * @param remaining additional records to merge + */ + State(long first, long second, long... remaining) { + List all = Lists + .newArrayListWithCapacity(2 + remaining.length); + all.add(first); + all.add(second); + for (long r : remaining) { + all.add(r); + } + this.records = all; + } + + /** + * Return the records for this command. + * + * @return the records + */ + public List records() { + return Collections.unmodifiableList(records); + } + + @Override + public String ccl() { + StringBuilder sb = new StringBuilder("consolidate "); + sb.append(CclRenderer.records(records)); + return sb.toString(); + } + + @Override + public String toString() { + return ccl(); + } + + } + + private ConsolidateCommand() {/* no-init */} + +} diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/DescribeCommand.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/DescribeCommand.java new file mode 100644 index 000000000..2ac70a2b7 --- /dev/null +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/DescribeCommand.java @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.lang.command; + +import java.util.Collections; +import java.util.List; + +import javax.annotation.Nullable; + +import com.cinchapi.concourse.Timestamp; + +/** + * A {@link Command} builder for {@code describe} commands. + *

+ * {@code describe} returns the keys that have at least one value in one or more + * records, optionally at a historical timestamp. + *

+ * + *
+ * describe <records> [at timestamp]
+ * 
+ * + * @author Jeff Nelson + */ +public final class DescribeCommand { + + /** + * The terminal state for a {@code describe} command. This state is reached + * after specifying the records to describe and supports an optional + * {@code at} clause for historical inspection. + */ + public static final class State implements Command { + + /** + * The target records. + */ + private final List records; + + /** + * The optional historical {@link Timestamp}. + */ + @Nullable + private Timestamp timestamp; + + /** + * Construct a new instance. + * + * @param record the first record to describe + * @param moreRecords additional records + */ + State(long record, long... moreRecords) { + this.records = CclRenderer.collectRecords(record, moreRecords); + } + + /** + * Pin this command to a historical {@link Timestamp}. + * + * @param timestamp the {@link Timestamp} + * @return this state for further chaining + */ + public State at(Timestamp timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Return the target records for this command. + * + * @return the records + */ + public List records() { + return Collections.unmodifiableList(records); + } + + /** + * Return the historical {@link Timestamp}. + * + * @return the {@link Timestamp}, or {@code null} + */ + @Nullable + public Timestamp timestamp() { + return timestamp; + } + + @Override + public String ccl() { + StringBuilder sb = new StringBuilder("describe "); + sb.append(CclRenderer.records(records)); + CclRenderer.appendTimestamp(sb, timestamp); + return sb.toString(); + } + + @Override + public String toString() { + return ccl(); + } + + } + + private DescribeCommand() {/* no-init */} + +} diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/DiffCommand.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/DiffCommand.java new file mode 100644 index 000000000..978503f3f --- /dev/null +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/DiffCommand.java @@ -0,0 +1,484 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.lang.command; + +import com.cinchapi.concourse.Timestamp; + +/** + * A {@link Command} builder for {@code diff} commands. + *

+ * {@code diff} computes the changes to a record or a key within a record + * between one or two timestamps. + *

+ * + *
+ * diff <record> at <start>
+ * diff <record> at <start> at <end>
+ * diff <key> in <record> at <start>
+ * diff <key> in <record> at <start> at <end>
+ * 
+ * + * @author Jeff Nelson + */ +public final class DiffCommand { + + /** + * The state after specifying the record for the {@code diff} command. + */ + public static final class RecordState { + + /** + * The target record. + */ + private final long record; + + /** + * Construct a new instance. + * + * @param record the target record + */ + RecordState(long record) { + this.record = record; + } + + /** + * Specify the start {@link Timestamp} for the diff. + * + * @param start the start {@link Timestamp} + * @return the next builder state + */ + public RecordTimestampState at(Timestamp start) { + return new RecordTimestampState(record, start); + } + + } + + /** + * The state after specifying the key for the {@code diff} command. + */ + public static final class KeyState { + + /** + * The key to diff. + */ + private final String key; + + /** + * Construct a new instance. + * + * @param key the key to diff + */ + KeyState(String key) { + this.key = key; + } + + /** + * Specify the record in which to diff the key. + * + * @param record the target record + * @return the next builder state + */ + public KeyRecordState in(long record) { + return new KeyRecordState(key, record); + } + + /** + * Alias for {@link #in(long)} to support alternate CCL dialects. + * + * @param record the target record + * @return the next builder state + */ + public KeyRecordState within(long record) { + return in(record); + } + + } + + /** + * The state after specifying the key and record for a key-scoped + * {@code diff} command. + */ + public static final class KeyRecordState { + + /** + * The key to diff. + */ + private final String key; + + /** + * The target record. + */ + private final long record; + + /** + * Construct a new instance. + * + * @param key the key + * @param record the target record + */ + KeyRecordState(String key, long record) { + this.key = key; + this.record = record; + } + + /** + * Specify the start {@link Timestamp} for the diff. + * + * @param start the start {@link Timestamp} + * @return the next builder state + */ + public KeyRecordTimestampState at(Timestamp start) { + return new KeyRecordTimestampState(key, record, start); + } + + } + + /** + * The terminal state for a record-scoped {@code diff} command with a start + * {@link Timestamp}. Supports an optional second {@code at} clause for an + * end timestamp. + */ + public static final class RecordTimestampState implements Command { + + /** + * The target record. + */ + private final long record; + + /** + * The start {@link Timestamp}. + */ + private final Timestamp start; + + /** + * Construct a new instance. + * + * @param record the target record + * @param start the start {@link Timestamp} + */ + RecordTimestampState(long record, Timestamp start) { + this.record = record; + this.start = start; + } + + /** + * Specify the end {@link Timestamp} for this command. + * + * @param end the end {@link Timestamp} + * @return the next builder state + */ + public RecordRangeState at(Timestamp end) { + return new RecordRangeState(record, start, end); + } + + /** + * Return the target record for this command. + * + * @return the record + */ + public long record() { + return record; + } + + /** + * Return the start {@link Timestamp} for this command. + * + * @return the start {@link Timestamp} + */ + public Timestamp start() { + return start; + } + + @Override + public String ccl() { + StringBuilder sb = new StringBuilder("diff "); + sb.append(Long.toString(record)); + CclRenderer.appendTimestamp(sb, start); + return sb.toString(); + } + + @Override + public String toString() { + return ccl(); + } + + } + + /** + * The terminal state for a record-scoped {@code diff} command that includes + * both a start and end {@link Timestamp}. + */ + public static final class RecordRangeState implements Command { + + /** + * The target record. + */ + private final long record; + + /** + * The start {@link Timestamp}. + */ + private final Timestamp start; + + /** + * The end {@link Timestamp}. + */ + private final Timestamp end; + + /** + * Construct a new instance. + * + * @param record the target record + * @param start the start {@link Timestamp} + * @param end the end {@link Timestamp} + */ + RecordRangeState(long record, Timestamp start, Timestamp end) { + this.record = record; + this.start = start; + this.end = end; + } + + /** + * Return the target record for this command. + * + * @return the record + */ + public long record() { + return record; + } + + /** + * Return the start {@link Timestamp} for this command. + * + * @return the start {@link Timestamp} + */ + public Timestamp start() { + return start; + } + + /** + * Return the end {@link Timestamp} for this command. + * + * @return the end {@link Timestamp} + */ + public Timestamp end() { + return end; + } + + @Override + public String ccl() { + StringBuilder sb = new StringBuilder("diff "); + sb.append(Long.toString(record)); + CclRenderer.appendTimestamp(sb, start); + CclRenderer.appendTimestamp(sb, end); + return sb.toString(); + } + + @Override + public String toString() { + return ccl(); + } + + } + + /** + * The terminal state for a key-scoped {@code diff} command with a start + * {@link Timestamp}. Supports an optional second {@code at} clause for an + * end timestamp. + */ + public static final class KeyRecordTimestampState implements Command { + + /** + * The key to diff. + */ + private final String key; + + /** + * The target record. + */ + private final long record; + + /** + * The start {@link Timestamp}. + */ + private final Timestamp start; + + /** + * Construct a new instance. + * + * @param key the key + * @param record the target record + * @param start the start {@link Timestamp} + */ + KeyRecordTimestampState(String key, long record, Timestamp start) { + this.key = key; + this.record = record; + this.start = start; + } + + /** + * Specify the end {@link Timestamp} for this command. + * + * @param end the end {@link Timestamp} + * @return the next builder state + */ + public KeyRecordRangeState at(Timestamp end) { + return new KeyRecordRangeState(key, record, start, end); + } + + /** + * Return the key for this command. + * + * @return the key + */ + public String key() { + return key; + } + + /** + * Return the target record for this command. + * + * @return the record + */ + public long record() { + return record; + } + + /** + * Return the start {@link Timestamp} for this command. + * + * @return the start {@link Timestamp} + */ + public Timestamp start() { + return start; + } + + @Override + public String ccl() { + StringBuilder sb = new StringBuilder("diff "); + sb.append(key); + sb.append(" in "); + sb.append(Long.toString(record)); + CclRenderer.appendTimestamp(sb, start); + return sb.toString(); + } + + @Override + public String toString() { + return ccl(); + } + + } + + /** + * The terminal state for a key-scoped {@code diff} command that includes + * both a start and end {@link Timestamp}. + */ + public static final class KeyRecordRangeState implements Command { + + /** + * The key to diff. + */ + private final String key; + + /** + * The target record. + */ + private final long record; + + /** + * The start {@link Timestamp}. + */ + private final Timestamp start; + + /** + * The end {@link Timestamp}. + */ + private final Timestamp end; + + /** + * Construct a new instance. + * + * @param key the key + * @param record the target record + * @param start the start {@link Timestamp} + * @param end the end {@link Timestamp} + */ + KeyRecordRangeState(String key, long record, Timestamp start, + Timestamp end) { + this.key = key; + this.record = record; + this.start = start; + this.end = end; + } + + /** + * Return the key for this command. + * + * @return the key + */ + public String key() { + return key; + } + + /** + * Return the target record for this command. + * + * @return the record + */ + public long record() { + return record; + } + + /** + * Return the start {@link Timestamp} for this command. + * + * @return the start {@link Timestamp} + */ + public Timestamp start() { + return start; + } + + /** + * Return the end {@link Timestamp} for this command. + * + * @return the end {@link Timestamp} + */ + public Timestamp end() { + return end; + } + + @Override + public String ccl() { + StringBuilder sb = new StringBuilder("diff "); + sb.append(key); + sb.append(" in "); + sb.append(Long.toString(record)); + CclRenderer.appendTimestamp(sb, start); + CclRenderer.appendTimestamp(sb, end); + return sb.toString(); + } + + @Override + public String toString() { + return ccl(); + } + + } + + private DiffCommand() {/* no-init */} + +} diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/FindCommand.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/FindCommand.java new file mode 100644 index 000000000..e5fb55660 --- /dev/null +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/FindCommand.java @@ -0,0 +1,192 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.lang.command; + +import javax.annotation.Nullable; + +import com.cinchapi.concourse.Timestamp; +import com.cinchapi.concourse.lang.Criteria; +import com.cinchapi.concourse.lang.paginate.Page; +import com.cinchapi.concourse.lang.sort.Order; + +/** + * A {@link Command} builder for {@code find} commands. + *

+ * {@code find} locates record identifiers that match a condition. + *

+ * + *
+ * find <condition> [at timestamp] [order by ...] [page ...]
+ * 
+ * + * @author Jeff Nelson + */ +public final class FindCommand { + + /** + * The terminal state for a {@code find} command. This state is reached + * after specifying the condition and supports optional {@code at}, + * {@code order}, and {@code page} clauses. + */ + public static final class ConditionState implements Command { + + /** + * The structured {@link Criteria}, or {@code null} if a raw CCL string + * was provided. + */ + @Nullable + private final Criteria criteria; + + /** + * The raw CCL condition string, or {@code null} if a {@link Criteria} + * was provided. + */ + @Nullable + private final String condition; + + /** + * The optional historical {@link Timestamp}. + */ + @Nullable + private Timestamp timestamp; + + /** + * The optional sort {@link Order}. + */ + @Nullable + private Order order; + + /** + * The optional {@link Page pagination}. + */ + @Nullable + private Page page; + + /** + * Construct a new instance. + * + * @param criteria the {@link Criteria}, or {@code null} + * @param condition the raw CCL string, or {@code null} + */ + ConditionState(@Nullable Criteria criteria, + @Nullable String condition) { + this.criteria = criteria; + this.condition = condition; + } + + /** + * Pin this {@code find} command to a historical {@link Timestamp}. + * + * @param timestamp the {@link Timestamp} + * @return this state for further chaining + */ + public ConditionState at(Timestamp timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Apply an {@link Order} to this {@code find} command. + * + * @param order the {@link Order} + * @return this state for further chaining + */ + public ConditionState order(Order order) { + this.order = order; + return this; + } + + /** + * Apply {@link Page pagination} to this {@code find} command. + * + * @param page the {@link Page} + * @return this state for further chaining + */ + public ConditionState page(Page page) { + this.page = page; + return this; + } + + /** + * Return the {@link Criteria} for this command. + * + * @return the {@link Criteria}, or {@code null} + */ + @Nullable + public Criteria criteria() { + return criteria; + } + + /** + * Return the raw CCL condition for this command. + * + * @return the condition string, or {@code null} + */ + @Nullable + public String condition() { + return condition; + } + + /** + * Return the historical {@link Timestamp}. + * + * @return the {@link Timestamp}, or {@code null} + */ + @Nullable + public Timestamp timestamp() { + return timestamp; + } + + /** + * Return the sort {@link Order}. + * + * @return the {@link Order}, or {@code null} + */ + @Nullable + public Order order() { + return order; + } + + /** + * Return the {@link Page pagination}. + * + * @return the {@link Page}, or {@code null} + */ + @Nullable + public Page page() { + return page; + } + + @Override + public String ccl() { + StringBuilder sb = new StringBuilder("find "); + CclRenderer.appendCondition(sb, criteria, condition); + CclRenderer.appendTimestamp(sb, timestamp); + CclRenderer.appendOrder(sb, order); + CclRenderer.appendPage(sb, page); + return sb.toString(); + } + + @Override + public String toString() { + return ccl(); + } + + } + + private FindCommand() {/* no-init */} + +} diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/FindOrAddCommand.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/FindOrAddCommand.java new file mode 100644 index 000000000..c69f5159f --- /dev/null +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/FindOrAddCommand.java @@ -0,0 +1,128 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.lang.command; + +/** + * A {@link Command} builder for {@code findOrAdd} commands. + *

+ * {@code findOrAdd} atomically finds a record where a key holds a specified + * value, or adds the key/value association to a new record if no match is + * found. + *

+ * + *
+ * findOrAdd <key> as <value>
+ * 
+ * + * @author Jeff Nelson + */ +public final class FindOrAddCommand { + + /** + * The state after specifying the key for the {@code findOrAdd} command. + */ + public static final class KeyState { + + /** + * The key to find or add. + */ + private final String key; + + /** + * Construct a new instance. + * + * @param key the key to find or add + */ + KeyState(String key) { + this.key = key; + } + + /** + * Specify the value to find or add for this key. + * + * @param value the value + * @return the next builder state + */ + public ValueState as(Object value) { + return new ValueState(key, value); + } + + } + + /** + * The terminal state for a {@code findOrAdd} command, reached after + * specifying the key and value. + */ + public static final class ValueState implements Command { + + /** + * The key to find or add. + */ + private final String key; + + /** + * The value to find or add. + */ + private final Object value; + + /** + * Construct a new instance. + * + * @param key the key + * @param value the value + */ + ValueState(String key, Object value) { + this.key = key; + this.value = value; + } + + /** + * Return the key for this command. + * + * @return the key + */ + public String key() { + return key; + } + + /** + * Return the value for this command. + * + * @return the value + */ + public Object value() { + return value; + } + + @Override + public String ccl() { + StringBuilder sb = new StringBuilder("findOrAdd "); + sb.append(key); + sb.append(" as "); + sb.append(CclRenderer.value(value)); + return sb.toString(); + } + + @Override + public String toString() { + return ccl(); + } + + } + + private FindOrAddCommand() {/* no-init */} + +} diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/FindOrInsertCommand.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/FindOrInsertCommand.java new file mode 100644 index 000000000..e67ee74ef --- /dev/null +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/FindOrInsertCommand.java @@ -0,0 +1,168 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.lang.command; + +import javax.annotation.Nullable; + +import com.cinchapi.concourse.lang.Criteria; + +/** + * A {@link Command} builder for {@code findOrInsert} commands. + *

+ * {@code findOrInsert} atomically finds records matching a condition, or + * inserts JSON data into a new record if no match is found. + *

+ * + *
+ * findOrInsert <condition> '<json>'
+ * 
+ * + * @author Jeff Nelson + */ +public final class FindOrInsertCommand { + + /** + * The state after specifying the condition for the {@code findOrInsert} + * command. + */ + public static final class ConditionState { + + /** + * The structured {@link Criteria}, or {@code null} if a raw CCL string + * was provided. + */ + @Nullable + private final Criteria criteria; + + /** + * The raw CCL condition string, or {@code null} if a {@link Criteria} + * was provided. + */ + @Nullable + private final String condition; + + /** + * Construct a new instance. + * + * @param criteria the {@link Criteria}, or {@code null} + * @param condition the raw CCL string, or {@code null} + */ + ConditionState(@Nullable Criteria criteria, + @Nullable String condition) { + this.criteria = criteria; + this.condition = condition; + } + + /** + * Specify the JSON data to insert if no matching record is found. + * + * @param json the JSON string to insert + * @return the next builder state + */ + public JsonState json(String json) { + return new JsonState(criteria, condition, json); + } + + } + + /** + * The terminal state for a {@code findOrInsert} command, reached after + * specifying the condition and JSON data. + */ + public static final class JsonState implements Command { + + /** + * The structured {@link Criteria}, or {@code null} if a raw CCL string + * was provided. + */ + @Nullable + private final Criteria criteria; + + /** + * The raw CCL condition string, or {@code null} if a {@link Criteria} + * was provided. + */ + @Nullable + private final String condition; + + /** + * The JSON data to insert. + */ + private final String json; + + /** + * Construct a new instance. + * + * @param criteria the {@link Criteria}, or {@code null} + * @param condition the raw CCL string, or {@code null} + * @param json the JSON data + */ + JsonState(@Nullable Criteria criteria, @Nullable String condition, + String json) { + this.criteria = criteria; + this.condition = condition; + this.json = json; + } + + /** + * Return the {@link Criteria} for this command. + * + * @return the {@link Criteria}, or {@code null} + */ + @Nullable + public Criteria criteria() { + return criteria; + } + + /** + * Return the raw CCL condition for this command. + * + * @return the condition string, or {@code null} + */ + @Nullable + public String condition() { + return condition; + } + + /** + * Return the JSON data for this command. + * + * @return the JSON string + */ + public String json() { + return json; + } + + @Override + public String ccl() { + StringBuilder sb = new StringBuilder("findOrInsert "); + CclRenderer.appendCondition(sb, criteria, condition); + sb.append(" '"); + sb.append(json); + sb.append("'"); + return sb.toString(); + } + + @Override + public String toString() { + return ccl(); + } + + } + + private FindOrInsertCommand() {/* no-init */} + +} diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/GetCommand.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/GetCommand.java new file mode 100644 index 000000000..ddd04bc3f --- /dev/null +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/GetCommand.java @@ -0,0 +1,444 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.lang.command; + +import java.util.Collections; +import java.util.List; + +import javax.annotation.Nullable; + +import com.cinchapi.concourse.Timestamp; +import com.cinchapi.concourse.lang.Criteria; +import com.cinchapi.concourse.lang.paginate.Page; +import com.cinchapi.concourse.lang.sort.Order; + +/** + * A {@link Command} builder for {@code get} commands. + *

+ * {@code get} retrieves the most recent value for specified keys from records + * or records matching a condition. + *

+ * + *
+ * get [keys] from <records>
+ *     [at timestamp] [order by ...] [page ...]
+ * get [keys] where <condition>
+ *     [at timestamp] [order by ...] [page ...]
+ * 
+ * + * @author Jeff Nelson + */ +public final class GetCommand { + + /** + * The state after calling {@link Command#getAll()} with no keys, indicating + * that all keys should be retrieved. + */ + public static final class AllKeysState { + + /** + * Construct a new instance. + */ + AllKeysState() {} + + /** + * Get all keys from the specified {@code record}. + * + * @param record the target record + * @return the next builder state + */ + public SourceState from(long record) { + return from(record, new long[0]); + } + + /** + * Get all keys from the specified {@code records}. + * + * @param record the first record + * @param moreRecords additional records + * @return the next builder state + */ + public SourceState from(long record, long... moreRecords) { + return new SourceState(null, + CclRenderer.collectRecords(record, moreRecords), null, + null); + } + + /** + * Alias for {@link #from(long)} to support alternate CCL dialects. + * + * @param record the target record + * @return the next builder state + */ + public SourceState in(long record) { + return from(record); + } + + /** + * Alias for {@link #from(long, long...)} to support alternate CCL + * dialects. + * + * @param record the first record + * @param moreRecords additional records + * @return the next builder state + */ + public SourceState in(long record, long... moreRecords) { + return from(record, moreRecords); + } + + /** + * Alias for {@link #from(long)} to support alternate CCL dialects. + * + * @param record the target record + * @return the next builder state + */ + public SourceState within(long record) { + return from(record); + } + + /** + * Alias for {@link #from(long, long...)} to support alternate CCL + * dialects. + * + * @param record the first record + * @param moreRecords additional records + * @return the next builder state + */ + public SourceState within(long record, long... moreRecords) { + return from(record, moreRecords); + } + + /** + * Get all keys from records matching the {@link Criteria}. + * + * @param criteria the {@link Criteria} + * @return the next builder state + */ + public SourceState where(Criteria criteria) { + return new SourceState(null, null, criteria, null); + } + + /** + * Get all keys from records matching the CCL condition. + * + * @param ccl the CCL condition string + * @return the next builder state + */ + public SourceState where(String ccl) { + return new SourceState(null, null, null, ccl); + } + + } + + /** + * The state after specifying keys for the {@code get} command. + */ + public static final class KeyState { + + /** + * The keys to get. + */ + private final List keys; + + /** + * Construct a new instance. + * + * @param key the first key + * @param moreKeys additional keys + */ + KeyState(String key, String... moreKeys) { + this.keys = CclRenderer.collectKeys(key, moreKeys); + } + + /** + * Get from the specified {@code record}. + * + * @param record the target record + * @return the next builder state + */ + public SourceState from(long record) { + return from(record, new long[0]); + } + + /** + * Get from the specified {@code records}. + * + * @param record the first record + * @param moreRecords additional records + * @return the next builder state + */ + public SourceState from(long record, long... moreRecords) { + return new SourceState(keys, + CclRenderer.collectRecords(record, moreRecords), null, + null); + } + + /** + * Alias for {@link #from(long)} to support alternate CCL dialects. + * + * @param record the target record + * @return the next builder state + */ + public SourceState in(long record) { + return from(record); + } + + /** + * Alias for {@link #from(long, long...)} to support alternate CCL + * dialects. + * + * @param record the first record + * @param moreRecords additional records + * @return the next builder state + */ + public SourceState in(long record, long... moreRecords) { + return from(record, moreRecords); + } + + /** + * Alias for {@link #from(long)} to support alternate CCL dialects. + * + * @param record the target record + * @return the next builder state + */ + public SourceState within(long record) { + return from(record); + } + + /** + * Alias for {@link #from(long, long...)} to support alternate CCL + * dialects. + * + * @param record the first record + * @param moreRecords additional records + * @return the next builder state + */ + public SourceState within(long record, long... moreRecords) { + return from(record, moreRecords); + } + + /** + * Get from records matching the {@link Criteria}. + * + * @param criteria the {@link Criteria} + * @return the next builder state + */ + public SourceState where(Criteria criteria) { + return new SourceState(keys, null, criteria, null); + } + + /** + * Get from records matching the CCL condition. + * + * @param ccl the CCL condition string + * @return the next builder state + */ + public SourceState where(String ccl) { + return new SourceState(keys, null, null, ccl); + } + + } + + /** + * The terminal state for a {@code get} command, reached after specifying + * the data source. Supports optional {@code at}, {@code order}, and + * {@code page} clauses. + */ + public static final class SourceState implements Command { + + /** + * The keys to get, or {@code null} for all keys. + */ + @Nullable + private final List keys; + + /** + * The target records, or {@code null} if a condition was provided. + */ + @Nullable + private final List records; + + /** + * The structured {@link Criteria}, or {@code null}. + */ + @Nullable + private final Criteria criteria; + + /** + * The raw CCL condition string, or {@code null}. + */ + @Nullable + private final String condition; + + /** + * The optional historical {@link Timestamp}. + */ + @Nullable + private Timestamp timestamp; + + /** + * The optional sort {@link Order}. + */ + @Nullable + private Order order; + + /** + * The optional {@link Page pagination}. + */ + @Nullable + private Page page; + + /** + * Construct a new instance. + * + * @param keys the keys, or {@code null} + * @param records the records, or {@code null} + * @param criteria the {@link Criteria}, or {@code null} + * @param condition the CCL string, or {@code null} + */ + SourceState(@Nullable List keys, @Nullable List records, + @Nullable Criteria criteria, @Nullable String condition) { + this.keys = keys; + this.records = records; + this.criteria = criteria; + this.condition = condition; + } + + /** + * Pin this command to a historical {@link Timestamp}. + * + * @param timestamp the {@link Timestamp} + * @return this state for further chaining + */ + public SourceState at(Timestamp timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Apply an {@link Order} to this command. + * + * @param order the {@link Order} + * @return this state for further chaining + */ + public SourceState order(Order order) { + this.order = order; + return this; + } + + /** + * Apply {@link Page pagination} to this command. + * + * @param page the {@link Page} + * @return this state for further chaining + */ + public SourceState page(Page page) { + this.page = page; + return this; + } + + /** + * Return the keys for this command. + * + * @return the keys, or an empty list for all keys + */ + public List keys() { + return keys != null ? Collections.unmodifiableList(keys) + : Collections.emptyList(); + } + + /** + * Return the target records. + * + * @return the records, or {@code null} + */ + @Nullable + public List records() { + return records != null ? Collections.unmodifiableList(records) + : null; + } + + /** + * Return the {@link Criteria}. + * + * @return the {@link Criteria}, or {@code null} + */ + @Nullable + public Criteria criteria() { + return criteria; + } + + /** + * Return the historical {@link Timestamp}. + * + * @return the {@link Timestamp}, or {@code null} + */ + @Nullable + public Timestamp timestamp() { + return timestamp; + } + + /** + * Return the sort {@link Order}. + * + * @return the {@link Order}, or {@code null} + */ + @Nullable + public Order order() { + return order; + } + + /** + * Return the {@link Page pagination}. + * + * @return the {@link Page}, or {@code null} + */ + @Nullable + public Page page() { + return page; + } + + @Override + public String ccl() { + StringBuilder sb = new StringBuilder("get"); + if(keys != null) { + sb.append(" "); + sb.append(CclRenderer.keys(keys)); + } + if(records != null) { + sb.append(" from "); + sb.append(CclRenderer.records(records)); + } + else { + sb.append(" where "); + CclRenderer.appendCondition(sb, criteria, condition); + } + CclRenderer.appendTimestamp(sb, timestamp); + CclRenderer.appendOrder(sb, order); + CclRenderer.appendPage(sb, page); + return sb.toString(); + } + + @Override + public String toString() { + return ccl(); + } + + } + + private GetCommand() {/* no-init */} + +} diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/HoldsCommand.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/HoldsCommand.java new file mode 100644 index 000000000..4855b187c --- /dev/null +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/HoldsCommand.java @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.lang.command; + +import java.util.Collections; +import java.util.List; + +/** + * A {@link Command} builder for {@code holds} commands. + *

+ * {@code holds} checks whether one or more records currently contain any data. + *

+ * + *
+ * holds <records>
+ * 
+ * + * @author Jeff Nelson + */ +public final class HoldsCommand { + + /** + * The terminal state for a {@code holds} command, reached after specifying + * the records to check. + */ + public static final class State implements Command { + + /** + * The target records. + */ + private final List records; + + /** + * Construct a new instance. + * + * @param record the first record to check + * @param moreRecords additional records + */ + State(long record, long... moreRecords) { + this.records = CclRenderer.collectRecords(record, moreRecords); + } + + /** + * Return the target records for this command. + * + * @return the records + */ + public List records() { + return Collections.unmodifiableList(records); + } + + @Override + public String ccl() { + StringBuilder sb = new StringBuilder("holds "); + sb.append(CclRenderer.records(records)); + return sb.toString(); + } + + @Override + public String toString() { + return ccl(); + } + + } + + private HoldsCommand() {/* no-init */} + +} diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/InsertCommand.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/InsertCommand.java new file mode 100644 index 000000000..ad1fe1afa --- /dev/null +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/InsertCommand.java @@ -0,0 +1,238 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.lang.command; + +import java.util.Collections; +import java.util.List; + +/** + * A {@link Command} builder for {@code insert} commands. + *

+ * {@code insert} imports JSON data into one or more records. When no records + * are specified, a new record is created. + *

+ * + *
+ * insert <json>
+ * insert <json> in <record>
+ * insert <json> in [<records>]
+ * 
+ * + * @author Jeff Nelson + */ +public final class InsertCommand { + + /** + * The terminal state after specifying JSON data for the {@code insert} + * command. This state produces CCL without a record target, but can + * optionally be narrowed to specific records via + * {@link #in(long, long...)}. + */ + public static final class JsonState implements Command { + + /** + * The JSON data to insert. + */ + private final String json; + + /** + * Construct a new instance. + * + * @param json the JSON string to insert + */ + JsonState(String json) { + this.json = json; + } + + /** + * Insert into the specified {@code record}. + * + * @param record the target record + * @return the next builder state + */ + public RecordState in(long record) { + return new RecordState(json, CclRenderer.collectRecords(record)); + } + + /** + * Insert into the specified {@code records}. + * + * @param first the first record + * @param more additional records + * @return the next builder state + */ + public RecordState in(long first, long... more) { + return new RecordState(json, + CclRenderer.collectRecords(first, more)); + } + + /** + * Alias for {@link #in(long)} to support alternate CCL dialects. + * + * @param record the target record + * @return the next builder state + */ + public RecordState into(long record) { + return in(record); + } + + /** + * Alias for {@link #in(long, long...)} to support alternate CCL + * dialects. + * + * @param first the first record + * @param more additional records + * @return the next builder state + */ + public RecordState into(long first, long... more) { + return in(first, more); + } + + /** + * Alias for {@link #in(long)} to support alternate CCL dialects. + * + * @param record the target record + * @return the next builder state + */ + public RecordState to(long record) { + return in(record); + } + + /** + * Alias for {@link #in(long, long...)} to support alternate CCL + * dialects. + * + * @param first the first record + * @param more additional records + * @return the next builder state + */ + public RecordState to(long first, long... more) { + return in(first, more); + } + + /** + * Alias for {@link #in(long)} to support alternate CCL dialects. + * + * @param record the target record + * @return the next builder state + */ + public RecordState within(long record) { + return in(record); + } + + /** + * Alias for {@link #in(long, long...)} to support alternate CCL + * dialects. + * + * @param first the first record + * @param more additional records + * @return the next builder state + */ + public RecordState within(long first, long... more) { + return in(first, more); + } + + /** + * Return the JSON data for this command. + * + * @return the JSON string + */ + public String json() { + return json; + } + + @Override + public String ccl() { + StringBuilder sb = new StringBuilder("insert "); + sb.append("'"); + sb.append(json); + sb.append("'"); + return sb.toString(); + } + + @Override + public String toString() { + return ccl(); + } + + } + + /** + * The terminal state for an {@code insert} command that targets specific + * records. + */ + public static final class RecordState implements Command { + + /** + * The JSON data to insert. + */ + private final String json; + + /** + * The target records. + */ + private final List records; + + /** + * Construct a new instance. + * + * @param json the JSON string + * @param records the target records + */ + RecordState(String json, List records) { + this.json = json; + this.records = records; + } + + /** + * Return the JSON data for this command. + * + * @return the JSON string + */ + public String json() { + return json; + } + + /** + * Return the target records for this command. + * + * @return the records + */ + public List records() { + return Collections.unmodifiableList(records); + } + + @Override + public String ccl() { + StringBuilder sb = new StringBuilder("insert "); + sb.append("'"); + sb.append(json); + sb.append("'"); + sb.append(" in "); + sb.append(CclRenderer.records(records)); + return sb.toString(); + } + + @Override + public String toString() { + return ccl(); + } + + } + + private InsertCommand() {/* no-init */} + +} diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/JsonifyCommand.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/JsonifyCommand.java new file mode 100644 index 000000000..d0cd4891c --- /dev/null +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/JsonifyCommand.java @@ -0,0 +1,146 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.lang.command; + +import java.util.Collections; +import java.util.List; + +import javax.annotation.Nullable; + +import com.cinchapi.concourse.Timestamp; + +/** + * A {@link Command} builder for {@code jsonify} commands. + *

+ * {@code jsonify} serializes one or more records as JSON, optionally at a + * historical timestamp and optionally including the record identifier in each + * JSON object. + *

+ * + *
+ * jsonify <records> [at timestamp] [identifier]
+ * 
+ * + * @author Jeff Nelson + */ +public final class JsonifyCommand { + + /** + * The terminal state for a {@code jsonify} command. This state is reached + * after specifying the records to serialize and supports optional + * {@code at} and {@code identifier} clauses. + */ + public static final class State implements Command { + + /** + * The target records. + */ + private final List records; + + /** + * The optional historical {@link Timestamp}. + */ + @Nullable + private Timestamp timestamp; + + /** + * Whether to include the record identifier in the JSON output. + */ + private boolean identifier; + + /** + * Construct a new instance. + * + * @param record the first record to jsonify + * @param moreRecords additional records + */ + State(long record, long... moreRecords) { + this.records = CclRenderer.collectRecords(record, moreRecords); + this.identifier = false; + } + + /** + * Pin this command to a historical {@link Timestamp}. + * + * @param timestamp the {@link Timestamp} + * @return this state for further chaining + */ + public State at(Timestamp timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Include the record identifier in each JSON object produced by this + * command. + * + * @return this state for further chaining + */ + public State identifier() { + this.identifier = true; + return this; + } + + /** + * Return the target records for this command. + * + * @return the records + */ + public List records() { + return Collections.unmodifiableList(records); + } + + /** + * Return the historical {@link Timestamp}. + * + * @return the {@link Timestamp}, or {@code null} + */ + @Nullable + public Timestamp timestamp() { + return timestamp; + } + + /** + * Return whether the record identifier should be included in the JSON + * output. + * + * @return {@code true} if the identifier is included + */ + public boolean includeIdentifier() { + return identifier; + } + + @Override + public String ccl() { + StringBuilder sb = new StringBuilder("jsonify "); + sb.append(CclRenderer.records(records)); + CclRenderer.appendTimestamp(sb, timestamp); + if(identifier) { + sb.append(" identifier"); + } + return sb.toString(); + } + + @Override + public String toString() { + return ccl(); + } + + } + + private JsonifyCommand() {/* no-init */} + +} diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/LinkCommand.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/LinkCommand.java new file mode 100644 index 000000000..2949f3e5c --- /dev/null +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/LinkCommand.java @@ -0,0 +1,201 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.lang.command; + +import java.util.Collections; +import java.util.List; + +/** + * A {@link Command} builder for {@code link} commands. + *

+ * {@code link} creates a directional relationship from a source record to one + * or more destination records on a given key. + *

+ * + *
+ * link <key> from <source> to <destination>
+ * link <key> from <source> to [<destinations>]
+ * 
+ * + * @author Jeff Nelson + */ +public final class LinkCommand { + + /** + * The state after specifying the key for the {@code link} command. + */ + public static final class KeyState { + + /** + * The link key. + */ + private final String key; + + /** + * Construct a new instance. + * + * @param key the link key + */ + KeyState(String key) { + this.key = key; + } + + /** + * Specify the source record from which the link originates. + * + * @param source the source record + * @return the next builder state + */ + public SourceState from(long source) { + return new SourceState(key, source); + } + + } + + /** + * The state after specifying the key and source record for the {@code link} + * command. + */ + public static final class SourceState { + + /** + * The link key. + */ + private final String key; + + /** + * The source record. + */ + private final long source; + + /** + * Construct a new instance. + * + * @param key the link key + * @param source the source record + */ + SourceState(String key, long source) { + this.key = key; + this.source = source; + } + + /** + * Specify a single destination record for the link. + * + * @param destination the destination record + * @return the next builder state + */ + public DestinationState to(long destination) { + return new DestinationState(key, source, + CclRenderer.collectRecords(destination)); + } + + /** + * Specify multiple destination records for the link. + * + * @param first the first destination record + * @param more additional destination records + * @return the next builder state + */ + public DestinationState to(long first, long... more) { + return new DestinationState(key, source, + CclRenderer.collectRecords(first, more)); + } + + } + + /** + * The terminal state for a {@code link} command, reached after specifying + * the key, source, and destination records. + */ + public static final class DestinationState implements Command { + + /** + * The link key. + */ + private final String key; + + /** + * The source record. + */ + private final long source; + + /** + * The destination records. + */ + private final List destinations; + + /** + * Construct a new instance. + * + * @param key the link key + * @param source the source record + * @param destinations the destination records + */ + DestinationState(String key, long source, List destinations) { + this.key = key; + this.source = source; + this.destinations = destinations; + } + + /** + * Return the link key for this command. + * + * @return the key + */ + public String key() { + return key; + } + + /** + * Return the source record for this command. + * + * @return the source record + */ + public long source() { + return source; + } + + /** + * Return the destination records for this command. + * + * @return the destination records + */ + public List destinations() { + return Collections.unmodifiableList(destinations); + } + + @Override + public String ccl() { + StringBuilder sb = new StringBuilder("link "); + sb.append(key); + sb.append(" from "); + sb.append(Long.toString(source)); + sb.append(" to "); + sb.append(CclRenderer.records(destinations)); + return sb.toString(); + } + + @Override + public String toString() { + return ccl(); + } + + } + + private LinkCommand() {/* no-init */} + +} diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/NavigateCommand.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/NavigateCommand.java new file mode 100644 index 000000000..9b8c5fad6 --- /dev/null +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/NavigateCommand.java @@ -0,0 +1,277 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.lang.command; + +import java.util.Collections; +import java.util.List; + +import javax.annotation.Nullable; + +import com.cinchapi.concourse.Timestamp; +import com.cinchapi.concourse.lang.Criteria; + +/** + * A {@link Command} builder for {@code navigate} commands. + *

+ * {@code navigate} follows link paths in the document-graph data model. + *

+ * + *
+ * navigate <keys> from <records> [at timestamp]
+ * navigate <keys> where <condition> [at timestamp]
+ * 
+ * + * @author Jeff Nelson + */ +public final class NavigateCommand { + + /** + * The state after specifying keys for the {@code navigate} command. + */ + public static final class KeyState { + + /** + * The navigation keys. + */ + private final List keys; + + /** + * Construct a new instance. + * + * @param key the first key + * @param moreKeys additional keys + */ + KeyState(String key, String... moreKeys) { + this.keys = CclRenderer.collectKeys(key, moreKeys); + } + + /** + * Navigate from the specified {@code record}. + * + * @param record the target record + * @return the next builder state + */ + public SourceState from(long record) { + return from(record, new long[0]); + } + + /** + * Navigate from the specified {@code records}. + * + * @param record the first record + * @param moreRecords additional records + * @return the next builder state + */ + public SourceState from(long record, long... moreRecords) { + return new SourceState(keys, + CclRenderer.collectRecords(record, moreRecords), null, + null); + } + + /** + * Alias for {@link #from(long)} to support alternate CCL dialects. + * + * @param record the target record + * @return the next builder state + */ + public SourceState in(long record) { + return from(record); + } + + /** + * Alias for {@link #from(long, long...)} to support alternate CCL + * dialects. + * + * @param record the first record + * @param moreRecords additional records + * @return the next builder state + */ + public SourceState in(long record, long... moreRecords) { + return from(record, moreRecords); + } + + /** + * Alias for {@link #from(long)} to support alternate CCL dialects. + * + * @param record the target record + * @return the next builder state + */ + public SourceState within(long record) { + return from(record); + } + + /** + * Alias for {@link #from(long, long...)} to support alternate CCL + * dialects. + * + * @param record the first record + * @param moreRecords additional records + * @return the next builder state + */ + public SourceState within(long record, long... moreRecords) { + return from(record, moreRecords); + } + + /** + * Navigate from records matching the {@link Criteria}. + * + * @param criteria the {@link Criteria} + * @return the next builder state + */ + public SourceState where(Criteria criteria) { + return new SourceState(keys, null, criteria, null); + } + + /** + * Navigate from records matching the CCL condition. + * + * @param ccl the CCL condition string + * @return the next builder state + */ + public SourceState where(String ccl) { + return new SourceState(keys, null, null, ccl); + } + + } + + /** + * The terminal state for a {@code navigate} command. Supports an optional + * {@code at} clause for historical navigation. + */ + public static final class SourceState implements Command { + + /** + * The navigation keys. + */ + private final List keys; + + /** + * The source records, or {@code null} if a condition was provided. + */ + @Nullable + private final List records; + + /** + * The structured {@link Criteria}, or {@code null}. + */ + @Nullable + private final Criteria criteria; + + /** + * The raw CCL condition string, or {@code null}. + */ + @Nullable + private final String condition; + + /** + * The optional historical {@link Timestamp}. + */ + @Nullable + private Timestamp timestamp; + + /** + * Construct a new instance. + * + * @param keys the keys + * @param records the records, or {@code null} + * @param criteria the {@link Criteria}, or {@code null} + * @param condition the CCL string, or {@code null} + */ + SourceState(List keys, @Nullable List records, + @Nullable Criteria criteria, @Nullable String condition) { + this.keys = keys; + this.records = records; + this.criteria = criteria; + this.condition = condition; + } + + /** + * Pin this command to a historical {@link Timestamp}. + * + * @param timestamp the {@link Timestamp} + * @return this state for further chaining + */ + public SourceState at(Timestamp timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Return the navigation keys. + * + * @return the keys + */ + public List keys() { + return Collections.unmodifiableList(keys); + } + + /** + * Return the source records. + * + * @return the records, or {@code null} + */ + @Nullable + public List records() { + return records != null ? Collections.unmodifiableList(records) + : null; + } + + /** + * Return the {@link Criteria}. + * + * @return the {@link Criteria}, or {@code null} + */ + @Nullable + public Criteria criteria() { + return criteria; + } + + /** + * Return the historical {@link Timestamp}. + * + * @return the {@link Timestamp}, or {@code null} + */ + @Nullable + public Timestamp timestamp() { + return timestamp; + } + + @Override + public String ccl() { + StringBuilder sb = new StringBuilder("navigate "); + sb.append(CclRenderer.keys(keys)); + if(records != null) { + sb.append(" from "); + sb.append(CclRenderer.records(records)); + } + else { + sb.append(" where "); + CclRenderer.appendCondition(sb, criteria, condition); + } + CclRenderer.appendTimestamp(sb, timestamp); + return sb.toString(); + } + + @Override + public String toString() { + return ccl(); + } + + } + + private NavigateCommand() {/* no-init */} + +} diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/ReconcileCommand.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/ReconcileCommand.java new file mode 100644 index 000000000..d4de194da --- /dev/null +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/ReconcileCommand.java @@ -0,0 +1,204 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.lang.command; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +/** + * A {@link Command} builder for {@code reconcile} commands. + *

+ * {@code reconcile} atomically replaces all values stored for a key in a record + * with a new set of values. + *

+ * + *
+ * reconcile <key> in <record> with <values>
+ * 
+ * + * @author Jeff Nelson + */ +public final class ReconcileCommand { + + /** + * The state after specifying the key for the {@code reconcile} command. + */ + public static final class KeyState { + + /** + * The key to reconcile. + */ + private final String key; + + /** + * Construct a new instance. + * + * @param key the key to reconcile + */ + KeyState(String key) { + this.key = key; + } + + /** + * Specify the record in which to reconcile the key. + * + * @param record the target record + * @return the next builder state + */ + public RecordState in(long record) { + return new RecordState(key, record); + } + + /** + * Alias for {@link #in(long)} to support alternate CCL dialects. + * + * @param record the target record + * @return the next builder state + */ + public RecordState within(long record) { + return in(record); + } + + } + + /** + * The state after specifying the key and record for the {@code reconcile} + * command. + */ + public static final class RecordState { + + /** + * The key to reconcile. + */ + private final String key; + + /** + * The target record. + */ + private final long record; + + /** + * Construct a new instance. + * + * @param key the key + * @param record the target record + */ + RecordState(String key, long record) { + this.key = key; + this.record = record; + } + + /** + * Specify the values to reconcile. + * + * @param value the first value + * @param moreValues additional values + * @return the next builder state + */ + public ValuesState with(Object value, Object... moreValues) { + List values = new ArrayList<>(); + values.add(value); + for (Object v : moreValues) { + values.add(v); + } + return new ValuesState(key, record, values); + } + + } + + /** + * The terminal state for a {@code reconcile} command, reached after + * specifying the key, record, and values. + */ + public static final class ValuesState implements Command { + + /** + * The key to reconcile. + */ + private final String key; + + /** + * The target record. + */ + private final long record; + + /** + * The values to reconcile. + */ + private final List values; + + /** + * Construct a new instance. + * + * @param key the key + * @param record the target record + * @param values the values + */ + ValuesState(String key, long record, List values) { + this.key = key; + this.record = record; + this.values = values; + } + + /** + * Return the key for this command. + * + * @return the key + */ + public String key() { + return key; + } + + /** + * Return the target record for this command. + * + * @return the record + */ + public long record() { + return record; + } + + /** + * Return the values for this command. + * + * @return the values + */ + public List values() { + return Collections.unmodifiableList(values); + } + + @Override + public String ccl() { + StringBuilder sb = new StringBuilder("reconcile "); + sb.append(key); + sb.append(" in "); + sb.append(Long.toString(record)); + sb.append(" with "); + sb.append(CclRenderer.values(values)); + return sb.toString(); + } + + @Override + public String toString() { + return ccl(); + } + + } + + private ReconcileCommand() {/* no-init */} + +} diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/RemoveCommand.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/RemoveCommand.java new file mode 100644 index 000000000..23b5d6f84 --- /dev/null +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/RemoveCommand.java @@ -0,0 +1,324 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.lang.command; + +import java.util.Collections; +import java.util.List; + +import javax.annotation.Nullable; + +/** + * A {@link Command} builder for {@code remove} commands. + *

+ * {@code remove} disassociates a value from a key in one or more records, or + * removes all values for a key from records. + *

+ * + *
+ * remove <key> as <value> from <record>
+ * remove <key> as <value> from [<records>]
+ * remove <key> from <record>
+ * remove <key> from [<records>]
+ * 
+ * + * @author Jeff Nelson + */ +public final class RemoveCommand { + + /** + * The state after specifying the key for the {@code remove} command. From + * here the caller can specify a value with {@link #as(Object)} or go + * directly to record targeting with {@link #from(long, long...)}. + */ + public static final class KeyState { + + /** + * The key to remove. + */ + private final String key; + + /** + * Construct a new instance. + * + * @param key the key to remove + */ + KeyState(String key) { + this.key = key; + } + + /** + * Specify the value to remove for this key. + * + * @param value the value to remove + * @return the next builder state + */ + public ValueState as(Object value) { + return new ValueState(key, value); + } + + /** + * Remove from the specified {@code record}. + * + * @param record the target record + * @return the next builder state + */ + public RecordState from(long record) { + return new RecordState(key, null, + CclRenderer.collectRecords(record)); + } + + /** + * Remove from the specified {@code records}. + * + * @param first the first record + * @param more additional records + * @return the next builder state + */ + public RecordState from(long first, long... more) { + return new RecordState(key, null, + CclRenderer.collectRecords(first, more)); + } + + /** + * Alias for {@link #from(long)} to support alternate CCL dialects. + * + * @param record the target record + * @return the next builder state + */ + public RecordState in(long record) { + return from(record); + } + + /** + * Alias for {@link #from(long, long...)} to support alternate CCL + * dialects. + * + * @param first the first record + * @param more additional records + * @return the next builder state + */ + public RecordState in(long first, long... more) { + return from(first, more); + } + + /** + * Alias for {@link #from(long)} to support alternate CCL dialects. + * + * @param record the target record + * @return the next builder state + */ + public RecordState within(long record) { + return from(record); + } + + /** + * Alias for {@link #from(long, long...)} to support alternate CCL + * dialects. + * + * @param first the first record + * @param more additional records + * @return the next builder state + */ + public RecordState within(long first, long... more) { + return from(first, more); + } + + } + + /** + * The state after specifying the key and value for the {@code remove} + * command. The caller must specify target records via {@link #from(long)} + * or {@link #from(long, long...)}. + */ + public static final class ValueState { + + /** + * The key to remove. + */ + private final String key; + + /** + * The value to remove. + */ + private final Object value; + + /** + * Construct a new instance. + * + * @param key the key + * @param value the value + */ + ValueState(String key, Object value) { + this.key = key; + this.value = value; + } + + /** + * Remove from the specified {@code record}. + * + * @param record the target record + * @return the next builder state + */ + public RecordState from(long record) { + return new RecordState(key, value, + CclRenderer.collectRecords(record)); + } + + /** + * Remove from the specified {@code records}. + * + * @param first the first record + * @param more additional records + * @return the next builder state + */ + public RecordState from(long first, long... more) { + return new RecordState(key, value, + CclRenderer.collectRecords(first, more)); + } + + /** + * Alias for {@link #from(long)} to support alternate CCL dialects. + * + * @param record the target record + * @return the next builder state + */ + public RecordState in(long record) { + return from(record); + } + + /** + * Alias for {@link #from(long, long...)} to support alternate CCL + * dialects. + * + * @param first the first record + * @param more additional records + * @return the next builder state + */ + public RecordState in(long first, long... more) { + return from(first, more); + } + + /** + * Alias for {@link #from(long)} to support alternate CCL dialects. + * + * @param record the target record + * @return the next builder state + */ + public RecordState within(long record) { + return from(record); + } + + /** + * Alias for {@link #from(long, long...)} to support alternate CCL + * dialects. + * + * @param first the first record + * @param more additional records + * @return the next builder state + */ + public RecordState within(long first, long... more) { + return from(first, more); + } + + } + + /** + * The terminal state for a {@code remove} command, reached after specifying + * the key, optional value, and target records. + */ + public static final class RecordState implements Command { + + /** + * The key to remove. + */ + private final String key; + + /** + * The value to remove, or {@code null} if all values for the key should + * be removed. + */ + @Nullable + private final Object value; + + /** + * The target records. + */ + private final List records; + + /** + * Construct a new instance. + * + * @param key the key + * @param value the value, or {@code null} + * @param records the target records + */ + RecordState(String key, @Nullable Object value, List records) { + this.key = key; + this.value = value; + this.records = records; + } + + /** + * Return the key for this command. + * + * @return the key + */ + public String key() { + return key; + } + + /** + * Return the value for this command. + * + * @return the value, or {@code null} if not specified + */ + @Nullable + public Object value() { + return value; + } + + /** + * Return the target records for this command. + * + * @return the records + */ + public List records() { + return Collections.unmodifiableList(records); + } + + @Override + public String ccl() { + StringBuilder sb = new StringBuilder("remove "); + sb.append(key); + if(value != null) { + sb.append(" as "); + sb.append(CclRenderer.value(value)); + } + sb.append(" from "); + sb.append(CclRenderer.records(records)); + return sb.toString(); + } + + @Override + public String toString() { + return ccl(); + } + + } + + private RemoveCommand() {/* no-init */} + +} diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/RevertCommand.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/RevertCommand.java new file mode 100644 index 000000000..5e6ed5189 --- /dev/null +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/RevertCommand.java @@ -0,0 +1,247 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.lang.command; + +import java.util.Collections; +import java.util.List; + +import com.cinchapi.concourse.Timestamp; + +/** + * A {@link Command} builder for {@code revert} commands. + *

+ * {@code revert} restores one or more keys in one or more records to their + * state at a given {@link Timestamp}. + *

+ * + *
+ * revert <keys> in <records> to <timestamp>
+ * 
+ * + * @author Jeff Nelson + */ +public final class RevertCommand { + + /** + * The state after specifying the keys for the {@code revert} command. + */ + public static final class KeyState { + + /** + * The keys to revert. + */ + private final List keys; + + /** + * Construct a new instance. + * + * @param key the first key + * @param moreKeys additional keys + */ + KeyState(String key, String... moreKeys) { + this.keys = CclRenderer.collectKeys(key, moreKeys); + } + + /** + * Specify the record in which to revert the keys. + * + * @param record the target record + * @return the next builder state + */ + public RecordState in(long record) { + return in(record, new long[0]); + } + + /** + * Specify the records in which to revert the keys. + * + * @param record the first record + * @param moreRecords additional records + * @return the next builder state + */ + public RecordState in(long record, long... moreRecords) { + return new RecordState(keys, + CclRenderer.collectRecords(record, moreRecords)); + } + + /** + * Alias for {@link #in(long)} to support alternate CCL dialects. + * + * @param record the target record + * @return the next builder state + */ + public RecordState from(long record) { + return in(record); + } + + /** + * Alias for {@link #in(long, long...)} to support alternate CCL + * dialects. + * + * @param record the first record + * @param moreRecords additional records + * @return the next builder state + */ + public RecordState from(long record, long... moreRecords) { + return in(record, moreRecords); + } + + /** + * Alias for {@link #in(long)} to support alternate CCL dialects. + * + * @param record the target record + * @return the next builder state + */ + public RecordState within(long record) { + return in(record); + } + + /** + * Alias for {@link #in(long, long...)} to support alternate CCL + * dialects. + * + * @param record the first record + * @param moreRecords additional records + * @return the next builder state + */ + public RecordState within(long record, long... moreRecords) { + return in(record, moreRecords); + } + + } + + /** + * The state after specifying the keys and records for the {@code revert} + * command. + */ + public static final class RecordState { + + /** + * The keys to revert. + */ + private final List keys; + + /** + * The target records. + */ + private final List records; + + /** + * Construct a new instance. + * + * @param keys the keys + * @param records the target records + */ + RecordState(List keys, List records) { + this.keys = keys; + this.records = records; + } + + /** + * Specify the {@link Timestamp} to revert to. + * + * @param timestamp the target {@link Timestamp} + * @return the next builder state + */ + public TimestampState to(Timestamp timestamp) { + return new TimestampState(keys, records, timestamp); + } + + } + + /** + * The terminal state for a {@code revert} command, reached after specifying + * keys, records, and the target {@link Timestamp}. + */ + public static final class TimestampState implements Command { + + /** + * The keys to revert. + */ + private final List keys; + + /** + * The target records. + */ + private final List records; + + /** + * The target {@link Timestamp}. + */ + private final Timestamp timestamp; + + /** + * Construct a new instance. + * + * @param keys the keys + * @param records the target records + * @param timestamp the target {@link Timestamp} + */ + TimestampState(List keys, List records, + Timestamp timestamp) { + this.keys = keys; + this.records = records; + this.timestamp = timestamp; + } + + /** + * Return the keys for this command. + * + * @return the keys + */ + public List keys() { + return Collections.unmodifiableList(keys); + } + + /** + * Return the target records for this command. + * + * @return the records + */ + public List records() { + return Collections.unmodifiableList(records); + } + + /** + * Return the target {@link Timestamp} for this command. + * + * @return the {@link Timestamp} + */ + public Timestamp timestamp() { + return timestamp; + } + + @Override + public String ccl() { + StringBuilder sb = new StringBuilder("revert "); + sb.append(CclRenderer.keys(keys)); + sb.append(" in "); + sb.append(CclRenderer.records(records)); + sb.append(" to "); + sb.append(timestamp.getMicros()); + return sb.toString(); + } + + @Override + public String toString() { + return ccl(); + } + + } + + private RevertCommand() {/* no-init */} + +} diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/SearchCommand.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/SearchCommand.java new file mode 100644 index 000000000..354f30b47 --- /dev/null +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/SearchCommand.java @@ -0,0 +1,127 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.lang.command; + +/** + * A {@link Command} builder for {@code search} commands. + *

+ * {@code search} performs a full-text search against indexed values for a + * specified key. + *

+ * + *
+ * search <key> <query>
+ * 
+ * + * @author Jeff Nelson + */ +public final class SearchCommand { + + /** + * The state after specifying the key for the {@code search} command. + */ + public static final class KeyState { + + /** + * The key to search. + */ + private final String key; + + /** + * Construct a new instance. + * + * @param key the key to search + */ + KeyState(String key) { + this.key = key; + } + + /** + * Specify the search query for this key. + * + * @param query the full-text search query + * @return the next builder state + */ + public QueryState forQuery(String query) { + return new QueryState(key, query); + } + + } + + /** + * The terminal state for a {@code search} command, reached after specifying + * both the key and the search query. + */ + public static final class QueryState implements Command { + + /** + * The key to search. + */ + private final String key; + + /** + * The full-text search query. + */ + private final String query; + + /** + * Construct a new instance. + * + * @param key the key to search + * @param query the search query + */ + QueryState(String key, String query) { + this.key = key; + this.query = query; + } + + /** + * Return the key for this command. + * + * @return the key + */ + public String key() { + return key; + } + + /** + * Return the search query for this command. + * + * @return the query + */ + public String query() { + return query; + } + + @Override + public String ccl() { + StringBuilder sb = new StringBuilder("search "); + sb.append(key); + sb.append(" "); + sb.append(query); + return sb.toString(); + } + + @Override + public String toString() { + return ccl(); + } + + } + + private SearchCommand() {/* no-init */} + +} diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/SelectCommand.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/SelectCommand.java new file mode 100644 index 000000000..e8367223e --- /dev/null +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/SelectCommand.java @@ -0,0 +1,444 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.lang.command; + +import java.util.Collections; +import java.util.List; + +import javax.annotation.Nullable; + +import com.cinchapi.concourse.Timestamp; +import com.cinchapi.concourse.lang.Criteria; +import com.cinchapi.concourse.lang.paginate.Page; +import com.cinchapi.concourse.lang.sort.Order; + +/** + * A {@link Command} builder for {@code select} commands. + *

+ * {@code select} retrieves all values for specified keys from records or + * records matching a condition. + *

+ * + *
+ * select [keys] from <records>
+ *     [at timestamp] [order by ...] [page ...]
+ * select [keys] where <condition>
+ *     [at timestamp] [order by ...] [page ...]
+ * 
+ * + * @author Jeff Nelson + */ +public final class SelectCommand { + + /** + * The state after calling {@link Command#selectAll()} with no keys, + * indicating that all keys should be selected. + */ + public static final class AllKeysState { + + /** + * Construct a new instance. + */ + AllKeysState() {} + + /** + * Select all keys from the specified {@code record}. + * + * @param record the target record + * @return the next builder state + */ + public SourceState from(long record) { + return from(record, new long[0]); + } + + /** + * Select all keys from the specified {@code records}. + * + * @param record the first record + * @param moreRecords additional records + * @return the next builder state + */ + public SourceState from(long record, long... moreRecords) { + return new SourceState(null, + CclRenderer.collectRecords(record, moreRecords), null, + null); + } + + /** + * Alias for {@link #from(long)} to support alternate CCL dialects. + * + * @param record the target record + * @return the next builder state + */ + public SourceState in(long record) { + return from(record); + } + + /** + * Alias for {@link #from(long, long...)} to support alternate CCL + * dialects. + * + * @param record the first record + * @param moreRecords additional records + * @return the next builder state + */ + public SourceState in(long record, long... moreRecords) { + return from(record, moreRecords); + } + + /** + * Alias for {@link #from(long)} to support alternate CCL dialects. + * + * @param record the target record + * @return the next builder state + */ + public SourceState within(long record) { + return from(record); + } + + /** + * Alias for {@link #from(long, long...)} to support alternate CCL + * dialects. + * + * @param record the first record + * @param moreRecords additional records + * @return the next builder state + */ + public SourceState within(long record, long... moreRecords) { + return from(record, moreRecords); + } + + /** + * Select all keys from records matching the {@link Criteria}. + * + * @param criteria the {@link Criteria} + * @return the next builder state + */ + public SourceState where(Criteria criteria) { + return new SourceState(null, null, criteria, null); + } + + /** + * Select all keys from records matching the CCL condition. + * + * @param ccl the CCL condition string + * @return the next builder state + */ + public SourceState where(String ccl) { + return new SourceState(null, null, null, ccl); + } + + } + + /** + * The state after specifying keys for the {@code select} command. + */ + public static final class KeyState { + + /** + * The keys to select. + */ + private final List keys; + + /** + * Construct a new instance. + * + * @param key the first key + * @param moreKeys additional keys + */ + KeyState(String key, String... moreKeys) { + this.keys = CclRenderer.collectKeys(key, moreKeys); + } + + /** + * Select from the specified {@code record}. + * + * @param record the target record + * @return the next builder state + */ + public SourceState from(long record) { + return from(record, new long[0]); + } + + /** + * Select from the specified {@code records}. + * + * @param record the first record + * @param moreRecords additional records + * @return the next builder state + */ + public SourceState from(long record, long... moreRecords) { + return new SourceState(keys, + CclRenderer.collectRecords(record, moreRecords), null, + null); + } + + /** + * Alias for {@link #from(long)} to support alternate CCL dialects. + * + * @param record the target record + * @return the next builder state + */ + public SourceState in(long record) { + return from(record); + } + + /** + * Alias for {@link #from(long, long...)} to support alternate CCL + * dialects. + * + * @param record the first record + * @param moreRecords additional records + * @return the next builder state + */ + public SourceState in(long record, long... moreRecords) { + return from(record, moreRecords); + } + + /** + * Alias for {@link #from(long)} to support alternate CCL dialects. + * + * @param record the target record + * @return the next builder state + */ + public SourceState within(long record) { + return from(record); + } + + /** + * Alias for {@link #from(long, long...)} to support alternate CCL + * dialects. + * + * @param record the first record + * @param moreRecords additional records + * @return the next builder state + */ + public SourceState within(long record, long... moreRecords) { + return from(record, moreRecords); + } + + /** + * Select from records matching the {@link Criteria}. + * + * @param criteria the {@link Criteria} + * @return the next builder state + */ + public SourceState where(Criteria criteria) { + return new SourceState(keys, null, criteria, null); + } + + /** + * Select from records matching the CCL condition. + * + * @param ccl the CCL condition string + * @return the next builder state + */ + public SourceState where(String ccl) { + return new SourceState(keys, null, null, ccl); + } + + } + + /** + * The terminal state for a {@code select} command, reached after specifying + * the data source (records or condition). Supports optional {@code at}, + * {@code order}, and {@code page} clauses. + */ + public static final class SourceState implements Command { + + /** + * The keys to select, or {@code null} for all keys. + */ + @Nullable + private final List keys; + + /** + * The target records, or {@code null} if a condition was provided. + */ + @Nullable + private final List records; + + /** + * The structured {@link Criteria}, or {@code null}. + */ + @Nullable + private final Criteria criteria; + + /** + * The raw CCL condition string, or {@code null}. + */ + @Nullable + private final String condition; + + /** + * The optional historical {@link Timestamp}. + */ + @Nullable + private Timestamp timestamp; + + /** + * The optional sort {@link Order}. + */ + @Nullable + private Order order; + + /** + * The optional {@link Page pagination}. + */ + @Nullable + private Page page; + + /** + * Construct a new instance. + * + * @param keys the keys, or {@code null} + * @param records the records, or {@code null} + * @param criteria the {@link Criteria}, or {@code null} + * @param condition the CCL string, or {@code null} + */ + SourceState(@Nullable List keys, @Nullable List records, + @Nullable Criteria criteria, @Nullable String condition) { + this.keys = keys; + this.records = records; + this.criteria = criteria; + this.condition = condition; + } + + /** + * Pin this command to a historical {@link Timestamp}. + * + * @param timestamp the {@link Timestamp} + * @return this state for further chaining + */ + public SourceState at(Timestamp timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Apply an {@link Order} to this command. + * + * @param order the {@link Order} + * @return this state for further chaining + */ + public SourceState order(Order order) { + this.order = order; + return this; + } + + /** + * Apply {@link Page pagination} to this command. + * + * @param page the {@link Page} + * @return this state for further chaining + */ + public SourceState page(Page page) { + this.page = page; + return this; + } + + /** + * Return the keys for this command. + * + * @return the keys, or an empty list for all keys + */ + public List keys() { + return keys != null ? Collections.unmodifiableList(keys) + : Collections.emptyList(); + } + + /** + * Return the target records. + * + * @return the records, or {@code null} + */ + @Nullable + public List records() { + return records != null ? Collections.unmodifiableList(records) + : null; + } + + /** + * Return the {@link Criteria}. + * + * @return the {@link Criteria}, or {@code null} + */ + @Nullable + public Criteria criteria() { + return criteria; + } + + /** + * Return the historical {@link Timestamp}. + * + * @return the {@link Timestamp}, or {@code null} + */ + @Nullable + public Timestamp timestamp() { + return timestamp; + } + + /** + * Return the sort {@link Order}. + * + * @return the {@link Order}, or {@code null} + */ + @Nullable + public Order order() { + return order; + } + + /** + * Return the {@link Page pagination}. + * + * @return the {@link Page}, or {@code null} + */ + @Nullable + public Page page() { + return page; + } + + @Override + public String ccl() { + StringBuilder sb = new StringBuilder("select"); + if(keys != null) { + sb.append(" "); + sb.append(CclRenderer.keys(keys)); + } + if(records != null) { + sb.append(" from "); + sb.append(CclRenderer.records(records)); + } + else { + sb.append(" where "); + CclRenderer.appendCondition(sb, criteria, condition); + } + CclRenderer.appendTimestamp(sb, timestamp); + CclRenderer.appendOrder(sb, order); + CclRenderer.appendPage(sb, page); + return sb.toString(); + } + + @Override + public String toString() { + return ccl(); + } + + } + + private SelectCommand() {/* no-init */} + +} diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/SetCommand.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/SetCommand.java new file mode 100644 index 000000000..d47c6c21a --- /dev/null +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/SetCommand.java @@ -0,0 +1,225 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.lang.command; + +import java.util.Collections; +import java.util.List; + +/** + * A {@link Command} builder for {@code set} commands. + *

+ * {@code set} atomically clears all existing values for a key in a record and + * adds a new value. Unlike {@code add}, {@code set} always requires a target + * record. + *

+ * + *
+ * set <key> as <value> in <record>
+ * set <key> as <value> in [<records>]
+ * 
+ * + * @author Jeff Nelson + */ +public final class SetCommand { + + /** + * The state after specifying the key for the {@code set} command. + */ + public static final class KeyState { + + /** + * The key to set. + */ + private final String key; + + /** + * Construct a new instance. + * + * @param key the key to set + */ + KeyState(String key) { + this.key = key; + } + + /** + * Specify the value to set for this key. + * + * @param value the value to set + * @return the next builder state + */ + public ValueState as(Object value) { + return new ValueState(key, value); + } + + } + + /** + * The state after specifying the key and value for the {@code set} command. + * This is not a terminal state because {@code set} requires a + * target record. + */ + public static final class ValueState { + + /** + * The key to set. + */ + private final String key; + + /** + * The value to set. + */ + private final Object value; + + /** + * Construct a new instance. + * + * @param key the key + * @param value the value + */ + ValueState(String key, Object value) { + this.key = key; + this.value = value; + } + + /** + * Set in the specified {@code record}. + * + * @param record the target record + * @return the next builder state + */ + public RecordState in(long record) { + return new RecordState(key, value, + CclRenderer.collectRecords(record)); + } + + /** + * Set in the specified {@code records}. + * + * @param first the first record + * @param more additional records + * @return the next builder state + */ + public RecordState in(long first, long... more) { + return new RecordState(key, value, + CclRenderer.collectRecords(first, more)); + } + + /** + * Alias for {@link #in(long)} to support alternate CCL dialects. + * + * @param record the target record + * @return the next builder state + */ + public RecordState within(long record) { + return in(record); + } + + /** + * Alias for {@link #in(long, long...)} to support alternate CCL + * dialects. + * + * @param first the first record + * @param more additional records + * @return the next builder state + */ + public RecordState within(long first, long... more) { + return in(first, more); + } + + } + + /** + * The terminal state for a {@code set} command, reached after specifying + * the key, value, and target records. + */ + public static final class RecordState implements Command { + + /** + * The key to set. + */ + private final String key; + + /** + * The value to set. + */ + private final Object value; + + /** + * The target records. + */ + private final List records; + + /** + * Construct a new instance. + * + * @param key the key + * @param value the value + * @param records the target records + */ + RecordState(String key, Object value, List records) { + this.key = key; + this.value = value; + this.records = records; + } + + /** + * Return the key for this command. + * + * @return the key + */ + public String key() { + return key; + } + + /** + * Return the value for this command. + * + * @return the value + */ + public Object value() { + return value; + } + + /** + * Return the target records for this command. + * + * @return the records + */ + public List records() { + return Collections.unmodifiableList(records); + } + + @Override + public String ccl() { + StringBuilder sb = new StringBuilder("set "); + sb.append(key); + sb.append(" as "); + sb.append(CclRenderer.value(value)); + sb.append(" in "); + sb.append(CclRenderer.records(records)); + return sb.toString(); + } + + @Override + public String toString() { + return ccl(); + } + + } + + private SetCommand() {/* no-init */} + +} diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/TraceCommand.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/TraceCommand.java new file mode 100644 index 000000000..125a402cb --- /dev/null +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/TraceCommand.java @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.lang.command; + +import java.util.Collections; +import java.util.List; + +import javax.annotation.Nullable; + +import com.cinchapi.concourse.Timestamp; + +/** + * A {@link Command} builder for {@code trace} commands. + *

+ * {@code trace} returns the records that link to one or more specified records, + * optionally at a historical timestamp. + *

+ * + *
+ * trace <records> [at timestamp]
+ * 
+ * + * @author Jeff Nelson + */ +public final class TraceCommand { + + /** + * The terminal state for a {@code trace} command. This state is reached + * after specifying the records to trace and supports an optional {@code at} + * clause for historical inspection. + */ + public static final class State implements Command { + + /** + * The target records. + */ + private final List records; + + /** + * The optional historical {@link Timestamp}. + */ + @Nullable + private Timestamp timestamp; + + /** + * Construct a new instance. + * + * @param record the first record to trace + * @param moreRecords additional records + */ + State(long record, long... moreRecords) { + this.records = CclRenderer.collectRecords(record, moreRecords); + } + + /** + * Pin this command to a historical {@link Timestamp}. + * + * @param timestamp the {@link Timestamp} + * @return this state for further chaining + */ + public State at(Timestamp timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Return the target records for this command. + * + * @return the records + */ + public List records() { + return Collections.unmodifiableList(records); + } + + /** + * Return the historical {@link Timestamp}. + * + * @return the {@link Timestamp}, or {@code null} + */ + @Nullable + public Timestamp timestamp() { + return timestamp; + } + + @Override + public String ccl() { + StringBuilder sb = new StringBuilder("trace "); + sb.append(CclRenderer.records(records)); + CclRenderer.appendTimestamp(sb, timestamp); + return sb.toString(); + } + + @Override + public String toString() { + return ccl(); + } + + } + + private TraceCommand() {/* no-init */} + +} diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/UnlinkCommand.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/UnlinkCommand.java new file mode 100644 index 000000000..f533923fc --- /dev/null +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/UnlinkCommand.java @@ -0,0 +1,184 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.lang.command; + +/** + * A {@link Command} builder for {@code unlink} commands. + *

+ * {@code unlink} removes a directional relationship from a source record to a + * destination record on a given key. + *

+ * + *
+ * unlink <key> from <source> to <destination>
+ * 
+ * + * @author Jeff Nelson + */ +public final class UnlinkCommand { + + /** + * The state after specifying the key for the {@code unlink} command. + */ + public static final class KeyState { + + /** + * The link key. + */ + private final String key; + + /** + * Construct a new instance. + * + * @param key the link key + */ + KeyState(String key) { + this.key = key; + } + + /** + * Specify the source record from which the link originates. + * + * @param source the source record + * @return the next builder state + */ + public SourceState from(long source) { + return new SourceState(key, source); + } + + } + + /** + * The state after specifying the key and source record for the + * {@code unlink} command. + */ + public static final class SourceState { + + /** + * The link key. + */ + private final String key; + + /** + * The source record. + */ + private final long source; + + /** + * Construct a new instance. + * + * @param key the link key + * @param source the source record + */ + SourceState(String key, long source) { + this.key = key; + this.source = source; + } + + /** + * Specify the destination record for the unlink. + * + * @param destination the destination record + * @return the next builder state + */ + public DestinationState to(long destination) { + return new DestinationState(key, source, destination); + } + + } + + /** + * The terminal state for an {@code unlink} command, reached after + * specifying the key, source, and destination record. + */ + public static final class DestinationState implements Command { + + /** + * The link key. + */ + private final String key; + + /** + * The source record. + */ + private final long source; + + /** + * The destination record. + */ + private final long destination; + + /** + * Construct a new instance. + * + * @param key the link key + * @param source the source record + * @param destination the destination record + */ + DestinationState(String key, long source, long destination) { + this.key = key; + this.source = source; + this.destination = destination; + } + + /** + * Return the link key for this command. + * + * @return the key + */ + public String key() { + return key; + } + + /** + * Return the source record for this command. + * + * @return the source record + */ + public long source() { + return source; + } + + /** + * Return the destination record for this command. + * + * @return the destination record + */ + public long destination() { + return destination; + } + + @Override + public String ccl() { + StringBuilder sb = new StringBuilder("unlink "); + sb.append(key); + sb.append(" from "); + sb.append(Long.toString(source)); + sb.append(" to "); + sb.append(Long.toString(destination)); + return sb.toString(); + } + + @Override + public String toString() { + return ccl(); + } + + } + + private UnlinkCommand() {/* no-init */} + +} diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/VerifyAndSwapCommand.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/VerifyAndSwapCommand.java new file mode 100644 index 000000000..1fbdcc8eb --- /dev/null +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/VerifyAndSwapCommand.java @@ -0,0 +1,259 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.lang.command; + +/** + * A {@link Command} builder for {@code verifyAndSwap} commands. + *

+ * {@code verifyAndSwap} atomically checks that a key holds an expected value in + * a record and, if so, replaces it with a new value. + *

+ * + *
+ * verifyAndSwap <key> as <expected> in <record> with <replacement>
+ * 
+ * + * @author Jeff Nelson + */ +public final class VerifyAndSwapCommand { + + /** + * The state after specifying the key for the {@code verifyAndSwap} command. + */ + public static final class KeyState { + + /** + * The key to verify and swap. + */ + private final String key; + + /** + * Construct a new instance. + * + * @param key the key to verify and swap + */ + KeyState(String key) { + this.key = key; + } + + /** + * Specify the expected value for this key. + * + * @param expected the expected value + * @return the next builder state + */ + public ValueState as(Object expected) { + return new ValueState(key, expected); + } + + } + + /** + * The state after specifying the key and expected value for the + * {@code verifyAndSwap} command. + */ + public static final class ValueState { + + /** + * The key to verify and swap. + */ + private final String key; + + /** + * The expected value. + */ + private final Object expected; + + /** + * Construct a new instance. + * + * @param key the key + * @param expected the expected value + */ + ValueState(String key, Object expected) { + this.key = key; + this.expected = expected; + } + + /** + * Specify the record in which to verify and swap. + * + * @param record the target record + * @return the next builder state + */ + public RecordState in(long record) { + return new RecordState(key, expected, record); + } + + /** + * Alias for {@link #in(long)} to support alternate CCL dialects. + * + * @param record the target record + * @return the next builder state + */ + public RecordState within(long record) { + return in(record); + } + + } + + /** + * The state after specifying the key, expected value, and record for the + * {@code verifyAndSwap} command. + */ + public static final class RecordState { + + /** + * The key to verify and swap. + */ + private final String key; + + /** + * The expected value. + */ + private final Object expected; + + /** + * The target record. + */ + private final long record; + + /** + * Construct a new instance. + * + * @param key the key + * @param expected the expected value + * @param record the target record + */ + RecordState(String key, Object expected, long record) { + this.key = key; + this.expected = expected; + this.record = record; + } + + /** + * Specify the replacement value to swap in. + * + * @param replacement the replacement value + * @return the next builder state + */ + public SwapState with(Object replacement) { + return new SwapState(key, expected, record, replacement); + } + + } + + /** + * The terminal state for a {@code verifyAndSwap} command, reached after + * specifying the key, expected value, record, and replacement value. + */ + public static final class SwapState implements Command { + + /** + * The key to verify and swap. + */ + private final String key; + + /** + * The expected value. + */ + private final Object expected; + + /** + * The target record. + */ + private final long record; + + /** + * The replacement value. + */ + private final Object replacement; + + /** + * Construct a new instance. + * + * @param key the key + * @param expected the expected value + * @param record the target record + * @param replacement the replacement value + */ + SwapState(String key, Object expected, long record, + Object replacement) { + this.key = key; + this.expected = expected; + this.record = record; + this.replacement = replacement; + } + + /** + * Return the key for this command. + * + * @return the key + */ + public String key() { + return key; + } + + /** + * Return the expected value for this command. + * + * @return the expected value + */ + public Object expected() { + return expected; + } + + /** + * Return the target record for this command. + * + * @return the record + */ + public long record() { + return record; + } + + /** + * Return the replacement value for this command. + * + * @return the replacement value + */ + public Object replacement() { + return replacement; + } + + @Override + public String ccl() { + StringBuilder sb = new StringBuilder("verifyAndSwap "); + sb.append(key); + sb.append(" as "); + sb.append(CclRenderer.value(expected)); + sb.append(" in "); + sb.append(Long.toString(record)); + sb.append(" with "); + sb.append(CclRenderer.value(replacement)); + return sb.toString(); + } + + @Override + public String toString() { + return ccl(); + } + + } + + private VerifyAndSwapCommand() {/* no-init */} + +} diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/VerifyCommand.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/VerifyCommand.java new file mode 100644 index 000000000..cfeeadef9 --- /dev/null +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/VerifyCommand.java @@ -0,0 +1,305 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.lang.command; + +import com.cinchapi.concourse.Timestamp; + +/** + * A {@link Command} builder for {@code verify} commands. + *

+ * {@code verify} checks whether a value is currently associated with a key in a + * record. + *

+ * + *
+ * verify <key> as <value> in <record>
+ * verify <key> as <value> in <record> at <timestamp>
+ * 
+ * + * @author Jeff Nelson + */ +public final class VerifyCommand { + + /** + * The state after specifying the key for the {@code verify} command. + */ + public static final class KeyState { + + /** + * The key to verify. + */ + private final String key; + + /** + * Construct a new instance. + * + * @param key the key to verify + */ + KeyState(String key) { + this.key = key; + } + + /** + * Specify the value to verify for this key. + * + * @param value the value to verify + * @return the next builder state + */ + public ValueState as(Object value) { + return new ValueState(key, value); + } + + } + + /** + * The state after specifying the key and value for the {@code verify} + * command. + */ + public static final class ValueState { + + /** + * The key to verify. + */ + private final String key; + + /** + * The value to verify. + */ + private final Object value; + + /** + * Construct a new instance. + * + * @param key the key + * @param value the value + */ + ValueState(String key, Object value) { + this.key = key; + this.value = value; + } + + /** + * Specify the record in which to verify. + * + * @param record the target record + * @return the next builder state + */ + public RecordState in(long record) { + return new RecordState(key, value, record); + } + + /** + * Alias for {@link #in(long)} to support alternate CCL dialects. + * + * @param record the target record + * @return the next builder state + */ + public RecordState within(long record) { + return in(record); + } + + } + + /** + * The terminal state for a {@code verify} command, reached after specifying + * the key, value, and record. Supports an optional {@code at} clause for + * historical verification. + */ + public static final class RecordState implements Command { + + /** + * The key to verify. + */ + private final String key; + + /** + * The value to verify. + */ + private final Object value; + + /** + * The target record. + */ + private final long record; + + /** + * Construct a new instance. + * + * @param key the key + * @param value the value + * @param record the target record + */ + RecordState(String key, Object value, long record) { + this.key = key; + this.value = value; + this.record = record; + } + + /** + * Pin this {@code verify} command to a historical {@link Timestamp}. + * + * @param timestamp the {@link Timestamp} + * @return the next builder state + */ + public TimestampState at(Timestamp timestamp) { + return new TimestampState(key, value, record, timestamp); + } + + /** + * Return the key for this command. + * + * @return the key + */ + public String key() { + return key; + } + + /** + * Return the value for this command. + * + * @return the value + */ + public Object value() { + return value; + } + + /** + * Return the target record for this command. + * + * @return the record + */ + public long record() { + return record; + } + + @Override + public String ccl() { + StringBuilder sb = new StringBuilder("verify "); + sb.append(key); + sb.append(" as "); + sb.append(CclRenderer.value(value)); + sb.append(" in "); + sb.append(Long.toString(record)); + return sb.toString(); + } + + @Override + public String toString() { + return ccl(); + } + + } + + /** + * The terminal state for a {@code verify} command that includes a + * historical {@link Timestamp}. + */ + public static final class TimestampState implements Command { + + /** + * The key to verify. + */ + private final String key; + + /** + * The value to verify. + */ + private final Object value; + + /** + * The target record. + */ + private final long record; + + /** + * The historical {@link Timestamp}. + */ + private final Timestamp timestamp; + + /** + * Construct a new instance. + * + * @param key the key + * @param value the value + * @param record the target record + * @param timestamp the {@link Timestamp} + */ + TimestampState(String key, Object value, long record, + Timestamp timestamp) { + this.key = key; + this.value = value; + this.record = record; + this.timestamp = timestamp; + } + + /** + * Return the key for this command. + * + * @return the key + */ + public String key() { + return key; + } + + /** + * Return the value for this command. + * + * @return the value + */ + public Object value() { + return value; + } + + /** + * Return the target record for this command. + * + * @return the record + */ + public long record() { + return record; + } + + /** + * Return the historical {@link Timestamp} for this command. + * + * @return the {@link Timestamp} + */ + public Timestamp timestamp() { + return timestamp; + } + + @Override + public String ccl() { + StringBuilder sb = new StringBuilder("verify "); + sb.append(key); + sb.append(" as "); + sb.append(CclRenderer.value(value)); + sb.append(" in "); + sb.append(Long.toString(record)); + CclRenderer.appendTimestamp(sb, timestamp); + return sb.toString(); + } + + @Override + public String toString() { + return ccl(); + } + + } + + private VerifyCommand() {/* no-init */} + +} diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/VerifyOrSetCommand.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/VerifyOrSetCommand.java new file mode 100644 index 000000000..9f7f5ae55 --- /dev/null +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/VerifyOrSetCommand.java @@ -0,0 +1,194 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.lang.command; + +/** + * A {@link Command} builder for {@code verifyOrSet} commands. + *

+ * {@code verifyOrSet} atomically checks whether a key holds a specific value in + * a record and, if not, sets the key to that value. + *

+ * + *
+ * verifyOrSet <key> as <value> in <record>
+ * 
+ * + * @author Jeff Nelson + */ +public final class VerifyOrSetCommand { + + /** + * The state after specifying the key for the {@code verifyOrSet} command. + */ + public static final class KeyState { + + /** + * The key to verify or set. + */ + private final String key; + + /** + * Construct a new instance. + * + * @param key the key to verify or set + */ + KeyState(String key) { + this.key = key; + } + + /** + * Specify the value to verify or set for this key. + * + * @param value the value + * @return the next builder state + */ + public ValueState as(Object value) { + return new ValueState(key, value); + } + + } + + /** + * The state after specifying the key and value for the {@code verifyOrSet} + * command. + */ + public static final class ValueState { + + /** + * The key to verify or set. + */ + private final String key; + + /** + * The value to verify or set. + */ + private final Object value; + + /** + * Construct a new instance. + * + * @param key the key + * @param value the value + */ + ValueState(String key, Object value) { + this.key = key; + this.value = value; + } + + /** + * Specify the record in which to verify or set. + * + * @param record the target record + * @return the next builder state + */ + public RecordState in(long record) { + return new RecordState(key, value, record); + } + + /** + * Alias for {@link #in(long)} to support alternate CCL dialects. + * + * @param record the target record + * @return the next builder state + */ + public RecordState within(long record) { + return in(record); + } + + } + + /** + * The terminal state for a {@code verifyOrSet} command, reached after + * specifying the key, value, and record. + */ + public static final class RecordState implements Command { + + /** + * The key to verify or set. + */ + private final String key; + + /** + * The value to verify or set. + */ + private final Object value; + + /** + * The target record. + */ + private final long record; + + /** + * Construct a new instance. + * + * @param key the key + * @param value the value + * @param record the target record + */ + RecordState(String key, Object value, long record) { + this.key = key; + this.value = value; + this.record = record; + } + + /** + * Return the key for this command. + * + * @return the key + */ + public String key() { + return key; + } + + /** + * Return the value for this command. + * + * @return the value + */ + public Object value() { + return value; + } + + /** + * Return the target record for this command. + * + * @return the record + */ + public long record() { + return record; + } + + @Override + public String ccl() { + StringBuilder sb = new StringBuilder("verifyOrSet "); + sb.append(key); + sb.append(" as "); + sb.append(CclRenderer.value(value)); + sb.append(" in "); + sb.append(Long.toString(record)); + return sb.toString(); + } + + @Override + public String toString() { + return ccl(); + } + + } + + private VerifyOrSetCommand() {/* no-init */} + +} diff --git a/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/CclRendererTest.java b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/CclRendererTest.java new file mode 100644 index 000000000..aeaac4494 --- /dev/null +++ b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/CclRendererTest.java @@ -0,0 +1,254 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.lang.command; + +import java.util.Arrays; +import java.util.List; + +import org.junit.Assert; +import org.junit.Test; + +/** + * Unit tests for {@link CclRenderer}. + * + * @author Jeff Nelson + */ +public class CclRendererTest { + + /** + * Goal: Verify that a single key is rendered bare, without + * brackets. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Create a single-element list containing {@code "name"}.
  • + *
  • Call {@link CclRenderer#keys(List)}.
  • + *
+ *

+ * Expected: The result is {@code "name"}. + */ + @Test + public void testSingleKey() { + String result = CclRenderer.keys(Arrays.asList("name")); + Assert.assertEquals("name", result); + } + + /** + * Goal: Verify that multiple keys are rendered as a + * bracketed, comma-separated list. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Create a list containing {@code "name"} and {@code "age"}.
  • + *
  • Call {@link CclRenderer#keys(List)}.
  • + *
+ *

+ * Expected: The result is {@code "[name, age]"}. + */ + @Test + public void testMultipleKeys() { + String result = CclRenderer.keys(Arrays.asList("name", "age")); + Assert.assertEquals("[name, age]", result); + } + + /** + * Goal: Verify that a single record is rendered bare, + * without brackets. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Create a single-element list containing {@code 1L}.
  • + *
  • Call {@link CclRenderer#records(List)}.
  • + *
+ *

+ * Expected: The result is {@code "1"}. + */ + @Test + public void testSingleRecord() { + String result = CclRenderer.records(Arrays.asList(1L)); + Assert.assertEquals("1", result); + } + + /** + * Goal: Verify that multiple records are rendered as a + * bracketed, comma-separated list. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Create a list containing {@code 1L}, {@code 2L}, and {@code 3L}.
  • + *
  • Call {@link CclRenderer#records(List)}.
  • + *
+ *

+ * Expected: The result is {@code "[1, 2, 3]"}. + */ + @Test + public void testMultipleRecords() { + String result = CclRenderer.records(Arrays.asList(1L, 2L, 3L)); + Assert.assertEquals("[1, 2, 3]", result); + } + + /** + * Goal: Verify that a {@link String} value is rendered + * with surrounding double quotes. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Call {@link CclRenderer#value(Object)} with {@code "hello"}.
  • + *
+ *

+ * Expected: The result is {@code "\"hello\""}. + */ + @Test + public void testStringValue() { + String result = CclRenderer.value("hello"); + Assert.assertEquals("\"hello\"", result); + } + + /** + * Goal: Verify that a numeric value is rendered without + * quotes. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Call {@link CclRenderer#value(Object)} with {@code 42}.
  • + *
+ *

+ * Expected: The result is {@code "42"}. + */ + @Test + public void testNumericValue() { + String result = CclRenderer.value(42); + Assert.assertEquals("42", result); + } + + /** + * Goal: Verify that a mixed list of values is rendered as + * a bracketed list with strings quoted and numbers bare. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Create a list containing {@code "a"} and {@code 1}.
  • + *
  • Call {@link CclRenderer#values(List)}.
  • + *
+ *

+ * Expected: The result is {@code "[\"a\", 1]"}. + */ + @Test + public void testValues() { + String result = CclRenderer.values(Arrays.asList("a", 1)); + Assert.assertEquals("[\"a\", 1]", result); + } + + /** + * Goal: Verify that + * {@link CclRenderer#collectRecords(long, long...)} correctly combines the + * first record with the varargs into a single list. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Call {@code collectRecords(1L, 2L, 3L)}.
  • + *
  • Assert that the result contains all three values in order.
  • + *
+ *

+ * Expected: The list contains {@code 1L}, {@code 2L}, and + * {@code 3L} in order. + */ + @Test + public void testCollectRecords() { + List records = CclRenderer.collectRecords(1L, 2L, 3L); + Assert.assertEquals(Arrays.asList(1L, 2L, 3L), records); + } + + /** + * Goal: Verify that + * {@link CclRenderer#collectKeys(String, String...)} correctly combines the + * first key with the varargs into a single list. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Call {@code collectKeys("name", "age")}.
  • + *
  • Assert that the result contains both values in order.
  • + *
+ *

+ * Expected: The list contains {@code "name"} and + * {@code "age"} in order. + */ + @Test + public void testCollectKeys() { + List keys = CclRenderer.collectKeys("name", "age"); + Assert.assertEquals(Arrays.asList("name", "age"), keys); + } + + /** + * Goal: Verify that a {@link String} value containing + * double quotes is properly escaped. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Call {@link CclRenderer#value(Object)} with a string containing an + * embedded double quote.
  • + *
+ *

+ * Expected: The result has the double quote escaped with a + * backslash. + */ + @Test + public void testStringValueWithQuotes() { + String result = CclRenderer.value("say \"hello\""); + Assert.assertEquals("\"say \\\"hello\\\"\"", result); + } + + /** + * Goal: Verify that a {@link String} value containing + * backslashes is properly escaped. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Call {@link CclRenderer#value(Object)} with a string containing a + * backslash.
  • + *
+ *

+ * Expected: The result has the backslash doubled. + */ + @Test + public void testStringValueWithBackslash() { + String result = CclRenderer.value("path\\to\\file"); + Assert.assertEquals("\"path\\\\to\\\\file\"", result); + } + +} diff --git a/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/InspectionCommandTest.java b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/InspectionCommandTest.java new file mode 100644 index 000000000..d6be20c64 --- /dev/null +++ b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/InspectionCommandTest.java @@ -0,0 +1,409 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.lang.command; + +import org.junit.Assert; +import org.junit.Test; + +import com.cinchapi.concourse.Timestamp; + +/** + * Unit tests for inspection {@link Command Commands} including {@code search}, + * {@code browse}, {@code describe}, {@code trace}, {@code holds}, + * {@code jsonify}, and simple utility commands. + * + * @author Jeff Nelson + */ +public class InspectionCommandTest { + + /** + * Goal: Verify that a {@code search} command renders the + * key and query in CCL. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code search} command for key {@code "name"} with query + * {@code "jeff"}.
  • + *
  • Call {@code ccl()}.
  • + *
+ *

+ * Expected: The CCL string is {@code "search name jeff"}. + */ + @Test + public void testSearch() { + String ccl = Command.search("name").forQuery("jeff").ccl(); + Assert.assertEquals("search name jeff", ccl); + } + + /** + * Goal: Verify that a {@code browse} command with a single + * key renders correctly. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code browse} command for key {@code "name"}.
  • + *
  • Call {@code ccl()}.
  • + *
+ *

+ * Expected: The CCL string is {@code "browse name"}. + */ + @Test + public void testBrowseSingleKey() { + String ccl = Command.browse("name").ccl(); + Assert.assertEquals("browse name", ccl); + } + + /** + * Goal: Verify that a {@code browse} command with multiple + * keys renders a bracketed list. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code browse} command for keys {@code "name"} and + * {@code "age"}.
  • + *
  • Call {@code ccl()}.
  • + *
+ *

+ * Expected: The CCL string is + * {@code "browse [name, age]"}. + */ + @Test + public void testBrowseMultipleKeys() { + String ccl = Command.browse("name", "age").ccl(); + Assert.assertEquals("browse [name, age]", ccl); + } + + /** + * Goal: Verify that a {@code browse} command with a + * historical timestamp renders the {@code at} clause. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code browse} command for key {@code "name"} at timestamp + * 12345.
  • + *
  • Call {@code ccl()}.
  • + *
+ *

+ * Expected: The CCL string is + * {@code "browse name at 12345"}. + */ + @Test + public void testBrowseWithTimestamp() { + String ccl = Command.browse("name").at(Timestamp.fromMicros(12345)) + .ccl(); + Assert.assertEquals("browse name at 12345", ccl); + } + + /** + * Goal: Verify that a {@code describe} command for a + * single record renders correctly. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code describe} command for record {@code 1}.
  • + *
  • Call {@code ccl()}.
  • + *
+ *

+ * Expected: The CCL string is {@code "describe 1"}. + */ + @Test + public void testDescribeSingleRecord() { + String ccl = Command.describe(1).ccl(); + Assert.assertEquals("describe 1", ccl); + } + + /** + * Goal: Verify that a {@code describe} command for + * multiple records renders a bracketed list. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code describe} command for records {@code 1}, {@code 2}, + * and {@code 3}.
  • + *
  • Call {@code ccl()}.
  • + *
+ *

+ * Expected: The CCL string is + * {@code "describe [1, 2, 3]"}. + */ + @Test + public void testDescribeMultipleRecords() { + String ccl = Command.describe(1, 2, 3).ccl(); + Assert.assertEquals("describe [1, 2, 3]", ccl); + } + + /** + * Goal: Verify that a {@code describe} command with a + * historical timestamp renders the {@code at} clause. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code describe} command for record {@code 1} at timestamp + * 12345.
  • + *
  • Call {@code ccl()}.
  • + *
+ *

+ * Expected: The CCL string is + * {@code "describe 1 at 12345"}. + */ + @Test + public void testDescribeWithTimestamp() { + String ccl = Command.describe(1).at(Timestamp.fromMicros(12345)).ccl(); + Assert.assertEquals("describe 1 at 12345", ccl); + } + + /** + * Goal: Verify that a {@code describeAll} command with no + * record arguments renders as a bare command. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code describeAll} command.
  • + *
  • Call {@code ccl()}.
  • + *
+ *

+ * Expected: The CCL string is {@code "describe"}. + */ + @Test + public void testDescribeAll() { + String ccl = Command.describeAll().ccl(); + Assert.assertEquals("describe", ccl); + } + + /** + * Goal: Verify that a {@code trace} command for a single + * record renders correctly. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code trace} command for record {@code 1}.
  • + *
  • Call {@code ccl()}.
  • + *
+ *

+ * Expected: The CCL string is {@code "trace 1"}. + */ + @Test + public void testTrace() { + String ccl = Command.trace(1).ccl(); + Assert.assertEquals("trace 1", ccl); + } + + /** + * Goal: Verify that a {@code trace} command for multiple + * records with a timestamp renders both the bracketed record list and the + * {@code at} clause. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code trace} command for records {@code 1} and {@code 2} at + * timestamp 12345.
  • + *
  • Call {@code ccl()}.
  • + *
+ *

+ * Expected: The CCL string is + * {@code "trace [1, 2] at 12345"}. + */ + @Test + public void testTraceWithTimestamp() { + String ccl = Command.trace(1, 2).at(Timestamp.fromMicros(12345)).ccl(); + Assert.assertEquals("trace [1, 2] at 12345", ccl); + } + + /** + * Goal: Verify that a {@code holds} command for multiple + * records renders a bracketed list. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code holds} command for records {@code 1} and + * {@code 2}.
  • + *
  • Call {@code ccl()}.
  • + *
+ *

+ * Expected: The CCL string is {@code "holds [1, 2]"}. + */ + @Test + public void testHolds() { + String ccl = Command.holds(1, 2).ccl(); + Assert.assertEquals("holds [1, 2]", ccl); + } + + /** + * Goal: Verify that a {@code jsonify} command for a single + * record renders correctly. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code jsonify} command for record {@code 1}.
  • + *
  • Call {@code ccl()}.
  • + *
+ *

+ * Expected: The CCL string is {@code "jsonify 1"}. + */ + @Test + public void testJsonify() { + String ccl = Command.jsonify(1).ccl(); + Assert.assertEquals("jsonify 1", ccl); + } + + /** + * Goal: Verify that a {@code jsonify} command with a + * timestamp and the {@code identifier} flag renders all three components. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code jsonify} command for record {@code 1} at timestamp + * 12345 with the identifier flag enabled.
  • + *
  • Call {@code ccl()}.
  • + *
+ *

+ * Expected: The CCL string is + * {@code "jsonify 1 at 12345 identifier"}. + */ + @Test + public void testJsonifyWithTimestampAndIdentifier() { + String ccl = Command.jsonify(1).at(Timestamp.fromMicros(12345)) + .identifier().ccl(); + Assert.assertEquals("jsonify 1 at 12345 identifier", ccl); + } + + /** + * Goal: Verify that the {@code ping} command renders + * correctly. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code ping} command.
  • + *
  • Call {@code ccl()}.
  • + *
+ *

+ * Expected: The CCL string is {@code "ping"}. + */ + @Test + public void testPing() { + String ccl = Command.ping().ccl(); + Assert.assertEquals("ping", ccl); + } + + /** + * Goal: Verify that the {@code stage} command renders + * correctly. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code stage} command.
  • + *
  • Call {@code ccl()}.
  • + *
+ *

+ * Expected: The CCL string is {@code "stage"}. + */ + @Test + public void testStage() { + String ccl = Command.stage().ccl(); + Assert.assertEquals("stage", ccl); + } + + /** + * Goal: Verify that the {@code commit} command renders + * correctly. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code commit} command.
  • + *
  • Call {@code ccl()}.
  • + *
+ *

+ * Expected: The CCL string is {@code "commit"}. + */ + @Test + public void testCommit() { + String ccl = Command.commit().ccl(); + Assert.assertEquals("commit", ccl); + } + + /** + * Goal: Verify that the {@code abort} command renders + * correctly. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build an {@code abort} command.
  • + *
  • Call {@code ccl()}.
  • + *
+ *

+ * Expected: The CCL string is {@code "abort"}. + */ + @Test + public void testAbort() { + String ccl = Command.abort().ccl(); + Assert.assertEquals("abort", ccl); + } + + /** + * Goal: Verify that the {@code inventory} command renders + * correctly. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build an {@code inventory} command.
  • + *
  • Call {@code ccl()}.
  • + *
+ *

+ * Expected: The CCL string is {@code "inventory"}. + */ + @Test + public void testInventory() { + String ccl = Command.inventory().ccl(); + Assert.assertEquals("inventory", ccl); + } + +} diff --git a/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/LinkCommandTest.java b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/LinkCommandTest.java new file mode 100644 index 000000000..dfb1b3553 --- /dev/null +++ b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/LinkCommandTest.java @@ -0,0 +1,308 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.lang.command; + +import org.junit.Assert; +import org.junit.Test; + +import com.cinchapi.concourse.Timestamp; + +/** + * Unit tests for link-related and verification {@link Command Commands}: + * {@code link}, {@code unlink}, {@code verify}, {@code verifyAndSwap}, + * {@code verifyOrSet}, {@code findOrAdd}, and {@code findOrInsert}. + * + * @author Jeff Nelson + */ +public class LinkCommandTest { + + /** + * Goal: Verify that a {@code link} command renders the + * correct CCL for a single destination record. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code link} command with key {@code "friends"}, source + * record {@code 1}, and destination record {@code 2}.
  • + *
  • Call {@code ccl()} on the resulting {@link Command}.
  • + *
+ *

+ * Expected: The CCL string is + * {@code "link friends from 1 to 2"}. + */ + @Test + public void testLinkSingleDestination() { + String ccl = Command.link("friends").from(1).to(2).ccl(); + Assert.assertEquals("link friends from 1 to 2", ccl); + } + + /** + * Goal: Verify that a {@code link} command renders the + * correct CCL for multiple destination records. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code link} command with key {@code "friends"}, source + * record {@code 1}, and destination records {@code 2} and {@code 3}.
  • + *
  • Call {@code ccl()} on the resulting {@link Command}.
  • + *
+ *

+ * Expected: The CCL string is + * {@code "link friends from 1 to [2, 3]"}. + */ + @Test + public void testLinkMultipleDestinations() { + String ccl = Command.link("friends").from(1).to(2, 3).ccl(); + Assert.assertEquals("link friends from 1 to [2, 3]", ccl); + } + + /** + * Goal: Verify that an {@code unlink} command renders the + * correct CCL for removing a directional relationship. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build an {@code unlink} command with key {@code "friends"}, source + * record {@code 1}, and destination record {@code 2}.
  • + *
  • Call {@code ccl()} on the resulting {@link Command}.
  • + *
+ *

+ * Expected: The CCL string is + * {@code "unlink friends from 1 to 2"}. + */ + @Test + public void testUnlink() { + String ccl = Command.unlink("friends").from(1).to(2).ccl(); + Assert.assertEquals("unlink friends from 1 to 2", ccl); + } + + /** + * Goal: Verify that a {@code verify} command renders the + * correct CCL for checking a key/value association in a record. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code verify} command with key {@code "name"}, value + * {@code "jeff"}, and record {@code 1}.
  • + *
  • Call {@code ccl()} on the resulting {@link Command}.
  • + *
+ *

+ * Expected: The CCL string is + * {@code "verify name as \"jeff\" in 1"}. + */ + @Test + public void testVerify() { + String ccl = Command.verify("name").as("jeff").in(1).ccl(); + Assert.assertEquals("verify name as \"jeff\" in 1", ccl); + } + + /** + * Goal: Verify that a {@code verify} command with a + * historical {@link Timestamp} renders the correct CCL including an + * {@code at} clause. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code verify} command with key {@code "name"}, value + * {@code "jeff"}, record {@code 1}, and a {@link Timestamp} created from + * {@code 12345} microseconds.
  • + *
  • Call {@code ccl()} on the resulting {@link Command}.
  • + *
+ *

+ * Expected: The CCL string is + * {@code "verify name as \"jeff\" in 1 at 12345"}. + */ + @Test + public void testVerifyWithTimestamp() { + String ccl = Command.verify("name").as("jeff").in(1) + .at(Timestamp.fromMicros(12345)).ccl(); + Assert.assertEquals("verify name as \"jeff\" in 1 at 12345", ccl); + } + + /** + * Goal: Verify that a {@code verifyAndSwap} command + * renders the correct CCL with the expected value, record, and replacement + * value. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code verifyAndSwap} command with key {@code "name"}, + * expected value {@code "jeff"}, record {@code 1}, and replacement value + * {@code "bob"}.
  • + *
  • Call {@code ccl()} on the resulting {@link Command}.
  • + *
+ *

+ * Expected: The CCL string is + * {@code "verifyAndSwap name as \"jeff\" in 1 with \"bob\""}. + */ + @Test + public void testVerifyAndSwap() { + String ccl = Command.verifyAndSwap("name").as("jeff").in(1).with("bob") + .ccl(); + Assert.assertEquals( + "verifyAndSwap name as \"jeff\" in 1" + " with \"bob\"", ccl); + } + + /** + * Goal: Verify that a {@code verifyOrSet} command renders + * the correct CCL for checking and conditionally setting a key/value in a + * record. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code verifyOrSet} command with key {@code "name"}, value + * {@code "jeff"}, and record {@code 1}.
  • + *
  • Call {@code ccl()} on the resulting {@link Command}.
  • + *
+ *

+ * Expected: The CCL string is + * {@code "verifyOrSet name as \"jeff\" in 1"}. + */ + @Test + public void testVerifyOrSet() { + String ccl = Command.verifyOrSet("name").as("jeff").in(1).ccl(); + Assert.assertEquals("verifyOrSet name as \"jeff\" in 1", ccl); + } + + /** + * Goal: Verify that a {@code findOrAdd} command renders + * the correct CCL for atomically finding or adding a key/value pair. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code findOrAdd} command with key {@code "name"} and value + * {@code "jeff"}.
  • + *
  • Call {@code ccl()} on the resulting {@link Command}.
  • + *
+ *

+ * Expected: The CCL string is + * {@code "findOrAdd name as \"jeff\""}. + */ + @Test + public void testFindOrAdd() { + String ccl = Command.findOrAdd("name").as("jeff").ccl(); + Assert.assertEquals("findOrAdd name as \"jeff\"", ccl); + } + + /** + * Goal: Verify that the {@code within()} alias on + * {@code verify} produces the same CCL as {@code in()}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code verify} command with key {@code "name"}, value + * {@code "jeff"}, using {@code within(1)} instead of {@code in(1)}.
  • + *
  • Call {@code ccl()} on the resulting {@link Command}.
  • + *
+ *

+ * Expected: The CCL string is + * {@code "verify name as \"jeff\" in 1"}. + */ + @Test + public void testVerifyWithinRecordAlias() { + String ccl = Command.verify("name").as("jeff").within(1).ccl(); + Assert.assertEquals("verify name as \"jeff\" in 1", ccl); + } + + /** + * Goal: Verify that the {@code within()} alias on + * {@code verifyAndSwap} produces the same CCL as {@code in()}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code verifyAndSwap} command with key {@code "name"}, + * expected value {@code "jeff"}, using {@code within(1)} instead of + * {@code in(1)}, then {@code with("bob")}.
  • + *
  • Call {@code ccl()} on the resulting {@link Command}.
  • + *
+ *

+ * Expected: The CCL string is + * {@code "verifyAndSwap name as \"jeff\" in 1 with \"bob\""}. + */ + @Test + public void testVerifyAndSwapWithinRecordAlias() { + String ccl = Command.verifyAndSwap("name").as("jeff").within(1) + .with("bob").ccl(); + Assert.assertEquals( + "verifyAndSwap name as \"jeff\" in 1" + " with \"bob\"", ccl); + } + + /** + * Goal: Verify that the {@code within()} alias on + * {@code verifyOrSet} produces the same CCL as {@code in()}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code verifyOrSet} command with key {@code "name"}, value + * {@code "jeff"}, using {@code within(1)} instead of {@code in(1)}.
  • + *
  • Call {@code ccl()} on the resulting {@link Command}.
  • + *
+ *

+ * Expected: The CCL string is + * {@code "verifyOrSet name as \"jeff\" in 1"}. + */ + @Test + public void testVerifyOrSetWithinRecordAlias() { + String ccl = Command.verifyOrSet("name").as("jeff").within(1).ccl(); + Assert.assertEquals("verifyOrSet name as \"jeff\" in 1", ccl); + } + + /** + * Goal: Verify that a {@code findOrInsert} command renders + * the correct CCL for a raw CCL condition and JSON data. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code findOrInsert} command with condition + * {@code "name = jeff"} and JSON {@code "{\"name\":\"jeff\"}"}.
  • + *
  • Call {@code ccl()} on the resulting {@link Command}.
  • + *
+ *

+ * Expected: The CCL string is {@code "findOrInsert name = + * jeff '{\"name\":\"jeff\"}'"}. + */ + @Test + public void testFindOrInsertWithCondition() { + String json = "{\"name\":\"jeff\"}"; + String ccl = Command.findOrInsert("name = jeff").json(json).ccl(); + Assert.assertEquals("findOrInsert name = jeff '" + json + "'", ccl); + } + +} diff --git a/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/QueryCommandTest.java b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/QueryCommandTest.java new file mode 100644 index 000000000..c5bfbe0b6 --- /dev/null +++ b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/QueryCommandTest.java @@ -0,0 +1,553 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.lang.command; + +import org.junit.Assert; +import org.junit.Test; + +import com.cinchapi.concourse.Timestamp; +import com.cinchapi.concourse.lang.paginate.Page; +import com.cinchapi.concourse.lang.sort.Order; + +/** + * Unit tests for query {@link Command} builders including {@code find}, + * {@code select}, {@code get}, and {@code navigate}. + * + * @author Jeff Nelson + */ +public class QueryCommandTest { + + /** + * Goal: Verify that a {@code find} command with a raw CCL + * condition renders correctly. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code find} command with the CCL string + * {@code "age > 30"}.
  • + *
  • Call {@code ccl()} on the resulting command.
  • + *
+ *

+ * Expected: The CCL output is {@code "find age > 30"}. + */ + @Test + public void testFindWithCclCondition() { + String ccl = Command.find("age > 30").ccl(); + Assert.assertEquals("find age > 30", ccl); + } + + /** + * Goal: Verify that a {@code find} command with a + * historical {@link Timestamp} appends the correct {@code at} clause. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code find} command with the CCL string {@code "age > 30"} + * and pin it to {@code Timestamp.fromMicros(12345)}.
  • + *
  • Call {@code ccl()} on the resulting command.
  • + *
+ *

+ * Expected: The CCL output is + * {@code "find age > 30 at 12345"}. + */ + @Test + public void testFindWithTimestamp() { + String ccl = Command.find("age > 30").at(Timestamp.fromMicros(12345)) + .ccl(); + Assert.assertEquals("find age > 30 at 12345", ccl); + } + + /** + * Goal: Verify that a {@code find} command with an + * {@link Order} and {@link Page} renders the {@code order by} and + * {@code page} clauses. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code find} command with condition {@code "age > 30"}, + * ordered by {@code "name"}, and paged with size 10.
  • + *
  • Call {@code ccl()} on the resulting command.
  • + *
+ *

+ * Expected: The CCL output is + * {@code "find age > 30 order by name page 1 size 10"}. + */ + @Test + public void testFindWithOrderAndPage() { + String ccl = Command.find("age > 30").order(Order.by("name").build()) + .page(Page.sized(10)).ccl(); + Assert.assertEquals("find age > 30 order by name page 1 size 10", ccl); + } + + /** + * Goal: Verify that a {@code select} command with multiple + * keys and multiple records renders correctly. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code select} command for keys {@code "name"} and + * {@code "age"} from records {@code 1}, {@code 2}, and {@code 3}.
  • + *
  • Call {@code ccl()} on the resulting command.
  • + *
+ *

+ * Expected: The CCL output is + * {@code "select [name, age] from [1, 2, 3]"}. + */ + @Test + public void testSelectKeysFromRecords() { + String ccl = Command.select("name", "age").from(1, 2, 3).ccl(); + Assert.assertEquals("select [name, age] from [1, 2, 3]", ccl); + } + + /** + * Goal: Verify that a {@code select} command for all keys + * from a single record renders correctly. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code selectAll} command from record {@code 1}.
  • + *
  • Call {@code ccl()} on the resulting command.
  • + *
+ *

+ * Expected: The CCL output is {@code "select from 1"}. + */ + @Test + public void testSelectAllKeysFromRecord() { + String ccl = Command.selectAll().from(1).ccl(); + Assert.assertEquals("select from 1", ccl); + } + + /** + * Goal: Verify that a {@code select} command with a CCL + * {@code where} clause renders correctly. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code select} command for key {@code "name"} with condition + * {@code "status = active"}.
  • + *
  • Call {@code ccl()} on the resulting command.
  • + *
+ *

+ * Expected: The CCL output is + * {@code "select name where status = active"}. + */ + @Test + public void testSelectWithCondition() { + String ccl = Command.select("name").where("status = active").ccl(); + Assert.assertEquals("select name where status = active", ccl); + } + + /** + * Goal: Verify that a {@code get} command with a single + * key and a single record renders correctly. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code get} command for key {@code "name"} from record + * {@code 1}.
  • + *
  • Call {@code ccl()} on the resulting command.
  • + *
+ *

+ * Expected: The CCL output is {@code "get name from 1"}. + */ + @Test + public void testGetFromRecord() { + String ccl = Command.get("name").from(1).ccl(); + Assert.assertEquals("get name from 1", ccl); + } + + /** + * Goal: Verify that a {@code get} command for all keys + * from multiple records renders correctly. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code getAll} command from records {@code 1} and + * {@code 2}.
  • + *
  • Call {@code ccl()} on the resulting command.
  • + *
+ *

+ * Expected: The CCL output is {@code "get from [1, 2]"}. + */ + @Test + public void testGetAllKeysFromRecords() { + String ccl = Command.getAll().from(1, 2).ccl(); + Assert.assertEquals("get from [1, 2]", ccl); + } + + /** + * Goal: Verify that a {@code get} command with multiple + * keys and a CCL {@code where} clause renders correctly. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code get} command for keys {@code "name"} and {@code "age"} + * with condition {@code "status = active"}.
  • + *
  • Call {@code ccl()} on the resulting command.
  • + *
+ *

+ * Expected: The CCL output is + * {@code "get [name, age] where status = active"}. + */ + @Test + public void testGetWithCondition() { + String ccl = Command.get("name", "age").where("status = active").ccl(); + Assert.assertEquals("get [name, age] where status = active", ccl); + } + + /** + * Goal: Verify that a {@code navigate} command with a + * navigation key and a record renders correctly. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code navigate} command for key {@code "friends.name"} from + * record {@code 1}.
  • + *
  • Call {@code ccl()} on the resulting command.
  • + *
+ *

+ * Expected: The CCL output is + * {@code "navigate friends.name from 1"}. + */ + @Test + public void testNavigateFromRecords() { + String ccl = Command.navigate("friends.name").from(1).ccl(); + Assert.assertEquals("navigate friends.name from 1", ccl); + } + + /** + * Goal: Verify that a {@code navigate} command with a CCL + * {@code where} clause renders correctly. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code navigate} command for key {@code "friends.name"} with + * condition {@code "active = true"}.
  • + *
  • Call {@code ccl()} on the resulting command.
  • + *
+ *

+ * Expected: The CCL output is + * {@code "navigate friends.name where active = true"}. + */ + @Test + public void testNavigateWithCondition() { + String ccl = Command.navigate("friends.name").where("active = true") + .ccl(); + Assert.assertEquals("navigate friends.name where active = true", ccl); + } + + /** + * Goal: Verify that a {@code navigate} command with a + * historical {@link Timestamp} appends the correct {@code at} clause. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code navigate} command for key {@code "friends.name"} from + * record {@code 1}, pinned to {@code Timestamp.fromMicros(12345)}.
  • + *
  • Call {@code ccl()} on the resulting command.
  • + *
+ *

+ * Expected: The CCL output is + * {@code "navigate friends.name from 1 at 12345"}. + */ + @Test + public void testNavigateWithTimestamp() { + String ccl = Command.navigate("friends.name").from(1) + .at(Timestamp.fromMicros(12345)).ccl(); + Assert.assertEquals("navigate friends.name from 1 at 12345", ccl); + } + + /** + * Goal: Verify that a single-key {@code select} command + * renders correctly without brackets. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code select} command for key {@code "name"} from record + * {@code 1}.
  • + *
  • Call {@code ccl()} on the resulting command.
  • + *
+ *

+ * Expected: The CCL output is + * {@code "select name from 1"}. + */ + @Test + public void testSelectSingleKeyFromRecord() { + String ccl = Command.select("name").from(1).ccl(); + Assert.assertEquals("select name from 1", ccl); + } + + /** + * Goal: Verify that the {@code in()} alias on + * {@code select} produces the same CCL as {@code from()}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code select} command for key {@code "name"} using + * {@code in(1)}.
  • + *
  • Call {@code ccl()} on the resulting command.
  • + *
+ *

+ * Expected: The CCL output is + * {@code "select name from 1"}. + */ + @Test + public void testSelectKeyInRecordAlias() { + String ccl = Command.select("name").in(1).ccl(); + Assert.assertEquals("select name from 1", ccl); + } + + /** + * Goal: Verify that the {@code in()} alias on + * {@code selectAll()} produces the same CCL as {@code from()}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code selectAll} command using {@code in(1)}.
  • + *
  • Call {@code ccl()} on the resulting command.
  • + *
+ *

+ * Expected: The CCL output is {@code "select from 1"}. + */ + @Test + public void testSelectAllInRecordAlias() { + String ccl = Command.selectAll().in(1).ccl(); + Assert.assertEquals("select from 1", ccl); + } + + /** + * Goal: Verify that the {@code in()} alias on {@code get} + * produces the same CCL as {@code from()}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code get} command for key {@code "name"} using + * {@code in(1)}.
  • + *
  • Call {@code ccl()} on the resulting command.
  • + *
+ *

+ * Expected: The CCL output is {@code "get name from 1"}. + */ + @Test + public void testGetKeyInRecordAlias() { + String ccl = Command.get("name").in(1).ccl(); + Assert.assertEquals("get name from 1", ccl); + } + + /** + * Goal: Verify that the {@code in()} alias on + * {@code navigate} produces the same CCL as {@code from()}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code navigate} command for key {@code "friends.name"} using + * {@code in(1)}.
  • + *
  • Call {@code ccl()} on the resulting command.
  • + *
+ *

+ * Expected: The CCL output is + * {@code "navigate friends.name from 1"}. + */ + @Test + public void testNavigateInRecordAlias() { + String ccl = Command.navigate("friends.name").in(1).ccl(); + Assert.assertEquals("navigate friends.name from 1", ccl); + } + + /** + * Goal: Verify that a {@code selectAll} command with a CCL + * condition renders correctly. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code selectAll} command with condition + * {@code "active = true"}.
  • + *
  • Call {@code ccl()} on the resulting command.
  • + *
+ *

+ * Expected: The CCL output is + * {@code "select where active = true"}. + */ + @Test + public void testSelectAllWithCondition() { + String ccl = Command.selectAll().where("active = true").ccl(); + Assert.assertEquals("select where active = true", ccl); + } + + /** + * Goal: Verify that the {@code within()} alias on + * {@code select} produces the same CCL as {@code from()}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code select} command for key {@code "name"} using + * {@code within(1)}.
  • + *
  • Call {@code ccl()} on the resulting command.
  • + *
+ *

+ * Expected: The CCL output is + * {@code "select name from 1"}. + */ + @Test + public void testSelectKeyWithinRecordAlias() { + String ccl = Command.select("name").within(1).ccl(); + Assert.assertEquals("select name from 1", ccl); + } + + /** + * Goal: Verify that the {@code within()} alias on + * {@code selectAll()} produces the same CCL as {@code from()}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code selectAll} command using {@code within(1)}.
  • + *
  • Call {@code ccl()} on the resulting command.
  • + *
+ *

+ * Expected: The CCL output is {@code "select from 1"}. + */ + @Test + public void testSelectAllWithinRecordAlias() { + String ccl = Command.selectAll().within(1).ccl(); + Assert.assertEquals("select from 1", ccl); + } + + /** + * Goal: Verify that the {@code within()} alias on + * {@code get} produces the same CCL as {@code from()}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code get} command for key {@code "name"} using + * {@code within(1)}.
  • + *
  • Call {@code ccl()} on the resulting command.
  • + *
+ *

+ * Expected: The CCL output is {@code "get name from 1"}. + */ + @Test + public void testGetKeyWithinRecordAlias() { + String ccl = Command.get("name").within(1).ccl(); + Assert.assertEquals("get name from 1", ccl); + } + + /** + * Goal: Verify that the {@code within()} alias on + * {@code getAll()} produces the same CCL as {@code from()}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code getAll} command using {@code within(1)}.
  • + *
  • Call {@code ccl()} on the resulting command.
  • + *
+ *

+ * Expected: The CCL output is {@code "get from 1"}. + */ + @Test + public void testGetAllWithinRecordAlias() { + String ccl = Command.getAll().within(1).ccl(); + Assert.assertEquals("get from 1", ccl); + } + + /** + * Goal: Verify that the {@code within()} alias on + * {@code navigate} produces the same CCL as {@code from()}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code navigate} command for key {@code "friends.name"} using + * {@code within(1)}.
  • + *
  • Call {@code ccl()} on the resulting command.
  • + *
+ *

+ * Expected: The CCL output is + * {@code "navigate friends.name from 1"}. + */ + @Test + public void testNavigateWithinRecordAlias() { + String ccl = Command.navigate("friends.name").within(1).ccl(); + Assert.assertEquals("navigate friends.name from 1", ccl); + } + + /** + * Goal: Verify that a {@code getAll} command with a CCL + * condition renders correctly. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code getAll} command with condition + * {@code "active = true"}.
  • + *
  • Call {@code ccl()} on the resulting command.
  • + *
+ *

+ * Expected: The CCL output is + * {@code "get where active = true"}. + */ + @Test + public void testGetAllWithCondition() { + String ccl = Command.getAll().where("active = true").ccl(); + Assert.assertEquals("get where active = true", ccl); + } + +} diff --git a/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/TemporalCommandTest.java b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/TemporalCommandTest.java new file mode 100644 index 000000000..901ba4642 --- /dev/null +++ b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/TemporalCommandTest.java @@ -0,0 +1,637 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.lang.command; + +import org.junit.Assert; +import org.junit.Test; + +import com.cinchapi.concourse.Timestamp; + +/** + * Unit tests for temporal {@link Command Commands} including {@code chronicle}, + * {@code diff}, {@code audit}, {@code revert}, {@code reconcile}, + * {@code consolidate}, and {@code calculate}. + * + * @author Jeff Nelson + */ +public class TemporalCommandTest { + + /** + * Goal: Verify that a {@code chronicle} command renders + * the key and record in CCL. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code chronicle} command for key {@code "name"} in record + * {@code 1}.
  • + *
  • Call {@code ccl()}.
  • + *
+ *

+ * Expected: The CCL string is + * {@code "chronicle name in 1"}. + */ + @Test + public void testChronicle() { + String ccl = Command.chronicle("name").in(1).ccl(); + Assert.assertEquals("chronicle name in 1", ccl); + } + + /** + * Goal: Verify that a {@code chronicle} command with a + * start timestamp renders the {@code at} clause. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code chronicle} command for key {@code "name"} in record + * {@code 1} at timestamp 100.
  • + *
  • Call {@code ccl()}.
  • + *
+ *

+ * Expected: The CCL string contains {@code "at 100"}. + */ + @Test + public void testChronicleWithTimestamp() { + String ccl = Command.chronicle("name").in(1) + .at(Timestamp.fromMicros(100)).ccl(); + Assert.assertEquals("chronicle name in 1 at 100", ccl); + } + + /** + * Goal: Verify that a {@code chronicle} command with a + * start and end timestamp renders both {@code at} clauses. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code chronicle} command for key {@code "name"} in record + * {@code 1} with start timestamp 100 and end timestamp 200.
  • + *
  • Call {@code ccl()}.
  • + *
+ *

+ * Expected: The CCL string contains both timestamps. + */ + @Test + public void testChronicleWithRange() { + String ccl = Command.chronicle("name").in(1) + .at(Timestamp.fromMicros(100)).at(Timestamp.fromMicros(200)) + .ccl(); + Assert.assertEquals("chronicle name in 1 at 100 at 200", ccl); + } + + /** + * Goal: Verify that a record-scoped {@code diff} command + * with a start timestamp renders correctly. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code diff} command for record {@code 1} at timestamp + * 100.
  • + *
  • Call {@code ccl()}.
  • + *
+ *

+ * Expected: The CCL string is {@code "diff 1 at 100"}. + */ + @Test + public void testDiffRecord() { + String ccl = Command.diff(1L).at(Timestamp.fromMicros(100)).ccl(); + Assert.assertEquals("diff 1 at 100", ccl); + } + + /** + * Goal: Verify that a record-scoped {@code diff} command + * with a start and end timestamp renders both {@code at} clauses. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code diff} command for record {@code 1} with start + * timestamp 100 and end timestamp 200.
  • + *
  • Call {@code ccl()}.
  • + *
+ *

+ * Expected: The CCL string contains both timestamps. + */ + @Test + public void testDiffRecordRange() { + String ccl = Command.diff(1L).at(Timestamp.fromMicros(100)) + .at(Timestamp.fromMicros(200)).ccl(); + Assert.assertEquals("diff 1 at 100 at 200", ccl); + } + + /** + * Goal: Verify that a key-scoped {@code diff} command + * renders the key, record, and start timestamp. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code diff} command for key {@code "name"} in record + * {@code 1} at timestamp 100.
  • + *
  • Call {@code ccl()}.
  • + *
+ *

+ * Expected: The CCL string is + * {@code "diff name in 1 at 100"}. + */ + @Test + public void testDiffKeyInRecord() { + String ccl = Command.diff("name").in(1).at(Timestamp.fromMicros(100)) + .ccl(); + Assert.assertEquals("diff name in 1 at 100", ccl); + } + + /** + * Goal: Verify that a key-scoped {@code diff} command with + * a start and end timestamp renders both {@code at} clauses. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code diff} command for key {@code "name"} in record + * {@code 1} with start timestamp 100 and end timestamp 200.
  • + *
  • Call {@code ccl()}.
  • + *
+ *

+ * Expected: The CCL string is + * {@code "diff name in 1 at 100 at 200"}. + */ + @Test + public void testDiffKeyInRecordRange() { + String ccl = Command.diff("name").in(1).at(Timestamp.fromMicros(100)) + .at(Timestamp.fromMicros(200)).ccl(); + Assert.assertEquals("diff name in 1 at 100 at 200", ccl); + } + + /** + * Goal: Verify that a record-scoped {@code audit} command + * renders the record. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build an {@code audit} command for record {@code 1}.
  • + *
  • Call {@code ccl()}.
  • + *
+ *

+ * Expected: The CCL string is {@code "audit 1"}. + */ + @Test + public void testAuditRecord() { + String ccl = Command.audit(1L).ccl(); + Assert.assertEquals("audit 1", ccl); + } + + /** + * Goal: Verify that a record-scoped {@code audit} command + * with a start timestamp renders the {@code at} clause. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build an {@code audit} command for record {@code 1} at timestamp + * 100.
  • + *
  • Call {@code ccl()}.
  • + *
+ *

+ * Expected: The CCL string is {@code "audit 1 at 100"}. + */ + @Test + public void testAuditRecordWithTimestamp() { + String ccl = Command.audit(1L).at(Timestamp.fromMicros(100)).ccl(); + Assert.assertEquals("audit 1 at 100", ccl); + } + + /** + * Goal: Verify that a key-scoped {@code audit} command + * renders the key and record. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build an {@code audit} command for key {@code "name"} in record + * {@code 1}.
  • + *
  • Call {@code ccl()}.
  • + *
+ *

+ * Expected: The CCL string is {@code "audit name in 1"}. + */ + @Test + public void testAuditKeyInRecord() { + String ccl = Command.audit("name").in(1).ccl(); + Assert.assertEquals("audit name in 1", ccl); + } + + /** + * Goal: Verify that a {@code revert} command renders keys, + * records, and the target timestamp. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code revert} command for keys {@code "name"} and + * {@code "age"} in records {@code 1} and {@code 2} to timestamp 100.
  • + *
  • Call {@code ccl()}.
  • + *
+ *

+ * Expected: The CCL string contains {@code "revert"}, both + * keys, both records, and {@code "to 100"}. + */ + @Test + public void testRevert() { + String ccl = Command.revert("name", "age").in(1, 2) + .to(Timestamp.fromMicros(100)).ccl(); + Assert.assertEquals("revert [name, age] in [1, 2] to 100", ccl); + } + + /** + * Goal: Verify that a {@code reconcile} command renders + * the key, record, and values. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code reconcile} command for key {@code "name"} in record + * {@code 1} with values {@code "jeff"} and {@code "bob"}.
  • + *
  • Call {@code ccl()}.
  • + *
+ *

+ * Expected: The CCL string contains + * {@code "reconcile name in 1 with"}. + */ + @Test + public void testReconcile() { + String ccl = Command.reconcile("name").in(1).with("jeff", "bob").ccl(); + Assert.assertTrue(ccl.contains("reconcile name in 1 with")); + } + + /** + * Goal: Verify that a {@code consolidate} command renders + * all records. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code consolidate} command for records {@code 1}, {@code 2}, + * and {@code 3}.
  • + *
  • Call {@code ccl()}.
  • + *
+ *

+ * Expected: The CCL string is + * {@code "consolidate [1, 2, 3]"}. + */ + @Test + public void testConsolidate() { + String ccl = Command.consolidate(1, 2, 3).ccl(); + Assert.assertEquals("consolidate [1, 2, 3]", ccl); + } + + /** + * Goal: Verify that a basic {@code calculate} command + * renders the function and key. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code calculate} command with function {@code "sum"} and key + * {@code "salary"}.
  • + *
  • Call {@code ccl()}.
  • + *
+ *

+ * Expected: The CCL string is + * {@code "calculate sum salary"}. + */ + @Test + public void testCalculateBasic() { + String ccl = Command.calculate("sum", "salary").ccl(); + Assert.assertEquals("calculate sum salary", ccl); + } + + /** + * Goal: Verify that a {@code calculate} command scoped to + * records renders the {@code in} clause. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code calculate} command with function {@code "avg"} and key + * {@code "age"} in records {@code 1} and {@code 2}.
  • + *
  • Call {@code ccl()}.
  • + *
+ *

+ * Expected: The CCL string is + * {@code "calculate avg age in [1, 2]"}. + */ + @Test + public void testCalculateInRecords() { + String ccl = Command.calculate("avg", "age").in(1, 2).ccl(); + Assert.assertEquals("calculate avg age in [1, 2]", ccl); + } + + /** + * Goal: Verify that a {@code calculate} command with a CCL + * condition renders the {@code where} clause. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code calculate} command with function {@code "count"} and + * key {@code "status"} where {@code "active = true"}.
  • + *
  • Call {@code ccl()}.
  • + *
+ *

+ * Expected: The CCL string contains {@code "where"}. + */ + @Test + public void testCalculateWithCondition() { + String ccl = Command.calculate("count", "status").where("active = true") + .ccl(); + Assert.assertTrue(ccl.contains("where")); + Assert.assertEquals("calculate count status where active = true", ccl); + } + + /** + * Goal: Verify that a {@code calculate} command with a + * historical timestamp renders the {@code at} clause. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code calculate} command with function {@code "sum"} and key + * {@code "salary"} at timestamp 12345.
  • + *
  • Call {@code ccl()}.
  • + *
+ *

+ * Expected: The CCL string is + * {@code "calculate sum salary at 12345"}. + */ + @Test + public void testCalculateWithTimestamp() { + String ccl = Command.calculate("sum", "salary") + .at(Timestamp.fromMicros(12345)).ccl(); + Assert.assertEquals("calculate sum salary at 12345", ccl); + } + + /** + * Goal: Verify that the {@code from()} alias on + * {@code revert} produces the same CCL as {@code in()}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code revert} command for key {@code "name"} using + * {@code from(1)} instead of {@code in(1)}, then {@code to()} with + * timestamp 100.
  • + *
  • Call {@code ccl()}.
  • + *
+ *

+ * Expected: The CCL string is + * {@code "revert name in 1 to 100"}. + */ + @Test + public void testRevertFromRecordAlias() { + String ccl = Command.revert("name").from(1) + .to(Timestamp.fromMicros(100)).ccl(); + Assert.assertEquals("revert name in 1 to 100", ccl); + } + + /** + * Goal: Verify that the {@code within()} alias on + * {@code chronicle} produces the same CCL as {@code in()}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code chronicle} command for key {@code "name"} using + * {@code within(1)} instead of {@code in(1)}.
  • + *
  • Call {@code ccl()}.
  • + *
+ *

+ * Expected: The CCL string is + * {@code "chronicle name in 1"}. + */ + @Test + public void testChronicleWithinRecordAlias() { + String ccl = Command.chronicle("name").within(1).ccl(); + Assert.assertEquals("chronicle name in 1", ccl); + } + + /** + * Goal: Verify that the {@code within()} alias on + * {@code diff} produces the same CCL as {@code in()}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code diff} command for key {@code "name"} using + * {@code within(1)} instead of {@code in(1)}, then pin to timestamp + * 100.
  • + *
  • Call {@code ccl()}.
  • + *
+ *

+ * Expected: The CCL string is + * {@code "diff name in 1 at 100"}. + */ + @Test + public void testDiffKeyWithinRecordAlias() { + String ccl = Command.diff("name").within(1) + .at(Timestamp.fromMicros(100)).ccl(); + Assert.assertEquals("diff name in 1 at 100", ccl); + } + + /** + * Goal: Verify that the {@code within()} alias on + * {@code audit} produces the same CCL as {@code in()}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build an {@code audit} command for key {@code "name"} using + * {@code within(1)} instead of {@code in(1)}.
  • + *
  • Call {@code ccl()}.
  • + *
+ *

+ * Expected: The CCL string is {@code "audit name in 1"}. + */ + @Test + public void testAuditKeyWithinRecordAlias() { + String ccl = Command.audit("name").within(1).ccl(); + Assert.assertEquals("audit name in 1", ccl); + } + + /** + * Goal: Verify that the {@code within()} alias on + * {@code revert} produces the same CCL as {@code in()}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code revert} command for key {@code "name"} using + * {@code within(1)} instead of {@code in(1)}, then {@code to()} with + * timestamp 100.
  • + *
  • Call {@code ccl()}.
  • + *
+ *

+ * Expected: The CCL string is + * {@code "revert name in 1 to 100"}. + */ + @Test + public void testRevertWithinRecordAlias() { + String ccl = Command.revert("name").within(1) + .to(Timestamp.fromMicros(100)).ccl(); + Assert.assertEquals("revert name in 1 to 100", ccl); + } + + /** + * Goal: Verify that the {@code within()} alias on + * {@code revert} works for multiple records. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code revert} command for key {@code "name"} using + * {@code within(1, 2)} instead of {@code in(1, 2)}, then {@code to()} with + * timestamp 100.
  • + *
  • Call {@code ccl()}.
  • + *
+ *

+ * Expected: The CCL string is + * {@code "revert name in [1, 2] to 100"}. + */ + @Test + public void testRevertWithinMultipleRecordsAlias() { + String ccl = Command.revert("name").within(1, 2) + .to(Timestamp.fromMicros(100)).ccl(); + Assert.assertEquals("revert name in [1, 2] to 100", ccl); + } + + /** + * Goal: Verify that the {@code within()} alias on + * {@code reconcile} produces the same CCL as {@code in()}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code reconcile} command for key {@code "name"} using + * {@code within(1)} instead of {@code in(1)}, then {@code with()} + * values.
  • + *
  • Call {@code ccl()}.
  • + *
+ *

+ * Expected: The CCL string contains + * {@code "reconcile name in 1 with"}. + */ + @Test + public void testReconcileWithinRecordAlias() { + String ccl = Command.reconcile("name").within(1).with("jeff", "bob") + .ccl(); + Assert.assertTrue(ccl.contains("reconcile name in 1 with")); + } + + /** + * Goal: Verify that the {@code from()} alias on + * {@code calculate} produces the same CCL as {@code in()}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code calculate} command with function {@code "sum"} and key + * {@code "salary"} using {@code from(1)} instead of {@code in(1)}.
  • + *
  • Call {@code ccl()}.
  • + *
+ *

+ * Expected: The CCL string is + * {@code "calculate sum salary in 1"}. + */ + @Test + public void testCalculateFromRecordAlias() { + String ccl = Command.calculate("sum", "salary").from(1).ccl(); + Assert.assertEquals("calculate sum salary in 1", ccl); + } + + /** + * Goal: Verify that the {@code within()} alias on + * {@code calculate} produces the same CCL as {@code in()}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code calculate} command with function {@code "avg"} and key + * {@code "age"} using {@code within(1, 2)} instead of + * {@code in(1, 2)}.
  • + *
  • Call {@code ccl()}.
  • + *
+ *

+ * Expected: The CCL string is + * {@code "calculate avg age in [1, 2]"}. + */ + @Test + public void testCalculateWithinRecordsAlias() { + String ccl = Command.calculate("avg", "age").within(1, 2).ccl(); + Assert.assertEquals("calculate avg age in [1, 2]", ccl); + } + + /** + * Goal: Verify that a {@code calculate} command with a + * single record using the single-arg overload renders correctly. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code calculate} command with function {@code "sum"} and key + * {@code "salary"} in record {@code 1}.
  • + *
  • Call {@code ccl()}.
  • + *
+ *

+ * Expected: The CCL string is + * {@code "calculate sum salary in 1"}. + */ + @Test + public void testCalculateInSingleRecord() { + String ccl = Command.calculate("sum", "salary").in(1).ccl(); + Assert.assertEquals("calculate sum salary in 1", ccl); + } + +} diff --git a/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/WriteCommandTest.java b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/WriteCommandTest.java new file mode 100644 index 000000000..06db026d9 --- /dev/null +++ b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/WriteCommandTest.java @@ -0,0 +1,536 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.lang.command; + +import org.junit.Assert; +import org.junit.Test; + +/** + * Unit tests for write {@link Command Commands}: {@code add}, {@code set}, + * {@code remove}, {@code clear}, and {@code insert}. + * + * @author Jeff Nelson + */ +public class WriteCommandTest { + + /** + * Goal: Verify that an {@code add} command renders the + * correct CCL for a key and string value. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build an {@code add} command with key {@code "name"} and value + * {@code "jeff"}.
  • + *
  • Call {@code ccl()} on the resulting {@link Command}.
  • + *
+ *

+ * Expected: The CCL string is + * {@code "add name as \"jeff\""}. + */ + @Test + public void testAddKeyValue() { + String ccl = Command.add("name").as("jeff").ccl(); + Assert.assertEquals("add name as \"jeff\"", ccl); + } + + /** + * Goal: Verify that an {@code add} command renders the + * correct CCL for a key, string value, and single target record. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build an {@code add} command with key {@code "name"}, value + * {@code "jeff"}, and record {@code 1}.
  • + *
  • Call {@code ccl()} on the resulting {@link Command}.
  • + *
+ *

+ * Expected: The CCL string is + * {@code "add name as \"jeff\" in 1"}. + */ + @Test + public void testAddKeyValueInRecord() { + String ccl = Command.add("name").as("jeff").in(1).ccl(); + Assert.assertEquals("add name as \"jeff\" in 1", ccl); + } + + /** + * Goal: Verify that an {@code add} command renders the + * correct CCL for a key, string value, and multiple target records. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build an {@code add} command with key {@code "name"}, value + * {@code "jeff"}, and records {@code 1}, {@code 2}, {@code 3}.
  • + *
  • Call {@code ccl()} on the resulting {@link Command}.
  • + *
+ *

+ * Expected: The CCL string is + * {@code "add name as \"jeff\" in [1, 2, 3]"}. + */ + @Test + public void testAddKeyValueInMultipleRecords() { + String ccl = Command.add("name").as("jeff").in(1, 2, 3).ccl(); + Assert.assertEquals("add name as \"jeff\" in [1, 2, 3]", ccl); + } + + /** + * Goal: Verify that an {@code add} command renders a + * numeric value without quotes. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build an {@code add} command with key {@code "age"} and integer value + * {@code 30}.
  • + *
  • Call {@code ccl()} on the resulting {@link Command}.
  • + *
+ *

+ * Expected: The CCL string is {@code "add age as 30"}. + */ + @Test + public void testAddNumericValue() { + String ccl = Command.add("age").as(30).ccl(); + Assert.assertEquals("add age as 30", ccl); + } + + /** + * Goal: Verify that a {@code set} command renders the + * correct CCL for a key, value, and single target record. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code set} command with key {@code "name"}, value + * {@code "jeff"}, and record {@code 1}.
  • + *
  • Call {@code ccl()} on the resulting {@link Command}.
  • + *
+ *

+ * Expected: The CCL string is + * {@code "set name as \"jeff\" in 1"}. + */ + @Test + public void testSetKeyValueInRecord() { + String ccl = Command.set("name").as("jeff").in(1).ccl(); + Assert.assertEquals("set name as \"jeff\" in 1", ccl); + } + + /** + * Goal: Verify that a {@code set} command renders the + * correct CCL for a key, value, and multiple target records. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code set} command with key {@code "name"}, value + * {@code "jeff"}, and records {@code 1}, {@code 2}.
  • + *
  • Call {@code ccl()} on the resulting {@link Command}.
  • + *
+ *

+ * Expected: The CCL string is + * {@code "set name as \"jeff\" in [1, 2]"}. + */ + @Test + public void testSetKeyValueInMultipleRecords() { + String ccl = Command.set("name").as("jeff").in(1, 2).ccl(); + Assert.assertEquals("set name as \"jeff\" in [1, 2]", ccl); + } + + /** + * Goal: Verify that a {@code remove} command renders the + * correct CCL for a key, value, and single target record. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code remove} command with key {@code "name"}, value + * {@code "jeff"}, and record {@code 1}.
  • + *
  • Call {@code ccl()} on the resulting {@link Command}.
  • + *
+ *

+ * Expected: The CCL string is + * {@code "remove name as \"jeff\" from 1"}. + */ + @Test + public void testRemoveKeyValueFromRecord() { + String ccl = Command.remove("name").as("jeff").from(1).ccl(); + Assert.assertEquals("remove name as \"jeff\" from 1", ccl); + } + + /** + * Goal: Verify that a {@code clear} command renders the + * correct CCL for multiple keys and multiple records. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code clear} command with keys {@code "name"} and + * {@code "age"}, targeting records {@code 1} and {@code 2}.
  • + *
  • Call {@code ccl()} on the resulting {@link Command}.
  • + *
+ *

+ * Expected: The CCL string is + * {@code "clear [name, age] from [1, 2]"}. + */ + @Test + public void testClearKeysInRecords() { + String ccl = Command.clear("name", "age").from(1, 2).ccl(); + Assert.assertEquals("clear [name, age] from [1, 2]", ccl); + } + + /** + * Goal: Verify that a {@code clear} command renders the + * correct CCL for clearing entire records without specifying keys. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code clear} command targeting records {@code 1} and + * {@code 2} with no keys.
  • + *
  • Call {@code ccl()} on the resulting {@link Command}.
  • + *
+ *

+ * Expected: The CCL string is {@code "clear [1, 2]"}. + */ + @Test + public void testClearRecords() { + String ccl = Command.clear(1, 2).ccl(); + Assert.assertEquals("clear [1, 2]", ccl); + } + + /** + * Goal: Verify that a {@code clear} command renders the + * correct CCL for a single key in a single record, without brackets. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code clear} command with key {@code "name"} targeting + * record {@code 1}.
  • + *
  • Call {@code ccl()} on the resulting {@link Command}.
  • + *
+ *

+ * Expected: The CCL string is {@code "clear name from 1"}. + */ + @Test + public void testClearSingleKeyInSingleRecord() { + String ccl = Command.clear("name").from(1).ccl(); + Assert.assertEquals("clear name from 1", ccl); + } + + /** + * Goal: Verify that an {@code insert} command renders the + * correct CCL for a JSON string. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build an {@code insert} command with JSON + * {@code "{\"name\":\"jeff\"}"}.
  • + *
  • Call {@code ccl()} on the resulting {@link Command}.
  • + *
+ *

+ * Expected: The CCL string starts with {@code "insert"} + * and contains the JSON data wrapped in single quotes. + */ + @Test + public void testInsertJson() { + String json = "{\"name\":\"jeff\"}"; + String ccl = Command.insert(json).ccl(); + Assert.assertEquals("insert '" + json + "'", ccl); + } + + /** + * Goal: Verify that an {@code insert} command renders the + * correct CCL for a JSON string targeted at a specific record. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build an {@code insert} command with JSON + * {@code "{\"name\":\"jeff\"}"} targeting record {@code 1}.
  • + *
  • Call {@code ccl()} on the resulting {@link Command}.
  • + *
+ *

+ * Expected: The CCL string contains {@code "insert"}, the + * JSON data, and {@code "in 1"}. + */ + @Test + public void testInsertJsonInRecord() { + String json = "{\"name\":\"jeff\"}"; + String ccl = Command.insert(json).in(1).ccl(); + Assert.assertEquals("insert '" + json + "' in 1", ccl); + } + + /** + * Goal: Verify that the {@code in()} alias on + * {@code remove} produces the same CCL as {@code from()}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code remove} command with key {@code "name"}, value + * {@code "jeff"}, and record {@code 1} using {@code in()} instead of + * {@code from()}.
  • + *
  • Call {@code ccl()} on the resulting {@link Command}.
  • + *
+ *

+ * Expected: The CCL string is + * {@code "remove name as \"jeff\" from 1"}. + */ + @Test + public void testRemoveKeyValueInRecordAlias() { + String ccl = Command.remove("name").as("jeff").in(1).ccl(); + Assert.assertEquals("remove name as \"jeff\" from 1", ccl); + } + + /** + * Goal: Verify that the {@code in()} alias on + * {@code clear} produces the same CCL as {@code from()}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code clear} command with key {@code "name"} using + * {@code in(1)} instead of {@code from(1)}.
  • + *
  • Call {@code ccl()} on the resulting {@link Command}.
  • + *
+ *

+ * Expected: The CCL string is {@code "clear name from 1"}. + */ + @Test + public void testClearKeyInRecordAlias() { + String ccl = Command.clear("name").in(1).ccl(); + Assert.assertEquals("clear name from 1", ccl); + } + + /** + * Goal: Verify that the {@code to()} alias on {@code add} + * produces the same CCL as {@code in()}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build an {@code add} command with key {@code "name"}, value + * {@code "jeff"}, using {@code to(1)} instead of {@code in(1)}.
  • + *
  • Call {@code ccl()} on the resulting {@link Command}.
  • + *
+ *

+ * Expected: The CCL string is + * {@code "add name as \"jeff\" in 1"}. + */ + @Test + public void testAddKeyValueToRecordAlias() { + String ccl = Command.add("name").as("jeff").to(1).ccl(); + Assert.assertEquals("add name as \"jeff\" in 1", ccl); + } + + /** + * Goal: Verify that the {@code within()} alias on + * {@code add} produces the same CCL as {@code in()}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build an {@code add} command with key {@code "name"}, value + * {@code "jeff"}, using {@code within(1)} instead of {@code in(1)}.
  • + *
  • Call {@code ccl()} on the resulting {@link Command}.
  • + *
+ *

+ * Expected: The CCL string is + * {@code "add name as \"jeff\" in 1"}. + */ + @Test + public void testAddKeyValueWithinRecordAlias() { + String ccl = Command.add("name").as("jeff").within(1).ccl(); + Assert.assertEquals("add name as \"jeff\" in 1", ccl); + } + + /** + * Goal: Verify that the {@code within()} alias on + * {@code set} produces the same CCL as {@code in()}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code set} command with key {@code "name"}, value + * {@code "jeff"}, using {@code within(1)} instead of {@code in(1)}.
  • + *
  • Call {@code ccl()} on the resulting {@link Command}.
  • + *
+ *

+ * Expected: The CCL string is + * {@code "set name as \"jeff\" in 1"}. + */ + @Test + public void testSetKeyValueWithinRecordAlias() { + String ccl = Command.set("name").as("jeff").within(1).ccl(); + Assert.assertEquals("set name as \"jeff\" in 1", ccl); + } + + /** + * Goal: Verify that the {@code into()} alias on + * {@code insert} produces the same CCL as {@code in()}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build an {@code insert} command with JSON + * {@code "{\"name\":\"jeff\"}"} using {@code into(1)} instead of + * {@code in(1)}.
  • + *
  • Call {@code ccl()} on the resulting {@link Command}.
  • + *
+ *

+ * Expected: The CCL string contains {@code "in 1"}. + */ + @Test + public void testInsertJsonIntoRecordAlias() { + String json = "{\"name\":\"jeff\"}"; + String ccl = Command.insert(json).into(1).ccl(); + Assert.assertEquals("insert '" + json + "' in 1", ccl); + } + + /** + * Goal: Verify that the {@code to()} alias on + * {@code insert} produces the same CCL as {@code in()}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build an {@code insert} command with JSON + * {@code "{\"name\":\"jeff\"}"} using {@code to(1)} instead of + * {@code in(1)}.
  • + *
  • Call {@code ccl()} on the resulting {@link Command}.
  • + *
+ *

+ * Expected: The CCL string contains {@code "in 1"}. + */ + @Test + public void testInsertJsonToRecordAlias() { + String json = "{\"name\":\"jeff\"}"; + String ccl = Command.insert(json).to(1).ccl(); + Assert.assertEquals("insert '" + json + "' in 1", ccl); + } + + /** + * Goal: Verify that the {@code within()} alias on + * {@code insert} produces the same CCL as {@code in()}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build an {@code insert} command with JSON + * {@code "{\"name\":\"jeff\"}"} using {@code within(1)} instead of + * {@code in(1)}.
  • + *
  • Call {@code ccl()} on the resulting {@link Command}.
  • + *
+ *

+ * Expected: The CCL string contains {@code "in 1"}. + */ + @Test + public void testInsertJsonWithinRecordAlias() { + String json = "{\"name\":\"jeff\"}"; + String ccl = Command.insert(json).within(1).ccl(); + Assert.assertEquals("insert '" + json + "' in 1", ccl); + } + + /** + * Goal: Verify that the {@code within()} alias on + * {@code remove} produces the same CCL as {@code from()}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code remove} command with key {@code "name"}, value + * {@code "jeff"}, using {@code within(1)} instead of {@code from(1)}.
  • + *
  • Call {@code ccl()} on the resulting {@link Command}.
  • + *
+ *

+ * Expected: The CCL string is + * {@code "remove name as \"jeff\" from 1"}. + */ + @Test + public void testRemoveKeyValueWithinRecordAlias() { + String ccl = Command.remove("name").as("jeff").within(1).ccl(); + Assert.assertEquals("remove name as \"jeff\" from 1", ccl); + } + + /** + * Goal: Verify that the {@code within()} alias on + * {@code clear} produces the same CCL as {@code from()}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code clear} command with key {@code "name"} using + * {@code within(1)} instead of {@code from(1)}.
  • + *
  • Call {@code ccl()} on the resulting {@link Command}.
  • + *
+ *

+ * Expected: The CCL string is {@code "clear name from 1"}. + */ + @Test + public void testClearKeyWithinRecordAlias() { + String ccl = Command.clear("name").within(1).ccl(); + Assert.assertEquals("clear name from 1", ccl); + } + + /** + * Goal: Verify that an {@code add} command with a string + * value containing double quotes properly escapes them. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build an {@code add} command with key {@code "title"} and value + * {@code "say \"hello\""}.
  • + *
  • Call {@code ccl()} on the resulting {@link Command}.
  • + *
+ *

+ * Expected: The CCL string contains the escaped double + * quotes. + */ + @Test + public void testAddValueWithQuotes() { + String ccl = Command.add("title").as("say \"hello\"").ccl(); + Assert.assertEquals("add title as \"say \\\"hello\\\"\"", ccl); + } + +} From d06d7b7f6a3fe68c6bc199d45b4623370f5050dd Mon Sep 17 00:00:00 2001 From: Jeff Nelson Date: Sat, 14 Mar 2026 17:36:31 -0400 Subject: [PATCH 02/13] second round of refinements --- .../concourse/lang/ConcourseCompiler.java | 17 +- .../lang/command/ConsolidateCommand.java | 14 +- .../concourse/lang/command/RevertCommand.java | 4 +- .../concourse/lang/command/SearchCommand.java | 6 +- .../concourse/lang/command/SelectCommand.java | 7 +- .../lang/command/CommandCompilationTest.java | 1206 +++++++++++++++++ .../lang/command/InspectionCommandTest.java | 5 +- .../lang/command/QueryCommandTest.java | 12 +- .../lang/command/TemporalCommandTest.java | 20 +- 9 files changed, 1254 insertions(+), 37 deletions(-) create mode 100644 concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/CommandCompilationTest.java diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/ConcourseCompiler.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/ConcourseCompiler.java index 6698ab76f..102468e9a 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/ConcourseCompiler.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/ConcourseCompiler.java @@ -60,6 +60,12 @@ private ConcourseCompiler() { Convert::stringToOperator); } + @Override + public List compile(String ccl, + Multimap data) { + return delegate.compile(ccl, data); + } + /** * Return {@code true} if the {@code data} is described by the condition * encapsulated in the {@code tree}. @@ -96,17 +102,6 @@ public final AbstractSyntaxTree parse(Criteria criteria, return parse(criteria.ccl(), data); } - @Override - public AbstractSyntaxTree parse(String ccl, Multimap data) { - return delegate.parse(ccl, data); - } - - @Override - public List compile(String ccl, - Multimap data) { - return delegate.compile(ccl, data); - } - /** * {@link #parse(String) Parse} the {@code criteria}. * diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/ConsolidateCommand.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/ConsolidateCommand.java index 507cb2fd0..115b59e08 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/ConsolidateCommand.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/ConsolidateCommand.java @@ -29,7 +29,8 @@ *

* *
- * consolidate <records>
+ * consolidate <first> <second>
+ * consolidate <first> [<remaining>]
  * 
* * @author Jeff Nelson @@ -76,7 +77,16 @@ public List records() { @Override public String ccl() { StringBuilder sb = new StringBuilder("consolidate "); - sb.append(CclRenderer.records(records)); + sb.append(records.get(0)); + if(records.size() == 2) { + sb.append(" "); + sb.append(records.get(1)); + } + else { + sb.append(" "); + sb.append(CclRenderer + .records(records.subList(1, records.size()))); + } return sb.toString(); } diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/RevertCommand.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/RevertCommand.java index 5e6ed5189..71c49385e 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/RevertCommand.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/RevertCommand.java @@ -28,7 +28,7 @@ *

* *
- * revert <keys> in <records> to <timestamp>
+ * revert <keys> in <records> at <timestamp>
  * 
* * @author Jeff Nelson @@ -230,7 +230,7 @@ public String ccl() { sb.append(CclRenderer.keys(keys)); sb.append(" in "); sb.append(CclRenderer.records(records)); - sb.append(" to "); + sb.append(" at "); sb.append(timestamp.getMicros()); return sb.toString(); } diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/SearchCommand.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/SearchCommand.java index 354f30b47..c9385e283 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/SearchCommand.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/SearchCommand.java @@ -23,7 +23,7 @@ *

* *
- * search <key> <query>
+ * search <key> for <query>
  * 
* * @author Jeff Nelson @@ -110,8 +110,8 @@ public String query() { public String ccl() { StringBuilder sb = new StringBuilder("search "); sb.append(key); - sb.append(" "); - sb.append(query); + sb.append(" for "); + sb.append(CclRenderer.value(query)); return sb.toString(); } diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/SelectCommand.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/SelectCommand.java index e8367223e..0b2cb5e99 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/SelectCommand.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/SelectCommand.java @@ -419,7 +419,12 @@ public String ccl() { sb.append(CclRenderer.keys(keys)); } if(records != null) { - sb.append(" from "); + if(keys != null) { + sb.append(" from "); + } + else { + sb.append(" "); + } sb.append(CclRenderer.records(records)); } else { diff --git a/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/CommandCompilationTest.java b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/CommandCompilationTest.java new file mode 100644 index 000000000..13c7c1ac4 --- /dev/null +++ b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/CommandCompilationTest.java @@ -0,0 +1,1206 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.lang.command; + +import java.util.List; + +import org.junit.Assert; +import org.junit.Test; + +import com.cinchapi.ccl.grammar.command.CommandSymbol; +import com.cinchapi.ccl.syntax.AbstractSyntaxTree; +import com.cinchapi.ccl.syntax.CommandTree; +import com.cinchapi.concourse.Timestamp; +import com.cinchapi.concourse.lang.ConcourseCompiler; +import com.cinchapi.concourse.lang.paginate.Page; +import com.cinchapi.concourse.lang.sort.Order; + +/** + * Verify that every {@link Command} builder produces CCL output that can be + * compiled by the {@link ConcourseCompiler} and resolves to the expected + * {@link CommandTree} type. + * + * @author Jeff Nelson + */ +public class CommandCompilationTest { + + // ========== Query Commands ========== + + /** + * Goal: Verify that a {@code find} command compiles to a + * {@code FIND} {@link CommandTree}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code find} command with condition {@code "age > 30"}.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code FIND}. + */ + @Test + public void testFindCompiles() { + assertCompiles(Command.find("age > 30").ccl(), "FIND"); + } + + /** + * Goal: Verify that a {@code find} command with a + * {@link Timestamp} compiles to a {@code FIND} {@link CommandTree}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code find} command with condition {@code "age > 30"} at + * timestamp 12345.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code FIND}. + */ + @Test + public void testFindWithTimestampCompiles() { + assertCompiles( + Command.find("age > 30").at(Timestamp.fromMicros(12345)).ccl(), + "FIND"); + } + + /** + * Goal: Verify that a {@code find} command with + * {@link Order} and {@link Page} compiles to a {@code FIND} + * {@link CommandTree}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code find} command with condition, order, and page.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code FIND}. + */ + @Test + public void testFindWithOrderAndPageCompiles() { + assertCompiles(Command.find("age > 30").order(Order.by("name").build()) + .page(Page.sized(10)).ccl(), "FIND"); + } + + /** + * Goal: Verify that a {@code select} command for all keys + * from a single record compiles to a {@code SELECT} {@link CommandTree}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code selectAll} command from record {@code 1}.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code SELECT}. + */ + @Test + public void testSelectAllFromRecordCompiles() { + assertCompiles(Command.selectAll().from(1).ccl(), "SELECT"); + } + + /** + * Goal: Verify that a {@code select} command with keys + * from records compiles to a {@code SELECT} {@link CommandTree}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code select} command for key {@code "name"} from record + * {@code 1}.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code SELECT}. + */ + @Test + public void testSelectFromRecordCompiles() { + assertCompiles(Command.select("name").from(1).ccl(), "SELECT"); + } + + /** + * Goal: Verify that a {@code select} command with multiple + * keys from multiple records compiles. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code select} command for keys {@code "name"} and + * {@code "age"} from records {@code 1}, {@code 2}, {@code 3}.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code SELECT}. + */ + @Test + public void testSelectMultipleKeysFromRecordsCompiles() { + assertCompiles(Command.select("name", "age").from(1, 2, 3).ccl(), + "SELECT"); + } + + /** + * Goal: Verify that a {@code select} command with a + * {@code where} clause compiles. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code select} command for key {@code "name"} where + * {@code "status = active"}.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code SELECT}. + */ + @Test + public void testSelectWhereCompiles() { + assertCompiles(Command.select("name").where("status = active").ccl(), + "SELECT"); + } + + /** + * Goal: Verify that a {@code get} command from a record + * compiles to a {@code GET} {@link CommandTree}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code get} command for key {@code "name"} from record + * {@code 1}.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code GET}. + */ + @Test + public void testGetFromRecordCompiles() { + assertCompiles(Command.get("name").from(1).ccl(), "GET"); + } + + /** + * Goal: Verify that a {@code get} command with a single + * key and a {@code where} clause compiles to a {@code GET} + * {@link CommandTree}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code get} command for key {@code "name"} where + * {@code "status = active"}.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code GET}. + */ + @Test + public void testGetWhereCompiles() { + assertCompiles(Command.get("name").where("status = active").ccl(), + "GET"); + } + + /** + * Goal: Verify that a {@code navigate} command from a + * record compiles to a {@code NAVIGATE} {@link CommandTree}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code navigate} command for key {@code "friends.name"} from + * record {@code 1}.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code NAVIGATE}. + */ + @Test + public void testNavigateFromRecordCompiles() { + assertCompiles(Command.navigate("friends.name").from(1).ccl(), + "NAVIGATE"); + } + + /** + * Goal: Verify that a {@code navigate} command with a + * {@code where} clause compiles. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code navigate} command for key {@code "friends.name"} where + * {@code "active = true"}.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code NAVIGATE}. + */ + @Test + public void testNavigateWhereCompiles() { + assertCompiles( + Command.navigate("friends.name").where("active = true").ccl(), + "NAVIGATE"); + } + + // ========== Write Commands ========== + + /** + * Goal: Verify that an {@code add} command without a + * target record compiles to an {@code ADD} {@link CommandTree}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build an {@code add} command for key {@code "name"} with value + * {@code "jeff"}.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code ADD}. + */ + @Test + public void testAddCompiles() { + assertCompiles(Command.add("name").as("jeff").ccl(), "ADD"); + } + + /** + * Goal: Verify that an {@code add} command with a target + * record compiles. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build an {@code add} command for key {@code "name"}, value + * {@code "jeff"}, in record {@code 1}.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code ADD}. + */ + @Test + public void testAddInRecordCompiles() { + assertCompiles(Command.add("name").as("jeff").in(1).ccl(), "ADD"); + } + + /** + * Goal: Verify that an {@code add} command with a numeric + * value compiles. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build an {@code add} command for key {@code "age"} with value + * {@code 30}.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code ADD}. + */ + @Test + public void testAddNumericValueCompiles() { + assertCompiles(Command.add("age").as(30).ccl(), "ADD"); + } + + /** + * Goal: Verify that a {@code set} command compiles to a + * {@code SET} {@link CommandTree}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code set} command for key {@code "name"}, value + * {@code "jeff"}, in record {@code 1}.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code SET}. + */ + @Test + public void testSetCompiles() { + assertCompiles(Command.set("name").as("jeff").in(1).ccl(), "SET"); + } + + /** + * Goal: Verify that a {@code remove} command compiles to a + * {@code REMOVE} {@link CommandTree}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code remove} command for key {@code "name"}, value + * {@code "jeff"}, from record {@code 1}.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code REMOVE}. + */ + @Test + public void testRemoveCompiles() { + assertCompiles(Command.remove("name").as("jeff").from(1).ccl(), + "REMOVE"); + } + + /** + * Goal: Verify that a {@code clear} command with keys and + * records compiles to a {@code CLEAR} {@link CommandTree}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code clear} command for key {@code "name"} from record + * {@code 1}.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code CLEAR}. + */ + @Test + public void testClearKeyFromRecordCompiles() { + assertCompiles(Command.clear("name").from(1).ccl(), "CLEAR"); + } + + /** + * Goal: Verify that a record-only {@code clear} command + * compiles. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code clear} command for record {@code 1}.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code CLEAR}. + */ + @Test + public void testClearRecordsCompiles() { + assertCompiles(Command.clear(1).ccl(), "CLEAR"); + } + + /** + * Goal: Verify that an {@code insert} command compiles to + * an {@code INSERT} {@link CommandTree}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build an {@code insert} command with JSON + * {@code "{\"name\":\"jeff\"}"}.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code INSERT}. + */ + @Test + public void testInsertCompiles() { + assertCompiles(Command.insert("{\"name\":\"jeff\"}").ccl(), "INSERT"); + } + + /** + * Goal: Verify that an {@code insert} command with a + * target record compiles. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build an {@code insert} command with JSON targeting record + * {@code 1}.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code INSERT}. + */ + @Test + public void testInsertInRecordCompiles() { + assertCompiles(Command.insert("{\"name\":\"jeff\"}").in(1).ccl(), + "INSERT"); + } + + // ========== Link Commands ========== + + /** + * Goal: Verify that a {@code link} command compiles to a + * {@code LINK} {@link CommandTree}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code link} command for key {@code "friends"} from record + * {@code 1} to record {@code 2}.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code LINK}. + */ + @Test + public void testLinkCompiles() { + assertCompiles(Command.link("friends").from(1).to(2).ccl(), "LINK"); + } + + /** + * Goal: Verify that an {@code unlink} command compiles to + * an {@code UNLINK} {@link CommandTree}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build an {@code unlink} command for key {@code "friends"} from record + * {@code 1} to record {@code 2}.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code UNLINK}. + */ + @Test + public void testUnlinkCompiles() { + assertCompiles(Command.unlink("friends").from(1).to(2).ccl(), "UNLINK"); + } + + // ========== Verify Commands ========== + + /** + * Goal: Verify that a {@code verify} command compiles to a + * {@code VERIFY} {@link CommandTree}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code verify} command for key {@code "name"}, value + * {@code "jeff"}, in record {@code 1}.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code VERIFY}. + */ + @Test + public void testVerifyCompiles() { + assertCompiles(Command.verify("name").as("jeff").in(1).ccl(), "VERIFY"); + } + + /** + * Goal: Verify that a {@code verify} command with a + * {@link Timestamp} compiles. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code verify} command for key {@code "name"}, value + * {@code "jeff"}, in record {@code 1} at timestamp 12345.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code VERIFY}. + */ + @Test + public void testVerifyWithTimestampCompiles() { + assertCompiles(Command.verify("name").as("jeff").in(1) + .at(Timestamp.fromMicros(12345)).ccl(), "VERIFY"); + } + + /** + * Goal: Verify that a {@code verifyAndSwap} command + * compiles to a {@code VERIFY_AND_SWAP} {@link CommandTree}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code verifyAndSwap} command for key {@code "name"}, + * expected value {@code "jeff"}, in record {@code 1}, with replacement + * {@code "bob"}.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code VERIFY_AND_SWAP}. + */ + @Test + public void testVerifyAndSwapCompiles() { + assertCompiles(Command.verifyAndSwap("name").as("jeff").in(1) + .with("bob").ccl(), "VERIFY_AND_SWAP"); + } + + /** + * Goal: Verify that a {@code verifyOrSet} command compiles + * to a {@code VERIFY_OR_SET} {@link CommandTree}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code verifyOrSet} command for key {@code "name"}, value + * {@code "jeff"}, in record {@code 1}.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code VERIFY_OR_SET}. + */ + @Test + public void testVerifyOrSetCompiles() { + assertCompiles(Command.verifyOrSet("name").as("jeff").in(1).ccl(), + "VERIFY_OR_SET"); + } + + /** + * Goal: Verify that a {@code findOrAdd} command compiles + * to a {@code FIND_OR_ADD} {@link CommandTree}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code findOrAdd} command for key {@code "name"} with value + * {@code "jeff"}.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code FIND_OR_ADD}. + */ + @Test + public void testFindOrAddCompiles() { + assertCompiles(Command.findOrAdd("name").as("jeff").ccl(), + "FIND_OR_ADD"); + } + + /** + * Goal: Verify that a {@code findOrInsert} command + * compiles to a {@code FIND_OR_INSERT} {@link CommandTree}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code findOrInsert} command with condition + * {@code "name = jeff"} and JSON {@code "{\"name\":\"jeff\"}"}.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code FIND_OR_INSERT}. + */ + @Test + public void testFindOrInsertCompiles() { + assertCompiles(Command.findOrInsert("name = jeff") + .json("{\"name\":\"jeff\"}").ccl(), "FIND_OR_INSERT"); + } + + // ========== Inspection Commands ========== + + /** + * Goal: Verify that a {@code browse} command compiles to a + * {@code BROWSE} {@link CommandTree}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code browse} command for key {@code "name"}.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code BROWSE}. + */ + @Test + public void testBrowseCompiles() { + assertCompiles(Command.browse("name").ccl(), "BROWSE"); + } + + /** + * Goal: Verify that a {@code browse} command with a + * {@link Timestamp} compiles. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code browse} command for key {@code "name"} at timestamp + * 12345.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code BROWSE}. + */ + @Test + public void testBrowseWithTimestampCompiles() { + assertCompiles( + Command.browse("name").at(Timestamp.fromMicros(12345)).ccl(), + "BROWSE"); + } + + /** + * Goal: Verify that a {@code search} command compiles to a + * {@code SEARCH} {@link CommandTree}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code search} command for key {@code "name"} with query + * {@code "jeff"}.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code SEARCH}. + */ + @Test + public void testSearchCompiles() { + assertCompiles(Command.search("name").forQuery("jeff").ccl(), "SEARCH"); + } + + /** + * Goal: Verify that a {@code describe} command for a + * single record compiles to a {@code DESCRIBE} {@link CommandTree}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code describe} command for record {@code 1}.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code DESCRIBE}. + */ + @Test + public void testDescribeCompiles() { + assertCompiles(Command.describe(1).ccl(), "DESCRIBE"); + } + + /** + * Goal: Verify that a bare {@code describe} command + * compiles to a {@code DESCRIBE} {@link CommandTree}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code describeAll} command.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code DESCRIBE}. + */ + @Test + public void testDescribeAllCompiles() { + assertCompiles(Command.describeAll().ccl(), "DESCRIBE"); + } + + /** + * Goal: Verify that a {@code trace} command compiles to a + * {@code TRACE} {@link CommandTree}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code trace} command for record {@code 1}.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code TRACE}. + */ + @Test + public void testTraceCompiles() { + assertCompiles(Command.trace(1).ccl(), "TRACE"); + } + + /** + * Goal: Verify that a {@code holds} command compiles to a + * {@code HOLDS} {@link CommandTree}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code holds} command for records {@code 1} and + * {@code 2}.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code HOLDS}. + */ + @Test + public void testHoldsCompiles() { + assertCompiles(Command.holds(1, 2).ccl(), "HOLDS"); + } + + /** + * Goal: Verify that a {@code jsonify} command compiles to + * a {@code JSONIFY} {@link CommandTree}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code jsonify} command for record {@code 1}.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code JSONIFY}. + */ + @Test + public void testJsonifyCompiles() { + assertCompiles(Command.jsonify(1).ccl(), "JSONIFY"); + } + + // ========== Utility Commands ========== + + /** + * Goal: Verify that the {@code ping} command compiles to a + * {@code PING} {@link CommandTree}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code ping} command.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code PING}. + */ + @Test + public void testPingCompiles() { + assertCompiles(Command.ping().ccl(), "PING"); + } + + /** + * Goal: Verify that the {@code stage} command compiles to + * a {@code STAGE} {@link CommandTree}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code stage} command.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code STAGE}. + */ + @Test + public void testStageCompiles() { + assertCompiles(Command.stage().ccl(), "STAGE"); + } + + /** + * Goal: Verify that the {@code commit} command compiles to + * a {@code COMMIT} {@link CommandTree}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code commit} command.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code COMMIT}. + */ + @Test + public void testCommitCompiles() { + assertCompiles(Command.commit().ccl(), "COMMIT"); + } + + /** + * Goal: Verify that the {@code abort} command compiles to + * an {@code ABORT} {@link CommandTree}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build an {@code abort} command.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code ABORT}. + */ + @Test + public void testAbortCompiles() { + assertCompiles(Command.abort().ccl(), "ABORT"); + } + + /** + * Goal: Verify that the {@code inventory} command compiles + * to an {@code INVENTORY} {@link CommandTree}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build an {@code inventory} command.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code INVENTORY}. + */ + @Test + public void testInventoryCompiles() { + assertCompiles(Command.inventory().ccl(), "INVENTORY"); + } + + // ========== Temporal Commands ========== + + /** + * Goal: Verify that a {@code chronicle} command compiles + * to a {@code CHRONICLE} {@link CommandTree}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code chronicle} command for key {@code "name"} in record + * {@code 1}.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code CHRONICLE}. + */ + @Test + public void testChronicleCompiles() { + assertCompiles(Command.chronicle("name").in(1).ccl(), "CHRONICLE"); + } + + /** + * Goal: Verify that a {@code chronicle} command with a + * start and end timestamp compiles. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code chronicle} command for key {@code "name"} in record + * {@code 1} with start timestamp 100 and end timestamp 200.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code CHRONICLE}. + */ + @Test + public void testChronicleWithRangeCompiles() { + assertCompiles( + Command.chronicle("name").in(1).at(Timestamp.fromMicros(100)) + .at(Timestamp.fromMicros(200)).ccl(), + "CHRONICLE"); + } + + /** + * Goal: Verify that a record-scoped {@code diff} command + * compiles to a {@code DIFF} {@link CommandTree}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code diff} command for record {@code 1} at timestamp + * 100.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code DIFF}. + */ + @Test + public void testDiffRecordCompiles() { + assertCompiles(Command.diff(1L).at(Timestamp.fromMicros(100)).ccl(), + "DIFF"); + } + + /** + * Goal: Verify that a key-scoped {@code diff} command + * compiles. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code diff} command for key {@code "name"} in record + * {@code 1} at timestamp 100.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code DIFF}. + */ + @Test + public void testDiffKeyInRecordCompiles() { + assertCompiles( + Command.diff("name").in(1).at(Timestamp.fromMicros(100)).ccl(), + "DIFF"); + } + + /** + * Goal: Verify that a record-scoped {@code audit} command + * compiles to an {@code AUDIT} {@link CommandTree}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build an {@code audit} command for record {@code 1}.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code AUDIT}. + */ + @Test + public void testAuditRecordCompiles() { + assertCompiles(Command.audit(1L).ccl(), "AUDIT"); + } + + /** + * Goal: Verify that a key-scoped {@code audit} command + * compiles. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build an {@code audit} command for key {@code "name"} in record + * {@code 1}.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code AUDIT}. + */ + @Test + public void testAuditKeyInRecordCompiles() { + assertCompiles(Command.audit("name").in(1).ccl(), "AUDIT"); + } + + /** + * Goal: Verify that a {@code reconcile} command compiles + * to a {@code RECONCILE} {@link CommandTree}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code reconcile} command for key {@code "name"} in record + * {@code 1} with values {@code "jeff"} and {@code "bob"}.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code RECONCILE}. + */ + @Test + public void testReconcileCompiles() { + assertCompiles( + Command.reconcile("name").in(1).with("jeff", "bob").ccl(), + "RECONCILE"); + } + + /** + * Goal: Verify that a {@code revert} command compiles to a + * {@code REVERT} {@link CommandTree}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code revert} command for key {@code "name"} in record + * {@code 1} to timestamp 100.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code REVERT}. + */ + @Test + public void testRevertCompiles() { + assertCompiles(Command.revert("name").in(1) + .to(Timestamp.fromMicros(100)).ccl(), "REVERT"); + } + + /** + * Goal: Verify that a {@code consolidate} command compiles + * to a {@code CONSOLIDATE} {@link CommandTree}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code consolidate} command for records {@code 1}, {@code 2}, + * and {@code 3}.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code CONSOLIDATE}. + */ + @Test + public void testConsolidateCompiles() { + assertCompiles(Command.consolidate(1, 2, 3).ccl(), "CONSOLIDATE"); + } + + /** + * Goal: Verify that a {@code calculate} command compiles + * to a {@code CALCULATE} {@link CommandTree}. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code calculate} command for function {@code "sum"} and key + * {@code "salary"}.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code CALCULATE}. + */ + @Test + public void testCalculateCompiles() { + assertCompiles(Command.calculate("sum", "salary").ccl(), "CALCULATE"); + } + + /** + * Goal: Verify that a {@code calculate} command with a + * {@code where} clause compiles. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code calculate} command for function {@code "count"} and + * key {@code "status"} where {@code "active = true"}.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code CALCULATE}. + */ + @Test + public void testCalculateWhereCompiles() { + assertCompiles(Command.calculate("count", "status") + .where("active = true").ccl(), "CALCULATE"); + } + + /** + * Goal: Verify that a {@code calculate} command scoped to + * records compiles. + *

+ * Start state: No prior state needed. + *

+ * Workflow: + *

    + *
  • Build a {@code calculate} command for function {@code "avg"} and key + * {@code "age"} in records {@code 1} and {@code 2}.
  • + *
  • Compile the CCL output.
  • + *
+ *

+ * Expected: The compiled tree is a {@link CommandTree} of + * type {@code CALCULATE}. + */ + @Test + public void testCalculateInRecordsCompiles() { + assertCompiles(Command.calculate("avg", "age").in(1, 2).ccl(), + "CALCULATE"); + } + + // ========== Helper ========== + + /** + * Compile the given CCL string using the {@link ConcourseCompiler} and + * assert that it produces a {@link CommandTree} with the expected command + * type. + * + * @param ccl the CCL string to compile + * @param expectedType the expected command type (e.g., {@code "FIND"}, + * {@code "SELECT"}) + */ + private static void assertCompiles(String ccl, String expectedType) { + List trees = ConcourseCompiler.get().compile(ccl); + Assert.assertFalse("CCL should compile to at least one tree: " + ccl, + trees.isEmpty()); + Assert.assertTrue("CCL should compile to a CommandTree: " + ccl, + trees.get(0) instanceof CommandTree); + CommandTree tree = (CommandTree) trees.get(0); + Assert.assertEquals("Command type mismatch for: " + ccl, expectedType, + ((CommandSymbol) tree.root()).type()); + } + +} diff --git a/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/InspectionCommandTest.java b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/InspectionCommandTest.java index d6be20c64..cf1bbee0a 100644 --- a/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/InspectionCommandTest.java +++ b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/InspectionCommandTest.java @@ -42,12 +42,13 @@ public class InspectionCommandTest { *

  • Call {@code ccl()}.
  • * *

    - * Expected: The CCL string is {@code "search name jeff"}. + * Expected: The CCL string is + * {@code "search name for \"jeff\""}. */ @Test public void testSearch() { String ccl = Command.search("name").forQuery("jeff").ccl(); - Assert.assertEquals("search name jeff", ccl); + Assert.assertEquals("search name for \"jeff\"", ccl); } /** diff --git a/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/QueryCommandTest.java b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/QueryCommandTest.java index c5bfbe0b6..3836db5a8 100644 --- a/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/QueryCommandTest.java +++ b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/QueryCommandTest.java @@ -132,12 +132,12 @@ public void testSelectKeysFromRecords() { *

  • Call {@code ccl()} on the resulting command.
  • * *

    - * Expected: The CCL output is {@code "select from 1"}. + * Expected: The CCL output is {@code "select 1"}. */ @Test public void testSelectAllKeysFromRecord() { String ccl = Command.selectAll().from(1).ccl(); - Assert.assertEquals("select from 1", ccl); + Assert.assertEquals("select 1", ccl); } /** @@ -350,12 +350,12 @@ public void testSelectKeyInRecordAlias() { *

  • Call {@code ccl()} on the resulting command.
  • * *

    - * Expected: The CCL output is {@code "select from 1"}. + * Expected: The CCL output is {@code "select 1"}. */ @Test public void testSelectAllInRecordAlias() { String ccl = Command.selectAll().in(1).ccl(); - Assert.assertEquals("select from 1", ccl); + Assert.assertEquals("select 1", ccl); } /** @@ -457,12 +457,12 @@ public void testSelectKeyWithinRecordAlias() { *

  • Call {@code ccl()} on the resulting command.
  • * *

    - * Expected: The CCL output is {@code "select from 1"}. + * Expected: The CCL output is {@code "select 1"}. */ @Test public void testSelectAllWithinRecordAlias() { String ccl = Command.selectAll().within(1).ccl(); - Assert.assertEquals("select from 1", ccl); + Assert.assertEquals("select 1", ccl); } /** diff --git a/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/TemporalCommandTest.java b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/TemporalCommandTest.java index 901ba4642..753f68c83 100644 --- a/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/TemporalCommandTest.java +++ b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/TemporalCommandTest.java @@ -261,13 +261,13 @@ public void testAuditKeyInRecord() { * *

    * Expected: The CCL string contains {@code "revert"}, both - * keys, both records, and {@code "to 100"}. + * keys, both records, and {@code "at 100"}. */ @Test public void testRevert() { String ccl = Command.revert("name", "age").in(1, 2) .to(Timestamp.fromMicros(100)).ccl(); - Assert.assertEquals("revert [name, age] in [1, 2] to 100", ccl); + Assert.assertEquals("revert [name, age] in [1, 2] at 100", ccl); } /** @@ -306,12 +306,12 @@ public void testReconcile() { * *

    * Expected: The CCL string is - * {@code "consolidate [1, 2, 3]"}. + * {@code "consolidate 1 [2, 3]"}. */ @Test public void testConsolidate() { String ccl = Command.consolidate(1, 2, 3).ccl(); - Assert.assertEquals("consolidate [1, 2, 3]", ccl); + Assert.assertEquals("consolidate 1 [2, 3]", ccl); } /** @@ -419,13 +419,13 @@ public void testCalculateWithTimestamp() { * *

    * Expected: The CCL string is - * {@code "revert name in 1 to 100"}. + * {@code "revert name in 1 at 100"}. */ @Test public void testRevertFromRecordAlias() { String ccl = Command.revert("name").from(1) .to(Timestamp.fromMicros(100)).ccl(); - Assert.assertEquals("revert name in 1 to 100", ccl); + Assert.assertEquals("revert name in 1 at 100", ccl); } /** @@ -510,13 +510,13 @@ public void testAuditKeyWithinRecordAlias() { * *

    * Expected: The CCL string is - * {@code "revert name in 1 to 100"}. + * {@code "revert name in 1 at 100"}. */ @Test public void testRevertWithinRecordAlias() { String ccl = Command.revert("name").within(1) .to(Timestamp.fromMicros(100)).ccl(); - Assert.assertEquals("revert name in 1 to 100", ccl); + Assert.assertEquals("revert name in 1 at 100", ccl); } /** @@ -534,13 +534,13 @@ public void testRevertWithinRecordAlias() { * *

    * Expected: The CCL string is - * {@code "revert name in [1, 2] to 100"}. + * {@code "revert name in [1, 2] at 100"}. */ @Test public void testRevertWithinMultipleRecordsAlias() { String ccl = Command.revert("name").within(1, 2) .to(Timestamp.fromMicros(100)).ccl(); - Assert.assertEquals("revert name in [1, 2] to 100", ccl); + Assert.assertEquals("revert name in [1, 2] at 100", ccl); } /** From ff85462d956115cd128d73a23fda4ac2f344b173 Mon Sep 17 00:00:00 2001 From: Jeff Nelson Date: Sat, 14 Mar 2026 19:34:36 -0400 Subject: [PATCH 03/13] prepare for review --- .../concourse/lang/command/Command.java | 59 +- .../lang/command/DescribeCommand.java | 54 ++ .../concourse/lang/command/DiffCommand.java | 163 ++++- .../lang/command/FindOrInsertCommand.java | 92 ++- .../concourse/lang/command/GetCommand.java | 7 +- .../lang/command/JsonifyCommand.java | 6 +- .../lang/command/CommandCompilationTest.java | 636 ++++++++++++++++++ .../lang/command/InspectionCommandTest.java | 60 +- .../lang/command/LinkCommandTest.java | 27 + .../lang/command/TemporalCommandTest.java | 44 ++ 10 files changed, 1126 insertions(+), 22 deletions(-) diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/Command.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/Command.java index 76637eb7d..772859cf4 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/Command.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/Command.java @@ -103,6 +103,31 @@ public static SelectCommand.KeyState select(String key, return new SelectCommand.KeyState(key, moreKeys); } + /** + * Return a {@code select} {@link Command} for all keys from the specified + * {@code record}. + * + * @param record the record to select from + * @return the next builder state + */ + public static SelectCommand.SourceState select(long record) { + return select(record, new long[0]); + } + + /** + * Return a {@code select} {@link Command} for all keys from the specified + * {@code records}. + * + * @param record the first record + * @param moreRecords additional records + * @return the next builder state + */ + public static SelectCommand.SourceState select(long record, + long... moreRecords) { + return new SelectCommand.SourceState(null, + CclRenderer.collectRecords(record, moreRecords), null, null); + } + /** * Start building a {@code select} {@link Command} for all keys. * @@ -135,6 +160,30 @@ public static GetCommand.KeyState get(String key, String... moreKeys) { return new GetCommand.KeyState(key, moreKeys); } + /** + * Return a {@code get} {@link Command} for all keys from the specified + * {@code record}. + * + * @param record the record to get from + * @return the next builder state + */ + public static GetCommand.SourceState get(long record) { + return get(record, new long[0]); + } + + /** + * Return a {@code get} {@link Command} for all keys from the specified + * {@code records}. + * + * @param record the first record + * @param moreRecords additional records + * @return the next builder state + */ + public static GetCommand.SourceState get(long record, long... moreRecords) { + return new GetCommand.SourceState(null, + CclRenderer.collectRecords(record, moreRecords), null, null); + } + /** * Start building a {@code get} {@link Command} for all keys. * @@ -417,12 +466,14 @@ public static DescribeCommand.State describe(long record, } /** - * Return a {@code describe} {@link Command} that describes all records. + * Start building a {@code describe} {@link Command} that describes all + * records, optionally at a historical + * {@link com.cinchapi.concourse.Timestamp Timestamp}. * - * @return the {@link Command} + * @return the next builder state */ - public static Command describeAll() { - return new BuiltCommand("describe"); + public static DescribeCommand.AllState describeAll() { + return new DescribeCommand.AllState(); } /** diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/DescribeCommand.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/DescribeCommand.java index 2ac70a2b7..6ab56d893 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/DescribeCommand.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/DescribeCommand.java @@ -30,6 +30,7 @@ *

    * *
    + * describe [at timestamp]
      * describe <records> [at timestamp]
      * 
    * @@ -37,6 +38,59 @@ */ public final class DescribeCommand { + /** + * The terminal state for a {@code describe} command that targets all + * records, supporting an optional {@code at} clause for historical + * inspection. + */ + public static final class AllState implements Command { + + /** + * The optional historical {@link Timestamp}. + */ + @Nullable + private Timestamp timestamp; + + /** + * Construct a new instance. + */ + AllState() {} + + /** + * Pin this command to a historical {@link Timestamp}. + * + * @param timestamp the {@link Timestamp} + * @return this state for further chaining + */ + public AllState at(Timestamp timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Return the historical {@link Timestamp}. + * + * @return the {@link Timestamp}, or {@code null} + */ + @Nullable + public Timestamp timestamp() { + return timestamp; + } + + @Override + public String ccl() { + StringBuilder sb = new StringBuilder("describe"); + CclRenderer.appendTimestamp(sb, timestamp); + return sb.toString(); + } + + @Override + public String toString() { + return ccl(); + } + + } + /** * The terminal state for a {@code describe} command. This state is reached * after specifying the records to describe and supports an optional diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/DiffCommand.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/DiffCommand.java index 978503f3f..887d8cc4e 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/DiffCommand.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/DiffCommand.java @@ -27,6 +27,8 @@ *
      * diff <record> at <start>
      * diff <record> at <start> at <end>
    + * diff <key> at <start>
    + * diff <key> at <start> at <end>
      * diff <key> in <record> at <start>
      * diff <key> in <record> at <start> at <end>
      * 
    @@ -85,6 +87,17 @@ public static final class KeyState { this.key = key; } + /** + * Specify the start {@link Timestamp} for a key-only diff (without a + * record). + * + * @param start the start {@link Timestamp} + * @return the next builder state + */ + public KeyTimestampState at(Timestamp start) { + return new KeyTimestampState(key, start); + } + /** * Specify the record in which to diff the key. * @@ -295,7 +308,155 @@ public String toString() { } /** - * The terminal state for a key-scoped {@code diff} command with a start + * The terminal state for a key-only {@code diff} command with a start + * {@link Timestamp}. Supports an optional second {@code at} clause for an + * end timestamp. + */ + public static final class KeyTimestampState implements Command { + + /** + * The key to diff. + */ + private final String key; + + /** + * The start {@link Timestamp}. + */ + private final Timestamp start; + + /** + * Construct a new instance. + * + * @param key the key + * @param start the start {@link Timestamp} + */ + KeyTimestampState(String key, Timestamp start) { + this.key = key; + this.start = start; + } + + /** + * Specify the end {@link Timestamp} for this command. + * + * @param end the end {@link Timestamp} + * @return the next builder state + */ + public KeyRangeState at(Timestamp end) { + return new KeyRangeState(key, start, end); + } + + /** + * Return the key for this command. + * + * @return the key + */ + public String key() { + return key; + } + + /** + * Return the start {@link Timestamp} for this command. + * + * @return the start {@link Timestamp} + */ + public Timestamp start() { + return start; + } + + @Override + public String ccl() { + StringBuilder sb = new StringBuilder("diff "); + sb.append(key); + CclRenderer.appendTimestamp(sb, start); + return sb.toString(); + } + + @Override + public String toString() { + return ccl(); + } + + } + + /** + * The terminal state for a key-only {@code diff} command that includes both + * a start and end {@link Timestamp}. + */ + public static final class KeyRangeState implements Command { + + /** + * The key to diff. + */ + private final String key; + + /** + * The start {@link Timestamp}. + */ + private final Timestamp start; + + /** + * The end {@link Timestamp}. + */ + private final Timestamp end; + + /** + * Construct a new instance. + * + * @param key the key + * @param start the start {@link Timestamp} + * @param end the end {@link Timestamp} + */ + KeyRangeState(String key, Timestamp start, Timestamp end) { + this.key = key; + this.start = start; + this.end = end; + } + + /** + * Return the key for this command. + * + * @return the key + */ + public String key() { + return key; + } + + /** + * Return the start {@link Timestamp} for this command. + * + * @return the start {@link Timestamp} + */ + public Timestamp start() { + return start; + } + + /** + * Return the end {@link Timestamp} for this command. + * + * @return the end {@link Timestamp} + */ + public Timestamp end() { + return end; + } + + @Override + public String ccl() { + StringBuilder sb = new StringBuilder("diff "); + sb.append(key); + CclRenderer.appendTimestamp(sb, start); + CclRenderer.appendTimestamp(sb, end); + return sb.toString(); + } + + @Override + public String toString() { + return ccl(); + } + + } + + /** + * The terminal state for a key-record {@code diff} command with a start * {@link Timestamp}. Supports an optional second {@code at} clause for an * end timestamp. */ diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/FindOrInsertCommand.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/FindOrInsertCommand.java index e67ee74ef..08080810f 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/FindOrInsertCommand.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/FindOrInsertCommand.java @@ -17,6 +17,7 @@ import javax.annotation.Nullable; +import com.cinchapi.concourse.Timestamp; import com.cinchapi.concourse.lang.Criteria; /** @@ -25,9 +26,9 @@ * {@code findOrInsert} atomically finds records matching a condition, or * inserts JSON data into a new record if no match is found. *

    - * + * *
    - * findOrInsert <condition> '<json>'
    + * findOrInsert <condition> [at timestamp] '<json>'
      * 
    * * @author Jeff Nelson @@ -66,6 +67,68 @@ public static final class ConditionState { this.condition = condition; } + /** + * Pin this command to a historical {@link Timestamp} for evaluating the + * condition. + * + * @param timestamp the {@link Timestamp} + * @return the next builder state + */ + public TimestampState at(Timestamp timestamp) { + return new TimestampState(criteria, condition, timestamp); + } + + /** + * Specify the JSON data to insert if no matching record is found. + * + * @param json the JSON string to insert + * @return the next builder state + */ + public JsonState json(String json) { + return new JsonState(criteria, condition, null, json); + } + + } + + /** + * The state after specifying the condition and a historical + * {@link Timestamp} for the {@code findOrInsert} command. + */ + public static final class TimestampState { + + /** + * The structured {@link Criteria}, or {@code null} if a raw CCL string + * was provided. + */ + @Nullable + private final Criteria criteria; + + /** + * The raw CCL condition string, or {@code null} if a {@link Criteria} + * was provided. + */ + @Nullable + private final String condition; + + /** + * The historical {@link Timestamp}. + */ + private final Timestamp timestamp; + + /** + * Construct a new instance. + * + * @param criteria the {@link Criteria}, or {@code null} + * @param condition the raw CCL string, or {@code null} + * @param timestamp the historical {@link Timestamp} + */ + TimestampState(@Nullable Criteria criteria, @Nullable String condition, + Timestamp timestamp) { + this.criteria = criteria; + this.condition = condition; + this.timestamp = timestamp; + } + /** * Specify the JSON data to insert if no matching record is found. * @@ -73,14 +136,14 @@ public static final class ConditionState { * @return the next builder state */ public JsonState json(String json) { - return new JsonState(criteria, condition, json); + return new JsonState(criteria, condition, timestamp, json); } } /** * The terminal state for a {@code findOrInsert} command, reached after - * specifying the condition and JSON data. + * specifying the condition, optional timestamp, and JSON data. */ public static final class JsonState implements Command { @@ -98,6 +161,12 @@ public static final class JsonState implements Command { @Nullable private final String condition; + /** + * The optional historical {@link Timestamp}. + */ + @Nullable + private final Timestamp timestamp; + /** * The JSON data to insert. */ @@ -108,12 +177,14 @@ public static final class JsonState implements Command { * * @param criteria the {@link Criteria}, or {@code null} * @param condition the raw CCL string, or {@code null} + * @param timestamp the historical {@link Timestamp}, or {@code null} * @param json the JSON data */ JsonState(@Nullable Criteria criteria, @Nullable String condition, - String json) { + @Nullable Timestamp timestamp, String json) { this.criteria = criteria; this.condition = condition; + this.timestamp = timestamp; this.json = json; } @@ -137,6 +208,16 @@ public String condition() { return condition; } + /** + * Return the historical {@link Timestamp} for this command. + * + * @return the {@link Timestamp}, or {@code null} + */ + @Nullable + public Timestamp timestamp() { + return timestamp; + } + /** * Return the JSON data for this command. * @@ -150,6 +231,7 @@ public String json() { public String ccl() { StringBuilder sb = new StringBuilder("findOrInsert "); CclRenderer.appendCondition(sb, criteria, condition); + CclRenderer.appendTimestamp(sb, timestamp); sb.append(" '"); sb.append(json); sb.append("'"); diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/GetCommand.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/GetCommand.java index ddd04bc3f..e04411b03 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/GetCommand.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/GetCommand.java @@ -419,7 +419,12 @@ public String ccl() { sb.append(CclRenderer.keys(keys)); } if(records != null) { - sb.append(" from "); + if(keys != null) { + sb.append(" from "); + } + else { + sb.append(" "); + } sb.append(CclRenderer.records(records)); } else { diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/JsonifyCommand.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/JsonifyCommand.java index d0cd4891c..9f852324f 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/JsonifyCommand.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/JsonifyCommand.java @@ -31,7 +31,7 @@ *

    * *
    - * jsonify <records> [at timestamp] [identifier]
    + * jsonify <records> [with $id$] [at timestamp]
      * 
    * * @author Jeff Nelson @@ -127,10 +127,10 @@ public boolean includeIdentifier() { public String ccl() { StringBuilder sb = new StringBuilder("jsonify "); sb.append(CclRenderer.records(records)); - CclRenderer.appendTimestamp(sb, timestamp); if(identifier) { - sb.append(" identifier"); + sb.append(" with $id$"); } + CclRenderer.appendTimestamp(sb, timestamp); return sb.toString(); } diff --git a/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/CommandCompilationTest.java b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/CommandCompilationTest.java index 13c7c1ac4..639d586f4 100644 --- a/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/CommandCompilationTest.java +++ b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/CommandCompilationTest.java @@ -1181,6 +1181,642 @@ public void testCalculateInRecordsCompiles() { "CALCULATE"); } + /** + * Goal: Verify that a {@code jsonify} command with the + * identifier flag compiles. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code jsonify} command for record {@code 1} with the + * identifier flag enabled.
    • + *
    • Compile the CCL output.
    • + *
    + *

    + * Expected: The compiled tree is a {@link CommandTree} of + * type {@code JSONIFY}. + */ + @Test + public void testJsonifyWithIdentifierCompiles() { + assertCompiles(Command.jsonify(1).identifier().ccl(), "JSONIFY"); + } + + /** + * Goal: Verify that a {@code jsonify} command with the + * identifier flag and a timestamp compiles. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code jsonify} command for record {@code 1} with the + * identifier flag and timestamp 12345.
    • + *
    • Compile the CCL output.
    • + *
    + *

    + * Expected: The compiled tree is a {@link CommandTree} of + * type {@code JSONIFY}. + */ + @Test + public void testJsonifyWithIdentifierAndTimestampCompiles() { + assertCompiles(Command.jsonify(1).identifier() + .at(Timestamp.fromMicros(12345)).ccl(), "JSONIFY"); + } + + /** + * Goal: Verify that a key-only {@code diff} command + * compiles. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code diff} command for key {@code "name"} at timestamp + * 100.
    • + *
    • Compile the CCL output.
    • + *
    + *

    + * Expected: The compiled tree is a {@link CommandTree} of + * type {@code DIFF}. + */ + @Test + public void testDiffKeyOnlyCompiles() { + assertCompiles(Command.diff("name").at(Timestamp.fromMicros(100)).ccl(), + "DIFF"); + } + + /** + * Goal: Verify that a key-only {@code diff} command with a + * range compiles. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code diff} command for key {@code "name"} at start + * timestamp 100 and end timestamp 200.
    • + *
    • Compile the CCL output.
    • + *
    + *

    + * Expected: The compiled tree is a {@link CommandTree} of + * type {@code DIFF}. + */ + @Test + public void testDiffKeyOnlyRangeCompiles() { + assertCompiles(Command.diff("name").at(Timestamp.fromMicros(100)) + .at(Timestamp.fromMicros(200)).ccl(), "DIFF"); + } + + /** + * Goal: Verify that a {@code findOrInsert} command with a + * historical timestamp compiles. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code findOrInsert} command with condition + * {@code "name = jeff"}, timestamp 12345, and JSON data.
    • + *
    • Compile the CCL output.
    • + *
    + *

    + * Expected: The compiled tree is a {@link CommandTree} of + * type {@code FIND_OR_INSERT}. + *

    + */ + @Test + public void testFindOrInsertWithTimestampCompiles() { + assertCompiles(Command.findOrInsert("name = jeff") + .at(Timestamp.fromMicros(12345)).json("{\"name\":\"jeff\"}") + .ccl(), "FIND_OR_INSERT"); + } + + /** + * Goal: Verify that a {@code describe} command for all + * records with a timestamp compiles. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code describeAll} command at timestamp 12345.
    • + *
    • Compile the CCL output.
    • + *
    + *

    + * Expected: The compiled tree is a {@link CommandTree} of + * type {@code DESCRIBE}. + */ + @Test + public void testDescribeAllWithTimestampCompiles() { + assertCompiles( + Command.describeAll().at(Timestamp.fromMicros(12345)).ccl(), + "DESCRIBE"); + } + + // ========== Temporal Variant Coverage ========== + + /** + * Goal: Verify that a {@code diff} command for a record + * with a start and end timestamp compiles. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code diff} command for record 1 at timestamps 100 and + * 200.
    • + *
    • Compile the CCL output.
    • + *
    + *

    + * Expected: The compiled tree is a {@link CommandTree} of + * type {@code DIFF}. + */ + @Test + public void testDiffRecordRangeCompiles() { + assertCompiles(Command.diff(1L).at(Timestamp.fromMicros(100)) + .at(Timestamp.fromMicros(200)).ccl(), "DIFF"); + } + + /** + * Goal: Verify that a {@code diff} command for a key in a + * record with a start and end timestamp compiles. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code diff} command for key {@code "name"} in record 1 at + * timestamps 100 and 200.
    • + *
    • Compile the CCL output.
    • + *
    + *

    + * Expected: The compiled tree is a {@link CommandTree} of + * type {@code DIFF}. + */ + @Test + public void testDiffKeyInRecordRangeCompiles() { + assertCompiles(Command.diff("name").in(1).at(Timestamp.fromMicros(100)) + .at(Timestamp.fromMicros(200)).ccl(), "DIFF"); + } + + /** + * Goal: Verify that a {@code chronicle} command with a + * single timestamp compiles. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code chronicle} command for key {@code "name"} in record 1 + * at timestamp 12345.
    • + *
    • Compile the CCL output.
    • + *
    + *

    + * Expected: The compiled tree is a {@link CommandTree} of + * type {@code CHRONICLE}. + */ + @Test + public void testChronicleWithTimestampCompiles() { + assertCompiles(Command.chronicle("name").in(1) + .at(Timestamp.fromMicros(12345)).ccl(), "CHRONICLE"); + } + + /** + * Goal: Verify that an {@code audit} command for a record + * with a timestamp compiles. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build an {@code audit} command for record 1 at timestamp 12345.
    • + *
    • Compile the CCL output.
    • + *
    + *

    + * Expected: The compiled tree is a {@link CommandTree} of + * type {@code AUDIT}. + */ + @Test + public void testAuditRecordWithTimestampCompiles() { + assertCompiles(Command.audit(1L).at(Timestamp.fromMicros(12345)).ccl(), + "AUDIT"); + } + + /** + * Goal: Verify that an {@code audit} command for a record + * with a start and end timestamp compiles. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build an {@code audit} command for record 1 at timestamps 100 and + * 200.
    • + *
    • Compile the CCL output.
    • + *
    + *

    + * Expected: The compiled tree is a {@link CommandTree} of + * type {@code AUDIT}. + */ + @Test + public void testAuditRecordRangeCompiles() { + assertCompiles(Command.audit(1L).at(Timestamp.fromMicros(100)) + .at(Timestamp.fromMicros(200)).ccl(), "AUDIT"); + } + + /** + * Goal: Verify that an {@code audit} command for a key in + * a record with a timestamp compiles. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build an {@code audit} command for key {@code "name"} in record 1 at + * timestamp 12345.
    • + *
    • Compile the CCL output.
    • + *
    + *

    + * Expected: The compiled tree is a {@link CommandTree} of + * type {@code AUDIT}. + */ + @Test + public void testAuditKeyInRecordWithTimestampCompiles() { + assertCompiles(Command.audit("name").in(1) + .at(Timestamp.fromMicros(12345)).ccl(), "AUDIT"); + } + + /** + * Goal: Verify that an {@code audit} command for a key in + * a record with a start and end timestamp compiles. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build an {@code audit} command for key {@code "name"} in record 1 at + * timestamps 100 and 200.
    • + *
    • Compile the CCL output.
    • + *
    + *

    + * Expected: The compiled tree is a {@link CommandTree} of + * type {@code AUDIT}. + */ + @Test + public void testAuditKeyInRecordRangeCompiles() { + assertCompiles(Command.audit("name").in(1).at(Timestamp.fromMicros(100)) + .at(Timestamp.fromMicros(200)).ccl(), "AUDIT"); + } + + /** + * Goal: Verify that a {@code trace} command with a + * timestamp compiles. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code trace} command for record 1 at timestamp 12345.
    • + *
    • Compile the CCL output.
    • + *
    + *

    + * Expected: The compiled tree is a {@link CommandTree} of + * type {@code TRACE}. + */ + @Test + public void testTraceWithTimestampCompiles() { + assertCompiles(Command.trace(1).at(Timestamp.fromMicros(12345)).ccl(), + "TRACE"); + } + + /** + * Goal: Verify that a {@code navigate} command with a + * timestamp compiles. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code navigate} command for key {@code "friends.name"} from + * record 1 at timestamp 12345.
    • + *
    • Compile the CCL output.
    • + *
    + *

    + * Expected: The compiled tree is a {@link CommandTree} of + * type {@code NAVIGATE}. + */ + @Test + public void testNavigateWithTimestampCompiles() { + assertCompiles(Command.navigate("friends.name").from(1) + .at(Timestamp.fromMicros(12345)).ccl(), "NAVIGATE"); + } + + /** + * Goal: Verify that a {@code describe} command for a + * specific record with a timestamp compiles. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code describe} command for record 1 at timestamp + * 12345.
    • + *
    • Compile the CCL output.
    • + *
    + *

    + * Expected: The compiled tree is a {@link CommandTree} of + * type {@code DESCRIBE}. + */ + @Test + public void testDescribeRecordWithTimestampCompiles() { + assertCompiles( + Command.describe(1).at(Timestamp.fromMicros(12345)).ccl(), + "DESCRIBE"); + } + + /** + * Goal: Verify that a {@code calculate} command with a + * timestamp compiles. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code calculate} command for function {@code "sum"} on key + * {@code "salary"} at timestamp 12345.
    • + *
    • Compile the CCL output.
    • + *
    + *

    + * Expected: The compiled tree is a {@link CommandTree} of + * type {@code CALCULATE}. + */ + @Test + public void testCalculateWithTimestampCompiles() { + assertCompiles(Command.calculate("sum", "salary") + .at(Timestamp.fromMicros(12345)).ccl(), "CALCULATE"); + } + + /** + * Goal: Verify that a {@code jsonify} command with a + * timestamp (but no identifier) compiles. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code jsonify} command for record 1 at timestamp 12345.
    • + *
    • Compile the CCL output.
    • + *
    + *

    + * Expected: The compiled tree is a {@link CommandTree} of + * type {@code JSONIFY}. + */ + @Test + public void testJsonifyWithTimestampCompiles() { + assertCompiles(Command.jsonify(1).at(Timestamp.fromMicros(12345)).ccl(), + "JSONIFY"); + } + + // ========== Order/Page Variant Coverage ========== + + /** + * Goal: Verify that a {@code select} command with + * {@link Order} compiles. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code select} command for key {@code "name"} from record 1 + * with order by {@code "name"} ascending.
    • + *
    • Compile the CCL output.
    • + *
    + *

    + * Expected: The compiled tree is a {@link CommandTree} of + * type {@code SELECT}. + */ + @Test + public void testSelectWithOrderCompiles() { + assertCompiles(Command.select("name").from(1) + .order(Order.by("name").build()).ccl(), "SELECT"); + } + + /** + * Goal: Verify that a {@code select} command with + * {@link Page} compiles. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code select} command for key {@code "name"} where + * {@code "age > 30"} with page of size 10.
    • + *
    • Compile the CCL output.
    • + *
    + *

    + * Expected: The compiled tree is a {@link CommandTree} of + * type {@code SELECT}. + */ + @Test + public void testSelectWithPageCompiles() { + assertCompiles(Command.select("name").where("age > 30") + .page(Page.sized(10)).ccl(), "SELECT"); + } + + /** + * Goal: Verify that a {@code select} command from a record + * with a timestamp compiles. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code select} command for key {@code "name"} from record 1 + * at timestamp 12345.
    • + *
    • Compile the CCL output.
    • + *
    + *

    + * Expected: The compiled tree is a {@link CommandTree} of + * type {@code SELECT}. + */ + @Test + public void testSelectFromRecordWithTimestampCompiles() { + assertCompiles(Command.select("name").from(1) + .at(Timestamp.fromMicros(12345)).ccl(), "SELECT"); + } + + // ========== Multi-Value Variant Coverage ========== + + /** + * Goal: Verify that an {@code add} command targeting + * multiple records compiles. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build an {@code add} command for key {@code "name"} with value + * {@code "jeff"} in records 1 and 2.
    • + *
    • Compile the CCL output.
    • + *
    + *

    + * Expected: The compiled tree is a {@link CommandTree} of + * type {@code ADD}. + */ + @Test + public void testAddInMultipleRecordsCompiles() { + assertCompiles(Command.add("name").as("jeff").in(1, 2).ccl(), "ADD"); + } + + /** + * Goal: Verify that a {@code link} command with multiple + * destinations compiles. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code link} command for key {@code "friends"} from record 1 + * to records 2 and 3.
    • + *
    • Compile the CCL output.
    • + *
    + *

    + * Expected: The compiled tree is a {@link CommandTree} of + * type {@code LINK}. + */ + @Test + public void testLinkMultipleDestinationsCompiles() { + assertCompiles(Command.link("friends").from(1).to(2, 3).ccl(), "LINK"); + } + + /** + * Goal: Verify that a {@code describe} command targeting + * multiple records compiles. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code describe} command for records 1, 2, and 3.
    • + *
    • Compile the CCL output.
    • + *
    + *

    + * Expected: The compiled tree is a {@link CommandTree} of + * type {@code DESCRIBE}. + */ + @Test + public void testDescribeMultipleRecordsCompiles() { + assertCompiles(Command.describe(1, 2, 3).ccl(), "DESCRIBE"); + } + + /** + * Goal: Verify that a {@code revert} command with multiple + * keys and records compiles. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code revert} command for keys {@code "name"} and + * {@code "age"} in records 1 and 2 at timestamp 12345.
    • + *
    • Compile the CCL output.
    • + *
    + *

    + * Expected: The compiled tree is a {@link CommandTree} of + * type {@code REVERT}. + */ + @Test + public void testRevertMultipleKeysAndRecordsCompiles() { + assertCompiles(Command.revert("name", "age").in(1, 2) + .to(Timestamp.fromMicros(12345)).ccl(), "REVERT"); + } + + // ========== All-Keys Variant Coverage ========== + + /** + * Goal: Verify that a {@code select} all-keys command with + * a condition compiles. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code selectAll} command with condition + * {@code "active = true"}.
    • + *
    • Compile the CCL output.
    • + *
    + *

    + * Expected: The compiled tree is a {@link CommandTree} of + * type {@code SELECT}. + */ + @Test + public void testSelectAllWhereCompiles() { + assertCompiles(Command.selectAll().where("active = true").ccl(), + "SELECT"); + } + + /** + * Goal: Verify that a {@code get} all-keys command from a + * single record compiles. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code getAll} command from record 1.
    • + *
    • Compile the CCL output.
    • + *
    + *

    + * Expected: The compiled tree is a {@link CommandTree} of + * type {@code GET}. + */ + @Test + public void testGetAllFromRecordCompiles() { + assertCompiles(Command.getAll().from(1).ccl(), "GET"); + } + + /** + * Goal: Verify that a {@code get} all-keys command from + * multiple records compiles. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code getAll} command from records 1 and 2.
    • + *
    • Compile the CCL output.
    • + *
    + *

    + * Expected: The compiled tree is a {@link CommandTree} of + * type {@code GET}. + */ + @Test + public void testGetAllFromMultipleRecordsCompiles() { + assertCompiles(Command.getAll().from(1, 2).ccl(), "GET"); + } + + /** + * Goal: Verify that a {@code get} all-keys command with a + * condition compiles. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code getAll} command with condition + * {@code "active = true"}.
    • + *
    • Compile the CCL output.
    • + *
    + *

    + * Expected: The compiled tree is a {@link CommandTree} of + * type {@code GET}. + */ + @Test + public void testGetAllWhereCompiles() { + assertCompiles(Command.getAll().where("active = true").ccl(), "GET"); + } + // ========== Helper ========== /** diff --git a/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/InspectionCommandTest.java b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/InspectionCommandTest.java index cf1bbee0a..b27bdfe7e 100644 --- a/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/InspectionCommandTest.java +++ b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/InspectionCommandTest.java @@ -285,26 +285,70 @@ public void testJsonify() { } /** - * Goal: Verify that a {@code jsonify} command with a - * timestamp and the {@code identifier} flag renders all three components. + * Goal: Verify that a {@code jsonify} command with the + * {@code identifier} flag and a timestamp renders both components in CCL + * grammar order ({@code with $id$} before {@code at}). *

    * Start state: No prior state needed. *

    * Workflow: *

      - *
    • Build a {@code jsonify} command for record {@code 1} at timestamp - * 12345 with the identifier flag enabled.
    • + *
    • Build a {@code jsonify} command for record {@code 1} with the + * identifier flag enabled and at timestamp 12345.
    • *
    • Call {@code ccl()}.
    • *
    *

    * Expected: The CCL string is - * {@code "jsonify 1 at 12345 identifier"}. + * {@code "jsonify 1 with $id$ at 12345"}. */ @Test public void testJsonifyWithTimestampAndIdentifier() { - String ccl = Command.jsonify(1).at(Timestamp.fromMicros(12345)) - .identifier().ccl(); - Assert.assertEquals("jsonify 1 at 12345 identifier", ccl); + String ccl = Command.jsonify(1).identifier() + .at(Timestamp.fromMicros(12345)).ccl(); + Assert.assertEquals("jsonify 1 with $id$ at 12345", ccl); + } + + /** + * Goal: Verify that a {@code jsonify} command with only + * the {@code identifier} flag (no timestamp) renders correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code jsonify} command for record {@code 1} with the + * identifier flag enabled.
    • + *
    • Call {@code ccl()}.
    • + *
    + *

    + * Expected: The CCL string is + * {@code "jsonify 1 with $id$"}. + */ + @Test + public void testJsonifyWithIdentifierOnly() { + String ccl = Command.jsonify(1).identifier().ccl(); + Assert.assertEquals("jsonify 1 with $id$", ccl); + } + + /** + * Goal: Verify that a {@code describe} command for all + * records with a historical timestamp renders the {@code at} clause. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code describeAll} command at timestamp 12345.
    • + *
    • Call {@code ccl()}.
    • + *
    + *

    + * Expected: The CCL string is {@code "describe at 12345"}. + */ + @Test + public void testDescribeAllWithTimestamp() { + String ccl = Command.describeAll().at(Timestamp.fromMicros(12345)) + .ccl(); + Assert.assertEquals("describe at 12345", ccl); } /** diff --git a/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/LinkCommandTest.java b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/LinkCommandTest.java index dfb1b3553..6e30e6d3b 100644 --- a/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/LinkCommandTest.java +++ b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/LinkCommandTest.java @@ -305,4 +305,31 @@ public void testFindOrInsertWithCondition() { Assert.assertEquals("findOrInsert name = jeff '" + json + "'", ccl); } + /** + * Goal: Verify that a {@code findOrInsert} command with a + * historical timestamp renders the {@code at} clause between the condition + * and the JSON data. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code findOrInsert} command with condition + * {@code "name = jeff"}, timestamp 12345, and JSON + * {@code "{\"name\":\"jeff\"}"}.
    • + *
    • Call {@code ccl()} on the resulting {@link Command}.
    • + *
    + *

    + * Expected: The CCL string is {@code "findOrInsert name = + * jeff at 12345 '{\"name\":\"jeff\"}'"}. + */ + @Test + public void testFindOrInsertWithTimestamp() { + String json = "{\"name\":\"jeff\"}"; + String ccl = Command.findOrInsert("name = jeff") + .at(Timestamp.fromMicros(12345)).json(json).ccl(); + Assert.assertEquals("findOrInsert name = jeff at 12345 '" + json + "'", + ccl); + } + } diff --git a/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/TemporalCommandTest.java b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/TemporalCommandTest.java index 753f68c83..b60be5b9c 100644 --- a/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/TemporalCommandTest.java +++ b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/TemporalCommandTest.java @@ -450,6 +450,50 @@ public void testChronicleWithinRecordAlias() { Assert.assertEquals("chronicle name in 1", ccl); } + /** + * Goal: Verify that a key-only {@code diff} command (no + * record) with a single timestamp renders correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code diff} command for key {@code "name"} at timestamp + * 100.
    • + *
    • Call {@code ccl()}.
    • + *
    + *

    + * Expected: The CCL string is {@code "diff name at 100"}. + */ + @Test + public void testDiffKeyOnly() { + String ccl = Command.diff("name").at(Timestamp.fromMicros(100)).ccl(); + Assert.assertEquals("diff name at 100", ccl); + } + + /** + * Goal: Verify that a key-only {@code diff} command with a + * start and end timestamp renders both {@code at} clauses. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code diff} command for key {@code "name"} at start + * timestamp 100 and end timestamp 200.
    • + *
    • Call {@code ccl()}.
    • + *
    + *

    + * Expected: The CCL string is + * {@code "diff name at 100 at 200"}. + */ + @Test + public void testDiffKeyOnlyRange() { + String ccl = Command.diff("name").at(Timestamp.fromMicros(100)) + .at(Timestamp.fromMicros(200)).ccl(); + Assert.assertEquals("diff name at 100 at 200", ccl); + } + /** * Goal: Verify that the {@code within()} alias on * {@code diff} produces the same CCL as {@code in()}. From 87f27492621c2d5ffea0cff82d0e8697b91a79c6 Mon Sep 17 00:00:00 2001 From: Jeff Nelson Date: Sat, 14 Mar 2026 19:51:58 -0400 Subject: [PATCH 04/13] fix failing test --- .../cinchapi/concourse/lang/command/QueryCommandTest.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/QueryCommandTest.java b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/QueryCommandTest.java index 3836db5a8..abf0665d2 100644 --- a/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/QueryCommandTest.java +++ b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/QueryCommandTest.java @@ -196,12 +196,12 @@ public void testGetFromRecord() { *

  • Call {@code ccl()} on the resulting command.
  • * *

    - * Expected: The CCL output is {@code "get from [1, 2]"}. + * Expected: The CCL output is {@code "get [1, 2]"}. */ @Test public void testGetAllKeysFromRecords() { String ccl = Command.getAll().from(1, 2).ccl(); - Assert.assertEquals("get from [1, 2]", ccl); + Assert.assertEquals("get [1, 2]", ccl); } /** @@ -498,12 +498,12 @@ public void testGetKeyWithinRecordAlias() { *

  • Call {@code ccl()} on the resulting command.
  • * *

    - * Expected: The CCL output is {@code "get from 1"}. + * Expected: The CCL output is {@code "get 1"}. */ @Test public void testGetAllWithinRecordAlias() { String ccl = Command.getAll().within(1).ccl(); - Assert.assertEquals("get from 1", ccl); + Assert.assertEquals("get 1", ccl); } /** From 305fd495dba2f6be2c2f7770809917db2d8cb4b8 Mon Sep 17 00:00:00 2001 From: Jeff Nelson Date: Sun, 15 Mar 2026 06:53:12 -0400 Subject: [PATCH 05/13] add conversion of command <-> tcommand (thrift --- .../concourse/ForwardingConcourse.java | 1 - .../lang/command/CalculateCommand.java | 10 + .../concourse/lang/command/Command.java | 46 +- .../lang/command/CommandSerializer.java | 1898 +++++++++++++ .../concourse/lang/command/GetCommand.java | 10 + .../lang/command/NavigateCommand.java | 10 + .../concourse/lang/command/SelectCommand.java | 10 + .../cinchapi/concourse/thrift/TCommand.java | 2494 +++++++++++++++++ .../concourse/thrift/TCommandVerb.java | 152 + .../command/CommandSerializationTest.java | 1611 +++++++++++ interface/data.thrift | 68 + 11 files changed, 6286 insertions(+), 24 deletions(-) create mode 100644 concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/CommandSerializer.java create mode 100644 concourse-driver-java/src/main/java/com/cinchapi/concourse/thrift/TCommand.java create mode 100644 concourse-driver-java/src/main/java/com/cinchapi/concourse/thrift/TCommandVerb.java create mode 100644 concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/CommandSerializationTest.java diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/ForwardingConcourse.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/ForwardingConcourse.java index 16786ef23..82a3f425f 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/ForwardingConcourse.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/ForwardingConcourse.java @@ -39,7 +39,6 @@ * * @author Jeff Nelson */ -@SuppressWarnings("deprecation") public abstract class ForwardingConcourse extends Concourse { /** diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/CalculateCommand.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/CalculateCommand.java index d7cd65b3f..6b3c210de 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/CalculateCommand.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/CalculateCommand.java @@ -232,6 +232,16 @@ public Criteria criteria() { return criteria; } + /** + * Return the raw CCL condition for this command. + * + * @return the condition string, or {@code null} + */ + @Nullable + public String condition() { + return condition; + } + /** * Return the historical {@link Timestamp} for this command. * diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/Command.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/Command.java index 772859cf4..6914fd1a0 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/Command.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/Command.java @@ -16,11 +16,12 @@ package com.cinchapi.concourse.lang.command; import com.cinchapi.concourse.lang.Criteria; +import com.cinchapi.concourse.thrift.TCommand; /** * A {@link Command} encapsulates a complete CCL (Concourse Command Language) - * statement that can be rendered as a CCL string and, in the future, serialized - * for wire transport. + * statement that can be rendered as a CCL string or serialized as a + * {@link TCommand} for wire transport. *

    * {@link Command Commands} are constructed using the fluent static factory * methods on this interface. Each factory returns a state object whose methods @@ -55,7 +56,26 @@ public interface Command { */ public String ccl(); - // ---- QUERY COMMANDS ---- + /** + * Return a {@link TCommand} Thrift representation of this {@link Command} + * suitable for wire transport. + * + * @return the {@link TCommand} + */ + public default TCommand toThrift() { + return CommandSerializer.toThrift(this); + } + + /** + * Reconstruct a {@link Command} from a {@link TCommand} received over the + * wire. + * + * @param tc the {@link TCommand} to deserialize + * @return the {@link Command} + */ + public static Command fromThrift(TCommand tc) { + return CommandSerializer.fromThrift(tc); + } /** * Start building a {@code find} {@link Command} using the provided @@ -217,8 +237,6 @@ public static NavigateCommand.KeyState navigate(String key, return new NavigateCommand.KeyState(key, moreKeys); } - // ---- WRITE COMMANDS ---- - /** * Start building an {@code add} {@link Command} for the specified * {@code key}. @@ -308,8 +326,6 @@ public static InsertCommand.JsonState insert(String json) { return new InsertCommand.JsonState(json); } - // ---- LINK COMMANDS ---- - /** * Start building a {@code link} {@link Command} for the specified * {@code key}. @@ -332,8 +348,6 @@ public static UnlinkCommand.KeyState unlink(String key) { return new UnlinkCommand.KeyState(key); } - // ---- VERIFY COMMANDS ---- - /** * Start building a {@code verify} {@link Command} for the specified * {@code key}. @@ -367,8 +381,6 @@ public static VerifyOrSetCommand.KeyState verifyOrSet(String key) { return new VerifyOrSetCommand.KeyState(key); } - // ---- FIND-OR COMMANDS ---- - /** * Start building a {@code findOrAdd} {@link Command} for the specified * {@code key}. @@ -403,8 +415,6 @@ public static FindOrInsertCommand.ConditionState findOrInsert(String ccl) { return new FindOrInsertCommand.ConditionState(null, ccl); } - // ---- SEARCH / BROWSE ---- - /** * Start building a {@code search} {@link Command} for the specified * {@code key}. @@ -439,8 +449,6 @@ public static BrowseCommand.State browse(String key, String... moreKeys) { return new BrowseCommand.State(key, moreKeys); } - // ---- RECORD INSPECTION ---- - /** * Start building a {@code describe} {@link Command} for the specified * {@code record}. @@ -546,8 +554,6 @@ public static JsonifyCommand.State jsonify(long record, return new JsonifyCommand.State(record, moreRecords); } - // ---- HISTORY / TEMPORAL ---- - /** * Start building a {@code chronicle} {@link Command} for the specified * {@code key}. @@ -627,8 +633,6 @@ public static RevertCommand.KeyState revert(String key, return new RevertCommand.KeyState(key, moreKeys); } - // ---- OTHER ---- - /** * Start building a {@code reconcile} {@link Command} for the specified * {@code key}. @@ -667,8 +671,6 @@ public static CalculateCommand.State calculate(String function, return new CalculateCommand.State(function, key); } - // ---- TRANSACTION ---- - /** * Return a {@code stage} {@link Command}. * @@ -696,8 +698,6 @@ public static Command abort() { return new BuiltCommand("abort"); } - // ---- UTILITY ---- - /** * Return a {@code ping} {@link Command}. * diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/CommandSerializer.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/CommandSerializer.java new file mode 100644 index 000000000..9a45ac255 --- /dev/null +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/CommandSerializer.java @@ -0,0 +1,1898 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.lang.command; + +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +import javax.annotation.Nullable; + +import com.cinchapi.concourse.Timestamp; +import com.cinchapi.concourse.lang.Criteria; +import com.cinchapi.concourse.lang.Language; +import com.cinchapi.concourse.lang.paginate.Page; +import com.cinchapi.concourse.lang.sort.Order; +import com.cinchapi.concourse.thrift.JavaThriftBridge; +import com.cinchapi.concourse.thrift.TCommand; +import com.cinchapi.concourse.thrift.TCommandVerb; +import com.cinchapi.concourse.thrift.TObject; +import com.cinchapi.concourse.util.Convert; + +/** + * Utility for converting {@link Command Commands} to and from {@link TCommand} + * Thrift representations. + * + * @author Jeff Nelson + */ +final class CommandSerializer { + + /** + * Convert a {@link Command} to a {@link TCommand} suitable for wire + * transport. + * + * @param command the {@link Command} to serialize + * @return the {@link TCommand} + * @throws UnsupportedOperationException if the {@link Command} type is not + * recognized + */ + public static TCommand toThrift(Command command) { + if(command instanceof BuiltCommand) { + return serializeBuiltCommand((BuiltCommand) command); + } + else if(command instanceof FindCommand.ConditionState) { + return serializeFindCommand((FindCommand.ConditionState) command); + } + else if(command instanceof SelectCommand.SourceState) { + return serializeSelectCommand((SelectCommand.SourceState) command); + } + else if(command instanceof GetCommand.SourceState) { + return serializeGetCommand((GetCommand.SourceState) command); + } + else if(command instanceof NavigateCommand.SourceState) { + return serializeNavigateCommand( + (NavigateCommand.SourceState) command); + } + else if(command instanceof AddCommand.RecordState) { + return serializeAddRecordCommand((AddCommand.RecordState) command); + } + else if(command instanceof AddCommand.ValueState) { + return serializeAddValueCommand((AddCommand.ValueState) command); + } + else if(command instanceof SetCommand.RecordState) { + return serializeSetCommand((SetCommand.RecordState) command); + } + else if(command instanceof RemoveCommand.RecordState) { + return serializeRemoveCommand((RemoveCommand.RecordState) command); + } + else if(command instanceof ClearCommand.RecordState) { + return serializeClearCommand((ClearCommand.RecordState) command); + } + else if(command instanceof InsertCommand.RecordState) { + return serializeInsertRecordCommand( + (InsertCommand.RecordState) command); + } + else if(command instanceof InsertCommand.JsonState) { + return serializeInsertJsonCommand( + (InsertCommand.JsonState) command); + } + else if(command instanceof LinkCommand.DestinationState) { + return serializeLinkCommand((LinkCommand.DestinationState) command); + } + else if(command instanceof UnlinkCommand.DestinationState) { + return serializeUnlinkCommand( + (UnlinkCommand.DestinationState) command); + } + else if(command instanceof VerifyCommand.TimestampState) { + return serializeVerifyTimestampCommand( + (VerifyCommand.TimestampState) command); + } + else if(command instanceof VerifyCommand.RecordState) { + return serializeVerifyCommand((VerifyCommand.RecordState) command); + } + else if(command instanceof VerifyAndSwapCommand.SwapState) { + return serializeVerifyAndSwapCommand( + (VerifyAndSwapCommand.SwapState) command); + } + else if(command instanceof VerifyOrSetCommand.RecordState) { + return serializeVerifyOrSetCommand( + (VerifyOrSetCommand.RecordState) command); + } + else if(command instanceof FindOrAddCommand.ValueState) { + return serializeFindOrAddCommand( + (FindOrAddCommand.ValueState) command); + } + else if(command instanceof FindOrInsertCommand.JsonState) { + return serializeFindOrInsertCommand( + (FindOrInsertCommand.JsonState) command); + } + else if(command instanceof SearchCommand.QueryState) { + return serializeSearchCommand((SearchCommand.QueryState) command); + } + else if(command instanceof BrowseCommand.State) { + return serializeBrowseCommand((BrowseCommand.State) command); + } + else if(command instanceof DescribeCommand.AllState) { + return serializeDescribeAllCommand( + (DescribeCommand.AllState) command); + } + else if(command instanceof DescribeCommand.State) { + return serializeDescribeCommand((DescribeCommand.State) command); + } + else if(command instanceof TraceCommand.State) { + return serializeTraceCommand((TraceCommand.State) command); + } + else if(command instanceof HoldsCommand.State) { + return serializeHoldsCommand((HoldsCommand.State) command); + } + else if(command instanceof JsonifyCommand.State) { + return serializeJsonifyCommand((JsonifyCommand.State) command); + } + else if(command instanceof ChronicleCommand.RangeState) { + return serializeChronicleRangeCommand( + (ChronicleCommand.RangeState) command); + } + else if(command instanceof ChronicleCommand.TimestampState) { + return serializeChronicleTimestampCommand( + (ChronicleCommand.TimestampState) command); + } + else if(command instanceof ChronicleCommand.RecordState) { + return serializeChronicleRecordCommand( + (ChronicleCommand.RecordState) command); + } + else if(command instanceof DiffCommand.KeyRecordRangeState) { + return serializeDiffCommand( + (DiffCommand.KeyRecordRangeState) command); + } + else if(command instanceof DiffCommand.KeyRecordTimestampState) { + return serializeDiffCommand( + (DiffCommand.KeyRecordTimestampState) command); + } + else if(command instanceof DiffCommand.KeyRangeState) { + return serializeDiffCommand((DiffCommand.KeyRangeState) command); + } + else if(command instanceof DiffCommand.KeyTimestampState) { + return serializeDiffCommand( + (DiffCommand.KeyTimestampState) command); + } + else if(command instanceof DiffCommand.RecordRangeState) { + return serializeDiffCommand((DiffCommand.RecordRangeState) command); + } + else if(command instanceof DiffCommand.RecordTimestampState) { + return serializeDiffCommand( + (DiffCommand.RecordTimestampState) command); + } + else if(command instanceof AuditCommand.KeyRecordRangeState) { + return serializeAuditCommand( + (AuditCommand.KeyRecordRangeState) command); + } + else if(command instanceof AuditCommand.KeyRecordTimestampState) { + return serializeAuditCommand( + (AuditCommand.KeyRecordTimestampState) command); + } + else if(command instanceof AuditCommand.RecordRangeState) { + return serializeAuditCommand( + (AuditCommand.RecordRangeState) command); + } + else if(command instanceof AuditCommand.RecordTimestampState) { + return serializeAuditCommand( + (AuditCommand.RecordTimestampState) command); + } + else if(command instanceof AuditCommand.KeyRecordState) { + return serializeAuditCommand((AuditCommand.KeyRecordState) command); + } + else if(command instanceof AuditCommand.RecordState) { + return serializeAuditCommand((AuditCommand.RecordState) command); + } + else if(command instanceof RevertCommand.TimestampState) { + return serializeRevertCommand( + (RevertCommand.TimestampState) command); + } + else if(command instanceof ReconcileCommand.ValuesState) { + return serializeReconcileCommand( + (ReconcileCommand.ValuesState) command); + } + else if(command instanceof ConsolidateCommand.State) { + return serializeConsolidateCommand( + (ConsolidateCommand.State) command); + } + else if(command instanceof CalculateCommand.State) { + return serializeCalculateCommand((CalculateCommand.State) command); + } + else { + throw new UnsupportedOperationException( + "Cannot serialize Command of type " + + command.getClass().getName()); + } + } + + /** + * Reconstruct a {@link Command} from a {@link TCommand} received over the + * wire. + * + * @param tc the {@link TCommand} to deserialize + * @return the {@link Command} + * @throws UnsupportedOperationException if the verb is not recognized + */ + public static Command fromThrift(TCommand tc) { + switch (tc.getVerb()) { + case PING: + case STAGE: + case COMMIT: + case ABORT: + case INVENTORY: + return new BuiltCommand(tc.getVerb().name().toLowerCase()); + case FIND: + return deserializeFind(tc); + case SELECT: + return deserializeSelect(tc); + case GET: + return deserializeGet(tc); + case NAVIGATE: + return deserializeNavigate(tc); + case ADD: + return deserializeAdd(tc); + case SET: + return deserializeSet(tc); + case REMOVE: + return deserializeRemove(tc); + case CLEAR: + return deserializeClear(tc); + case INSERT: + return deserializeInsert(tc); + case LINK: + return deserializeLink(tc); + case UNLINK: + return deserializeUnlink(tc); + case VERIFY: + return deserializeVerify(tc); + case VERIFY_AND_SWAP: + return deserializeVerifyAndSwap(tc); + case VERIFY_OR_SET: + return deserializeVerifyOrSet(tc); + case FIND_OR_ADD: + return deserializeFindOrAdd(tc); + case FIND_OR_INSERT: + return deserializeFindOrInsert(tc); + case SEARCH: + return deserializeSearch(tc); + case BROWSE: + return deserializeBrowse(tc); + case DESCRIBE: + return deserializeDescribe(tc); + case TRACE: + return deserializeTrace(tc); + case HOLDS: + return deserializeHolds(tc); + case JSONIFY: + return deserializeJsonify(tc); + case CHRONICLE: + return deserializeChronicle(tc); + case DIFF: + return deserializeDiff(tc); + case AUDIT: + return deserializeAudit(tc); + case REVERT: + return deserializeRevert(tc); + case RECONCILE: + return deserializeReconcile(tc); + case CONSOLIDATE: + return deserializeConsolidate(tc); + case CALCULATE: + return deserializeCalculate(tc); + default: + throw new UnsupportedOperationException( + "Cannot deserialize TCommand with verb " + tc.getVerb()); + } + } + + /** + * Deserialize a {@code find} {@link TCommand} into a + * {@link FindCommand.ConditionState}. + * + * @param tc the {@link TCommand} to deserialize + * @return the deserialized {@link Command} + */ + private static Command deserializeFind(TCommand tc) { + FindCommand.ConditionState state = new FindCommand.ConditionState( + getCriteria(tc), tc.getCondition()); + applyTimestamp(state, tc); + applyOrder(state, tc); + applyPage(state, tc); + return state; + } + + /** + * Deserialize a {@code select} {@link TCommand} into a + * {@link SelectCommand.SourceState}. + * + * @param tc the {@link TCommand} to deserialize + * @return the deserialized {@link Command} + */ + private static Command deserializeSelect(TCommand tc) { + SelectCommand.SourceState state = new SelectCommand.SourceState( + getKeys(tc), getRecords(tc), getCriteria(tc), + tc.getCondition()); + applyTimestamp(state, tc); + applyOrder(state, tc); + applyPage(state, tc); + return state; + } + + /** + * Deserialize a {@code get} {@link TCommand} into a + * {@link GetCommand.SourceState}. + * + * @param tc the {@link TCommand} to deserialize + * @return the deserialized {@link Command} + */ + private static Command deserializeGet(TCommand tc) { + GetCommand.SourceState state = new GetCommand.SourceState(getKeys(tc), + getRecords(tc), getCriteria(tc), tc.getCondition()); + applyTimestamp(state, tc); + applyOrder(state, tc); + applyPage(state, tc); + return state; + } + + /** + * Deserialize a {@code navigate} {@link TCommand} into a + * {@link NavigateCommand.SourceState}. + * + * @param tc the {@link TCommand} to deserialize + * @return the deserialized {@link Command} + */ + private static Command deserializeNavigate(TCommand tc) { + NavigateCommand.SourceState state = new NavigateCommand.SourceState( + tc.getKeys(), getRecords(tc), getCriteria(tc), + tc.getCondition()); + applyTimestamp(state, tc); + return state; + } + + /** + * Deserialize an {@code add} {@link TCommand} into either an + * {@link AddCommand.RecordState} or {@link AddCommand.ValueState}, + * depending on whether records are specified. + * + * @param tc the {@link TCommand} to deserialize + * @return the deserialized {@link Command} + */ + private static Command deserializeAdd(TCommand tc) { + String key = tc.getKeys().get(0); + Object value = Convert.thriftToJava(tc.getValue()); + if(tc.isSetRecords()) { + return new AddCommand.RecordState(key, value, tc.getRecords()); + } + else { + return new AddCommand.ValueState(key, value); + } + } + + /** + * Deserialize a {@code set} {@link TCommand} into a + * {@link SetCommand.RecordState}. + * + * @param tc the {@link TCommand} to deserialize + * @return the deserialized {@link Command} + */ + private static Command deserializeSet(TCommand tc) { + return new SetCommand.RecordState(tc.getKeys().get(0), + Convert.thriftToJava(tc.getValue()), tc.getRecords()); + } + + /** + * Deserialize a {@code remove} {@link TCommand} into a + * {@link RemoveCommand.RecordState}. + * + * @param tc the {@link TCommand} to deserialize + * @return the deserialized {@link Command} + */ + private static Command deserializeRemove(TCommand tc) { + Object value = tc.isSetValue() ? Convert.thriftToJava(tc.getValue()) + : null; + return new RemoveCommand.RecordState(tc.getKeys().get(0), value, + tc.getRecords()); + } + + /** + * Deserialize a {@code clear} {@link TCommand} into a + * {@link ClearCommand.RecordState}. + * + * @param tc the {@link TCommand} to deserialize + * @return the deserialized {@link Command} + */ + private static Command deserializeClear(TCommand tc) { + List keys = tc.isSetKeys() ? tc.getKeys() : null; + List records = tc.getRecords(); + return new ClearCommand.RecordState(keys, records.get(0), + tail(records)); + } + + /** + * Deserialize an {@code insert} {@link TCommand} into either an + * {@link InsertCommand.RecordState} or {@link InsertCommand.JsonState}, + * depending on whether records are specified. + * + * @param tc the {@link TCommand} to deserialize + * @return the deserialized {@link Command} + */ + private static Command deserializeInsert(TCommand tc) { + if(tc.isSetRecords()) { + return new InsertCommand.RecordState(tc.getJson(), tc.getRecords()); + } + else { + return new InsertCommand.JsonState(tc.getJson()); + } + } + + /** + * Deserialize a {@code link} {@link TCommand} into a + * {@link LinkCommand.DestinationState}. + * + * @param tc the {@link TCommand} to deserialize + * @return the deserialized {@link Command} + */ + private static Command deserializeLink(TCommand tc) { + return new LinkCommand.DestinationState(tc.getKeys().get(0), + tc.getSourceRecord(), tc.getRecords()); + } + + /** + * Deserialize an {@code unlink} {@link TCommand} into an + * {@link UnlinkCommand.DestinationState}. + * + * @param tc the {@link TCommand} to deserialize + * @return the deserialized {@link Command} + */ + private static Command deserializeUnlink(TCommand tc) { + return new UnlinkCommand.DestinationState(tc.getKeys().get(0), + tc.getSourceRecord(), tc.getRecords().get(0)); + } + + /** + * Deserialize a {@code verify} {@link TCommand} into either a + * {@link VerifyCommand.TimestampState} or + * {@link VerifyCommand.RecordState}, depending on whether a timestamp is + * specified. + * + * @param tc the {@link TCommand} to deserialize + * @return the deserialized {@link Command} + */ + private static Command deserializeVerify(TCommand tc) { + String key = tc.getKeys().get(0); + Object value = Convert.thriftToJava(tc.getValue()); + long record = tc.getRecords().get(0); + if(tc.isSetTimestamp()) { + return new VerifyCommand.TimestampState(key, value, record, + Timestamp.fromMicros(tc.getTimestamp())); + } + else { + return new VerifyCommand.RecordState(key, value, record); + } + } + + /** + * Deserialize a {@code verifyAndSwap} {@link TCommand} into a + * {@link VerifyAndSwapCommand.SwapState}. + * + * @param tc the {@link TCommand} to deserialize + * @return the deserialized {@link Command} + */ + private static Command deserializeVerifyAndSwap(TCommand tc) { + return new VerifyAndSwapCommand.SwapState(tc.getKeys().get(0), + Convert.thriftToJava(tc.getValue()), tc.getRecords().get(0), + Convert.thriftToJava(tc.getReplacement())); + } + + /** + * Deserialize a {@code verifyOrSet} {@link TCommand} into a + * {@link VerifyOrSetCommand.RecordState}. + * + * @param tc the {@link TCommand} to deserialize + * @return the deserialized {@link Command} + */ + private static Command deserializeVerifyOrSet(TCommand tc) { + return new VerifyOrSetCommand.RecordState(tc.getKeys().get(0), + Convert.thriftToJava(tc.getValue()), tc.getRecords().get(0)); + } + + /** + * Deserialize a {@code findOrAdd} {@link TCommand} into a + * {@link FindOrAddCommand.ValueState}. + * + * @param tc the {@link TCommand} to deserialize + * @return the deserialized {@link Command} + */ + private static Command deserializeFindOrAdd(TCommand tc) { + return new FindOrAddCommand.ValueState(tc.getKeys().get(0), + Convert.thriftToJava(tc.getValue())); + } + + /** + * Deserialize a {@code findOrInsert} {@link TCommand} into a + * {@link FindOrInsertCommand.JsonState}. + * + * @param tc the {@link TCommand} to deserialize + * @return the deserialized {@link Command} + */ + private static Command deserializeFindOrInsert(TCommand tc) { + Timestamp ts = tc.isSetTimestamp() + ? Timestamp.fromMicros(tc.getTimestamp()) + : null; + return new FindOrInsertCommand.JsonState(getCriteria(tc), + tc.getCondition(), ts, tc.getJson()); + } + + /** + * Deserialize a {@code search} {@link TCommand} into a + * {@link SearchCommand.QueryState}. + * + * @param tc the {@link TCommand} to deserialize + * @return the deserialized {@link Command} + */ + private static Command deserializeSearch(TCommand tc) { + return new SearchCommand.QueryState(tc.getKeys().get(0), tc.getQuery()); + } + + /** + * Deserialize a {@code browse} {@link TCommand} into a + * {@link BrowseCommand.State}. + * + * @param tc the {@link TCommand} to deserialize + * @return the deserialized {@link Command} + */ + private static Command deserializeBrowse(TCommand tc) { + List keys = tc.getKeys(); + BrowseCommand.State state = new BrowseCommand.State(keys.get(0), + keys.subList(1, keys.size()).toArray(new String[0])); + applyTimestamp(state, tc); + return state; + } + + /** + * Deserialize a {@code describe} {@link TCommand} into either a + * {@link DescribeCommand.State} or {@link DescribeCommand.AllState}, + * depending on whether records are specified. + * + * @param tc the {@link TCommand} to deserialize + * @return the deserialized {@link Command} + */ + private static Command deserializeDescribe(TCommand tc) { + if(tc.isSetRecords()) { + List records = tc.getRecords(); + DescribeCommand.State state = new DescribeCommand.State( + records.get(0), tail(records)); + applyTimestamp(state, tc); + return state; + } + else { + DescribeCommand.AllState state = new DescribeCommand.AllState(); + applyTimestamp(state, tc); + return state; + } + } + + /** + * Deserialize a {@code trace} {@link TCommand} into a + * {@link TraceCommand.State}. + * + * @param tc the {@link TCommand} to deserialize + * @return the deserialized {@link Command} + */ + private static Command deserializeTrace(TCommand tc) { + List records = tc.getRecords(); + TraceCommand.State state = new TraceCommand.State(records.get(0), + tail(records)); + applyTimestamp(state, tc); + return state; + } + + /** + * Deserialize a {@code holds} {@link TCommand} into a + * {@link HoldsCommand.State}. + * + * @param tc the {@link TCommand} to deserialize + * @return the deserialized {@link Command} + */ + private static Command deserializeHolds(TCommand tc) { + List records = tc.getRecords(); + return new HoldsCommand.State(records.get(0), tail(records)); + } + + /** + * Deserialize a {@code jsonify} {@link TCommand} into a + * {@link JsonifyCommand.State}. + * + * @param tc the {@link TCommand} to deserialize + * @return the deserialized {@link Command} + */ + private static Command deserializeJsonify(TCommand tc) { + List records = tc.getRecords(); + JsonifyCommand.State state = new JsonifyCommand.State(records.get(0), + tail(records)); + applyTimestamp(state, tc); + return state; + } + + /** + * Deserialize a {@code chronicle} {@link TCommand} into the appropriate + * {@link ChronicleCommand} state, depending on which timestamp fields are + * set. + * + * @param tc the {@link TCommand} to deserialize + * @return the deserialized {@link Command} + */ + private static Command deserializeChronicle(TCommand tc) { + String key = tc.getKeys().get(0); + long record = tc.getRecords().get(0); + if(tc.isSetEndTimestamp()) { + return new ChronicleCommand.RangeState(key, record, + Timestamp.fromMicros(tc.getTimestamp()), + Timestamp.fromMicros(tc.getEndTimestamp())); + } + else if(tc.isSetTimestamp()) { + return new ChronicleCommand.TimestampState(key, record, + Timestamp.fromMicros(tc.getTimestamp())); + } + else { + return new ChronicleCommand.RecordState(key, record); + } + } + + /** + * Deserialize a {@code diff} {@link TCommand} into the appropriate + * {@link DiffCommand} state, depending on which fields are set. + * + * @param tc the {@link TCommand} to deserialize + * @return the deserialized {@link Command} + */ + private static Command deserializeDiff(TCommand tc) { + boolean hasKey = tc.isSetKeys(); + boolean hasRecord = tc.isSetRecords(); + boolean hasEnd = tc.isSetEndTimestamp(); + Timestamp start = Timestamp.fromMicros(tc.getTimestamp()); + if(hasKey && hasRecord && hasEnd) { + return new DiffCommand.KeyRecordRangeState(tc.getKeys().get(0), + tc.getRecords().get(0), start, + Timestamp.fromMicros(tc.getEndTimestamp())); + } + else if(hasKey && hasRecord) { + return new DiffCommand.KeyRecordTimestampState(tc.getKeys().get(0), + tc.getRecords().get(0), start); + } + else if(hasKey && hasEnd) { + return new DiffCommand.KeyRangeState(tc.getKeys().get(0), start, + Timestamp.fromMicros(tc.getEndTimestamp())); + } + else if(hasKey) { + return new DiffCommand.KeyTimestampState(tc.getKeys().get(0), + start); + } + else if(hasEnd) { + return new DiffCommand.RecordRangeState(tc.getRecords().get(0), + start, Timestamp.fromMicros(tc.getEndTimestamp())); + } + else { + return new DiffCommand.RecordTimestampState(tc.getRecords().get(0), + start); + } + } + + /** + * Deserialize an {@code audit} {@link TCommand} into the appropriate + * {@link AuditCommand} state, depending on which fields are set. + * + * @param tc the {@link TCommand} to deserialize + * @return the deserialized {@link Command} + */ + private static Command deserializeAudit(TCommand tc) { + boolean hasKey = tc.isSetKeys(); + boolean hasTimestamp = tc.isSetTimestamp(); + boolean hasEnd = tc.isSetEndTimestamp(); + if(hasKey && hasTimestamp && hasEnd) { + return new AuditCommand.KeyRecordRangeState(tc.getKeys().get(0), + tc.getRecords().get(0), + Timestamp.fromMicros(tc.getTimestamp()), + Timestamp.fromMicros(tc.getEndTimestamp())); + } + else if(hasKey && hasTimestamp) { + return new AuditCommand.KeyRecordTimestampState(tc.getKeys().get(0), + tc.getRecords().get(0), + Timestamp.fromMicros(tc.getTimestamp())); + } + else if(hasKey) { + return new AuditCommand.KeyRecordState(tc.getKeys().get(0), + tc.getRecords().get(0)); + } + else if(hasTimestamp && hasEnd) { + return new AuditCommand.RecordRangeState(tc.getRecords().get(0), + Timestamp.fromMicros(tc.getTimestamp()), + Timestamp.fromMicros(tc.getEndTimestamp())); + } + else if(hasTimestamp) { + return new AuditCommand.RecordTimestampState(tc.getRecords().get(0), + Timestamp.fromMicros(tc.getTimestamp())); + } + else { + return new AuditCommand.RecordState(tc.getRecords().get(0)); + } + } + + /** + * Deserialize a {@code revert} {@link TCommand} into a + * {@link RevertCommand.TimestampState}. + * + * @param tc the {@link TCommand} to deserialize + * @return the deserialized {@link Command} + */ + private static Command deserializeRevert(TCommand tc) { + return new RevertCommand.TimestampState(tc.getKeys(), tc.getRecords(), + Timestamp.fromMicros(tc.getTimestamp())); + } + + /** + * Deserialize a {@code reconcile} {@link TCommand} into a + * {@link ReconcileCommand.ValuesState}. + * + * @param tc the {@link TCommand} to deserialize + * @return the deserialized {@link Command} + */ + private static Command deserializeReconcile(TCommand tc) { + List values = tc.getValues().stream().map(Convert::thriftToJava) + .collect(Collectors.toList()); + return new ReconcileCommand.ValuesState(tc.getKeys().get(0), + tc.getRecords().get(0), values); + } + + /** + * Deserialize a {@code consolidate} {@link TCommand} into a + * {@link ConsolidateCommand.State}. + * + * @param tc the {@link TCommand} to deserialize + * @return the deserialized {@link Command} + */ + private static Command deserializeConsolidate(TCommand tc) { + List records = tc.getRecords(); + return new ConsolidateCommand.State(records.get(0), records.get(1), + tail(records, 2)); + } + + /** + * Deserialize a {@code calculate} {@link TCommand} into a + * {@link CalculateCommand.State}. + * + * @param tc the {@link TCommand} to deserialize + * @return the deserialized {@link Command} + */ + private static Command deserializeCalculate(TCommand tc) { + CalculateCommand.State state = new CalculateCommand.State( + tc.getFunction(), tc.getKeys().get(0)); + if(tc.isSetRecords()) { + List records = tc.getRecords(); + state.in(records.get(0), tail(records)); + } + Criteria criteria = getCriteria(tc); + if(criteria != null) { + state.where(criteria); + } + else if(tc.isSetCondition()) { + state.where(tc.getCondition()); + } + applyTimestamp(state, tc); + return state; + } + + /** + * Return the {@link Criteria} from a {@link TCommand}, or {@code null} if + * not set. + * + * @param tc the {@link TCommand} to extract from + * @return the {@link Criteria}, or {@code null} + */ + @Nullable + private static Criteria getCriteria(TCommand tc) { + return tc.isSetCriteria() + ? Language.translateFromThriftCriteria(tc.getCriteria()) + : null; + } + + /** + * Return the keys list from a {@link TCommand}, or {@code null} if not set. + * + * @param tc the {@link TCommand} to extract from + * @return the keys {@link List}, or {@code null} + */ + @Nullable + private static List getKeys(TCommand tc) { + return tc.isSetKeys() ? tc.getKeys() : null; + } + + /** + * Return the records list from a {@link TCommand}, or {@code null} if not + * set. + * + * @param tc the {@link TCommand} to extract from + * @return the records {@link List}, or {@code null} + */ + @Nullable + private static List getRecords(TCommand tc) { + return tc.isSetRecords() ? tc.getRecords() : null; + } + + /** + * Apply the optional timestamp from a {@link TCommand} to a + * {@link FindCommand.ConditionState}. + * + * @param state the {@link FindCommand.ConditionState} to modify + * @param tc the {@link TCommand} containing the timestamp + */ + private static void applyTimestamp(FindCommand.ConditionState state, + TCommand tc) { + if(tc.isSetTimestamp()) { + state.at(Timestamp.fromMicros(tc.getTimestamp())); + } + } + + /** + * Apply the optional order from a {@link TCommand} to a + * {@link FindCommand.ConditionState}. + * + * @param state the {@link FindCommand.ConditionState} to modify + * @param tc the {@link TCommand} containing the order + */ + private static void applyOrder(FindCommand.ConditionState state, + TCommand tc) { + if(tc.isSetOrder()) { + state.order(JavaThriftBridge.convert(tc.getOrder())); + } + } + + /** + * Apply the optional page from a {@link TCommand} to a + * {@link FindCommand.ConditionState}. + * + * @param state the {@link FindCommand.ConditionState} to modify + * @param tc the {@link TCommand} containing the page + */ + private static void applyPage(FindCommand.ConditionState state, + TCommand tc) { + if(tc.isSetPage()) { + state.page(JavaThriftBridge.convert(tc.getPage())); + } + } + + /** + * Apply the optional timestamp from a {@link TCommand} to a + * {@link SelectCommand.SourceState}. + * + * @param state the {@link SelectCommand.SourceState} to modify + * @param tc the {@link TCommand} containing the timestamp + */ + private static void applyTimestamp(SelectCommand.SourceState state, + TCommand tc) { + if(tc.isSetTimestamp()) { + state.at(Timestamp.fromMicros(tc.getTimestamp())); + } + } + + /** + * Apply the optional order from a {@link TCommand} to a + * {@link SelectCommand.SourceState}. + * + * @param state the {@link SelectCommand.SourceState} to modify + * @param tc the {@link TCommand} containing the order + */ + private static void applyOrder(SelectCommand.SourceState state, + TCommand tc) { + if(tc.isSetOrder()) { + state.order(JavaThriftBridge.convert(tc.getOrder())); + } + } + + /** + * Apply the optional page from a {@link TCommand} to a + * {@link SelectCommand.SourceState}. + * + * @param state the {@link SelectCommand.SourceState} to modify + * @param tc the {@link TCommand} containing the page + */ + private static void applyPage(SelectCommand.SourceState state, + TCommand tc) { + if(tc.isSetPage()) { + state.page(JavaThriftBridge.convert(tc.getPage())); + } + } + + /** + * Apply the optional timestamp from a {@link TCommand} to a + * {@link GetCommand.SourceState}. + * + * @param state the {@link GetCommand.SourceState} to modify + * @param tc the {@link TCommand} containing the timestamp + */ + private static void applyTimestamp(GetCommand.SourceState state, + TCommand tc) { + if(tc.isSetTimestamp()) { + state.at(Timestamp.fromMicros(tc.getTimestamp())); + } + } + + /** + * Apply the optional order from a {@link TCommand} to a + * {@link GetCommand.SourceState}. + * + * @param state the {@link GetCommand.SourceState} to modify + * @param tc the {@link TCommand} containing the order + */ + private static void applyOrder(GetCommand.SourceState state, TCommand tc) { + if(tc.isSetOrder()) { + state.order(JavaThriftBridge.convert(tc.getOrder())); + } + } + + /** + * Apply the optional page from a {@link TCommand} to a + * {@link GetCommand.SourceState}. + * + * @param state the {@link GetCommand.SourceState} to modify + * @param tc the {@link TCommand} containing the page + */ + private static void applyPage(GetCommand.SourceState state, TCommand tc) { + if(tc.isSetPage()) { + state.page(JavaThriftBridge.convert(tc.getPage())); + } + } + + /** + * Apply the optional timestamp from a {@link TCommand} to a + * {@link NavigateCommand.SourceState}. + * + * @param state the {@link NavigateCommand.SourceState} to modify + * @param tc the {@link TCommand} containing the timestamp + */ + private static void applyTimestamp(NavigateCommand.SourceState state, + TCommand tc) { + if(tc.isSetTimestamp()) { + state.at(Timestamp.fromMicros(tc.getTimestamp())); + } + } + + /** + * Apply the optional timestamp from a {@link TCommand} to a + * {@link BrowseCommand.State}. + * + * @param state the {@link BrowseCommand.State} to modify + * @param tc the {@link TCommand} containing the timestamp + */ + private static void applyTimestamp(BrowseCommand.State state, TCommand tc) { + if(tc.isSetTimestamp()) { + state.at(Timestamp.fromMicros(tc.getTimestamp())); + } + } + + /** + * Apply the optional timestamp from a {@link TCommand} to a + * {@link DescribeCommand.State}. + * + * @param state the {@link DescribeCommand.State} to modify + * @param tc the {@link TCommand} containing the timestamp + */ + private static void applyTimestamp(DescribeCommand.State state, + TCommand tc) { + if(tc.isSetTimestamp()) { + state.at(Timestamp.fromMicros(tc.getTimestamp())); + } + } + + /** + * Apply the optional timestamp from a {@link TCommand} to a + * {@link DescribeCommand.AllState}. + * + * @param state the {@link DescribeCommand.AllState} to modify + * @param tc the {@link TCommand} containing the timestamp + */ + private static void applyTimestamp(DescribeCommand.AllState state, + TCommand tc) { + if(tc.isSetTimestamp()) { + state.at(Timestamp.fromMicros(tc.getTimestamp())); + } + } + + /** + * Apply the optional timestamp from a {@link TCommand} to a + * {@link TraceCommand.State}. + * + * @param state the {@link TraceCommand.State} to modify + * @param tc the {@link TCommand} containing the timestamp + */ + private static void applyTimestamp(TraceCommand.State state, TCommand tc) { + if(tc.isSetTimestamp()) { + state.at(Timestamp.fromMicros(tc.getTimestamp())); + } + } + + /** + * Apply the optional timestamp from a {@link TCommand} to a + * {@link JsonifyCommand.State}. + * + * @param state the {@link JsonifyCommand.State} to modify + * @param tc the {@link TCommand} containing the timestamp + */ + private static void applyTimestamp(JsonifyCommand.State state, + TCommand tc) { + if(tc.isSetTimestamp()) { + state.at(Timestamp.fromMicros(tc.getTimestamp())); + } + } + + /** + * Apply the optional timestamp from a {@link TCommand} to a + * {@link CalculateCommand.State}. + * + * @param state the {@link CalculateCommand.State} to modify + * @param tc the {@link TCommand} containing the timestamp + */ + private static void applyTimestamp(CalculateCommand.State state, + TCommand tc) { + if(tc.isSetTimestamp()) { + state.at(Timestamp.fromMicros(tc.getTimestamp())); + } + } + + /** + * Extract all elements after the first from a {@link List} of {@link Long + * Longs} as a {@code long} array. + * + * @param list the {@link List} to extract from + * @return the tail as a {@code long} array + */ + private static long[] tail(List list) { + return tail(list, 1); + } + + /** + * Extract all elements starting at {@code offset} from a {@link List} of + * {@link Long Longs} as a {@code long} array. + * + * @param list the {@link List} to extract from + * @param offset the starting index + * @return the sub-list as a {@code long} array + */ + private static long[] tail(List list, int offset) { + long[] arr = new long[list.size() - offset]; + for (int i = offset; i < list.size(); i++) { + arr[i - offset] = list.get(i); + } + return arr; + } + + /** + * Serialize a nullary {@link BuiltCommand} into a {@link TCommand}. + * + * @param command the {@link BuiltCommand} to serialize + * @return the {@link TCommand} + */ + private static TCommand serializeBuiltCommand(BuiltCommand command) { + String verb = command.ccl().toUpperCase(); + return new TCommand(TCommandVerb.valueOf(verb)); + } + + /** + * Serialize a {@code find} {@link FindCommand.ConditionState} into a + * {@link TCommand}. + * + * @param state the {@link FindCommand.ConditionState} to serialize + * @return the {@link TCommand} + */ + private static TCommand serializeFindCommand( + FindCommand.ConditionState state) { + TCommand tc = new TCommand(TCommandVerb.FIND); + setCondition(tc, state.criteria(), state.condition()); + setTimestamp(tc, state.timestamp()); + setOrder(tc, state.order()); + setPage(tc, state.page()); + return tc; + } + + /** + * Serialize a {@code select} {@link SelectCommand.SourceState} into a + * {@link TCommand}. + * + * @param state the {@link SelectCommand.SourceState} to serialize + * @return the {@link TCommand} + */ + private static TCommand serializeSelectCommand( + SelectCommand.SourceState state) { + TCommand tc = new TCommand(TCommandVerb.SELECT); + setKeys(tc, state.keys()); + setRecords(tc, state.records()); + setCondition(tc, state.criteria(), state.condition()); + setTimestamp(tc, state.timestamp()); + setOrder(tc, state.order()); + setPage(tc, state.page()); + return tc; + } + + /** + * Serialize a {@code get} {@link GetCommand.SourceState} into a + * {@link TCommand}. + * + * @param state the {@link GetCommand.SourceState} to serialize + * @return the {@link TCommand} + */ + private static TCommand serializeGetCommand(GetCommand.SourceState state) { + TCommand tc = new TCommand(TCommandVerb.GET); + setKeys(tc, state.keys()); + setRecords(tc, state.records()); + setCondition(tc, state.criteria(), state.condition()); + setTimestamp(tc, state.timestamp()); + setOrder(tc, state.order()); + setPage(tc, state.page()); + return tc; + } + + /** + * Serialize a {@code navigate} {@link NavigateCommand.SourceState} into a + * {@link TCommand}. + * + * @param state the {@link NavigateCommand.SourceState} to serialize + * @return the {@link TCommand} + */ + private static TCommand serializeNavigateCommand( + NavigateCommand.SourceState state) { + TCommand tc = new TCommand(TCommandVerb.NAVIGATE); + setKeys(tc, state.keys()); + setRecords(tc, state.records()); + setCondition(tc, state.criteria(), state.condition()); + setTimestamp(tc, state.timestamp()); + return tc; + } + + /** + * Serialize an {@code add} {@link AddCommand.RecordState} into a + * {@link TCommand} with record targets. + * + * @param state the {@link AddCommand.RecordState} to serialize + * @return the {@link TCommand} + */ + private static TCommand serializeAddRecordCommand( + AddCommand.RecordState state) { + TCommand tc = new TCommand(TCommandVerb.ADD); + tc.setKeys(Collections.singletonList(state.key())); + tc.setValue(Convert.javaToThrift(state.value())); + tc.setRecords(state.records()); + return tc; + } + + /** + * Serialize an {@code add} {@link AddCommand.ValueState} into a + * {@link TCommand} without record targets. + * + * @param state the {@link AddCommand.ValueState} to serialize + * @return the {@link TCommand} + */ + private static TCommand serializeAddValueCommand( + AddCommand.ValueState state) { + TCommand tc = new TCommand(TCommandVerb.ADD); + tc.setKeys(Collections.singletonList(state.key())); + tc.setValue(Convert.javaToThrift(state.value())); + return tc; + } + + /** + * Serialize a {@code set} {@link SetCommand.RecordState} into a + * {@link TCommand}. + * + * @param state the {@link SetCommand.RecordState} to serialize + * @return the {@link TCommand} + */ + private static TCommand serializeSetCommand(SetCommand.RecordState state) { + TCommand tc = new TCommand(TCommandVerb.SET); + tc.setKeys(Collections.singletonList(state.key())); + tc.setValue(Convert.javaToThrift(state.value())); + tc.setRecords(state.records()); + return tc; + } + + /** + * Serialize a {@code remove} {@link RemoveCommand.RecordState} into a + * {@link TCommand}. + * + * @param state the {@link RemoveCommand.RecordState} to serialize + * @return the {@link TCommand} + */ + private static TCommand serializeRemoveCommand( + RemoveCommand.RecordState state) { + TCommand tc = new TCommand(TCommandVerb.REMOVE); + tc.setKeys(Collections.singletonList(state.key())); + if(state.value() != null) { + tc.setValue(Convert.javaToThrift(state.value())); + } + tc.setRecords(state.records()); + return tc; + } + + /** + * Serialize a {@code clear} {@link ClearCommand.RecordState} into a + * {@link TCommand}. + * + * @param state the {@link ClearCommand.RecordState} to serialize + * @return the {@link TCommand} + */ + private static TCommand serializeClearCommand( + ClearCommand.RecordState state) { + TCommand tc = new TCommand(TCommandVerb.CLEAR); + if(state.keys() != null) { + tc.setKeys(state.keys()); + } + tc.setRecords(state.records()); + return tc; + } + + /** + * Serialize an {@code insert} {@link InsertCommand.RecordState} into a + * {@link TCommand} with record targets. + * + * @param state the {@link InsertCommand.RecordState} to serialize + * @return the {@link TCommand} + */ + private static TCommand serializeInsertRecordCommand( + InsertCommand.RecordState state) { + TCommand tc = new TCommand(TCommandVerb.INSERT); + tc.setJson(state.json()); + tc.setRecords(state.records()); + return tc; + } + + /** + * Serialize an {@code insert} {@link InsertCommand.JsonState} into a + * {@link TCommand} without record targets. + * + * @param state the {@link InsertCommand.JsonState} to serialize + * @return the {@link TCommand} + */ + private static TCommand serializeInsertJsonCommand( + InsertCommand.JsonState state) { + TCommand tc = new TCommand(TCommandVerb.INSERT); + tc.setJson(state.json()); + return tc; + } + + /** + * Serialize a {@code link} {@link LinkCommand.DestinationState} into a + * {@link TCommand}. + * + * @param state the {@link LinkCommand.DestinationState} to serialize + * @return the {@link TCommand} + */ + private static TCommand serializeLinkCommand( + LinkCommand.DestinationState state) { + TCommand tc = new TCommand(TCommandVerb.LINK); + tc.setKeys(Collections.singletonList(state.key())); + tc.setSourceRecord(state.source()); + tc.setRecords(state.destinations()); + return tc; + } + + /** + * Serialize an {@code unlink} {@link UnlinkCommand.DestinationState} into a + * {@link TCommand}. + * + * @param state the {@link UnlinkCommand.DestinationState} to serialize + * @return the {@link TCommand} + */ + private static TCommand serializeUnlinkCommand( + UnlinkCommand.DestinationState state) { + TCommand tc = new TCommand(TCommandVerb.UNLINK); + tc.setKeys(Collections.singletonList(state.key())); + tc.setSourceRecord(state.source()); + tc.setRecords(Collections.singletonList(state.destination())); + return tc; + } + + /** + * Serialize a {@code verify} {@link VerifyCommand.RecordState} into a + * {@link TCommand} without a timestamp. + * + * @param state the {@link VerifyCommand.RecordState} to serialize + * @return the {@link TCommand} + */ + private static TCommand serializeVerifyCommand( + VerifyCommand.RecordState state) { + TCommand tc = new TCommand(TCommandVerb.VERIFY); + tc.setKeys(Collections.singletonList(state.key())); + tc.setValue(Convert.javaToThrift(state.value())); + tc.setRecords(Collections.singletonList(state.record())); + return tc; + } + + /** + * Serialize a {@code verify} {@link VerifyCommand.TimestampState} into a + * {@link TCommand} with a timestamp. + * + * @param state the {@link VerifyCommand.TimestampState} to serialize + * @return the {@link TCommand} + */ + private static TCommand serializeVerifyTimestampCommand( + VerifyCommand.TimestampState state) { + TCommand tc = new TCommand(TCommandVerb.VERIFY); + tc.setKeys(Collections.singletonList(state.key())); + tc.setValue(Convert.javaToThrift(state.value())); + tc.setRecords(Collections.singletonList(state.record())); + tc.setTimestamp(state.timestamp().getMicros()); + return tc; + } + + /** + * Serialize a {@code verifyAndSwap} {@link VerifyAndSwapCommand.SwapState} + * into a {@link TCommand}. + * + * @param state the {@link VerifyAndSwapCommand.SwapState} to serialize + * @return the {@link TCommand} + */ + private static TCommand serializeVerifyAndSwapCommand( + VerifyAndSwapCommand.SwapState state) { + TCommand tc = new TCommand(TCommandVerb.VERIFY_AND_SWAP); + tc.setKeys(Collections.singletonList(state.key())); + tc.setValue(Convert.javaToThrift(state.expected())); + tc.setReplacement(Convert.javaToThrift(state.replacement())); + tc.setRecords(Collections.singletonList(state.record())); + return tc; + } + + /** + * Serialize a {@code verifyOrSet} {@link VerifyOrSetCommand.RecordState} + * into a {@link TCommand}. + * + * @param state the {@link VerifyOrSetCommand.RecordState} to serialize + * @return the {@link TCommand} + */ + private static TCommand serializeVerifyOrSetCommand( + VerifyOrSetCommand.RecordState state) { + TCommand tc = new TCommand(TCommandVerb.VERIFY_OR_SET); + tc.setKeys(Collections.singletonList(state.key())); + tc.setValue(Convert.javaToThrift(state.value())); + tc.setRecords(Collections.singletonList(state.record())); + return tc; + } + + /** + * Serialize a {@code findOrAdd} {@link FindOrAddCommand.ValueState} into a + * {@link TCommand}. + * + * @param state the {@link FindOrAddCommand.ValueState} to serialize + * @return the {@link TCommand} + */ + private static TCommand serializeFindOrAddCommand( + FindOrAddCommand.ValueState state) { + TCommand tc = new TCommand(TCommandVerb.FIND_OR_ADD); + tc.setKeys(Collections.singletonList(state.key())); + tc.setValue(Convert.javaToThrift(state.value())); + return tc; + } + + /** + * Serialize a {@code findOrInsert} {@link FindOrInsertCommand.JsonState} + * into a {@link TCommand}. + * + * @param state the {@link FindOrInsertCommand.JsonState} to serialize + * @return the {@link TCommand} + */ + private static TCommand serializeFindOrInsertCommand( + FindOrInsertCommand.JsonState state) { + TCommand tc = new TCommand(TCommandVerb.FIND_OR_INSERT); + setCondition(tc, state.criteria(), state.condition()); + setTimestamp(tc, state.timestamp()); + tc.setJson(state.json()); + return tc; + } + + /** + * Serialize a {@code search} {@link SearchCommand.QueryState} into a + * {@link TCommand}. + * + * @param state the {@link SearchCommand.QueryState} to serialize + * @return the {@link TCommand} + */ + private static TCommand serializeSearchCommand( + SearchCommand.QueryState state) { + TCommand tc = new TCommand(TCommandVerb.SEARCH); + tc.setKeys(Collections.singletonList(state.key())); + tc.setQuery(state.query()); + return tc; + } + + /** + * Serialize a {@code browse} {@link BrowseCommand.State} into a + * {@link TCommand}. + * + * @param state the {@link BrowseCommand.State} to serialize + * @return the {@link TCommand} + */ + private static TCommand serializeBrowseCommand(BrowseCommand.State state) { + TCommand tc = new TCommand(TCommandVerb.BROWSE); + tc.setKeys(state.keys()); + setTimestamp(tc, state.timestamp()); + return tc; + } + + /** + * Serialize a {@code describe} {@link DescribeCommand.AllState} into a + * {@link TCommand} without records. + * + * @param state the {@link DescribeCommand.AllState} to serialize + * @return the {@link TCommand} + */ + private static TCommand serializeDescribeAllCommand( + DescribeCommand.AllState state) { + TCommand tc = new TCommand(TCommandVerb.DESCRIBE); + setTimestamp(tc, state.timestamp()); + return tc; + } + + /** + * Serialize a {@code describe} {@link DescribeCommand.State} into a + * {@link TCommand} with records. + * + * @param state the {@link DescribeCommand.State} to serialize + * @return the {@link TCommand} + */ + private static TCommand serializeDescribeCommand( + DescribeCommand.State state) { + TCommand tc = new TCommand(TCommandVerb.DESCRIBE); + tc.setRecords(state.records()); + setTimestamp(tc, state.timestamp()); + return tc; + } + + /** + * Serialize a {@code trace} {@link TraceCommand.State} into a + * {@link TCommand}. + * + * @param state the {@link TraceCommand.State} to serialize + * @return the {@link TCommand} + */ + private static TCommand serializeTraceCommand(TraceCommand.State state) { + TCommand tc = new TCommand(TCommandVerb.TRACE); + tc.setRecords(state.records()); + setTimestamp(tc, state.timestamp()); + return tc; + } + + /** + * Serialize a {@code holds} {@link HoldsCommand.State} into a + * {@link TCommand}. + * + * @param state the {@link HoldsCommand.State} to serialize + * @return the {@link TCommand} + */ + private static TCommand serializeHoldsCommand(HoldsCommand.State state) { + TCommand tc = new TCommand(TCommandVerb.HOLDS); + tc.setRecords(state.records()); + return tc; + } + + /** + * Serialize a {@code jsonify} {@link JsonifyCommand.State} into a + * {@link TCommand}. + * + * @param state the {@link JsonifyCommand.State} to serialize + * @return the {@link TCommand} + */ + private static TCommand serializeJsonifyCommand( + JsonifyCommand.State state) { + TCommand tc = new TCommand(TCommandVerb.JSONIFY); + tc.setRecords(state.records()); + setTimestamp(tc, state.timestamp()); + return tc; + } + + /** + * Serialize a {@code chronicle} {@link ChronicleCommand.RangeState} into a + * {@link TCommand} with a time range. + * + * @param state the {@link ChronicleCommand.RangeState} to serialize + * @return the {@link TCommand} + */ + private static TCommand serializeChronicleRangeCommand( + ChronicleCommand.RangeState state) { + TCommand tc = new TCommand(TCommandVerb.CHRONICLE); + tc.setKeys(Collections.singletonList(state.key())); + tc.setRecords(Collections.singletonList(state.record())); + tc.setTimestamp(state.start().getMicros()); + tc.setEndTimestamp(state.end().getMicros()); + return tc; + } + + /** + * Serialize a {@code chronicle} {@link ChronicleCommand.TimestampState} + * into a {@link TCommand} with a start timestamp. + * + * @param state the {@link ChronicleCommand.TimestampState} to serialize + * @return the {@link TCommand} + */ + private static TCommand serializeChronicleTimestampCommand( + ChronicleCommand.TimestampState state) { + TCommand tc = new TCommand(TCommandVerb.CHRONICLE); + tc.setKeys(Collections.singletonList(state.key())); + tc.setRecords(Collections.singletonList(state.record())); + tc.setTimestamp(state.start().getMicros()); + return tc; + } + + /** + * Serialize a {@code chronicle} {@link ChronicleCommand.RecordState} into a + * {@link TCommand} without timestamps. + * + * @param state the {@link ChronicleCommand.RecordState} to serialize + * @return the {@link TCommand} + */ + private static TCommand serializeChronicleRecordCommand( + ChronicleCommand.RecordState state) { + TCommand tc = new TCommand(TCommandVerb.CHRONICLE); + tc.setKeys(Collections.singletonList(state.key())); + tc.setRecords(Collections.singletonList(state.record())); + return tc; + } + + /** + * Serialize a {@code diff} {@link DiffCommand.KeyRecordRangeState} into a + * {@link TCommand}. + * + * @param state the {@link DiffCommand.KeyRecordRangeState} to serialize + * @return the {@link TCommand} + */ + private static TCommand serializeDiffCommand( + DiffCommand.KeyRecordRangeState state) { + TCommand tc = new TCommand(TCommandVerb.DIFF); + tc.setKeys(Collections.singletonList(state.key())); + tc.setRecords(Collections.singletonList(state.record())); + tc.setTimestamp(state.start().getMicros()); + tc.setEndTimestamp(state.end().getMicros()); + return tc; + } + + /** + * Serialize a {@code diff} {@link DiffCommand.KeyRecordTimestampState} into + * a {@link TCommand}. + * + * @param state the {@link DiffCommand.KeyRecordTimestampState} to serialize + * @return the {@link TCommand} + */ + private static TCommand serializeDiffCommand( + DiffCommand.KeyRecordTimestampState state) { + TCommand tc = new TCommand(TCommandVerb.DIFF); + tc.setKeys(Collections.singletonList(state.key())); + tc.setRecords(Collections.singletonList(state.record())); + tc.setTimestamp(state.start().getMicros()); + return tc; + } + + /** + * Serialize a {@code diff} {@link DiffCommand.KeyRangeState} into a + * {@link TCommand}. + * + * @param state the {@link DiffCommand.KeyRangeState} to serialize + * @return the {@link TCommand} + */ + private static TCommand serializeDiffCommand( + DiffCommand.KeyRangeState state) { + TCommand tc = new TCommand(TCommandVerb.DIFF); + tc.setKeys(Collections.singletonList(state.key())); + tc.setTimestamp(state.start().getMicros()); + tc.setEndTimestamp(state.end().getMicros()); + return tc; + } + + /** + * Serialize a {@code diff} {@link DiffCommand.KeyTimestampState} into a + * {@link TCommand}. + * + * @param state the {@link DiffCommand.KeyTimestampState} to serialize + * @return the {@link TCommand} + */ + private static TCommand serializeDiffCommand( + DiffCommand.KeyTimestampState state) { + TCommand tc = new TCommand(TCommandVerb.DIFF); + tc.setKeys(Collections.singletonList(state.key())); + tc.setTimestamp(state.start().getMicros()); + return tc; + } + + /** + * Serialize a {@code diff} {@link DiffCommand.RecordRangeState} into a + * {@link TCommand}. + * + * @param state the {@link DiffCommand.RecordRangeState} to serialize + * @return the {@link TCommand} + */ + private static TCommand serializeDiffCommand( + DiffCommand.RecordRangeState state) { + TCommand tc = new TCommand(TCommandVerb.DIFF); + tc.setRecords(Collections.singletonList(state.record())); + tc.setTimestamp(state.start().getMicros()); + tc.setEndTimestamp(state.end().getMicros()); + return tc; + } + + /** + * Serialize a {@code diff} {@link DiffCommand.RecordTimestampState} into a + * {@link TCommand}. + * + * @param state the {@link DiffCommand.RecordTimestampState} to serialize + * @return the {@link TCommand} + */ + private static TCommand serializeDiffCommand( + DiffCommand.RecordTimestampState state) { + TCommand tc = new TCommand(TCommandVerb.DIFF); + tc.setRecords(Collections.singletonList(state.record())); + tc.setTimestamp(state.start().getMicros()); + return tc; + } + + /** + * Serialize an {@code audit} {@link AuditCommand.KeyRecordRangeState} into + * a {@link TCommand}. + * + * @param state the {@link AuditCommand.KeyRecordRangeState} to serialize + * @return the {@link TCommand} + */ + private static TCommand serializeAuditCommand( + AuditCommand.KeyRecordRangeState state) { + TCommand tc = new TCommand(TCommandVerb.AUDIT); + tc.setKeys(Collections.singletonList(state.key())); + tc.setRecords(Collections.singletonList(state.record())); + tc.setTimestamp(state.start().getMicros()); + tc.setEndTimestamp(state.end().getMicros()); + return tc; + } + + /** + * Serialize an {@code audit} {@link AuditCommand.KeyRecordTimestampState} + * into a {@link TCommand}. + * + * @param state the {@link AuditCommand.KeyRecordTimestampState} to + * serialize + * @return the {@link TCommand} + */ + private static TCommand serializeAuditCommand( + AuditCommand.KeyRecordTimestampState state) { + TCommand tc = new TCommand(TCommandVerb.AUDIT); + tc.setKeys(Collections.singletonList(state.key())); + tc.setRecords(Collections.singletonList(state.record())); + tc.setTimestamp(state.start().getMicros()); + return tc; + } + + /** + * Serialize an {@code audit} {@link AuditCommand.RecordRangeState} into a + * {@link TCommand}. + * + * @param state the {@link AuditCommand.RecordRangeState} to serialize + * @return the {@link TCommand} + */ + private static TCommand serializeAuditCommand( + AuditCommand.RecordRangeState state) { + TCommand tc = new TCommand(TCommandVerb.AUDIT); + tc.setRecords(Collections.singletonList(state.record())); + tc.setTimestamp(state.start().getMicros()); + tc.setEndTimestamp(state.end().getMicros()); + return tc; + } + + /** + * Serialize an {@code audit} {@link AuditCommand.RecordTimestampState} into + * a {@link TCommand}. + * + * @param state the {@link AuditCommand.RecordTimestampState} to serialize + * @return the {@link TCommand} + */ + private static TCommand serializeAuditCommand( + AuditCommand.RecordTimestampState state) { + TCommand tc = new TCommand(TCommandVerb.AUDIT); + tc.setRecords(Collections.singletonList(state.record())); + tc.setTimestamp(state.start().getMicros()); + return tc; + } + + /** + * Serialize an {@code audit} {@link AuditCommand.KeyRecordState} into a + * {@link TCommand}. + * + * @param state the {@link AuditCommand.KeyRecordState} to serialize + * @return the {@link TCommand} + */ + private static TCommand serializeAuditCommand( + AuditCommand.KeyRecordState state) { + TCommand tc = new TCommand(TCommandVerb.AUDIT); + tc.setKeys(Collections.singletonList(state.key())); + tc.setRecords(Collections.singletonList(state.record())); + return tc; + } + + /** + * Serialize an {@code audit} {@link AuditCommand.RecordState} into a + * {@link TCommand}. + * + * @param state the {@link AuditCommand.RecordState} to serialize + * @return the {@link TCommand} + */ + private static TCommand serializeAuditCommand( + AuditCommand.RecordState state) { + TCommand tc = new TCommand(TCommandVerb.AUDIT); + tc.setRecords(Collections.singletonList(state.record())); + return tc; + } + + /** + * Serialize a {@code revert} {@link RevertCommand.TimestampState} into a + * {@link TCommand}. + * + * @param state the {@link RevertCommand.TimestampState} to serialize + * @return the {@link TCommand} + */ + private static TCommand serializeRevertCommand( + RevertCommand.TimestampState state) { + TCommand tc = new TCommand(TCommandVerb.REVERT); + tc.setKeys(state.keys()); + tc.setRecords(state.records()); + tc.setTimestamp(state.timestamp().getMicros()); + return tc; + } + + /** + * Serialize a {@code reconcile} {@link ReconcileCommand.ValuesState} into a + * {@link TCommand}. + * + * @param state the {@link ReconcileCommand.ValuesState} to serialize + * @return the {@link TCommand} + */ + private static TCommand serializeReconcileCommand( + ReconcileCommand.ValuesState state) { + TCommand tc = new TCommand(TCommandVerb.RECONCILE); + tc.setKeys(Collections.singletonList(state.key())); + tc.setRecords(Collections.singletonList(state.record())); + List tvalues = state.values().stream() + .map(Convert::javaToThrift).collect(Collectors.toList()); + tc.setValues(tvalues); + return tc; + } + + /** + * Serialize a {@code consolidate} {@link ConsolidateCommand.State} into a + * {@link TCommand}. + * + * @param state the {@link ConsolidateCommand.State} to serialize + * @return the {@link TCommand} + */ + private static TCommand serializeConsolidateCommand( + ConsolidateCommand.State state) { + TCommand tc = new TCommand(TCommandVerb.CONSOLIDATE); + tc.setRecords(state.records()); + return tc; + } + + /** + * Serialize a {@code calculate} {@link CalculateCommand.State} into a + * {@link TCommand}. + * + * @param state the {@link CalculateCommand.State} to serialize + * @return the {@link TCommand} + */ + private static TCommand serializeCalculateCommand( + CalculateCommand.State state) { + TCommand tc = new TCommand(TCommandVerb.CALCULATE); + tc.setFunction(state.function()); + tc.setKeys(Collections.singletonList(state.key())); + if(state.records() != null) { + tc.setRecords(state.records()); + } + setCondition(tc, state.criteria(), state.condition()); + setTimestamp(tc, state.timestamp()); + return tc; + } + + /** + * Set the condition fields on a {@link TCommand} from the given + * {@link Criteria} or CCL condition string. + * + * @param tc the {@link TCommand} to modify + * @param criteria the {@link Criteria}, or {@code null} + * @param condition the CCL condition string, or {@code null} + */ + private static void setCondition(TCommand tc, @Nullable Criteria criteria, + @Nullable String condition) { + if(criteria != null) { + tc.setCriteria(Language.translateToThriftCriteria(criteria)); + } + else if(condition != null) { + tc.setCondition(condition); + } + } + + /** + * Set the timestamp field on a {@link TCommand} if the given + * {@link Timestamp} is not {@code null}. + * + * @param tc the {@link TCommand} to modify + * @param timestamp the {@link Timestamp}, or {@code null} + */ + private static void setTimestamp(TCommand tc, + @Nullable Timestamp timestamp) { + if(timestamp != null) { + tc.setTimestamp(timestamp.getMicros()); + } + } + + /** + * Set the order field on a {@link TCommand} if the given {@link Order} is + * not {@code null}. + * + * @param tc the {@link TCommand} to modify + * @param order the {@link Order}, or {@code null} + */ + private static void setOrder(TCommand tc, @Nullable Order order) { + if(order != null) { + tc.setOrder(JavaThriftBridge.convert(order)); + } + } + + /** + * Set the page field on a {@link TCommand} if the given {@link Page} is not + * {@code null}. + * + * @param tc the {@link TCommand} to modify + * @param page the {@link Page}, or {@code null} + */ + private static void setPage(TCommand tc, @Nullable Page page) { + if(page != null) { + tc.setPage(JavaThriftBridge.convert(page)); + } + } + + /** + * Set the keys field on a {@link TCommand} from a list that may be + * {@code null} or empty (indicating all keys). + * + * @param tc the {@link TCommand} to modify + * @param keys the keys {@link List}, or {@code null} + */ + private static void setKeys(TCommand tc, @Nullable List keys) { + if(keys != null && !keys.isEmpty()) { + tc.setKeys(keys); + } + } + + /** + * Set the records field on a {@link TCommand} if the given list is not + * {@code null}. + * + * @param tc the {@link TCommand} to modify + * @param records the records {@link List}, or {@code null} + */ + private static void setRecords(TCommand tc, @Nullable List records) { + if(records != null) { + tc.setRecords(records); + } + } + + /** + * Construct a new {@link CommandSerializer}. + */ + private CommandSerializer() {/* no-init */} + +} diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/GetCommand.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/GetCommand.java index e04411b03..8602202cb 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/GetCommand.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/GetCommand.java @@ -381,6 +381,16 @@ public Criteria criteria() { return criteria; } + /** + * Return the raw CCL condition for this command. + * + * @return the condition string, or {@code null} + */ + @Nullable + public String condition() { + return condition; + } + /** * Return the historical {@link Timestamp}. * diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/NavigateCommand.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/NavigateCommand.java index 9b8c5fad6..dfce1ae44 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/NavigateCommand.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/NavigateCommand.java @@ -239,6 +239,16 @@ public Criteria criteria() { return criteria; } + /** + * Return the raw CCL condition for this command. + * + * @return the condition string, or {@code null} + */ + @Nullable + public String condition() { + return condition; + } + /** * Return the historical {@link Timestamp}. * diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/SelectCommand.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/SelectCommand.java index 0b2cb5e99..ccb6182ab 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/SelectCommand.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/SelectCommand.java @@ -381,6 +381,16 @@ public Criteria criteria() { return criteria; } + /** + * Return the raw CCL condition for this command. + * + * @return the condition string, or {@code null} + */ + @Nullable + public String condition() { + return condition; + } + /** * Return the historical {@link Timestamp}. * diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/thrift/TCommand.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/thrift/TCommand.java new file mode 100644 index 000000000..65558dd29 --- /dev/null +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/thrift/TCommand.java @@ -0,0 +1,2494 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.thrift; + +/** + * A structured representation of a complete Concourse command that can be + * transmitted over the wire. Each command is identified by a required verb; the + * optional fields carry the parameters appropriate for that verb. + * + * Reuses existing types (TCriteria, TOrder, TPage, TObject) for condition, + * ordering, pagination, and values. + */ +@SuppressWarnings({ "cast", "rawtypes", "serial", "unchecked", "unused" }) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.20.0)", date = "2026-03-14") +public class TCommand 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( + "TCommand"); + + private static final org.apache.thrift.protocol.TField VERB_FIELD_DESC = new org.apache.thrift.protocol.TField( + "verb", org.apache.thrift.protocol.TType.I32, (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.protocol.TField RECORDS_FIELD_DESC = new org.apache.thrift.protocol.TField( + "records", org.apache.thrift.protocol.TType.LIST, (short) 3); + private static final org.apache.thrift.protocol.TField CRITERIA_FIELD_DESC = new org.apache.thrift.protocol.TField( + "criteria", org.apache.thrift.protocol.TType.STRUCT, (short) 4); + private static final org.apache.thrift.protocol.TField CONDITION_FIELD_DESC = new org.apache.thrift.protocol.TField( + "condition", org.apache.thrift.protocol.TType.STRING, (short) 5); + private static final org.apache.thrift.protocol.TField TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField( + "timestamp", org.apache.thrift.protocol.TType.I64, (short) 6); + private static final org.apache.thrift.protocol.TField END_TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField( + "endTimestamp", org.apache.thrift.protocol.TType.I64, (short) 7); + private static final org.apache.thrift.protocol.TField ORDER_FIELD_DESC = new org.apache.thrift.protocol.TField( + "order", org.apache.thrift.protocol.TType.STRUCT, (short) 8); + private static final org.apache.thrift.protocol.TField PAGE_FIELD_DESC = new org.apache.thrift.protocol.TField( + "page", org.apache.thrift.protocol.TType.STRUCT, (short) 9); + private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField( + "value", org.apache.thrift.protocol.TType.STRUCT, (short) 10); + private static final org.apache.thrift.protocol.TField REPLACEMENT_FIELD_DESC = new org.apache.thrift.protocol.TField( + "replacement", org.apache.thrift.protocol.TType.STRUCT, (short) 11); + private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField( + "values", org.apache.thrift.protocol.TType.LIST, (short) 12); + private static final org.apache.thrift.protocol.TField JSON_FIELD_DESC = new org.apache.thrift.protocol.TField( + "json", org.apache.thrift.protocol.TType.STRING, (short) 13); + private static final org.apache.thrift.protocol.TField QUERY_FIELD_DESC = new org.apache.thrift.protocol.TField( + "query", org.apache.thrift.protocol.TType.STRING, (short) 14); + private static final org.apache.thrift.protocol.TField FUNCTION_FIELD_DESC = new org.apache.thrift.protocol.TField( + "function", org.apache.thrift.protocol.TType.STRING, (short) 15); + private static final org.apache.thrift.protocol.TField SOURCE_RECORD_FIELD_DESC = new org.apache.thrift.protocol.TField( + "sourceRecord", org.apache.thrift.protocol.TType.I64, (short) 16); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TCommandStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TCommandTupleSchemeFactory(); + + /** + * + * @see TCommandVerb + */ + public @org.apache.thrift.annotation.Nullable TCommandVerb verb; // required + public @org.apache.thrift.annotation.Nullable java.util.List keys; // optional + public @org.apache.thrift.annotation.Nullable java.util.List records; // optional + public @org.apache.thrift.annotation.Nullable TCriteria criteria; // optional + public @org.apache.thrift.annotation.Nullable java.lang.String condition; // optional + public long timestamp; // optional + public long endTimestamp; // optional + public @org.apache.thrift.annotation.Nullable TOrder order; // optional + public @org.apache.thrift.annotation.Nullable TPage page; // optional + public @org.apache.thrift.annotation.Nullable TObject value; // optional + public @org.apache.thrift.annotation.Nullable TObject replacement; // optional + public @org.apache.thrift.annotation.Nullable java.util.List values; // optional + public @org.apache.thrift.annotation.Nullable java.lang.String json; // optional + public @org.apache.thrift.annotation.Nullable java.lang.String query; // optional + public @org.apache.thrift.annotation.Nullable java.lang.String function; // optional + public long sourceRecord; // 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 { + /** + * + * @see TCommandVerb + */ + VERB((short) 1, "verb"), + KEYS((short) 2, "keys"), + RECORDS((short) 3, "records"), + CRITERIA((short) 4, "criteria"), + CONDITION((short) 5, "condition"), + TIMESTAMP((short) 6, "timestamp"), + END_TIMESTAMP((short) 7, "endTimestamp"), + ORDER((short) 8, "order"), + PAGE((short) 9, "page"), + VALUE((short) 10, "value"), + REPLACEMENT((short) 11, "replacement"), + VALUES((short) 12, "values"), + JSON((short) 13, "json"), + QUERY((short) 14, "query"), + FUNCTION((short) 15, "function"), + SOURCE_RECORD((short) 16, "sourceRecord"); + + 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: // VERB + return VERB; + case 2: // KEYS + return KEYS; + case 3: // RECORDS + return RECORDS; + case 4: // CRITERIA + return CRITERIA; + case 5: // CONDITION + return CONDITION; + case 6: // TIMESTAMP + return TIMESTAMP; + case 7: // END_TIMESTAMP + return END_TIMESTAMP; + case 8: // ORDER + return ORDER; + case 9: // PAGE + return PAGE; + case 10: // VALUE + return VALUE; + case 11: // REPLACEMENT + return REPLACEMENT; + case 12: // VALUES + return VALUES; + case 13: // JSON + return JSON; + case 14: // QUERY + return QUERY; + case 15: // FUNCTION + return FUNCTION; + case 16: // SOURCE_RECORD + return SOURCE_RECORD; + 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 __TIMESTAMP_ISSET_ID = 0; + private static final int __ENDTIMESTAMP_ISSET_ID = 1; + private static final int __SOURCERECORD_ISSET_ID = 2; + private byte __isset_bitfield = 0; + private static final _Fields optionals[] = { _Fields.KEYS, _Fields.RECORDS, + _Fields.CRITERIA, _Fields.CONDITION, _Fields.TIMESTAMP, + _Fields.END_TIMESTAMP, _Fields.ORDER, _Fields.PAGE, _Fields.VALUE, + _Fields.REPLACEMENT, _Fields.VALUES, _Fields.JSON, _Fields.QUERY, + _Fields.FUNCTION, _Fields.SOURCE_RECORD }; + 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.VERB, + new org.apache.thrift.meta_data.FieldMetaData("verb", + org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.EnumMetaData( + org.apache.thrift.protocol.TType.ENUM, + TCommandVerb.class))); + tmpMap.put(_Fields.KEYS, new org.apache.thrift.meta_data.FieldMetaData( + "keys", org.apache.thrift.TFieldRequirementType.OPTIONAL, + 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)))); + tmpMap.put(_Fields.RECORDS, + new org.apache.thrift.meta_data.FieldMetaData("records", + org.apache.thrift.TFieldRequirementType.OPTIONAL, + 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.I64)))); + tmpMap.put(_Fields.CRITERIA, + new org.apache.thrift.meta_data.FieldMetaData("criteria", + org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData( + org.apache.thrift.protocol.TType.STRUCT, + TCriteria.class))); + tmpMap.put(_Fields.CONDITION, + new org.apache.thrift.meta_data.FieldMetaData("condition", + org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData( + org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.TIMESTAMP, + new org.apache.thrift.meta_data.FieldMetaData("timestamp", + org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData( + org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.END_TIMESTAMP, + new org.apache.thrift.meta_data.FieldMetaData("endTimestamp", + org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData( + org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.ORDER, + new org.apache.thrift.meta_data.FieldMetaData("order", + org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData( + org.apache.thrift.protocol.TType.STRUCT, + TOrder.class))); + tmpMap.put(_Fields.PAGE, + new org.apache.thrift.meta_data.FieldMetaData("page", + org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData( + org.apache.thrift.protocol.TType.STRUCT, + TPage.class))); + tmpMap.put(_Fields.VALUE, + new org.apache.thrift.meta_data.FieldMetaData("value", + org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData( + org.apache.thrift.protocol.TType.STRUCT, + TObject.class))); + tmpMap.put(_Fields.REPLACEMENT, + new org.apache.thrift.meta_data.FieldMetaData("replacement", + org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData( + org.apache.thrift.protocol.TType.STRUCT, + TObject.class))); + tmpMap.put(_Fields.VALUES, + new org.apache.thrift.meta_data.FieldMetaData("values", + org.apache.thrift.TFieldRequirementType.OPTIONAL, + 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, + TObject.class)))); + tmpMap.put(_Fields.JSON, + new org.apache.thrift.meta_data.FieldMetaData("json", + org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData( + org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.QUERY, + new org.apache.thrift.meta_data.FieldMetaData("query", + org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData( + org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.FUNCTION, + new org.apache.thrift.meta_data.FieldMetaData("function", + org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData( + org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.SOURCE_RECORD, + new org.apache.thrift.meta_data.FieldMetaData("sourceRecord", + 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(TCommand.class, metaDataMap); + } + + public TCommand() {} + + public TCommand(TCommandVerb verb) { + this(); + this.verb = verb; + } + + /** + * Performs a deep copy on other. + */ + public TCommand(TCommand other) { + __isset_bitfield = other.__isset_bitfield; + if(other.isSetVerb()) { + this.verb = other.verb; + } + if(other.isSetKeys()) { + java.util.List __this__keys = new java.util.ArrayList( + other.keys); + this.keys = __this__keys; + } + if(other.isSetRecords()) { + java.util.List __this__records = new java.util.ArrayList( + other.records); + this.records = __this__records; + } + if(other.isSetCriteria()) { + this.criteria = new TCriteria(other.criteria); + } + if(other.isSetCondition()) { + this.condition = other.condition; + } + this.timestamp = other.timestamp; + this.endTimestamp = other.endTimestamp; + if(other.isSetOrder()) { + this.order = new TOrder(other.order); + } + if(other.isSetPage()) { + this.page = new TPage(other.page); + } + if(other.isSetValue()) { + this.value = new TObject(other.value); + } + if(other.isSetReplacement()) { + this.replacement = new TObject(other.replacement); + } + if(other.isSetValues()) { + java.util.List __this__values = new java.util.ArrayList( + other.values.size()); + for (TObject other_element : other.values) { + __this__values.add(new TObject(other_element)); + } + this.values = __this__values; + } + if(other.isSetJson()) { + this.json = other.json; + } + if(other.isSetQuery()) { + this.query = other.query; + } + if(other.isSetFunction()) { + this.function = other.function; + } + this.sourceRecord = other.sourceRecord; + } + + @Override + public TCommand deepCopy() { + return new TCommand(this); + } + + @Override + public void clear() { + this.verb = null; + this.keys = null; + this.records = null; + this.criteria = null; + this.condition = null; + setTimestampIsSet(false); + this.timestamp = 0; + setEndTimestampIsSet(false); + this.endTimestamp = 0; + this.order = null; + this.page = null; + this.value = null; + this.replacement = null; + this.values = null; + this.json = null; + this.query = null; + this.function = null; + setSourceRecordIsSet(false); + this.sourceRecord = 0; + } + + /** + * + * @see TCommandVerb + */ + @org.apache.thrift.annotation.Nullable + public TCommandVerb getVerb() { + return this.verb; + } + + /** + * + * @see TCommandVerb + */ + public TCommand setVerb( + @org.apache.thrift.annotation.Nullable TCommandVerb verb) { + this.verb = verb; + return this; + } + + public void unsetVerb() { + this.verb = null; + } + + /** + * Returns true if field verb is set (has been assigned a value) and false + * otherwise + */ + public boolean isSetVerb() { + return this.verb != null; + } + + public void setVerbIsSet(boolean value) { + if(!value) { + this.verb = null; + } + } + + 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.lang.String 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 TCommand 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 int getRecordsSize() { + return (this.records == null) ? 0 : this.records.size(); + } + + @org.apache.thrift.annotation.Nullable + public java.util.Iterator getRecordsIterator() { + return (this.records == null) ? null : this.records.iterator(); + } + + public void addToRecords(long elem) { + if(this.records == null) { + this.records = new java.util.ArrayList(); + } + this.records.add(elem); + } + + @org.apache.thrift.annotation.Nullable + public java.util.List getRecords() { + return this.records; + } + + public TCommand setRecords( + @org.apache.thrift.annotation.Nullable java.util.List records) { + this.records = records; + return this; + } + + public void unsetRecords() { + this.records = null; + } + + /** + * Returns true if field records is set (has been assigned a value) and + * false otherwise + */ + public boolean isSetRecords() { + return this.records != null; + } + + public void setRecordsIsSet(boolean value) { + if(!value) { + this.records = null; + } + } + + @org.apache.thrift.annotation.Nullable + public TCriteria getCriteria() { + return this.criteria; + } + + public TCommand setCriteria( + @org.apache.thrift.annotation.Nullable TCriteria criteria) { + this.criteria = criteria; + return this; + } + + public void unsetCriteria() { + this.criteria = null; + } + + /** + * Returns true if field criteria is set (has been assigned a value) and + * false otherwise + */ + public boolean isSetCriteria() { + return this.criteria != null; + } + + public void setCriteriaIsSet(boolean value) { + if(!value) { + this.criteria = null; + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getCondition() { + return this.condition; + } + + public TCommand setCondition( + @org.apache.thrift.annotation.Nullable java.lang.String condition) { + this.condition = condition; + return this; + } + + public void unsetCondition() { + this.condition = null; + } + + /** + * Returns true if field condition is set (has been assigned a value) and + * false otherwise + */ + public boolean isSetCondition() { + return this.condition != null; + } + + public void setConditionIsSet(boolean value) { + if(!value) { + this.condition = null; + } + } + + public long getTimestamp() { + return this.timestamp; + } + + public TCommand setTimestamp(long timestamp) { + this.timestamp = timestamp; + setTimestampIsSet(true); + return this; + } + + public void unsetTimestamp() { + __isset_bitfield = org.apache.thrift.EncodingUtils + .clearBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + } + + /** + * Returns true if field timestamp is set (has been assigned a value) and + * false otherwise + */ + public boolean isSetTimestamp() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, + __TIMESTAMP_ISSET_ID); + } + + public void setTimestampIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils + .setBit(__isset_bitfield, __TIMESTAMP_ISSET_ID, value); + } + + public long getEndTimestamp() { + return this.endTimestamp; + } + + public TCommand setEndTimestamp(long endTimestamp) { + this.endTimestamp = endTimestamp; + setEndTimestampIsSet(true); + return this; + } + + public void unsetEndTimestamp() { + __isset_bitfield = org.apache.thrift.EncodingUtils + .clearBit(__isset_bitfield, __ENDTIMESTAMP_ISSET_ID); + } + + /** + * Returns true if field endTimestamp is set (has been assigned a value) and + * false otherwise + */ + public boolean isSetEndTimestamp() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, + __ENDTIMESTAMP_ISSET_ID); + } + + public void setEndTimestampIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils + .setBit(__isset_bitfield, __ENDTIMESTAMP_ISSET_ID, value); + } + + @org.apache.thrift.annotation.Nullable + public TOrder getOrder() { + return this.order; + } + + public TCommand setOrder( + @org.apache.thrift.annotation.Nullable TOrder order) { + this.order = order; + return this; + } + + public void unsetOrder() { + this.order = null; + } + + /** + * Returns true if field order is set (has been assigned a value) and false + * otherwise + */ + public boolean isSetOrder() { + return this.order != null; + } + + public void setOrderIsSet(boolean value) { + if(!value) { + this.order = null; + } + } + + @org.apache.thrift.annotation.Nullable + public TPage getPage() { + return this.page; + } + + public TCommand setPage(@org.apache.thrift.annotation.Nullable TPage page) { + this.page = page; + return this; + } + + public void unsetPage() { + this.page = null; + } + + /** + * Returns true if field page is set (has been assigned a value) and false + * otherwise + */ + public boolean isSetPage() { + return this.page != null; + } + + public void setPageIsSet(boolean value) { + if(!value) { + this.page = null; + } + } + + @org.apache.thrift.annotation.Nullable + public TObject getValue() { + return this.value; + } + + public TCommand setValue( + @org.apache.thrift.annotation.Nullable TObject value) { + this.value = 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; + } + } + + @org.apache.thrift.annotation.Nullable + public TObject getReplacement() { + return this.replacement; + } + + public TCommand setReplacement( + @org.apache.thrift.annotation.Nullable TObject replacement) { + this.replacement = replacement; + return this; + } + + public void unsetReplacement() { + this.replacement = null; + } + + /** + * Returns true if field replacement is set (has been assigned a value) and + * false otherwise + */ + public boolean isSetReplacement() { + return this.replacement != null; + } + + public void setReplacementIsSet(boolean value) { + if(!value) { + this.replacement = null; + } + } + + public int getValuesSize() { + return (this.values == null) ? 0 : this.values.size(); + } + + @org.apache.thrift.annotation.Nullable + public java.util.Iterator getValuesIterator() { + return (this.values == null) ? null : this.values.iterator(); + } + + public void addToValues(TObject elem) { + if(this.values == null) { + this.values = new java.util.ArrayList(); + } + this.values.add(elem); + } + + @org.apache.thrift.annotation.Nullable + public java.util.List getValues() { + return this.values; + } + + public TCommand setValues( + @org.apache.thrift.annotation.Nullable java.util.List values) { + this.values = values; + return this; + } + + public void unsetValues() { + this.values = null; + } + + /** + * Returns true if field values is set (has been assigned a value) and false + * otherwise + */ + public boolean isSetValues() { + return this.values != null; + } + + public void setValuesIsSet(boolean value) { + if(!value) { + this.values = null; + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getJson() { + return this.json; + } + + public TCommand setJson( + @org.apache.thrift.annotation.Nullable java.lang.String json) { + this.json = json; + return this; + } + + public void unsetJson() { + this.json = null; + } + + /** + * Returns true if field json is set (has been assigned a value) and false + * otherwise + */ + public boolean isSetJson() { + return this.json != null; + } + + public void setJsonIsSet(boolean value) { + if(!value) { + this.json = null; + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getQuery() { + return this.query; + } + + public TCommand setQuery( + @org.apache.thrift.annotation.Nullable java.lang.String query) { + this.query = query; + return this; + } + + public void unsetQuery() { + this.query = null; + } + + /** + * Returns true if field query is set (has been assigned a value) and false + * otherwise + */ + public boolean isSetQuery() { + return this.query != null; + } + + public void setQueryIsSet(boolean value) { + if(!value) { + this.query = null; + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getFunction() { + return this.function; + } + + public TCommand setFunction( + @org.apache.thrift.annotation.Nullable java.lang.String function) { + this.function = function; + return this; + } + + public void unsetFunction() { + this.function = null; + } + + /** + * Returns true if field function is set (has been assigned a value) and + * false otherwise + */ + public boolean isSetFunction() { + return this.function != null; + } + + public void setFunctionIsSet(boolean value) { + if(!value) { + this.function = null; + } + } + + public long getSourceRecord() { + return this.sourceRecord; + } + + public TCommand setSourceRecord(long sourceRecord) { + this.sourceRecord = sourceRecord; + setSourceRecordIsSet(true); + return this; + } + + public void unsetSourceRecord() { + __isset_bitfield = org.apache.thrift.EncodingUtils + .clearBit(__isset_bitfield, __SOURCERECORD_ISSET_ID); + } + + /** + * Returns true if field sourceRecord is set (has been assigned a value) and + * false otherwise + */ + public boolean isSetSourceRecord() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, + __SOURCERECORD_ISSET_ID); + } + + public void setSourceRecordIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils + .setBit(__isset_bitfield, __SOURCERECORD_ISSET_ID, value); + } + + @Override + public void setFieldValue(_Fields field, + @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case VERB: + if(value == null) { + unsetVerb(); + } + else { + setVerb((TCommandVerb) value); + } + break; + + case KEYS: + if(value == null) { + unsetKeys(); + } + else { + setKeys((java.util.List) value); + } + break; + + case RECORDS: + if(value == null) { + unsetRecords(); + } + else { + setRecords((java.util.List) value); + } + break; + + case CRITERIA: + if(value == null) { + unsetCriteria(); + } + else { + setCriteria((TCriteria) value); + } + break; + + case CONDITION: + if(value == null) { + unsetCondition(); + } + else { + setCondition((java.lang.String) value); + } + break; + + case TIMESTAMP: + if(value == null) { + unsetTimestamp(); + } + else { + setTimestamp((java.lang.Long) value); + } + break; + + case END_TIMESTAMP: + if(value == null) { + unsetEndTimestamp(); + } + else { + setEndTimestamp((java.lang.Long) value); + } + break; + + case ORDER: + if(value == null) { + unsetOrder(); + } + else { + setOrder((TOrder) value); + } + break; + + case PAGE: + if(value == null) { + unsetPage(); + } + else { + setPage((TPage) value); + } + break; + + case VALUE: + if(value == null) { + unsetValue(); + } + else { + setValue((TObject) value); + } + break; + + case REPLACEMENT: + if(value == null) { + unsetReplacement(); + } + else { + setReplacement((TObject) value); + } + break; + + case VALUES: + if(value == null) { + unsetValues(); + } + else { + setValues((java.util.List) value); + } + break; + + case JSON: + if(value == null) { + unsetJson(); + } + else { + setJson((java.lang.String) value); + } + break; + + case QUERY: + if(value == null) { + unsetQuery(); + } + else { + setQuery((java.lang.String) value); + } + break; + + case FUNCTION: + if(value == null) { + unsetFunction(); + } + else { + setFunction((java.lang.String) value); + } + break; + + case SOURCE_RECORD: + if(value == null) { + unsetSourceRecord(); + } + else { + setSourceRecord((java.lang.Long) value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case VERB: + return getVerb(); + + case KEYS: + return getKeys(); + + case RECORDS: + return getRecords(); + + case CRITERIA: + return getCriteria(); + + case CONDITION: + return getCondition(); + + case TIMESTAMP: + return getTimestamp(); + + case END_TIMESTAMP: + return getEndTimestamp(); + + case ORDER: + return getOrder(); + + case PAGE: + return getPage(); + + case VALUE: + return getValue(); + + case REPLACEMENT: + return getReplacement(); + + case VALUES: + return getValues(); + + case JSON: + return getJson(); + + case QUERY: + return getQuery(); + + case FUNCTION: + return getFunction(); + + case SOURCE_RECORD: + return getSourceRecord(); + + } + 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 VERB: + return isSetVerb(); + case KEYS: + return isSetKeys(); + case RECORDS: + return isSetRecords(); + case CRITERIA: + return isSetCriteria(); + case CONDITION: + return isSetCondition(); + case TIMESTAMP: + return isSetTimestamp(); + case END_TIMESTAMP: + return isSetEndTimestamp(); + case ORDER: + return isSetOrder(); + case PAGE: + return isSetPage(); + case VALUE: + return isSetValue(); + case REPLACEMENT: + return isSetReplacement(); + case VALUES: + return isSetValues(); + case JSON: + return isSetJson(); + case QUERY: + return isSetQuery(); + case FUNCTION: + return isSetFunction(); + case SOURCE_RECORD: + return isSetSourceRecord(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if(that instanceof TCommand) + return this.equals((TCommand) that); + return false; + } + + public boolean equals(TCommand that) { + if(that == null) + return false; + if(this == that) + return true; + + boolean this_present_verb = true && this.isSetVerb(); + boolean that_present_verb = true && that.isSetVerb(); + if(this_present_verb || that_present_verb) { + if(!(this_present_verb && that_present_verb)) + return false; + if(!this.verb.equals(that.verb)) + 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_records = true && this.isSetRecords(); + boolean that_present_records = true && that.isSetRecords(); + if(this_present_records || that_present_records) { + if(!(this_present_records && that_present_records)) + return false; + if(!this.records.equals(that.records)) + return false; + } + + boolean this_present_criteria = true && this.isSetCriteria(); + boolean that_present_criteria = true && that.isSetCriteria(); + if(this_present_criteria || that_present_criteria) { + if(!(this_present_criteria && that_present_criteria)) + return false; + if(!this.criteria.equals(that.criteria)) + return false; + } + + boolean this_present_condition = true && this.isSetCondition(); + boolean that_present_condition = true && that.isSetCondition(); + if(this_present_condition || that_present_condition) { + if(!(this_present_condition && that_present_condition)) + return false; + if(!this.condition.equals(that.condition)) + return false; + } + + boolean this_present_timestamp = true && this.isSetTimestamp(); + boolean that_present_timestamp = true && that.isSetTimestamp(); + if(this_present_timestamp || that_present_timestamp) { + if(!(this_present_timestamp && that_present_timestamp)) + return false; + if(this.timestamp != that.timestamp) + return false; + } + + boolean this_present_endTimestamp = true && this.isSetEndTimestamp(); + boolean that_present_endTimestamp = true && that.isSetEndTimestamp(); + if(this_present_endTimestamp || that_present_endTimestamp) { + if(!(this_present_endTimestamp && that_present_endTimestamp)) + return false; + if(this.endTimestamp != that.endTimestamp) + return false; + } + + boolean this_present_order = true && this.isSetOrder(); + boolean that_present_order = true && that.isSetOrder(); + if(this_present_order || that_present_order) { + if(!(this_present_order && that_present_order)) + return false; + if(!this.order.equals(that.order)) + return false; + } + + boolean this_present_page = true && this.isSetPage(); + boolean that_present_page = true && that.isSetPage(); + if(this_present_page || that_present_page) { + if(!(this_present_page && that_present_page)) + return false; + if(!this.page.equals(that.page)) + 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; + } + + boolean this_present_replacement = true && this.isSetReplacement(); + boolean that_present_replacement = true && that.isSetReplacement(); + if(this_present_replacement || that_present_replacement) { + if(!(this_present_replacement && that_present_replacement)) + return false; + if(!this.replacement.equals(that.replacement)) + return false; + } + + boolean this_present_values = true && this.isSetValues(); + boolean that_present_values = true && that.isSetValues(); + if(this_present_values || that_present_values) { + if(!(this_present_values && that_present_values)) + return false; + if(!this.values.equals(that.values)) + return false; + } + + boolean this_present_json = true && this.isSetJson(); + boolean that_present_json = true && that.isSetJson(); + if(this_present_json || that_present_json) { + if(!(this_present_json && that_present_json)) + return false; + if(!this.json.equals(that.json)) + return false; + } + + boolean this_present_query = true && this.isSetQuery(); + boolean that_present_query = true && that.isSetQuery(); + if(this_present_query || that_present_query) { + if(!(this_present_query && that_present_query)) + return false; + if(!this.query.equals(that.query)) + return false; + } + + boolean this_present_function = true && this.isSetFunction(); + boolean that_present_function = true && that.isSetFunction(); + if(this_present_function || that_present_function) { + if(!(this_present_function && that_present_function)) + return false; + if(!this.function.equals(that.function)) + return false; + } + + boolean this_present_sourceRecord = true && this.isSetSourceRecord(); + boolean that_present_sourceRecord = true && that.isSetSourceRecord(); + if(this_present_sourceRecord || that_present_sourceRecord) { + if(!(this_present_sourceRecord && that_present_sourceRecord)) + return false; + if(this.sourceRecord != that.sourceRecord) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetVerb()) ? 131071 : 524287); + if(isSetVerb()) + hashCode = hashCode * 8191 + verb.getValue(); + + hashCode = hashCode * 8191 + ((isSetKeys()) ? 131071 : 524287); + if(isSetKeys()) + hashCode = hashCode * 8191 + keys.hashCode(); + + hashCode = hashCode * 8191 + ((isSetRecords()) ? 131071 : 524287); + if(isSetRecords()) + hashCode = hashCode * 8191 + records.hashCode(); + + hashCode = hashCode * 8191 + ((isSetCriteria()) ? 131071 : 524287); + if(isSetCriteria()) + hashCode = hashCode * 8191 + criteria.hashCode(); + + hashCode = hashCode * 8191 + ((isSetCondition()) ? 131071 : 524287); + if(isSetCondition()) + hashCode = hashCode * 8191 + condition.hashCode(); + + hashCode = hashCode * 8191 + ((isSetTimestamp()) ? 131071 : 524287); + if(isSetTimestamp()) + hashCode = hashCode * 8191 + + org.apache.thrift.TBaseHelper.hashCode(timestamp); + + hashCode = hashCode * 8191 + ((isSetEndTimestamp()) ? 131071 : 524287); + if(isSetEndTimestamp()) + hashCode = hashCode * 8191 + + org.apache.thrift.TBaseHelper.hashCode(endTimestamp); + + hashCode = hashCode * 8191 + ((isSetOrder()) ? 131071 : 524287); + if(isSetOrder()) + hashCode = hashCode * 8191 + order.hashCode(); + + hashCode = hashCode * 8191 + ((isSetPage()) ? 131071 : 524287); + if(isSetPage()) + hashCode = hashCode * 8191 + page.hashCode(); + + hashCode = hashCode * 8191 + ((isSetValue()) ? 131071 : 524287); + if(isSetValue()) + hashCode = hashCode * 8191 + value.hashCode(); + + hashCode = hashCode * 8191 + ((isSetReplacement()) ? 131071 : 524287); + if(isSetReplacement()) + hashCode = hashCode * 8191 + replacement.hashCode(); + + hashCode = hashCode * 8191 + ((isSetValues()) ? 131071 : 524287); + if(isSetValues()) + hashCode = hashCode * 8191 + values.hashCode(); + + hashCode = hashCode * 8191 + ((isSetJson()) ? 131071 : 524287); + if(isSetJson()) + hashCode = hashCode * 8191 + json.hashCode(); + + hashCode = hashCode * 8191 + ((isSetQuery()) ? 131071 : 524287); + if(isSetQuery()) + hashCode = hashCode * 8191 + query.hashCode(); + + hashCode = hashCode * 8191 + ((isSetFunction()) ? 131071 : 524287); + if(isSetFunction()) + hashCode = hashCode * 8191 + function.hashCode(); + + hashCode = hashCode * 8191 + ((isSetSourceRecord()) ? 131071 : 524287); + if(isSetSourceRecord()) + hashCode = hashCode * 8191 + + org.apache.thrift.TBaseHelper.hashCode(sourceRecord); + + return hashCode; + } + + @Override + public int compareTo(TCommand other) { + if(!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.compare(isSetVerb(), + other.isSetVerb()); + if(lastComparison != 0) { + return lastComparison; + } + if(isSetVerb()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.verb, + other.verb); + 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(isSetRecords(), + other.isSetRecords()); + if(lastComparison != 0) { + return lastComparison; + } + if(isSetRecords()) { + lastComparison = org.apache.thrift.TBaseHelper + .compareTo(this.records, other.records); + if(lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetCriteria(), + other.isSetCriteria()); + if(lastComparison != 0) { + return lastComparison; + } + if(isSetCriteria()) { + lastComparison = org.apache.thrift.TBaseHelper + .compareTo(this.criteria, other.criteria); + if(lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetCondition(), + other.isSetCondition()); + if(lastComparison != 0) { + return lastComparison; + } + if(isSetCondition()) { + lastComparison = org.apache.thrift.TBaseHelper + .compareTo(this.condition, other.condition); + if(lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetTimestamp(), + other.isSetTimestamp()); + if(lastComparison != 0) { + return lastComparison; + } + if(isSetTimestamp()) { + lastComparison = org.apache.thrift.TBaseHelper + .compareTo(this.timestamp, other.timestamp); + if(lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetEndTimestamp(), + other.isSetEndTimestamp()); + if(lastComparison != 0) { + return lastComparison; + } + if(isSetEndTimestamp()) { + lastComparison = org.apache.thrift.TBaseHelper + .compareTo(this.endTimestamp, other.endTimestamp); + if(lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetOrder(), + other.isSetOrder()); + if(lastComparison != 0) { + return lastComparison; + } + if(isSetOrder()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.order, + other.order); + if(lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetPage(), + other.isSetPage()); + if(lastComparison != 0) { + return lastComparison; + } + if(isSetPage()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.page, + other.page); + 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; + } + } + lastComparison = java.lang.Boolean.compare(isSetReplacement(), + other.isSetReplacement()); + if(lastComparison != 0) { + return lastComparison; + } + if(isSetReplacement()) { + lastComparison = org.apache.thrift.TBaseHelper + .compareTo(this.replacement, other.replacement); + if(lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetValues(), + other.isSetValues()); + if(lastComparison != 0) { + return lastComparison; + } + if(isSetValues()) { + lastComparison = org.apache.thrift.TBaseHelper + .compareTo(this.values, other.values); + if(lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetJson(), + other.isSetJson()); + if(lastComparison != 0) { + return lastComparison; + } + if(isSetJson()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.json, + other.json); + if(lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetQuery(), + other.isSetQuery()); + if(lastComparison != 0) { + return lastComparison; + } + if(isSetQuery()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.query, + other.query); + if(lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetFunction(), + other.isSetFunction()); + if(lastComparison != 0) { + return lastComparison; + } + if(isSetFunction()) { + lastComparison = org.apache.thrift.TBaseHelper + .compareTo(this.function, other.function); + if(lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetSourceRecord(), + other.isSetSourceRecord()); + if(lastComparison != 0) { + return lastComparison; + } + if(isSetSourceRecord()) { + lastComparison = org.apache.thrift.TBaseHelper + .compareTo(this.sourceRecord, other.sourceRecord); + 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("TCommand("); + boolean first = true; + + sb.append("verb:"); + if(this.verb == null) { + sb.append("null"); + } + else { + sb.append(this.verb); + } + first = false; + if(isSetKeys()) { + if(!first) + sb.append(", "); + sb.append("keys:"); + if(this.keys == null) { + sb.append("null"); + } + else { + sb.append(this.keys); + } + first = false; + } + if(isSetRecords()) { + if(!first) + sb.append(", "); + sb.append("records:"); + if(this.records == null) { + sb.append("null"); + } + else { + sb.append(this.records); + } + first = false; + } + if(isSetCriteria()) { + if(!first) + sb.append(", "); + sb.append("criteria:"); + if(this.criteria == null) { + sb.append("null"); + } + else { + sb.append(this.criteria); + } + first = false; + } + if(isSetCondition()) { + if(!first) + sb.append(", "); + sb.append("condition:"); + if(this.condition == null) { + sb.append("null"); + } + else { + sb.append(this.condition); + } + first = false; + } + if(isSetTimestamp()) { + if(!first) + sb.append(", "); + sb.append("timestamp:"); + sb.append(this.timestamp); + first = false; + } + if(isSetEndTimestamp()) { + if(!first) + sb.append(", "); + sb.append("endTimestamp:"); + sb.append(this.endTimestamp); + first = false; + } + if(isSetOrder()) { + if(!first) + sb.append(", "); + sb.append("order:"); + if(this.order == null) { + sb.append("null"); + } + else { + sb.append(this.order); + } + first = false; + } + if(isSetPage()) { + if(!first) + sb.append(", "); + sb.append("page:"); + if(this.page == null) { + sb.append("null"); + } + else { + sb.append(this.page); + } + first = false; + } + if(isSetValue()) { + if(!first) + sb.append(", "); + sb.append("value:"); + if(this.value == null) { + sb.append("null"); + } + else { + sb.append(this.value); + } + first = false; + } + if(isSetReplacement()) { + if(!first) + sb.append(", "); + sb.append("replacement:"); + if(this.replacement == null) { + sb.append("null"); + } + else { + sb.append(this.replacement); + } + first = false; + } + if(isSetValues()) { + if(!first) + sb.append(", "); + sb.append("values:"); + if(this.values == null) { + sb.append("null"); + } + else { + sb.append(this.values); + } + first = false; + } + if(isSetJson()) { + if(!first) + sb.append(", "); + sb.append("json:"); + if(this.json == null) { + sb.append("null"); + } + else { + sb.append(this.json); + } + first = false; + } + if(isSetQuery()) { + if(!first) + sb.append(", "); + sb.append("query:"); + if(this.query == null) { + sb.append("null"); + } + else { + sb.append(this.query); + } + first = false; + } + if(isSetFunction()) { + if(!first) + sb.append(", "); + sb.append("function:"); + if(this.function == null) { + sb.append("null"); + } + else { + sb.append(this.function); + } + first = false; + } + if(isSetSourceRecord()) { + if(!first) + sb.append(", "); + sb.append("sourceRecord:"); + sb.append(this.sourceRecord); + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if(verb == null) { + throw new org.apache.thrift.protocol.TProtocolException( + "Required field 'verb' was not present! Struct: " + + toString()); + } + // check for sub-struct validity + if(criteria != null) { + criteria.validate(); + } + if(order != null) { + order.validate(); + } + if(page != null) { + page.validate(); + } + if(value != null) { + value.validate(); + } + if(replacement != null) { + replacement.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 { + // 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 TCommandStandardSchemeFactory implements + org.apache.thrift.scheme.SchemeFactory { + @Override + public TCommandStandardScheme getScheme() { + return new TCommandStandardScheme(); + } + } + + private static class TCommandStandardScheme + extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, + TCommand 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: // VERB + if(schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.verb = com.cinchapi.concourse.thrift.TCommandVerb + .findByValue(iprot.readI32()); + struct.setVerbIsSet(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 _list16 = iprot + .readListBegin(); + struct.keys = new java.util.ArrayList( + _list16.size); + @org.apache.thrift.annotation.Nullable java.lang.String _elem17; + for (int _i18 = 0; _i18 < _list16.size; ++_i18) { + _elem17 = iprot.readString(); + struct.keys.add(_elem17); + } + iprot.readListEnd(); + } + struct.setKeysIsSet(true); + } + else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, + schemeField.type); + } + break; + case 3: // RECORDS + if(schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list19 = iprot + .readListBegin(); + struct.records = new java.util.ArrayList( + _list19.size); + long _elem20; + for (int _i21 = 0; _i21 < _list19.size; ++_i21) { + _elem20 = iprot.readI64(); + struct.records.add(_elem20); + } + iprot.readListEnd(); + } + struct.setRecordsIsSet(true); + } + else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, + schemeField.type); + } + break; + case 4: // CRITERIA + if(schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.criteria = new TCriteria(); + struct.criteria.read(iprot); + struct.setCriteriaIsSet(true); + } + else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, + schemeField.type); + } + break; + case 5: // CONDITION + if(schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.condition = iprot.readString(); + struct.setConditionIsSet(true); + } + else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, + schemeField.type); + } + break; + case 6: // TIMESTAMP + if(schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + } + else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, + schemeField.type); + } + break; + case 7: // END_TIMESTAMP + if(schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.endTimestamp = iprot.readI64(); + struct.setEndTimestampIsSet(true); + } + else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, + schemeField.type); + } + break; + case 8: // ORDER + if(schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.order = new TOrder(); + struct.order.read(iprot); + struct.setOrderIsSet(true); + } + else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, + schemeField.type); + } + break; + case 9: // PAGE + if(schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.page = new TPage(); + struct.page.read(iprot); + struct.setPageIsSet(true); + } + else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, + schemeField.type); + } + break; + case 10: // VALUE + if(schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.value = new TObject(); + struct.value.read(iprot); + struct.setValueIsSet(true); + } + else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, + schemeField.type); + } + break; + case 11: // REPLACEMENT + if(schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.replacement = new TObject(); + struct.replacement.read(iprot); + struct.setReplacementIsSet(true); + } + else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, + schemeField.type); + } + break; + case 12: // VALUES + if(schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list22 = iprot + .readListBegin(); + struct.values = new java.util.ArrayList( + _list22.size); + @org.apache.thrift.annotation.Nullable TObject _elem23; + for (int _i24 = 0; _i24 < _list22.size; ++_i24) { + _elem23 = new TObject(); + _elem23.read(iprot); + struct.values.add(_elem23); + } + iprot.readListEnd(); + } + struct.setValuesIsSet(true); + } + else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, + schemeField.type); + } + break; + case 13: // JSON + if(schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.json = iprot.readString(); + struct.setJsonIsSet(true); + } + else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, + schemeField.type); + } + break; + case 14: // QUERY + if(schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.query = iprot.readString(); + struct.setQueryIsSet(true); + } + else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, + schemeField.type); + } + break; + case 15: // FUNCTION + if(schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.function = iprot.readString(); + struct.setFunctionIsSet(true); + } + else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, + schemeField.type); + } + break; + case 16: // SOURCE_RECORD + if(schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.sourceRecord = iprot.readI64(); + struct.setSourceRecordIsSet(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, + TCommand struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if(struct.verb != null) { + oprot.writeFieldBegin(VERB_FIELD_DESC); + oprot.writeI32(struct.verb.getValue()); + oprot.writeFieldEnd(); + } + if(struct.keys != null) { + if(struct.isSetKeys()) { + oprot.writeFieldBegin(KEYS_FIELD_DESC); + { + oprot.writeListBegin( + new org.apache.thrift.protocol.TList( + org.apache.thrift.protocol.TType.STRING, + struct.keys.size())); + for (java.lang.String _iter25 : struct.keys) { + oprot.writeString(_iter25); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + } + if(struct.records != null) { + if(struct.isSetRecords()) { + oprot.writeFieldBegin(RECORDS_FIELD_DESC); + { + oprot.writeListBegin( + new org.apache.thrift.protocol.TList( + org.apache.thrift.protocol.TType.I64, + struct.records.size())); + for (long _iter26 : struct.records) { + oprot.writeI64(_iter26); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + } + if(struct.criteria != null) { + if(struct.isSetCriteria()) { + oprot.writeFieldBegin(CRITERIA_FIELD_DESC); + struct.criteria.write(oprot); + oprot.writeFieldEnd(); + } + } + if(struct.condition != null) { + if(struct.isSetCondition()) { + oprot.writeFieldBegin(CONDITION_FIELD_DESC); + oprot.writeString(struct.condition); + oprot.writeFieldEnd(); + } + } + if(struct.isSetTimestamp()) { + oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC); + oprot.writeI64(struct.timestamp); + oprot.writeFieldEnd(); + } + if(struct.isSetEndTimestamp()) { + oprot.writeFieldBegin(END_TIMESTAMP_FIELD_DESC); + oprot.writeI64(struct.endTimestamp); + oprot.writeFieldEnd(); + } + if(struct.order != null) { + if(struct.isSetOrder()) { + oprot.writeFieldBegin(ORDER_FIELD_DESC); + struct.order.write(oprot); + oprot.writeFieldEnd(); + } + } + if(struct.page != null) { + if(struct.isSetPage()) { + oprot.writeFieldBegin(PAGE_FIELD_DESC); + struct.page.write(oprot); + oprot.writeFieldEnd(); + } + } + if(struct.value != null) { + if(struct.isSetValue()) { + oprot.writeFieldBegin(VALUE_FIELD_DESC); + struct.value.write(oprot); + oprot.writeFieldEnd(); + } + } + if(struct.replacement != null) { + if(struct.isSetReplacement()) { + oprot.writeFieldBegin(REPLACEMENT_FIELD_DESC); + struct.replacement.write(oprot); + oprot.writeFieldEnd(); + } + } + if(struct.values != null) { + if(struct.isSetValues()) { + oprot.writeFieldBegin(VALUES_FIELD_DESC); + { + oprot.writeListBegin( + new org.apache.thrift.protocol.TList( + org.apache.thrift.protocol.TType.STRUCT, + struct.values.size())); + for (TObject _iter27 : struct.values) { + _iter27.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + } + if(struct.json != null) { + if(struct.isSetJson()) { + oprot.writeFieldBegin(JSON_FIELD_DESC); + oprot.writeString(struct.json); + oprot.writeFieldEnd(); + } + } + if(struct.query != null) { + if(struct.isSetQuery()) { + oprot.writeFieldBegin(QUERY_FIELD_DESC); + oprot.writeString(struct.query); + oprot.writeFieldEnd(); + } + } + if(struct.function != null) { + if(struct.isSetFunction()) { + oprot.writeFieldBegin(FUNCTION_FIELD_DESC); + oprot.writeString(struct.function); + oprot.writeFieldEnd(); + } + } + if(struct.isSetSourceRecord()) { + oprot.writeFieldBegin(SOURCE_RECORD_FIELD_DESC); + oprot.writeI64(struct.sourceRecord); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TCommandTupleSchemeFactory implements + org.apache.thrift.scheme.SchemeFactory { + @Override + public TCommandTupleScheme getScheme() { + return new TCommandTupleScheme(); + } + } + + private static class TCommandTupleScheme + extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, + TCommand struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + oprot.writeI32(struct.verb.getValue()); + java.util.BitSet optionals = new java.util.BitSet(); + if(struct.isSetKeys()) { + optionals.set(0); + } + if(struct.isSetRecords()) { + optionals.set(1); + } + if(struct.isSetCriteria()) { + optionals.set(2); + } + if(struct.isSetCondition()) { + optionals.set(3); + } + if(struct.isSetTimestamp()) { + optionals.set(4); + } + if(struct.isSetEndTimestamp()) { + optionals.set(5); + } + if(struct.isSetOrder()) { + optionals.set(6); + } + if(struct.isSetPage()) { + optionals.set(7); + } + if(struct.isSetValue()) { + optionals.set(8); + } + if(struct.isSetReplacement()) { + optionals.set(9); + } + if(struct.isSetValues()) { + optionals.set(10); + } + if(struct.isSetJson()) { + optionals.set(11); + } + if(struct.isSetQuery()) { + optionals.set(12); + } + if(struct.isSetFunction()) { + optionals.set(13); + } + if(struct.isSetSourceRecord()) { + optionals.set(14); + } + oprot.writeBitSet(optionals, 15); + if(struct.isSetKeys()) { + { + oprot.writeI32(struct.keys.size()); + for (java.lang.String _iter28 : struct.keys) { + oprot.writeString(_iter28); + } + } + } + if(struct.isSetRecords()) { + { + oprot.writeI32(struct.records.size()); + for (long _iter29 : struct.records) { + oprot.writeI64(_iter29); + } + } + } + if(struct.isSetCriteria()) { + struct.criteria.write(oprot); + } + if(struct.isSetCondition()) { + oprot.writeString(struct.condition); + } + if(struct.isSetTimestamp()) { + oprot.writeI64(struct.timestamp); + } + if(struct.isSetEndTimestamp()) { + oprot.writeI64(struct.endTimestamp); + } + if(struct.isSetOrder()) { + struct.order.write(oprot); + } + if(struct.isSetPage()) { + struct.page.write(oprot); + } + if(struct.isSetValue()) { + struct.value.write(oprot); + } + if(struct.isSetReplacement()) { + struct.replacement.write(oprot); + } + if(struct.isSetValues()) { + { + oprot.writeI32(struct.values.size()); + for (TObject _iter30 : struct.values) { + _iter30.write(oprot); + } + } + } + if(struct.isSetJson()) { + oprot.writeString(struct.json); + } + if(struct.isSetQuery()) { + oprot.writeString(struct.query); + } + if(struct.isSetFunction()) { + oprot.writeString(struct.function); + } + if(struct.isSetSourceRecord()) { + oprot.writeI64(struct.sourceRecord); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, + TCommand struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.verb = com.cinchapi.concourse.thrift.TCommandVerb + .findByValue(iprot.readI32()); + struct.setVerbIsSet(true); + java.util.BitSet incoming = iprot.readBitSet(15); + if(incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list31 = iprot + .readListBegin( + org.apache.thrift.protocol.TType.STRING); + struct.keys = new java.util.ArrayList( + _list31.size); + @org.apache.thrift.annotation.Nullable java.lang.String _elem32; + for (int _i33 = 0; _i33 < _list31.size; ++_i33) { + _elem32 = iprot.readString(); + struct.keys.add(_elem32); + } + } + struct.setKeysIsSet(true); + } + if(incoming.get(1)) { + { + org.apache.thrift.protocol.TList _list34 = iprot + .readListBegin( + org.apache.thrift.protocol.TType.I64); + struct.records = new java.util.ArrayList( + _list34.size); + long _elem35; + for (int _i36 = 0; _i36 < _list34.size; ++_i36) { + _elem35 = iprot.readI64(); + struct.records.add(_elem35); + } + } + struct.setRecordsIsSet(true); + } + if(incoming.get(2)) { + struct.criteria = new TCriteria(); + struct.criteria.read(iprot); + struct.setCriteriaIsSet(true); + } + if(incoming.get(3)) { + struct.condition = iprot.readString(); + struct.setConditionIsSet(true); + } + if(incoming.get(4)) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + } + if(incoming.get(5)) { + struct.endTimestamp = iprot.readI64(); + struct.setEndTimestampIsSet(true); + } + if(incoming.get(6)) { + struct.order = new TOrder(); + struct.order.read(iprot); + struct.setOrderIsSet(true); + } + if(incoming.get(7)) { + struct.page = new TPage(); + struct.page.read(iprot); + struct.setPageIsSet(true); + } + if(incoming.get(8)) { + struct.value = new TObject(); + struct.value.read(iprot); + struct.setValueIsSet(true); + } + if(incoming.get(9)) { + struct.replacement = new TObject(); + struct.replacement.read(iprot); + struct.setReplacementIsSet(true); + } + if(incoming.get(10)) { + { + org.apache.thrift.protocol.TList _list37 = iprot + .readListBegin( + org.apache.thrift.protocol.TType.STRUCT); + struct.values = new java.util.ArrayList( + _list37.size); + @org.apache.thrift.annotation.Nullable TObject _elem38; + for (int _i39 = 0; _i39 < _list37.size; ++_i39) { + _elem38 = new TObject(); + _elem38.read(iprot); + struct.values.add(_elem38); + } + } + struct.setValuesIsSet(true); + } + if(incoming.get(11)) { + struct.json = iprot.readString(); + struct.setJsonIsSet(true); + } + if(incoming.get(12)) { + struct.query = iprot.readString(); + struct.setQueryIsSet(true); + } + if(incoming.get(13)) { + struct.function = iprot.readString(); + struct.setFunctionIsSet(true); + } + if(incoming.get(14)) { + struct.sourceRecord = iprot.readI64(); + struct.setSourceRecordIsSet(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/concourse-driver-java/src/main/java/com/cinchapi/concourse/thrift/TCommandVerb.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/thrift/TCommandVerb.java new file mode 100644 index 000000000..637532126 --- /dev/null +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/thrift/TCommandVerb.java @@ -0,0 +1,152 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.thrift; + +/** + * The verb identifying which operation a TCommand represents. + */ +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.20.0)", date = "2026-03-14") +public enum TCommandVerb implements org.apache.thrift.TEnum { + FIND(1), + SELECT(2), + GET(3), + NAVIGATE(4), + ADD(5), + SET(6), + REMOVE(7), + CLEAR(8), + INSERT(9), + LINK(10), + UNLINK(11), + VERIFY(12), + VERIFY_AND_SWAP(13), + VERIFY_OR_SET(14), + FIND_OR_ADD(15), + FIND_OR_INSERT(16), + SEARCH(17), + BROWSE(18), + DESCRIBE(19), + TRACE(20), + HOLDS(21), + JSONIFY(22), + CHRONICLE(23), + DIFF(24), + AUDIT(25), + REVERT(26), + RECONCILE(27), + CONSOLIDATE(28), + CALCULATE(29), + STAGE(30), + COMMIT(31), + ABORT(32), + PING(33), + INVENTORY(34); + + private final int value; + + private TCommandVerb(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 TCommandVerb findByValue(int value) { + switch (value) { + case 1: + return FIND; + case 2: + return SELECT; + case 3: + return GET; + case 4: + return NAVIGATE; + case 5: + return ADD; + case 6: + return SET; + case 7: + return REMOVE; + case 8: + return CLEAR; + case 9: + return INSERT; + case 10: + return LINK; + case 11: + return UNLINK; + case 12: + return VERIFY; + case 13: + return VERIFY_AND_SWAP; + case 14: + return VERIFY_OR_SET; + case 15: + return FIND_OR_ADD; + case 16: + return FIND_OR_INSERT; + case 17: + return SEARCH; + case 18: + return BROWSE; + case 19: + return DESCRIBE; + case 20: + return TRACE; + case 21: + return HOLDS; + case 22: + return JSONIFY; + case 23: + return CHRONICLE; + case 24: + return DIFF; + case 25: + return AUDIT; + case 26: + return REVERT; + case 27: + return RECONCILE; + case 28: + return CONSOLIDATE; + case 29: + return CALCULATE; + case 30: + return STAGE; + case 31: + return COMMIT; + case 32: + return ABORT; + case 33: + return PING; + case 34: + return INVENTORY; + default: + return null; + } + } +} diff --git a/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/CommandSerializationTest.java b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/CommandSerializationTest.java new file mode 100644 index 000000000..69946e706 --- /dev/null +++ b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/CommandSerializationTest.java @@ -0,0 +1,1611 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.lang.command; + +import java.util.Arrays; + +import org.junit.Assert; +import org.junit.Test; + +import com.cinchapi.concourse.Timestamp; +import com.cinchapi.concourse.lang.paginate.Page; +import com.cinchapi.concourse.lang.sort.Order; +import com.cinchapi.concourse.thrift.TCommand; +import com.cinchapi.concourse.thrift.TCommandVerb; + +/** + * Unit tests verifying round-trip serialization and deserialization of + * {@link Command Commands} through {@link TCommand}. + *

    + * Each test builds a {@link Command} via the fluent API, serializes it to a + * {@link TCommand}, then deserializes back and asserts that the resulting + * {@code ccl()} output matches the original. + *

    + * + * @author Jeff Nelson + */ +public class CommandSerializationTest { + + /** + * Goal: Verify that a {@code ping} command round-trips + * through {@link TCommand} serialization. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code ping} command.
    • + *
    • Serialize to {@link TCommand} and verify the verb.
    • + *
    • Deserialize back and compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The verb is {@code PING} and the round-tripped + * CCL matches the original. + */ + @Test + public void testPingRoundTrip() { + Command cmd = Command.ping(); + TCommand tc = cmd.toThrift(); + Assert.assertEquals(TCommandVerb.PING, tc.getVerb()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that a {@code stage} command round-trips + * through {@link TCommand} serialization. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code stage} command.
    • + *
    • Serialize to {@link TCommand} and verify the verb.
    • + *
    • Deserialize back and compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The verb is {@code STAGE} and the + * round-tripped CCL matches the original. + */ + @Test + public void testStageRoundTrip() { + Command cmd = Command.stage(); + TCommand tc = cmd.toThrift(); + Assert.assertEquals(TCommandVerb.STAGE, tc.getVerb()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that a {@code commit} command round-trips + * through {@link TCommand} serialization. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code commit} command.
    • + *
    • Serialize to {@link TCommand} and verify the verb.
    • + *
    • Deserialize back and compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The verb is {@code COMMIT} and the + * round-tripped CCL matches the original. + */ + @Test + public void testCommitRoundTrip() { + Command cmd = Command.commit(); + TCommand tc = cmd.toThrift(); + Assert.assertEquals(TCommandVerb.COMMIT, tc.getVerb()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that an {@code abort} command round-trips + * through {@link TCommand} serialization. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build an {@code abort} command.
    • + *
    • Serialize to {@link TCommand} and verify the verb.
    • + *
    • Deserialize back and compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The verb is {@code ABORT} and the + * round-tripped CCL matches the original. + */ + @Test + public void testAbortRoundTrip() { + Command cmd = Command.abort(); + TCommand tc = cmd.toThrift(); + Assert.assertEquals(TCommandVerb.ABORT, tc.getVerb()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that an {@code inventory} command + * round-trips through {@link TCommand} serialization. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build an {@code inventory} command.
    • + *
    • Serialize to {@link TCommand} and verify the verb.
    • + *
    • Deserialize back and compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The verb is {@code INVENTORY} and the + * round-tripped CCL matches the original. + */ + @Test + public void testInventoryRoundTrip() { + Command cmd = Command.inventory(); + TCommand tc = cmd.toThrift(); + Assert.assertEquals(TCommandVerb.INVENTORY, tc.getVerb()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that a {@code find} command with a CCL + * condition round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code find} command with condition {@code "age > 30"}.
    • + *
    • Serialize, verify verb is {@code FIND}, and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL is + * {@code "find age > 30"}. + */ + @Test + public void testFindWithConditionRoundTrip() { + Command cmd = Command.find("age > 30"); + TCommand tc = cmd.toThrift(); + Assert.assertEquals(TCommandVerb.FIND, tc.getVerb()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that a {@code find} command with a + * timestamp round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code find} command with condition {@code "age > 30"} and a + * historical timestamp.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL includes the {@code at} + * clause. + */ + @Test + public void testFindWithTimestampRoundTrip() { + Command cmd = Command.find("age > 30").at(Timestamp.fromMicros(12345)); + TCommand tc = cmd.toThrift(); + Assert.assertTrue(tc.isSetTimestamp()); + Assert.assertEquals(12345, tc.getTimestamp()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that a {@code find} command with order and + * page round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code find} command with condition, order, and page.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL includes + * {@code order by} and {@code page} clauses. + */ + @Test + public void testFindWithOrderAndPageRoundTrip() { + Command cmd = Command.find("age > 30").order(Order.by("name").build()) + .page(Page.sized(10)); + TCommand tc = cmd.toThrift(); + Assert.assertTrue(tc.isSetOrder()); + Assert.assertTrue(tc.isSetPage()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that a {@code select} command with keys and + * records round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code select} command for keys {@code "name"} and + * {@code "age"} from records {@code 1}, {@code 2}, {@code 3}.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL is + * {@code "select [name, age] from [1, 2, 3]"}. + */ + @Test + public void testSelectKeysFromRecordsRoundTrip() { + Command cmd = Command.select("name", "age").from(1, 2, 3); + TCommand tc = cmd.toThrift(); + Assert.assertEquals(TCommandVerb.SELECT, tc.getVerb()); + Assert.assertEquals(Arrays.asList("name", "age"), tc.getKeys()); + Assert.assertEquals(Arrays.asList(1L, 2L, 3L), tc.getRecords()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that a {@code selectAll} command from a + * record round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code selectAll} command from record {@code 1}.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL is {@code "select 1"}. + */ + @Test + public void testSelectAllFromRecordRoundTrip() { + Command cmd = Command.selectAll().from(1); + TCommand tc = cmd.toThrift(); + Assert.assertFalse(tc.isSetKeys()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that a {@code select} command with a CCL + * condition round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code select} command for key {@code "name"} with condition + * {@code "status = active"}.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL is + * {@code "select name where status = active"}. + */ + @Test + public void testSelectWithConditionRoundTrip() { + Command cmd = Command.select("name").where("status = active"); + TCommand tc = cmd.toThrift(); + Assert.assertTrue(tc.isSetCondition()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that a {@code select} command with + * timestamp, order, and page round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code select} with keys, records, timestamp, order, and + * page.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL includes all clauses. + */ + @Test + public void testSelectWithAllOptionsRoundTrip() { + Command cmd = Command.select("name").from(1) + .at(Timestamp.fromMicros(5000)).order(Order.by("name").build()) + .page(Page.sized(5)); + TCommand tc = cmd.toThrift(); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that a {@code get} command with a key and + * record round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code get} command for key {@code "name"} from record + * {@code 1}.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL is + * {@code "get name from 1"}. + */ + @Test + public void testGetFromRecordRoundTrip() { + Command cmd = Command.get("name").from(1); + TCommand tc = cmd.toThrift(); + Assert.assertEquals(TCommandVerb.GET, tc.getVerb()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that a {@code getAll} command with a + * condition round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code getAll} command with condition + * {@code "active = true"}.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL is + * {@code "get where active = true"}. + */ + @Test + public void testGetAllWithConditionRoundTrip() { + Command cmd = Command.getAll().where("active = true"); + TCommand tc = cmd.toThrift(); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that a {@code navigate} command from a + * record round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code navigate} command for key {@code "friends.name"} from + * record {@code 1}.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL is + * {@code "navigate friends.name from 1"}. + */ + @Test + public void testNavigateFromRecordRoundTrip() { + Command cmd = Command.navigate("friends.name").from(1); + TCommand tc = cmd.toThrift(); + Assert.assertEquals(TCommandVerb.NAVIGATE, tc.getVerb()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that a {@code navigate} command with a + * condition and timestamp round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code navigate} command with a condition and historical + * timestamp.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL includes both the + * {@code where} and {@code at} clauses. + */ + @Test + public void testNavigateWithConditionAndTimestampRoundTrip() { + Command cmd = Command.navigate("friends.name").where("active = true") + .at(Timestamp.fromMicros(9999)); + TCommand tc = cmd.toThrift(); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that an {@code add} command with key and + * value round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build an {@code add} command with key {@code "name"} and value + * {@code "jeff"}.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL is + * {@code "add name as \"jeff\""}. + */ + @Test + public void testAddKeyValueRoundTrip() { + Command cmd = Command.add("name").as("jeff"); + TCommand tc = cmd.toThrift(); + Assert.assertEquals(TCommandVerb.ADD, tc.getVerb()); + Assert.assertFalse(tc.isSetRecords()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that an {@code add} command with key, + * value, and records round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build an {@code add} command with key {@code "name"}, value + * {@code "jeff"}, and records {@code 1}, {@code 2}.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL is + * {@code "add name as \"jeff\" in [1, 2]"}. + */ + @Test + public void testAddKeyValueInRecordsRoundTrip() { + Command cmd = Command.add("name").as("jeff").in(1, 2); + TCommand tc = cmd.toThrift(); + Assert.assertTrue(tc.isSetRecords()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that an {@code add} command with a numeric + * value round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build an {@code add} command with key {@code "age"} and integer value + * {@code 30}.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL is + * {@code "add age as 30"}. + */ + @Test + public void testAddNumericValueRoundTrip() { + Command cmd = Command.add("age").as(30); + TCommand tc = cmd.toThrift(); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that a {@code set} command round-trips + * correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code set} command with key {@code "name"}, value + * {@code "jeff"}, and record {@code 1}.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL is + * {@code "set name as \"jeff\" in 1"}. + */ + @Test + public void testSetRoundTrip() { + Command cmd = Command.set("name").as("jeff").in(1); + TCommand tc = cmd.toThrift(); + Assert.assertEquals(TCommandVerb.SET, tc.getVerb()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that a {@code remove} command round-trips + * correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code remove} command with key {@code "name"}, value + * {@code "jeff"}, and record {@code 1}.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL is + * {@code "remove name as \"jeff\" from 1"}. + */ + @Test + public void testRemoveRoundTrip() { + Command cmd = Command.remove("name").as("jeff").from(1); + TCommand tc = cmd.toThrift(); + Assert.assertEquals(TCommandVerb.REMOVE, tc.getVerb()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that a {@code clear} command with keys and + * records round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code clear} command with keys {@code "name"} and + * {@code "age"} from records {@code 1} and {@code 2}.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL is + * {@code "clear [name, age] from [1, 2]"}. + */ + @Test + public void testClearKeysFromRecordsRoundTrip() { + Command cmd = Command.clear("name", "age").from(1, 2); + TCommand tc = cmd.toThrift(); + Assert.assertEquals(TCommandVerb.CLEAR, tc.getVerb()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that a {@code clear} command with records + * only (no keys) round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code clear} command targeting records {@code 1} and + * {@code 2}.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL is + * {@code "clear [1, 2]"}. + */ + @Test + public void testClearRecordsOnlyRoundTrip() { + Command cmd = Command.clear(1, 2); + TCommand tc = cmd.toThrift(); + Assert.assertFalse(tc.isSetKeys()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that an {@code insert} command with JSON + * round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build an {@code insert} command with JSON + * {@code "{\"name\":\"jeff\"}"}.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL matches the original. + */ + @Test + public void testInsertJsonRoundTrip() { + Command cmd = Command.insert("{\"name\":\"jeff\"}"); + TCommand tc = cmd.toThrift(); + Assert.assertEquals(TCommandVerb.INSERT, tc.getVerb()); + Assert.assertFalse(tc.isSetRecords()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that an {@code insert} command with JSON + * and a record target round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build an {@code insert} command with JSON targeting record + * {@code 1}.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL includes {@code "in 1"}. + */ + @Test + public void testInsertJsonInRecordRoundTrip() { + Command cmd = Command.insert("{\"name\":\"jeff\"}").in(1); + TCommand tc = cmd.toThrift(); + Assert.assertTrue(tc.isSetRecords()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that a {@code link} command round-trips + * correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code link} command for key {@code "friends"} from source + * record {@code 1} to destination {@code 2}.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL matches the original. + */ + @Test + public void testLinkRoundTrip() { + Command cmd = Command.link("friends").from(1).to(2); + TCommand tc = cmd.toThrift(); + Assert.assertEquals(TCommandVerb.LINK, tc.getVerb()); + Assert.assertEquals(1, tc.getSourceRecord()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that an {@code unlink} command round-trips + * correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build an {@code unlink} command for key {@code "friends"} from source + * {@code 1} to destination {@code 2}.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL matches the original. + */ + @Test + public void testUnlinkRoundTrip() { + Command cmd = Command.unlink("friends").from(1).to(2); + TCommand tc = cmd.toThrift(); + Assert.assertEquals(TCommandVerb.UNLINK, tc.getVerb()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that a {@code verify} command without a + * timestamp round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code verify} command for key {@code "name"}, value + * {@code "jeff"}, and record {@code 1}.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL matches the original. + */ + @Test + public void testVerifyRoundTrip() { + Command cmd = Command.verify("name").as("jeff").in(1); + TCommand tc = cmd.toThrift(); + Assert.assertEquals(TCommandVerb.VERIFY, tc.getVerb()); + Assert.assertFalse(tc.isSetTimestamp()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that a {@code verify} command with a + * timestamp round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code verify} command with a historical timestamp.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL includes the {@code at} + * clause. + */ + @Test + public void testVerifyWithTimestampRoundTrip() { + Command cmd = Command.verify("name").as("jeff").in(1) + .at(Timestamp.fromMicros(5000)); + TCommand tc = cmd.toThrift(); + Assert.assertTrue(tc.isSetTimestamp()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that a {@code verifyAndSwap} command + * round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code verifyAndSwap} command for key {@code "name"}, + * expected value {@code "jeff"}, record {@code 1}, and replacement + * {@code "bob"}.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL matches the original. + */ + @Test + public void testVerifyAndSwapRoundTrip() { + Command cmd = Command.verifyAndSwap("name").as("jeff").in(1) + .with("bob"); + TCommand tc = cmd.toThrift(); + Assert.assertEquals(TCommandVerb.VERIFY_AND_SWAP, tc.getVerb()); + Assert.assertTrue(tc.isSetReplacement()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that a {@code verifyOrSet} command + * round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code verifyOrSet} command for key {@code "name"}, value + * {@code "jeff"}, and record {@code 1}.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL matches the original. + */ + @Test + public void testVerifyOrSetRoundTrip() { + Command cmd = Command.verifyOrSet("name").as("jeff").in(1); + TCommand tc = cmd.toThrift(); + Assert.assertEquals(TCommandVerb.VERIFY_OR_SET, tc.getVerb()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that a {@code findOrAdd} command + * round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code findOrAdd} command for key {@code "name"} and value + * {@code "jeff"}.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL matches the original. + */ + @Test + public void testFindOrAddRoundTrip() { + Command cmd = Command.findOrAdd("name").as("jeff"); + TCommand tc = cmd.toThrift(); + Assert.assertEquals(TCommandVerb.FIND_OR_ADD, tc.getVerb()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that a {@code findOrInsert} command + * round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code findOrInsert} command with condition + * {@code "name = jeff"} and JSON {@code "{\"name\":\"jeff\"}"}.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL matches the original. + */ + @Test + public void testFindOrInsertRoundTrip() { + Command cmd = Command.findOrInsert("name = jeff") + .json("{\"name\":\"jeff\"}"); + TCommand tc = cmd.toThrift(); + Assert.assertEquals(TCommandVerb.FIND_OR_INSERT, tc.getVerb()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that a {@code search} command round-trips + * correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code search} command for key {@code "name"} with query + * {@code "jeff"}.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL matches the original. + */ + @Test + public void testSearchRoundTrip() { + Command cmd = Command.search("name").forQuery("jeff"); + TCommand tc = cmd.toThrift(); + Assert.assertEquals(TCommandVerb.SEARCH, tc.getVerb()); + Assert.assertEquals("jeff", tc.getQuery()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that a {@code browse} command round-trips + * correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code browse} command for key {@code "name"}.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL matches the original. + */ + @Test + public void testBrowseRoundTrip() { + Command cmd = Command.browse("name"); + TCommand tc = cmd.toThrift(); + Assert.assertEquals(TCommandVerb.BROWSE, tc.getVerb()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that a {@code browse} command with a + * timestamp round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code browse} command with a historical timestamp.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL includes the {@code at} + * clause. + */ + @Test + public void testBrowseWithTimestampRoundTrip() { + Command cmd = Command.browse("name").at(Timestamp.fromMicros(5000)); + TCommand tc = cmd.toThrift(); + Assert.assertTrue(tc.isSetTimestamp()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that a {@code describe} command with + * records round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code describe} command for records {@code 1} and + * {@code 2}.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL matches the original. + */ + @Test + public void testDescribeRecordsRoundTrip() { + Command cmd = Command.describe(1, 2); + TCommand tc = cmd.toThrift(); + Assert.assertEquals(TCommandVerb.DESCRIBE, tc.getVerb()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that a {@code describeAll} command + * round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code describeAll} command.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL matches the original. + */ + @Test + public void testDescribeAllRoundTrip() { + Command cmd = Command.describeAll(); + TCommand tc = cmd.toThrift(); + Assert.assertFalse(tc.isSetRecords()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that a {@code describeAll} command with a + * timestamp round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code describeAll} command with a historical timestamp.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL includes the {@code at} + * clause. + */ + @Test + public void testDescribeAllWithTimestampRoundTrip() { + Command cmd = Command.describeAll().at(Timestamp.fromMicros(5000)); + TCommand tc = cmd.toThrift(); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that a {@code trace} command round-trips + * correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code trace} command for records {@code 1} and + * {@code 2}.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL matches the original. + */ + @Test + public void testTraceRoundTrip() { + Command cmd = Command.trace(1, 2); + TCommand tc = cmd.toThrift(); + Assert.assertEquals(TCommandVerb.TRACE, tc.getVerb()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that a {@code trace} command with a + * timestamp round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code trace} command with a historical timestamp.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL includes the {@code at} + * clause. + */ + @Test + public void testTraceWithTimestampRoundTrip() { + Command cmd = Command.trace(1).at(Timestamp.fromMicros(5000)); + TCommand tc = cmd.toThrift(); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that a {@code holds} command round-trips + * correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code holds} command for records {@code 1} and + * {@code 2}.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL matches the original. + */ + @Test + public void testHoldsRoundTrip() { + Command cmd = Command.holds(1, 2); + TCommand tc = cmd.toThrift(); + Assert.assertEquals(TCommandVerb.HOLDS, tc.getVerb()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that a {@code jsonify} command round-trips + * correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code jsonify} command for record {@code 1}.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL matches the original. + */ + @Test + public void testJsonifyRoundTrip() { + Command cmd = Command.jsonify(1); + TCommand tc = cmd.toThrift(); + Assert.assertEquals(TCommandVerb.JSONIFY, tc.getVerb()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that a {@code jsonify} command with a + * timestamp round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code jsonify} command with a historical timestamp.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL includes the {@code at} + * clause. + */ + @Test + public void testJsonifyWithTimestampRoundTrip() { + Command cmd = Command.jsonify(1).at(Timestamp.fromMicros(5000)); + TCommand tc = cmd.toThrift(); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that a {@code chronicle} command without + * temporal bounds round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code chronicle} command for key {@code "name"} in record + * {@code 1}.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL matches the original. + */ + @Test + public void testChronicleRoundTrip() { + Command cmd = Command.chronicle("name").in(1); + TCommand tc = cmd.toThrift(); + Assert.assertEquals(TCommandVerb.CHRONICLE, tc.getVerb()); + Assert.assertFalse(tc.isSetTimestamp()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that a {@code chronicle} command with a + * timestamp round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code chronicle} command with a historical timestamp.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL includes the {@code at} + * clause. + */ + @Test + public void testChronicleWithTimestampRoundTrip() { + Command cmd = Command.chronicle("name").in(1) + .at(Timestamp.fromMicros(5000)); + TCommand tc = cmd.toThrift(); + Assert.assertTrue(tc.isSetTimestamp()); + Assert.assertFalse(tc.isSetEndTimestamp()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that a {@code chronicle} command with a + * timestamp range round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code chronicle} command with a start and end + * timestamp.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL includes both {@code at} + * clauses. + */ + @Test + public void testChronicleWithRangeRoundTrip() { + Command cmd = Command.chronicle("name").in(1) + .at(Timestamp.fromMicros(1000)).at(Timestamp.fromMicros(2000)); + TCommand tc = cmd.toThrift(); + Assert.assertTrue(tc.isSetTimestamp()); + Assert.assertTrue(tc.isSetEndTimestamp()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that a {@code diff} command for a record at + * a timestamp round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code diff} command for record {@code 1} at a + * timestamp.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL matches the original. + */ + @Test + public void testDiffRecordTimestampRoundTrip() { + Command cmd = Command.diff(1).at(Timestamp.fromMicros(5000)); + TCommand tc = cmd.toThrift(); + Assert.assertEquals(TCommandVerb.DIFF, tc.getVerb()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that a {@code diff} command for a record + * between timestamps round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code diff} command for record {@code 1} with start and end + * timestamps.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL includes both {@code at} + * clauses. + */ + @Test + public void testDiffRecordRangeRoundTrip() { + Command cmd = Command.diff(1).at(Timestamp.fromMicros(1000)) + .at(Timestamp.fromMicros(2000)); + TCommand tc = cmd.toThrift(); + Assert.assertTrue(tc.isSetEndTimestamp()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that a {@code diff} command for a key at a + * timestamp round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code diff} command for key {@code "name"} at a + * timestamp.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL matches the original. + */ + @Test + public void testDiffKeyTimestampRoundTrip() { + Command cmd = Command.diff("name").at(Timestamp.fromMicros(5000)); + TCommand tc = cmd.toThrift(); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that a {@code diff} command for a key and + * record at a timestamp round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code diff} command for key {@code "name"} in record + * {@code 1} at a timestamp.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL matches the original. + */ + @Test + public void testDiffKeyRecordTimestampRoundTrip() { + Command cmd = Command.diff("name").in(1).at(Timestamp.fromMicros(5000)); + TCommand tc = cmd.toThrift(); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that a {@code diff} command for a key and + * record between timestamps round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code diff} command for key {@code "name"} in record + * {@code 1} with start and end timestamps.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL includes both {@code at} + * clauses. + */ + @Test + public void testDiffKeyRecordRangeRoundTrip() { + Command cmd = Command.diff("name").in(1).at(Timestamp.fromMicros(1000)) + .at(Timestamp.fromMicros(2000)); + TCommand tc = cmd.toThrift(); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that an {@code audit} command for a record + * round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build an {@code audit} command for record {@code 1}.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL matches the original. + */ + @Test + public void testAuditRecordRoundTrip() { + Command cmd = Command.audit(1); + TCommand tc = cmd.toThrift(); + Assert.assertEquals(TCommandVerb.AUDIT, tc.getVerb()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that an {@code audit} command for a record + * at a timestamp round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build an {@code audit} command for record {@code 1} at a + * timestamp.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL includes the {@code at} + * clause. + */ + @Test + public void testAuditRecordTimestampRoundTrip() { + Command cmd = Command.audit(1).at(Timestamp.fromMicros(5000)); + TCommand tc = cmd.toThrift(); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that an {@code audit} command for a record + * between timestamps round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build an {@code audit} command for record {@code 1} with start and + * end timestamps.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL includes both {@code at} + * clauses. + */ + @Test + public void testAuditRecordRangeRoundTrip() { + Command cmd = Command.audit(1).at(Timestamp.fromMicros(1000)) + .at(Timestamp.fromMicros(2000)); + TCommand tc = cmd.toThrift(); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that an {@code audit} command for a key and + * record round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build an {@code audit} command for key {@code "name"} in record + * {@code 1}.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL matches the original. + */ + @Test + public void testAuditKeyRecordRoundTrip() { + Command cmd = Command.audit("name").in(1); + TCommand tc = cmd.toThrift(); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that an {@code audit} command for a key and + * record at a timestamp round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build an {@code audit} command for key {@code "name"} in record + * {@code 1} at a timestamp.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL includes the {@code at} + * clause. + */ + @Test + public void testAuditKeyRecordTimestampRoundTrip() { + Command cmd = Command.audit("name").in(1) + .at(Timestamp.fromMicros(5000)); + TCommand tc = cmd.toThrift(); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that an {@code audit} command for a key and + * record between timestamps round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build an {@code audit} command for key {@code "name"} in record + * {@code 1} with start and end timestamps.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL includes both {@code at} + * clauses. + */ + @Test + public void testAuditKeyRecordRangeRoundTrip() { + Command cmd = Command.audit("name").in(1).at(Timestamp.fromMicros(1000)) + .at(Timestamp.fromMicros(2000)); + TCommand tc = cmd.toThrift(); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that a {@code revert} command round-trips + * correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code revert} command for key {@code "name"} in record + * {@code 1} at a timestamp.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL matches the original. + */ + @Test + public void testRevertRoundTrip() { + Command cmd = Command.revert("name").in(1) + .to(Timestamp.fromMicros(5000)); + TCommand tc = cmd.toThrift(); + Assert.assertEquals(TCommandVerb.REVERT, tc.getVerb()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that a {@code reconcile} command + * round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code reconcile} command for key {@code "name"} in record + * {@code 1} with values {@code "jeff"} and {@code "bob"}.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL matches the original. + */ + @Test + public void testReconcileRoundTrip() { + Command cmd = Command.reconcile("name").in(1).with("jeff", "bob"); + TCommand tc = cmd.toThrift(); + Assert.assertEquals(TCommandVerb.RECONCILE, tc.getVerb()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that a {@code consolidate} command + * round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code consolidate} command for records {@code 1}, {@code 2}, + * and {@code 3}.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL matches the original. + */ + @Test + public void testConsolidateRoundTrip() { + Command cmd = Command.consolidate(1, 2, 3); + TCommand tc = cmd.toThrift(); + Assert.assertEquals(TCommandVerb.CONSOLIDATE, tc.getVerb()); + Assert.assertEquals(Arrays.asList(1L, 2L, 3L), tc.getRecords()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that a {@code calculate} command with + * records round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code calculate} command with function {@code "count"} for + * key {@code "name"} in records {@code 1} and {@code 2}.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL matches the original. + */ + @Test + public void testCalculateWithRecordsRoundTrip() { + Command cmd = Command.calculate("count", "name").in(1, 2); + TCommand tc = cmd.toThrift(); + Assert.assertEquals(TCommandVerb.CALCULATE, tc.getVerb()); + Assert.assertEquals("count", tc.getFunction()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that a {@code calculate} command with a + * condition round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code calculate} command with function {@code "count"} for + * key {@code "name"} with condition {@code "active = true"}.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL matches the original. + */ + @Test + public void testCalculateWithConditionRoundTrip() { + Command cmd = Command.calculate("count", "name").where("active = true"); + TCommand tc = cmd.toThrift(); + Assert.assertTrue(tc.isSetCondition()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that a {@code calculate} command with a + * condition and timestamp round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code calculate} command with function, key, condition, and + * timestamp.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL includes both the + * condition and timestamp. + */ + @Test + public void testCalculateWithConditionAndTimestampRoundTrip() { + Command cmd = Command.calculate("count", "name").where("active = true") + .at(Timestamp.fromMicros(5000)); + TCommand tc = cmd.toThrift(); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + +} diff --git a/interface/data.thrift b/interface/data.thrift index 850923bc9..c78cac4ac 100644 --- a/interface/data.thrift +++ b/interface/data.thrift @@ -104,3 +104,71 @@ struct TPage { 1:required i32 skip, 2:required i32 limit } + +/** + * The verb identifying which operation a TCommand represents. + */ +enum TCommandVerb { + FIND = 1, + SELECT = 2, + GET = 3, + NAVIGATE = 4, + ADD = 5, + SET = 6, + REMOVE = 7, + CLEAR = 8, + INSERT = 9, + LINK = 10, + UNLINK = 11, + VERIFY = 12, + VERIFY_AND_SWAP = 13, + VERIFY_OR_SET = 14, + FIND_OR_ADD = 15, + FIND_OR_INSERT = 16, + SEARCH = 17, + BROWSE = 18, + DESCRIBE = 19, + TRACE = 20, + HOLDS = 21, + JSONIFY = 22, + CHRONICLE = 23, + DIFF = 24, + AUDIT = 25, + REVERT = 26, + RECONCILE = 27, + CONSOLIDATE = 28, + CALCULATE = 29, + STAGE = 30, + COMMIT = 31, + ABORT = 32, + PING = 33, + INVENTORY = 34, +} + +/** + * A structured representation of a complete Concourse command that can + * be transmitted over the wire. Each command is identified by a required + * verb; the optional fields carry the parameters appropriate for that + * verb. + * + * Reuses existing types (TCriteria, TOrder, TPage, TObject) for + * condition, ordering, pagination, and values. + */ +struct TCommand { + 1: required TCommandVerb verb, + 2: optional list keys, + 3: optional list records, + 4: optional TCriteria criteria, + 5: optional string condition, + 6: optional i64 timestamp, + 7: optional i64 endTimestamp, + 8: optional TOrder order, + 9: optional TPage page, + 10: optional TObject value, + 11: optional TObject replacement, + 12: optional list values, + 13: optional string json, + 14: optional string query, + 15: optional string function, + 16: optional i64 sourceRecord, +} From 8d0a6855fdeb6f6f783481122db145b7af95cd7a Mon Sep 17 00:00:00 2001 From: Jeff Nelson Date: Sun, 15 Mar 2026 07:02:39 -0400 Subject: [PATCH 06/13] more test cases --- .../command/CommandSerializationTest.java | 119 ++++++++++++++++++ 1 file changed, 119 insertions(+) diff --git a/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/CommandSerializationTest.java b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/CommandSerializationTest.java index 69946e706..ae5423bcf 100644 --- a/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/CommandSerializationTest.java +++ b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/CommandSerializationTest.java @@ -21,8 +21,10 @@ import org.junit.Test; import com.cinchapi.concourse.Timestamp; +import com.cinchapi.concourse.lang.Criteria; import com.cinchapi.concourse.lang.paginate.Page; import com.cinchapi.concourse.lang.sort.Order; +import com.cinchapi.concourse.thrift.Operator; import com.cinchapi.concourse.thrift.TCommand; import com.cinchapi.concourse.thrift.TCommandVerb; @@ -235,6 +237,38 @@ public void testFindWithOrderAndPageRoundTrip() { Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); } + /** + * Goal: Verify that a {@code find} command built with a + * structured {@link Criteria} object round-trips correctly through + * {@link TCommand} serialization. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@link Criteria} with {@code age GREATER_THAN 30}.
    • + *
    • Build a {@code find} command using that {@link Criteria}.
    • + *
    • Serialize to {@link TCommand} and verify the {@code criteria} field + * is set instead of {@code condition}.
    • + *
    • Deserialize and compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The {@link TCommand} has + * {@code isSetCriteria() == true} and {@code isSetCondition() == false}, + * and the round-tripped CCL matches the original. + */ + @Test + public void testFindWithCriteriaRoundTrip() { + Criteria criteria = Criteria.where().key("age") + .operator(Operator.GREATER_THAN).value(30).build(); + Command cmd = Command.find(criteria); + TCommand tc = cmd.toThrift(); + Assert.assertEquals(TCommandVerb.FIND, tc.getVerb()); + Assert.assertTrue(tc.isSetCriteria()); + Assert.assertFalse(tc.isSetCondition()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + /** * Goal: Verify that a {@code select} command with keys and * records round-trips correctly. @@ -384,6 +418,61 @@ public void testGetAllWithConditionRoundTrip() { Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); } + /** + * Goal: Verify that a {@code get} command with a timestamp + * round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code get} command for key {@code "name"} from record + * {@code 1} at a historical timestamp.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL includes the {@code at} + * clause. + */ + @Test + public void testGetWithTimestampRoundTrip() { + Command cmd = Command.get("name").from(1) + .at(Timestamp.fromMicros(5000)); + TCommand tc = cmd.toThrift(); + Assert.assertTrue(tc.isSetTimestamp()); + Assert.assertEquals(5000, tc.getTimestamp()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + + /** + * Goal: Verify that a {@code get} command with timestamp, + * order, and page round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code get} command for key {@code "name"} from record + * {@code 1} with a timestamp, order, and page.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The round-tripped CCL includes the {@code at}, + * {@code order by}, and {@code page} clauses. + */ + @Test + public void testGetWithAllOptionsRoundTrip() { + Command cmd = Command.get("name").from(1).at(Timestamp.fromMicros(5000)) + .order(Order.by("name").build()).page(Page.sized(5)); + TCommand tc = cmd.toThrift(); + Assert.assertTrue(tc.isSetTimestamp()); + Assert.assertTrue(tc.isSetOrder()); + Assert.assertTrue(tc.isSetPage()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + /** * Goal: Verify that a {@code navigate} command from a * record round-trips correctly. @@ -1267,6 +1356,36 @@ public void testDiffKeyTimestampRoundTrip() { Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); } + /** + * Goal: Verify that a {@code diff} command for a key + * between two timestamps (without a record) round-trips correctly. + *

    + * Start state: No prior state needed. + *

    + * Workflow: + *

      + *
    • Build a {@code diff} command for key {@code "name"} with start and + * end timestamps.
    • + *
    • Serialize and deserialize.
    • + *
    • Compare {@code ccl()} output.
    • + *
    + *

    + * Expected: The {@link TCommand} has keys and both + * timestamp fields set but no records, and the round-tripped CCL matches + * the original. + */ + @Test + public void testDiffKeyRangeRoundTrip() { + Command cmd = Command.diff("name").at(Timestamp.fromMicros(1000)) + .at(Timestamp.fromMicros(2000)); + TCommand tc = cmd.toThrift(); + Assert.assertTrue(tc.isSetKeys()); + Assert.assertFalse(tc.isSetRecords()); + Assert.assertTrue(tc.isSetTimestamp()); + Assert.assertTrue(tc.isSetEndTimestamp()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } + /** * Goal: Verify that a {@code diff} command for a key and * record at a timestamp round-trips correctly. From b0c9b7fa78a969832dddc4116f01b5e87eaa6c68 Mon Sep 17 00:00:00 2001 From: Jeff Nelson Date: Sun, 15 Mar 2026 07:22:57 -0400 Subject: [PATCH 07/13] fix of the unit tests again --- .../command/CommandSerializationTest.java | 260 ++++++++---------- 1 file changed, 113 insertions(+), 147 deletions(-) diff --git a/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/CommandSerializationTest.java b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/CommandSerializationTest.java index ae5423bcf..1a8a55b0d 100644 --- a/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/CommandSerializationTest.java +++ b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/CommandSerializationTest.java @@ -42,123 +42,33 @@ public class CommandSerializationTest { /** - * Goal: Verify that a {@code ping} command round-trips - * through {@link TCommand} serialization. + * Goal: Verify that all nullary commands (no parameters) + * round-trip through {@link TCommand} serialization. *

    * Start state: No prior state needed. *

    * Workflow: *

      - *
    • Build a {@code ping} command.
    • - *
    • Serialize to {@link TCommand} and verify the verb.
    • + *
    • Build each nullary command ({@code ping}, {@code stage}, + * {@code commit}, {@code abort}, {@code inventory}).
    • + *
    • Serialize to {@link TCommand} and verify the verb matches the CCL + * verb name.
    • *
    • Deserialize back and compare {@code ccl()} output.
    • *
    *

    - * Expected: The verb is {@code PING} and the round-tripped - * CCL matches the original. + * Expected: Each command's verb maps correctly and the + * round-tripped CCL matches the original. All five share the same + * serialization path, so one test covers the mechanism. */ @Test - public void testPingRoundTrip() { - Command cmd = Command.ping(); - TCommand tc = cmd.toThrift(); - Assert.assertEquals(TCommandVerb.PING, tc.getVerb()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); - } - - /** - * Goal: Verify that a {@code stage} command round-trips - * through {@link TCommand} serialization. - *

    - * Start state: No prior state needed. - *

    - * Workflow: - *

      - *
    • Build a {@code stage} command.
    • - *
    • Serialize to {@link TCommand} and verify the verb.
    • - *
    • Deserialize back and compare {@code ccl()} output.
    • - *
    - *

    - * Expected: The verb is {@code STAGE} and the - * round-tripped CCL matches the original. - */ - @Test - public void testStageRoundTrip() { - Command cmd = Command.stage(); - TCommand tc = cmd.toThrift(); - Assert.assertEquals(TCommandVerb.STAGE, tc.getVerb()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); - } - - /** - * Goal: Verify that a {@code commit} command round-trips - * through {@link TCommand} serialization. - *

    - * Start state: No prior state needed. - *

    - * Workflow: - *

      - *
    • Build a {@code commit} command.
    • - *
    • Serialize to {@link TCommand} and verify the verb.
    • - *
    • Deserialize back and compare {@code ccl()} output.
    • - *
    - *

    - * Expected: The verb is {@code COMMIT} and the - * round-tripped CCL matches the original. - */ - @Test - public void testCommitRoundTrip() { - Command cmd = Command.commit(); - TCommand tc = cmd.toThrift(); - Assert.assertEquals(TCommandVerb.COMMIT, tc.getVerb()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); - } - - /** - * Goal: Verify that an {@code abort} command round-trips - * through {@link TCommand} serialization. - *

    - * Start state: No prior state needed. - *

    - * Workflow: - *

      - *
    • Build an {@code abort} command.
    • - *
    • Serialize to {@link TCommand} and verify the verb.
    • - *
    • Deserialize back and compare {@code ccl()} output.
    • - *
    - *

    - * Expected: The verb is {@code ABORT} and the - * round-tripped CCL matches the original. - */ - @Test - public void testAbortRoundTrip() { - Command cmd = Command.abort(); - TCommand tc = cmd.toThrift(); - Assert.assertEquals(TCommandVerb.ABORT, tc.getVerb()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); - } - - /** - * Goal: Verify that an {@code inventory} command - * round-trips through {@link TCommand} serialization. - *

    - * Start state: No prior state needed. - *

    - * Workflow: - *

      - *
    • Build an {@code inventory} command.
    • - *
    • Serialize to {@link TCommand} and verify the verb.
    • - *
    • Deserialize back and compare {@code ccl()} output.
    • - *
    - *

    - * Expected: The verb is {@code INVENTORY} and the - * round-tripped CCL matches the original. - */ - @Test - public void testInventoryRoundTrip() { - Command cmd = Command.inventory(); - TCommand tc = cmd.toThrift(); - Assert.assertEquals(TCommandVerb.INVENTORY, tc.getVerb()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + public void testNullaryCommandsRoundTrip() { + Command[] commands = { Command.ping(), Command.stage(), + Command.commit(), Command.abort(), Command.inventory() }; + for (Command cmd : commands) { + TCommand tc = cmd.toThrift(); + Assert.assertEquals(cmd.ccl(), tc.getVerb().name().toLowerCase()); + Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + } } /** @@ -358,7 +268,8 @@ public void testSelectWithConditionRoundTrip() { *

  • Compare {@code ccl()} output.
  • * *

    - * Expected: The round-tripped CCL includes all clauses. + * Expected: The {@link TCommand} has timestamp, order, and + * page fields set, and the round-tripped CCL matches. */ @Test public void testSelectWithAllOptionsRoundTrip() { @@ -366,6 +277,9 @@ public void testSelectWithAllOptionsRoundTrip() { .at(Timestamp.fromMicros(5000)).order(Order.by("name").build()) .page(Page.sized(5)); TCommand tc = cmd.toThrift(); + Assert.assertTrue(tc.isSetTimestamp()); + Assert.assertTrue(tc.isSetOrder()); + Assert.assertTrue(tc.isSetPage()); Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); } @@ -408,13 +322,15 @@ public void testGetFromRecordRoundTrip() { *

  • Compare {@code ccl()} output.
  • * *

    - * Expected: The round-tripped CCL is - * {@code "get where active = true"}. + * Expected: The {@link TCommand} has the condition field + * set, no keys, and the round-tripped CCL matches. */ @Test public void testGetAllWithConditionRoundTrip() { Command cmd = Command.getAll().where("active = true"); TCommand tc = cmd.toThrift(); + Assert.assertTrue(tc.isSetCondition()); + Assert.assertFalse(tc.isSetKeys()); Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); } @@ -512,14 +428,17 @@ public void testNavigateFromRecordRoundTrip() { *

  • Compare {@code ccl()} output.
  • * *

    - * Expected: The round-tripped CCL includes both the - * {@code where} and {@code at} clauses. + * Expected: The {@link TCommand} has both condition and + * timestamp fields set, and the round-tripped CCL matches. */ @Test public void testNavigateWithConditionAndTimestampRoundTrip() { Command cmd = Command.navigate("friends.name").where("active = true") .at(Timestamp.fromMicros(9999)); TCommand tc = cmd.toThrift(); + Assert.assertTrue(tc.isSetCondition()); + Assert.assertTrue(tc.isSetTimestamp()); + Assert.assertEquals(9999, tc.getTimestamp()); Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); } @@ -574,30 +493,6 @@ public void testAddKeyValueInRecordsRoundTrip() { Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); } - /** - * Goal: Verify that an {@code add} command with a numeric - * value round-trips correctly. - *

    - * Start state: No prior state needed. - *

    - * Workflow: - *

      - *
    • Build an {@code add} command with key {@code "age"} and integer value - * {@code 30}.
    • - *
    • Serialize and deserialize.
    • - *
    • Compare {@code ccl()} output.
    • - *
    - *

    - * Expected: The round-tripped CCL is - * {@code "add age as 30"}. - */ - @Test - public void testAddNumericValueRoundTrip() { - Command cmd = Command.add("age").as(30); - TCommand tc = cmd.toThrift(); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); - } - /** * Goal: Verify that a {@code set} command round-trips * correctly. @@ -637,14 +532,17 @@ public void testSetRoundTrip() { *

  • Compare {@code ccl()} output.
  • * *

    - * Expected: The round-tripped CCL is - * {@code "remove name as \"jeff\" from 1"}. + * Expected: The {@link TCommand} has key, value, and + * records fields correctly populated. */ @Test public void testRemoveRoundTrip() { Command cmd = Command.remove("name").as("jeff").from(1); TCommand tc = cmd.toThrift(); Assert.assertEquals(TCommandVerb.REMOVE, tc.getVerb()); + Assert.assertTrue(tc.isSetValue()); + Assert.assertEquals(Arrays.asList("name"), tc.getKeys()); + Assert.assertEquals(Arrays.asList(1L), tc.getRecords()); Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); } @@ -786,13 +684,16 @@ public void testLinkRoundTrip() { *

  • Compare {@code ccl()} output.
  • * *

    - * Expected: The round-tripped CCL matches the original. + * Expected: The {@link TCommand} has the source record and + * destination record correctly mapped. */ @Test public void testUnlinkRoundTrip() { Command cmd = Command.unlink("friends").from(1).to(2); TCommand tc = cmd.toThrift(); Assert.assertEquals(TCommandVerb.UNLINK, tc.getVerb()); + Assert.assertEquals(1, tc.getSourceRecord()); + Assert.assertEquals(Arrays.asList(2L), tc.getRecords()); Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); } @@ -887,13 +788,16 @@ public void testVerifyAndSwapRoundTrip() { *

  • Compare {@code ccl()} output.
  • * *

    - * Expected: The round-tripped CCL matches the original. + * Expected: The {@link TCommand} has key, value, and + * record fields populated. */ @Test public void testVerifyOrSetRoundTrip() { Command cmd = Command.verifyOrSet("name").as("jeff").in(1); TCommand tc = cmd.toThrift(); Assert.assertEquals(TCommandVerb.VERIFY_OR_SET, tc.getVerb()); + Assert.assertTrue(tc.isSetValue()); + Assert.assertEquals(Arrays.asList(1L), tc.getRecords()); Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); } @@ -911,13 +815,17 @@ public void testVerifyOrSetRoundTrip() { *

  • Compare {@code ccl()} output.
  • * *

    - * Expected: The round-tripped CCL matches the original. + * Expected: The {@link TCommand} has key and value fields + * populated but no records. */ @Test public void testFindOrAddRoundTrip() { Command cmd = Command.findOrAdd("name").as("jeff"); TCommand tc = cmd.toThrift(); Assert.assertEquals(TCommandVerb.FIND_OR_ADD, tc.getVerb()); + Assert.assertTrue(tc.isSetValue()); + Assert.assertEquals(Arrays.asList("name"), tc.getKeys()); + Assert.assertFalse(tc.isSetRecords()); Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); } @@ -935,7 +843,8 @@ public void testFindOrAddRoundTrip() { *

  • Compare {@code ccl()} output.
  • * *

    - * Expected: The round-tripped CCL matches the original. + * Expected: The {@link TCommand} has condition and json + * fields populated. */ @Test public void testFindOrInsertRoundTrip() { @@ -943,6 +852,8 @@ public void testFindOrInsertRoundTrip() { .json("{\"name\":\"jeff\"}"); TCommand tc = cmd.toThrift(); Assert.assertEquals(TCommandVerb.FIND_OR_INSERT, tc.getVerb()); + Assert.assertTrue(tc.isSetCondition()); + Assert.assertTrue(tc.isSetJson()); Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); } @@ -1078,13 +989,15 @@ public void testDescribeAllRoundTrip() { *

  • Compare {@code ccl()} output.
  • * *

    - * Expected: The round-tripped CCL includes the {@code at} - * clause. + * Expected: The {@link TCommand} has a timestamp but no + * records, and the round-tripped CCL matches. */ @Test public void testDescribeAllWithTimestampRoundTrip() { Command cmd = Command.describeAll().at(Timestamp.fromMicros(5000)); TCommand tc = cmd.toThrift(); + Assert.assertTrue(tc.isSetTimestamp()); + Assert.assertFalse(tc.isSetRecords()); Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); } @@ -1102,13 +1015,16 @@ public void testDescribeAllWithTimestampRoundTrip() { *

  • Compare {@code ccl()} output.
  • * *

    - * Expected: The round-tripped CCL matches the original. + * Expected: The {@link TCommand} has the records list + * populated and the round-tripped CCL matches. */ @Test public void testTraceRoundTrip() { Command cmd = Command.trace(1, 2); TCommand tc = cmd.toThrift(); Assert.assertEquals(TCommandVerb.TRACE, tc.getVerb()); + Assert.assertEquals(Arrays.asList(1L, 2L), tc.getRecords()); + Assert.assertFalse(tc.isSetTimestamp()); Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); } @@ -1125,13 +1041,15 @@ public void testTraceRoundTrip() { *

  • Compare {@code ccl()} output.
  • * *

    - * Expected: The round-tripped CCL includes the {@code at} - * clause. + * Expected: The {@link TCommand} has both records and + * timestamp set. */ @Test public void testTraceWithTimestampRoundTrip() { Command cmd = Command.trace(1).at(Timestamp.fromMicros(5000)); TCommand tc = cmd.toThrift(); + Assert.assertTrue(tc.isSetTimestamp()); + Assert.assertEquals(5000, tc.getTimestamp()); Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); } @@ -1202,6 +1120,8 @@ public void testJsonifyRoundTrip() { public void testJsonifyWithTimestampRoundTrip() { Command cmd = Command.jsonify(1).at(Timestamp.fromMicros(5000)); TCommand tc = cmd.toThrift(); + Assert.assertTrue(tc.isSetTimestamp()); + Assert.assertEquals(5000, tc.getTimestamp()); Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); } @@ -1304,6 +1224,10 @@ public void testDiffRecordTimestampRoundTrip() { Command cmd = Command.diff(1).at(Timestamp.fromMicros(5000)); TCommand tc = cmd.toThrift(); Assert.assertEquals(TCommandVerb.DIFF, tc.getVerb()); + Assert.assertTrue(tc.isSetRecords()); + Assert.assertTrue(tc.isSetTimestamp()); + Assert.assertFalse(tc.isSetEndTimestamp()); + Assert.assertFalse(tc.isSetKeys()); Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); } @@ -1329,7 +1253,12 @@ public void testDiffRecordRangeRoundTrip() { Command cmd = Command.diff(1).at(Timestamp.fromMicros(1000)) .at(Timestamp.fromMicros(2000)); TCommand tc = cmd.toThrift(); + Assert.assertTrue(tc.isSetRecords()); + Assert.assertFalse(tc.isSetKeys()); + Assert.assertTrue(tc.isSetTimestamp()); + Assert.assertEquals(1000, tc.getTimestamp()); Assert.assertTrue(tc.isSetEndTimestamp()); + Assert.assertEquals(2000, tc.getEndTimestamp()); Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); } @@ -1353,6 +1282,10 @@ public void testDiffRecordRangeRoundTrip() { public void testDiffKeyTimestampRoundTrip() { Command cmd = Command.diff("name").at(Timestamp.fromMicros(5000)); TCommand tc = cmd.toThrift(); + Assert.assertTrue(tc.isSetKeys()); + Assert.assertFalse(tc.isSetRecords()); + Assert.assertTrue(tc.isSetTimestamp()); + Assert.assertFalse(tc.isSetEndTimestamp()); Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); } @@ -1406,6 +1339,10 @@ public void testDiffKeyRangeRoundTrip() { public void testDiffKeyRecordTimestampRoundTrip() { Command cmd = Command.diff("name").in(1).at(Timestamp.fromMicros(5000)); TCommand tc = cmd.toThrift(); + Assert.assertTrue(tc.isSetKeys()); + Assert.assertTrue(tc.isSetRecords()); + Assert.assertTrue(tc.isSetTimestamp()); + Assert.assertFalse(tc.isSetEndTimestamp()); Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); } @@ -1431,6 +1368,11 @@ public void testDiffKeyRecordRangeRoundTrip() { Command cmd = Command.diff("name").in(1).at(Timestamp.fromMicros(1000)) .at(Timestamp.fromMicros(2000)); TCommand tc = cmd.toThrift(); + Assert.assertTrue(tc.isSetKeys()); + Assert.assertTrue(tc.isSetRecords()); + Assert.assertTrue(tc.isSetEndTimestamp()); + Assert.assertEquals(1000, tc.getTimestamp()); + Assert.assertEquals(2000, tc.getEndTimestamp()); Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); } @@ -1478,6 +1420,8 @@ public void testAuditRecordRoundTrip() { public void testAuditRecordTimestampRoundTrip() { Command cmd = Command.audit(1).at(Timestamp.fromMicros(5000)); TCommand tc = cmd.toThrift(); + Assert.assertTrue(tc.isSetTimestamp()); + Assert.assertFalse(tc.isSetKeys()); Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); } @@ -1503,6 +1447,10 @@ public void testAuditRecordRangeRoundTrip() { Command cmd = Command.audit(1).at(Timestamp.fromMicros(1000)) .at(Timestamp.fromMicros(2000)); TCommand tc = cmd.toThrift(); + Assert.assertTrue(tc.isSetTimestamp()); + Assert.assertEquals(1000, tc.getTimestamp()); + Assert.assertTrue(tc.isSetEndTimestamp()); + Assert.assertEquals(2000, tc.getEndTimestamp()); Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); } @@ -1526,6 +1474,9 @@ public void testAuditRecordRangeRoundTrip() { public void testAuditKeyRecordRoundTrip() { Command cmd = Command.audit("name").in(1); TCommand tc = cmd.toThrift(); + Assert.assertTrue(tc.isSetKeys()); + Assert.assertEquals(Arrays.asList("name"), tc.getKeys()); + Assert.assertFalse(tc.isSetTimestamp()); Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); } @@ -1551,6 +1502,9 @@ public void testAuditKeyRecordTimestampRoundTrip() { Command cmd = Command.audit("name").in(1) .at(Timestamp.fromMicros(5000)); TCommand tc = cmd.toThrift(); + Assert.assertTrue(tc.isSetKeys()); + Assert.assertTrue(tc.isSetTimestamp()); + Assert.assertFalse(tc.isSetEndTimestamp()); Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); } @@ -1576,6 +1530,9 @@ public void testAuditKeyRecordRangeRoundTrip() { Command cmd = Command.audit("name").in(1).at(Timestamp.fromMicros(1000)) .at(Timestamp.fromMicros(2000)); TCommand tc = cmd.toThrift(); + Assert.assertTrue(tc.isSetKeys()); + Assert.assertTrue(tc.isSetTimestamp()); + Assert.assertTrue(tc.isSetEndTimestamp()); Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); } @@ -1601,6 +1558,10 @@ public void testRevertRoundTrip() { .to(Timestamp.fromMicros(5000)); TCommand tc = cmd.toThrift(); Assert.assertEquals(TCommandVerb.REVERT, tc.getVerb()); + Assert.assertTrue(tc.isSetKeys()); + Assert.assertTrue(tc.isSetRecords()); + Assert.assertTrue(tc.isSetTimestamp()); + Assert.assertEquals(5000, tc.getTimestamp()); Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); } @@ -1625,6 +1586,8 @@ public void testReconcileRoundTrip() { Command cmd = Command.reconcile("name").in(1).with("jeff", "bob"); TCommand tc = cmd.toThrift(); Assert.assertEquals(TCommandVerb.RECONCILE, tc.getVerb()); + Assert.assertTrue(tc.isSetValues()); + Assert.assertEquals(2, tc.getValues().size()); Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); } @@ -1724,6 +1687,9 @@ public void testCalculateWithConditionAndTimestampRoundTrip() { Command cmd = Command.calculate("count", "name").where("active = true") .at(Timestamp.fromMicros(5000)); TCommand tc = cmd.toThrift(); + Assert.assertTrue(tc.isSetCondition()); + Assert.assertTrue(tc.isSetTimestamp()); + Assert.assertEquals(5000, tc.getTimestamp()); Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); } From ad121a996cbebd45790d6754604df6beeb2696af Mon Sep 17 00:00:00 2001 From: Jeff Nelson Date: Sun, 15 Mar 2026 10:27:34 -0400 Subject: [PATCH 08/13] add support command execution on the server --- .../com/cinchapi/concourse/Concourse.java | 112 + .../concourse/ConcourseThriftDriver.java | 59 + .../concourse/ForwardingConcourse.java | 42 + .../com/cinchapi/concourse/NoOpConcourse.java | 42 + .../concourse/lang/command/Command.java | 20 + .../concourse/lang/command/CommandGroup.java | 929 ++ .../lang/command/DefaultCommandGroup.java | 2803 +++++ .../thrift/ConcourseCalculateService.java | 2 +- .../thrift/ConcourseNavigateService.java | 2 +- .../concourse/thrift/ConcourseService.java | 9394 ++++++++++++----- .../lang/command/DefaultCommandGroupTest.java | 240 + .../concourse/CommandExecutionTest.java | 310 + .../plugin/StatefulConcourseService.java | 8 + .../concourse/server/ConcourseServer.java | 64 + .../ConcourseManagementService.java | 2 +- .../server/ops/CommandDispatcher.java | 822 ++ interface/concourse.thrift | 28 + utils/codegen/CommandGroupGenerator.groovy | 387 + .../StatefulConcourseServiceGenerator.groovy | 3 +- utils/compile-thrift-java.sh | 12 + 20 files changed, 12499 insertions(+), 2782 deletions(-) create mode 100644 concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/CommandGroup.java create mode 100644 concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/DefaultCommandGroup.java create mode 100644 concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/DefaultCommandGroupTest.java create mode 100644 concourse-integration-tests/src/test/java/com/cinchapi/concourse/CommandExecutionTest.java create mode 100644 concourse-server/src/main/java/com/cinchapi/concourse/server/ops/CommandDispatcher.java create mode 100644 utils/codegen/CommandGroupGenerator.groovy diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/Concourse.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/Concourse.java index 8b4396409..6b1e5fbaa 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/Concourse.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/Concourse.java @@ -32,6 +32,8 @@ import com.cinchapi.concourse.config.ConcourseClientPreferences; import com.cinchapi.concourse.lang.BuildableState; import com.cinchapi.concourse.lang.Criteria; +import com.cinchapi.concourse.lang.command.Command; +import com.cinchapi.concourse.lang.command.CommandGroup; import com.cinchapi.concourse.lang.paginate.Page; import com.cinchapi.concourse.lang.sort.Order; import com.cinchapi.concourse.thrift.Diff; @@ -7445,6 +7447,116 @@ public final boolean stage(Runnable task) throws TransactionException { } } + /** + * Execute a single {@link Command} and return its result. + *

    + * If the {@link Command} fails, the exception is propagated immediately. + *

    + * + * @param command the {@link Command} to execute + * @return the result of the {@link Command} + */ + public abstract Object exec(Command command); + + /** + * Execute two or more {@link Command Commands} and return the result of the + * last one. + *

    + * {@link Command Commands} are executed sequentially. If any + * {@link Command} fails, execution stops and the exception is propagated + * immediately. + *

    + * + * @param command the first {@link Command} to execute + * @param more additional {@link Command Commands} to execute + * @return the result of the last {@link Command} + */ + public abstract Object exec(Command command, Command... more); + + /** + * Execute a list of {@link Command Commands} and return the result of the + * last one. + *

    + * {@link Command Commands} are executed sequentially. If any + * {@link Command} fails, execution stops and the exception is propagated + * immediately. + *

    + * + * @param commands the {@link Command Commands} to execute + * @return the result of the last {@link Command} + */ + public abstract Object exec(List commands); + + /** + * Submit a single {@link Command} and return a {@link List} containing its + * result. + *

    + * If the {@link Command} fails, the exception is propagated immediately. + *

    + * + * @param command the {@link Command} to submit + * @return a {@link List} containing the result + */ + public abstract List submit(Command command); + + /** + * Submit two or more {@link Command Commands} and return a {@link List} of + * results corresponding to each {@link Command}. + *

    + * {@link Command Commands} are executed sequentially on the server in a + * single round trip. If any {@link Command} fails, execution stops and the + * exception is propagated. + *

    + * + * @param command the first {@link Command} to submit + * @param more additional {@link Command Commands} to submit + * @return a {@link List} of results, one per {@link Command} + */ + public abstract List submit(Command command, Command... more); + + /** + * Submit a list of {@link Command Commands} and return a {@link List} of + * results corresponding to each {@link Command}. + *

    + * {@link Command Commands} are executed sequentially on the server in a + * single round trip. If any {@link Command} fails, execution stops and the + * exception is propagated. + *

    + * + * @param commands the {@link Command Commands} to submit + * @return a {@link List} of results, one per {@link Command} + */ + public abstract List submit(List commands); + + /** + * Submit all the {@link Command Commands} that have been collected by the + * {@code group} and return a {@link List} of results corresponding to each + * {@link Command}. + *

    + * {@link Command Commands} are executed sequentially on the server in a + * single round trip. If any {@link Command} fails, execution stops and the + * exception is propagated. + *

    + * + * @param group the {@link CommandGroup} containing the {@link Command + * Commands} to submit + * @return a {@link List} of results, one per {@link Command} + */ + public abstract List submit(CommandGroup group); + + /** + * Return a new {@link CommandGroup} that can be used to collect + * {@link Command Commands} for batch submission. + *

    + * Call methods on the returned {@link CommandGroup} to record operations. + * Then pass the {@link CommandGroup} to {@link #submit(CommandGroup)} to + * execute all the recorded operations in a single round trip. + *

    + * + * @return a new {@link CommandGroup} + */ + public abstract CommandGroup group(); + /** * Return a {@link Timestamp} that represents the current instant according * to the server. diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/ConcourseThriftDriver.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/ConcourseThriftDriver.java index 31702188c..709b41cb6 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/ConcourseThriftDriver.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/ConcourseThriftDriver.java @@ -48,6 +48,9 @@ import com.cinchapi.concourse.data.transform.DataTable; import com.cinchapi.concourse.lang.Criteria; import com.cinchapi.concourse.lang.Language; +import com.cinchapi.concourse.lang.command.Command; +import com.cinchapi.concourse.lang.command.CommandGroup; +import com.cinchapi.concourse.lang.command.DefaultCommandGroup; import com.cinchapi.concourse.lang.paginate.Page; import com.cinchapi.concourse.lang.sort.Order; import com.cinchapi.concourse.security.ClientSecurity; @@ -60,6 +63,7 @@ import com.cinchapi.concourse.thrift.JavaThriftBridge; import com.cinchapi.concourse.thrift.Operator; import com.cinchapi.concourse.thrift.SecurityException; +import com.cinchapi.concourse.thrift.TCommand; import com.cinchapi.concourse.thrift.TObject; import com.cinchapi.concourse.thrift.TransactionToken; import com.cinchapi.concourse.util.Collections; @@ -4063,6 +4067,61 @@ public void stage() throws TransactionException { }); } + @Override + public Object exec(Command command) { + return exec(Lists.newArrayList(command)); + } + + @Override + public Object exec(Command command, Command... more) { + List commands = Lists.newArrayList(command); + java.util.Collections.addAll(commands, more); + return exec(commands); + } + + @Override + public Object exec(List commands) { + return execute(() -> { + List tcommands = commands.stream().map(Command::toThrift) + .collect(Collectors.toList()); + return core.exec(tcommands, creds, transaction, environment) + .getJavaObject(); + }); + } + + @Override + public List submit(Command command) { + return submit(Lists.newArrayList(command)); + } + + @Override + public List submit(Command command, Command... more) { + List commands = Lists.newArrayList(command); + java.util.Collections.addAll(commands, more); + return submit(commands); + } + + @Override + public List submit(List commands) { + return execute(() -> { + List tcommands = commands.stream().map(Command::toThrift) + .collect(Collectors.toList()); + return core.submit(tcommands, creds, transaction, environment) + .stream().map(ComplexTObject::getJavaObject) + .collect(Collectors.toList()); + }); + } + + @Override + public List submit(CommandGroup group) { + return submit(group.commands()); + } + + @Override + public CommandGroup group() { + return new DefaultCommandGroup(); + } + @Override public Timestamp time() { return execute(() -> Timestamp diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/ForwardingConcourse.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/ForwardingConcourse.java index 82a3f425f..f363e06a9 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/ForwardingConcourse.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/ForwardingConcourse.java @@ -21,6 +21,8 @@ import java.util.Set; import com.cinchapi.concourse.lang.Criteria; +import com.cinchapi.concourse.lang.command.Command; +import com.cinchapi.concourse.lang.command.CommandGroup; import com.cinchapi.concourse.lang.paginate.Page; import com.cinchapi.concourse.lang.sort.Order; import com.cinchapi.concourse.thrift.Diff; @@ -1710,6 +1712,46 @@ public void verifyOrSet(String key, Object value, long record) { concourse.verifyOrSet(key, value, record); } + @Override + public Object exec(Command command) { + return concourse.exec(command); + } + + @Override + public Object exec(Command command, Command... more) { + return concourse.exec(command, more); + } + + @Override + public Object exec(List commands) { + return concourse.exec(commands); + } + + @Override + public List submit(Command command) { + return concourse.submit(command); + } + + @Override + public List submit(Command command, Command... more) { + return concourse.submit(command, more); + } + + @Override + public List submit(List commands) { + return concourse.submit(commands); + } + + @Override + public List submit(CommandGroup group) { + return concourse.submit(group); + } + + @Override + public CommandGroup group() { + return concourse.group(); + } + @Override boolean failed() { return concourse.failed(); diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/NoOpConcourse.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/NoOpConcourse.java index 547e387c5..483edb558 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/NoOpConcourse.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/NoOpConcourse.java @@ -21,6 +21,8 @@ import java.util.Set; import com.cinchapi.concourse.lang.Criteria; +import com.cinchapi.concourse.lang.command.Command; +import com.cinchapi.concourse.lang.command.CommandGroup; import com.cinchapi.concourse.lang.paginate.Page; import com.cinchapi.concourse.lang.sort.Order; import com.cinchapi.concourse.thrift.Diff; @@ -1696,6 +1698,46 @@ public void verifyOrSet(String key, Object value, long record) { throw new UnsupportedOperationException(); } + @Override + public Object exec(Command command) { + throw new UnsupportedOperationException(); + } + + @Override + public Object exec(Command command, Command... more) { + throw new UnsupportedOperationException(); + } + + @Override + public Object exec(List commands) { + throw new UnsupportedOperationException(); + } + + @Override + public List submit(Command command) { + throw new UnsupportedOperationException(); + } + + @Override + public List submit(Command command, Command... more) { + throw new UnsupportedOperationException(); + } + + @Override + public List submit(List commands) { + throw new UnsupportedOperationException(); + } + + @Override + public List submit(CommandGroup group) { + throw new UnsupportedOperationException(); + } + + @Override + public CommandGroup group() { + throw new UnsupportedOperationException(); + } + @Override protected Concourse copyConnection() { throw new UnsupportedOperationException(); diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/Command.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/Command.java index 6914fd1a0..221e3ff6f 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/Command.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/Command.java @@ -716,4 +716,24 @@ public static Command inventory() { return new BuiltCommand("inventory"); } + /** + * Return a {@code time} {@link Command}. + * + * @return the {@link Command} + */ + public static Command time() { + return new BuiltCommand("time"); + } + + /** + * Return a {@code time} {@link Command} that resolves the given + * {@code phrase} to a timestamp. + * + * @param phrase the natural language time phrase + * @return the {@link Command} + */ + public static Command time(String phrase) { + return new BuiltCommand("time " + phrase); + } + } diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/CommandGroup.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/CommandGroup.java new file mode 100644 index 000000000..120f594b0 --- /dev/null +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/CommandGroup.java @@ -0,0 +1,929 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.lang.command; + +import java.util.List; +import java.util.Set; + +import com.cinchapi.concourse.lang.Criteria; +import com.cinchapi.concourse.lang.paginate.Page; +import com.cinchapi.concourse.lang.sort.Order; +import com.cinchapi.concourse.thrift.Operator; + +/** + * An interface that mirrors the Concourse API with void-returning methods. + * Implementations collect the method invocations as {@link Command Commands} + * for batch submission via {@code Concourse#submit(CommandGroup)}. + */ +public interface CommandGroup { + + /** + * Return the collected {@link Command Commands}. + * + * @return the {@link Command Commands} + */ + List commands(); + + void abort(); + + void add(String key, Object value); + + void add(String key, Object value, long record); + + void add(String key, Object value, List records); + + void audit(long record); + + void audit(long record, long start); + + void audit(long record, String start); + + void audit(long record, long start, long tend); + + void audit(long record, String start, String tend); + + void audit(String key, long record); + + void audit(String key, long record, long start); + + void audit(String key, long record, String start); + + void audit(String key, long record, long start, long tend); + + void audit(String key, long record, String start, String tend); + + void browse(String key); + + void browse(List keys); + + void browse(String key, long timestamp); + + void browse(String key, String timestamp); + + void browse(List keys, long timestamp); + + void browse(List keys, String timestamp); + + void chronicle(String key, long record); + + void chronicle(String key, long record, long start); + + void chronicle(String key, long record, String start); + + void chronicle(String key, long record, long start, long tend); + + void chronicle(String key, long record, String start, String tend); + + void clear(long record); + + void clear(List records); + + void clear(String key, long record); + + void clear(List keys, long record); + + void clear(String key, List records); + + void clear(List keys, List records); + + void commit(); + + void describe(); + + void describe(long timestamp); + + void describe(String timestamp); + + void describe(long record, long timestamp); + + void describe(long record, String timestamp); + + void describe(List records); + + void describe(List records, long timestamp); + + void describe(List records, String timestamp); + + void diff(long record, long start); + + void diff(long record, String start); + + void diff(long record, long start, long tend); + + void diff(long record, String start, String tend); + + void diff(String key, long record, long start); + + void diff(String key, long record, String start); + + void diff(String key, long record, long start, long tend); + + void diff(String key, long record, String start, String tend); + + void diff(String key, long start); + + void diff(String key, String start); + + void diff(String key, String start, String tend); + + void stage(); + + void insert(String json); + + void insert(String json, long record); + + void insert(String json, List records); + + void remove(String key, Object value, long record); + + void remove(String key, Object value, List records); + + void set(String key, Object value, long record); + + void set(String key, Object value); + + void set(String key, Object value, List records); + + void reconcile(String key, long record, Set values); + + void inventory(); + + void select(long record); + + void select(List records); + + void select(List records, Page page); + + void select(List records, Order order); + + void select(List records, Order order, Page page); + + void select(long record, long timestamp); + + void select(long record, String timestamp); + + void select(List records, long timestamp); + + void select(List records, long timestamp, Page page); + + void select(List records, long timestamp, Order order); + + void select(List records, long timestamp, Order order, Page page); + + void select(List records, String timestamp); + + void select(List records, String timestamp, Page page); + + void select(List records, String timestamp, Order order); + + void select(List records, String timestamp, Order order, Page page); + + void select(String key, long record); + + void select(String key, long record, long timestamp); + + void select(String key, long record, String timestamp); + + void select(List keys, long record, long timestamp); + + void select(List keys, long record, String timestamp); + + void select(List keys, List records); + + void select(List keys, List records, Page page); + + void select(List keys, List records, Order order); + + void select(List keys, List records, Order order, Page page); + + void select(String key, List records); + + void select(String key, List records, Page page); + + void select(String key, List records, Order order); + + void select(String key, List records, Order order, Page page); + + void select(String key, List records, long timestamp); + + void select(String key, List records, long timestamp, Page page); + + void select(String key, List records, long timestamp, Order order); + + void select(String key, List records, long timestamp, Order order, + Page page); + + void select(String key, List records, String timestamp); + + void select(String key, List records, String timestamp, Page page); + + void select(String key, List records, String timestamp, Order order); + + void select(String key, List records, String timestamp, Order order, + Page page); + + void select(List keys, List records, long timestamp); + + void select(List keys, List records, long timestamp, + Page page); + + void select(List keys, List records, long timestamp, + Order order); + + void select(List keys, List records, long timestamp, + Order order, Page page); + + void select(List keys, List records, String timestamp); + + void select(List keys, List records, String timestamp, + Page page); + + void select(List keys, List records, String timestamp, + Order order); + + void select(List keys, List records, String timestamp, + Order order, Page page); + + void select(Criteria criteria); + + void select(Criteria criteria, Page page); + + void select(Criteria criteria, Order order); + + void select(Criteria criteria, Order order, Page page); + + void select(String ccl); + + void select(String ccl, Page page); + + void select(String ccl, Order order); + + void select(String ccl, Order order, Page page); + + void select(Criteria criteria, long timestamp); + + void select(Criteria criteria, long timestamp, Page page); + + void select(Criteria criteria, long timestamp, Order order); + + void select(Criteria criteria, long timestamp, Order order, Page page); + + void select(Criteria criteria, String timestamp); + + void select(Criteria criteria, String timestamp, Page page); + + void select(Criteria criteria, String timestamp, Order order); + + void select(Criteria criteria, String timestamp, Order order, Page page); + + void select(String ccl, long timestamp, Page page); + + void select(String ccl, long timestamp, Order order); + + void select(String ccl, long timestamp, Order order, Page page); + + void select(String ccl, String timestamp); + + void select(String ccl, String timestamp, Page page); + + void select(String ccl, String timestamp, Order order); + + void select(String ccl, String timestamp, Order order, Page page); + + void select(String key, Criteria criteria); + + void select(String key, Criteria criteria, Page page); + + void select(String key, Criteria criteria, Order order); + + void select(String key, Criteria criteria, Order order, Page page); + + void select(String key, Criteria criteria, long timestamp); + + void select(String key, Criteria criteria, long timestamp, Page page); + + void select(String key, Criteria criteria, long timestamp, Order order); + + void select(String key, Criteria criteria, long timestamp, Order order, + Page page); + + void select(String key, Criteria criteria, String timestamp); + + void select(String key, Criteria criteria, String timestamp, Page page); + + void select(String key, Criteria criteria, String timestamp, Order order); + + void select(String key, Criteria criteria, String timestamp, Order order, + Page page); + + void select(String key, String ccl, long timestamp); + + void select(String key, String ccl, long timestamp, Page page); + + void select(String key, String ccl, long timestamp, Order order); + + void select(String key, String ccl, long timestamp, Order order, Page page); + + void select(String key, String ccl, String timestamp); + + void select(String key, String ccl, String timestamp, Page page); + + void select(String key, String ccl, String timestamp, Order order); + + void select(String key, String ccl, String timestamp, Order order, + Page page); + + void select(List keys, Criteria criteria); + + void select(List keys, Criteria criteria, Page page); + + void select(List keys, Criteria criteria, Order order); + + void select(List keys, Criteria criteria, Order order, Page page); + + void select(List keys, Criteria criteria, long timestamp); + + void select(List keys, Criteria criteria, long timestamp, + Page page); + + void select(List keys, Criteria criteria, long timestamp, + Order order); + + void select(List keys, Criteria criteria, long timestamp, + Order order, Page page); + + void select(List keys, Criteria criteria, String timestamp); + + void select(List keys, Criteria criteria, String timestamp, + Page page); + + void select(List keys, Criteria criteria, String timestamp, + Order order); + + void select(List keys, Criteria criteria, String timestamp, + Order order, Page page); + + void select(List keys, String ccl, long timestamp); + + void select(List keys, String ccl, long timestamp, Page page); + + void select(List keys, String ccl, long timestamp, Order order); + + void select(List keys, String ccl, long timestamp, Order order, + Page page); + + void select(List keys, String ccl, String timestamp); + + void select(List keys, String ccl, String timestamp, Page page); + + void select(List keys, String ccl, String timestamp, Order order); + + void select(List keys, String ccl, String timestamp, Order order, + Page page); + + void get(String key, long record); + + void get(String key, long record, long timestamp); + + void get(String key, long record, String timestamp); + + void get(List keys, long record); + + void get(List keys, long record, long timestamp); + + void get(List keys, long record, String timestamp); + + void get(List keys, List records); + + void get(List keys, List records, Page page); + + void get(List keys, List records, Order order); + + void get(List keys, List records, Order order, Page page); + + void get(String key, List records); + + void get(String key, List records, Page page); + + void get(String key, List records, Order order); + + void get(String key, List records, Order order, Page page); + + void get(String key, List records, long timestamp); + + void get(String key, List records, long timestamp, Page page); + + void get(String key, List records, long timestamp, Order order); + + void get(String key, List records, long timestamp, Order order, + Page page); + + void get(String key, List records, String timestamp); + + void get(String key, List records, String timestamp, Page page); + + void get(String key, List records, String timestamp, Order order); + + void get(String key, List records, String timestamp, Order order, + Page page); + + void get(List keys, List records, long timestamp); + + void get(List keys, List records, long timestamp, Page page); + + void get(List keys, List records, long timestamp, + Order order); + + void get(List keys, List records, long timestamp, Order order, + Page page); + + void get(List keys, List records, String timestamp); + + void get(List keys, List records, String timestamp, + Page page); + + void get(List keys, List records, String timestamp, + Order order); + + void get(List keys, List records, String timestamp, + Order order, Page page); + + void get(String key, Criteria criteria); + + void get(String key, Criteria criteria, Page page); + + void get(String key, Criteria criteria, Order order); + + void get(String key, Criteria criteria, Order order, Page page); + + void get(Criteria criteria); + + void get(Criteria criteria, Page page); + + void get(Criteria criteria, Order order); + + void get(Criteria criteria, Order order, Page page); + + void get(String ccl); + + void get(String ccl, Page page); + + void get(String ccl, Order order); + + void get(String ccl, Order order, Page page); + + void get(Criteria criteria, long timestamp); + + void get(Criteria criteria, long timestamp, Page page); + + void get(Criteria criteria, long timestamp, Order order); + + void get(Criteria criteria, long timestamp, Order order, Page page); + + void get(Criteria criteria, String timestamp); + + void get(Criteria criteria, String timestamp, Page page); + + void get(Criteria criteria, String timestamp, Order order); + + void get(Criteria criteria, String timestamp, Order order, Page page); + + void get(String ccl, long timestamp, Page page); + + void get(String ccl, long timestamp, Order order); + + void get(String ccl, long timestamp, Order order, Page page); + + void get(String ccl, String timestamp); + + void get(String ccl, String timestamp, Page page); + + void get(String ccl, String timestamp, Order order); + + void get(String ccl, String timestamp, Order order, Page page); + + void get(String key, Criteria criteria, long timestamp); + + void get(String key, Criteria criteria, long timestamp, Page page); + + void get(String key, Criteria criteria, long timestamp, Order order); + + void get(String key, Criteria criteria, long timestamp, Order order, + Page page); + + void get(String key, Criteria criteria, String timestamp); + + void get(String key, Criteria criteria, String timestamp, Page page); + + void get(String key, Criteria criteria, String timestamp, Order order); + + void get(String key, Criteria criteria, String timestamp, Order order, + Page page); + + void get(String key, String ccl, long timestamp); + + void get(String key, String ccl, long timestamp, Page page); + + void get(String key, String ccl, long timestamp, Order order); + + void get(String key, String ccl, long timestamp, Order order, Page page); + + void get(String key, String ccl, String timestamp); + + void get(String key, String ccl, String timestamp, Page page); + + void get(String key, String ccl, String timestamp, Order order); + + void get(String key, String ccl, String timestamp, Order order, Page page); + + void get(List keys, Criteria criteria); + + void get(List keys, Criteria criteria, Page page); + + void get(List keys, Criteria criteria, Order order); + + void get(List keys, Criteria criteria, Order order, Page page); + + void get(List keys, String ccl); + + void get(List keys, String ccl, Page page); + + void get(List keys, String ccl, Order order); + + void get(List keys, String ccl, Order order, Page page); + + void get(List keys, Criteria criteria, long timestamp); + + void get(List keys, Criteria criteria, long timestamp, Page page); + + void get(List keys, Criteria criteria, long timestamp, Order order); + + void get(List keys, Criteria criteria, long timestamp, Order order, + Page page); + + void get(List keys, Criteria criteria, String timestamp); + + void get(List keys, Criteria criteria, String timestamp, Page page); + + void get(List keys, Criteria criteria, String timestamp, + Order order); + + void get(List keys, Criteria criteria, String timestamp, + Order order, Page page); + + void get(List keys, String ccl, long timestamp); + + void get(List keys, String ccl, long timestamp, Page page); + + void get(List keys, String ccl, long timestamp, Order order); + + void get(List keys, String ccl, long timestamp, Order order, + Page page); + + void get(List keys, String ccl, String timestamp); + + void get(List keys, String ccl, String timestamp, Page page); + + void get(List keys, String ccl, String timestamp, Order order); + + void get(List keys, String ccl, String timestamp, Order order, + Page page); + + void verify(String key, Object value, long record); + + void verify(String key, Object value, long record, long timestamp); + + void verify(String key, Object value, long record, String timestamp); + + void jsonify(List records, boolean identifier); + + void jsonify(List records, long timestamp, boolean identifier); + + void jsonify(List records, String timestamp, boolean identifier); + + void find(Criteria criteria); + + void find(Criteria criteria, Page page); + + void find(Criteria criteria, Order order); + + void find(Criteria criteria, Order order, Page page); + + void find(String ccl); + + void find(String ccl, Page page); + + void find(String ccl, Order order); + + void find(String ccl, Order order, Page page); + + void find(String key, Operator operator, List values); + + void find(String key, Operator operator, List values, Page page); + + void find(String key, Operator operator, List values, Order order); + + void find(String key, Operator operator, List values, Order order, + Page page); + + void find(String key, Operator operator, List values, + long timestamp); + + void find(String key, Operator operator, List values, + long timestamp, Page page); + + void find(String key, Operator operator, List values, + long timestamp, Order order); + + void find(String key, Operator operator, List values, + long timestamp, Order order, Page page); + + void find(String key, Operator operator, List values, + String timestamp); + + void find(String key, Operator operator, List values, + String timestamp, Page page); + + void find(String key, Operator operator, List values, + String timestamp, Order order); + + void find(String key, Operator operator, List values, + String timestamp, Order order, Page page); + + void find(String key, String operator, List values); + + void find(String key, String operator, List values, Page page); + + void find(String key, String operator, List values, Order order); + + void find(String key, String operator, List values, Order order, + Page page); + + void find(String key, String operator, List values, long timestamp); + + void find(String key, String operator, List values, long timestamp, + Page page); + + void find(String key, String operator, List values, long timestamp, + Order order); + + void find(String key, String operator, List values, long timestamp, + Order order, Page page); + + void find(String key, String operator, List values, + String timestamp); + + void find(String key, String operator, List values, + String timestamp, Page page); + + void find(String key, String operator, List values, + String timestamp, Order order); + + void find(String key, String operator, List values, + String timestamp, Order order, Page page); + + void search(String key, String query); + + void revert(List keys, List records, long timestamp); + + void revert(List keys, List records, String timestamp); + + void revert(List keys, long record, long timestamp); + + void revert(List keys, long record, String timestamp); + + void revert(String key, List records, long timestamp); + + void revert(String key, List records, String timestamp); + + void revert(String key, long record, long timestamp); + + void revert(String key, long record, String timestamp); + + void holds(List records); + + void holds(long record); + + void verifyAndSwap(String key, Object expected, long record, + Object replacement); + + void verifyOrSet(String key, Object value, long record); + + void findOrAdd(String key, Object value); + + void findOrInsert(Criteria criteria, String json); + + void findOrInsert(String ccl, String json); + + void time(); + + void time(String phrase); + + void trace(long record); + + void trace(long record, long timestamp); + + void trace(long record, String timestamp); + + void trace(List records); + + void trace(List records, long timestamp); + + void trace(List records, String timestamp); + + void consolidate(List records); + + void ping(); + + void sum(String key, long record); + + void sum(String key, long record, long timestamp); + + void sum(String key, long record, String timestamp); + + void sum(String key, List records); + + void sum(String key, List records, long timestamp); + + void sum(String key, List records, String timestamp); + + void sum(String key); + + void sum(String key, String timestamp); + + void sum(String key, Criteria criteria); + + void sum(String key, Criteria criteria, long timestamp); + + void sum(String key, Criteria criteria, String timestamp); + + void sum(String key, String ccl, long timestamp); + + void sum(String key, String ccl, String timestamp); + + void average(String key, long record); + + void average(String key, long record, long timestamp); + + void average(String key, long record, String timestamp); + + void average(String key, List records); + + void average(String key, List records, long timestamp); + + void average(String key, List records, String timestamp); + + void average(String key); + + void average(String key, String timestamp); + + void average(String key, Criteria criteria); + + void average(String key, Criteria criteria, long timestamp); + + void average(String key, Criteria criteria, String timestamp); + + void average(String key, String ccl, long timestamp); + + void average(String key, String ccl, String timestamp); + + void count(String key, long record); + + void count(String key, long record, long timestamp); + + void count(String key, long record, String timestamp); + + void count(String key, List records); + + void count(String key, List records, long timestamp); + + void count(String key, List records, String timestamp); + + void count(String key); + + void count(String key, String timestamp); + + void count(String key, Criteria criteria); + + void count(String key, Criteria criteria, long timestamp); + + void count(String key, Criteria criteria, String timestamp); + + void count(String key, String ccl, long timestamp); + + void count(String key, String ccl, String timestamp); + + void max(String key, long record); + + void max(String key, long record, long timestamp); + + void max(String key, long record, String timestamp); + + void max(String key, List records); + + void max(String key, List records, long timestamp); + + void max(String key, List records, String timestamp); + + void max(String key, Criteria criteria); + + void max(String key, Criteria criteria, long timestamp); + + void max(String key, Criteria criteria, String timestamp); + + void max(String key, String ccl); + + void max(String key, String ccl, long timestamp); + + void max(String key, String ccl, String timestamp); + + void max(String key); + + void min(String key, long record); + + void min(String key, long record, long timestamp); + + void min(String key, long record, String timestamp); + + void min(String key); + + void min(String key, List records, long timestamp); + + void min(String key, List records, String timestamp); + + void min(String key, Criteria criteria); + + void min(String key, Criteria criteria, long timestamp); + + void min(String key, Criteria criteria, String timestamp); + + void min(String key, String ccl); + + void min(String key, String ccl, long timestamp); + + void min(String key, String ccl, String timestamp); + + void min(String key, List records); + + void navigate(String key, long record); + + void navigate(String key, long record, long timestamp); + + void navigate(String key, long record, String timestamp); + + void navigate(List keys, long record); + + void navigate(List keys, long record, long timestamp); + + void navigate(List keys, long record, String timestamp); + + void navigate(List keys, List records); + + void navigate(String key, List records); + + void navigate(String key, List records, long timestamp); + + void navigate(String key, List records, String timestamp); + + void navigate(List keys, List records, long timestamp); + + void navigate(List keys, List records, String timestamp); + + void navigate(String key, String ccl); + + void navigate(String key, String ccl, long timestamp); + + void navigate(String key, String ccl, String timestamp); + + void navigate(List keys, String ccl); + + void navigate(List keys, String ccl, long timestamp); + + void navigate(List keys, String ccl, String timestamp); + + void navigate(String key, Criteria criteria); + + void navigate(String key, Criteria criteria, long timestamp); + + void navigate(String key, Criteria criteria, String timestamp); + + void navigate(List keys, Criteria criteria); + + void navigate(List keys, Criteria criteria, long timestamp); + + void navigate(List keys, Criteria criteria, String timestamp); + +} \ No newline at end of file diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/DefaultCommandGroup.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/DefaultCommandGroup.java new file mode 100644 index 000000000..34504709e --- /dev/null +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/DefaultCommandGroup.java @@ -0,0 +1,2803 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.lang.command; + +import java.util.Collections; +import java.util.List; +import java.util.Set; + +import com.cinchapi.concourse.Timestamp; +import com.cinchapi.concourse.lang.Criteria; +import com.cinchapi.concourse.lang.paginate.Page; +import com.cinchapi.concourse.lang.sort.Order; +import com.cinchapi.concourse.thrift.Operator; +import com.google.common.collect.Lists; + +/** + * The default {@link CommandGroup} implementation that collects {@link Command + * Commands} for batch submission. + *

    + * Each method call records a {@link Command} in an internal list. The + * accumulated {@link Command Commands} are retrieved via {@link #commands()} + * and submitted to the server through {@code Concourse#submit(CommandGroup)}. + *

    + * + * @author Jeff Nelson + */ +public class DefaultCommandGroup implements CommandGroup { + + /** + * The collected {@link Command Commands}. + */ + private final List commands = Lists.newArrayList(); + + /** + * Return an unmodifiable view of the collected {@link Command Commands}. + * + * @return the {@link Command Commands} + */ + public List commands() { + return Collections.unmodifiableList(commands); + } + + /** + * Return the first record from the provided list. + * + * @param records the list of records + * @return the first record + */ + private static long firstRecord(List records) { + return records.get(0); + } + + /** + * Return all but the first record from the provided list as an array. + * + * @param records the list of records + * @return the remaining records + */ + private static long[] restRecords(List records) { + long[] rest = new long[records.size() - 1]; + for (int i = 1; i < records.size(); i++) { + rest[i - 1] = records.get(i); + } + return rest; + } + + /** + * Return the first key from the provided list. + * + * @param keys the list of keys + * @return the first key + */ + private static String firstKey(List keys) { + return keys.get(0); + } + + /** + * Return all but the first key from the provided list as an array. + * + * @param keys the list of keys + * @return the remaining keys + */ + private static String[] restKeys(List keys) { + return keys.subList(1, keys.size()).toArray(new String[0]); + } + + @Override + public void abort() { + commands.add(Command.abort()); + } + + @Override + public void add(String key, Object value) { + commands.add(Command.add(key).as(value)); + } + + @Override + public void add(String key, Object value, long record) { + commands.add(Command.add(key).as(value).in(record)); + } + + @Override + public void add(String key, Object value, List records) { + for (long record : records) { + commands.add(Command.add(key).as(value).in(record)); + } + } + + @Override + public void audit(long record) { + commands.add(Command.audit(record)); + } + + @Override + public void audit(long record, long start) { + commands.add(Command.audit(record).at(Timestamp.fromMicros(start))); + } + + @Override + public void audit(long record, String start) { + commands.add(Command.audit(record).at(Timestamp.fromString(start))); + } + + @Override + public void audit(long record, long start, long tend) { + commands.add(Command.audit(record).at(Timestamp.fromMicros(start)) + .at(Timestamp.fromMicros(tend))); + } + + @Override + public void audit(long record, String start, String tend) { + commands.add(Command.audit(record).at(Timestamp.fromString(start)) + .at(Timestamp.fromString(tend))); + } + + @Override + public void audit(String key, long record) { + commands.add(Command.audit(key).in(record)); + } + + @Override + public void audit(String key, long record, long start) { + commands.add( + Command.audit(key).in(record).at(Timestamp.fromMicros(start))); + } + + @Override + public void audit(String key, long record, String start) { + commands.add( + Command.audit(key).in(record).at(Timestamp.fromString(start))); + } + + @Override + public void audit(String key, long record, long start, long tend) { + commands.add( + Command.audit(key).in(record).at(Timestamp.fromMicros(start)) + .at(Timestamp.fromMicros(tend))); + } + + @Override + public void audit(String key, long record, String start, String tend) { + commands.add( + Command.audit(key).in(record).at(Timestamp.fromString(start)) + .at(Timestamp.fromString(tend))); + } + + @Override + public void browse(String key) { + commands.add(Command.browse(key)); + } + + @Override + public void browse(List keys) { + for (String key : keys) { + commands.add(Command.browse(key)); + } + } + + @Override + public void browse(String key, long timestamp) { + commands.add(Command.browse(key).at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void browse(String key, String timestamp) { + commands.add(Command.browse(key).at(Timestamp.fromString(timestamp))); + } + + @Override + public void browse(List keys, long timestamp) { + for (String key : keys) { + commands.add( + Command.browse(key).at(Timestamp.fromMicros(timestamp))); + } + } + + @Override + public void browse(List keys, String timestamp) { + for (String key : keys) { + commands.add( + Command.browse(key).at(Timestamp.fromString(timestamp))); + } + } + + @Override + public void chronicle(String key, long record) { + commands.add(Command.chronicle(key).in(record)); + } + + @Override + public void chronicle(String key, long record, long start) { + commands.add(Command.chronicle(key).in(record) + .at(Timestamp.fromMicros(start))); + } + + @Override + public void chronicle(String key, long record, String start) { + commands.add(Command.chronicle(key).in(record) + .at(Timestamp.fromString(start))); + } + + @Override + public void chronicle(String key, long record, long start, long tend) { + commands.add(Command.chronicle(key).in(record) + .at(Timestamp.fromMicros(start)) + .at(Timestamp.fromMicros(tend))); + } + + @Override + public void chronicle(String key, long record, String start, String tend) { + commands.add(Command.chronicle(key).in(record) + .at(Timestamp.fromString(start)) + .at(Timestamp.fromString(tend))); + } + + @Override + public void clear(long record) { + commands.add(Command.clear(record)); + } + + @Override + public void clear(List records) { + for (long record : records) { + commands.add(Command.clear(record)); + } + } + + @Override + public void clear(String key, long record) { + commands.add(Command.clear(key).from(record)); + } + + @Override + public void clear(List keys, long record) { + for (String key : keys) { + commands.add(Command.clear(key).from(record)); + } + } + + @Override + public void clear(String key, List records) { + for (long record : records) { + commands.add(Command.clear(key).from(record)); + } + } + + @Override + public void clear(List keys, List records) { + for (String key : keys) { + for (long record : records) { + commands.add(Command.clear(key).from(record)); + } + } + } + + @Override + public void commit() { + commands.add(Command.commit()); + } + + @Override + public void describe() { + commands.add(Command.describeAll()); + } + + @Override + public void describe(long timestamp) { + commands.add(Command.describeAll().at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void describe(String timestamp) { + commands.add(Command.describeAll().at(Timestamp.fromString(timestamp))); + } + + @Override + public void describe(long record, long timestamp) { + commands.add( + Command.describe(record).at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void describe(long record, String timestamp) { + commands.add( + Command.describe(record).at(Timestamp.fromString(timestamp))); + } + + @Override + public void describe(List records) { + for (long record : records) { + commands.add(Command.describe(record)); + } + } + + @Override + public void describe(List records, long timestamp) { + for (long record : records) { + commands.add(Command.describe(record) + .at(Timestamp.fromMicros(timestamp))); + } + } + + @Override + public void describe(List records, String timestamp) { + for (long record : records) { + commands.add(Command.describe(record) + .at(Timestamp.fromString(timestamp))); + } + } + + @Override + public void diff(long record, long start) { + commands.add(Command.diff(record).at(Timestamp.fromMicros(start))); + } + + @Override + public void diff(long record, String start) { + commands.add(Command.diff(record).at(Timestamp.fromString(start))); + } + + @Override + public void diff(long record, long start, long tend) { + commands.add(Command.diff(record).at(Timestamp.fromMicros(start)) + .at(Timestamp.fromMicros(tend))); + } + + @Override + public void diff(long record, String start, String tend) { + commands.add(Command.diff(record).at(Timestamp.fromString(start)) + .at(Timestamp.fromString(tend))); + } + + @Override + public void diff(String key, long record, long start) { + commands.add( + Command.diff(key).in(record).at(Timestamp.fromMicros(start))); + } + + @Override + public void diff(String key, long record, String start) { + commands.add( + Command.diff(key).in(record).at(Timestamp.fromString(start))); + } + + @Override + public void diff(String key, long record, long start, long tend) { + commands.add( + Command.diff(key).in(record).at(Timestamp.fromMicros(start)) + .at(Timestamp.fromMicros(tend))); + } + + @Override + public void diff(String key, long record, String start, String tend) { + commands.add( + Command.diff(key).in(record).at(Timestamp.fromString(start)) + .at(Timestamp.fromString(tend))); + } + + @Override + public void diff(String key, long start) { + commands.add(Command.diff(key).at(Timestamp.fromMicros(start))); + } + + @Override + public void diff(String key, String start) { + commands.add(Command.diff(key).at(Timestamp.fromString(start))); + } + + @Override + public void diff(String key, String start, String tend) { + commands.add(Command.diff(key).at(Timestamp.fromString(start)) + .at(Timestamp.fromString(tend))); + } + + @Override + public void stage() { + commands.add(Command.stage()); + } + + @Override + public void insert(String json) { + commands.add(Command.insert(json)); + } + + @Override + public void insert(String json, long record) { + commands.add(Command.insert(json).in(record)); + } + + @Override + public void insert(String json, List records) { + for (long record : records) { + commands.add(Command.insert(json).in(record)); + } + } + + @Override + public void remove(String key, Object value, long record) { + commands.add(Command.remove(key).as(value).from(record)); + } + + @Override + public void remove(String key, Object value, List records) { + for (long record : records) { + commands.add(Command.remove(key).as(value).from(record)); + } + } + + @Override + public void set(String key, Object value, long record) { + commands.add(Command.set(key).as(value).in(record)); + } + + @Override + public void set(String key, Object value) { + commands.add(new BuiltCommand( + "set " + key + " as " + CclRenderer.value(value))); + } + + @Override + public void set(String key, Object value, List records) { + for (long record : records) { + commands.add(Command.set(key).as(value).in(record)); + } + } + + @Override + public void reconcile(String key, long record, Set values) { + Object[] array = values.toArray(); + if(array.length > 0) { + Object first = array[0]; + Object[] rest = new Object[array.length - 1]; + System.arraycopy(array, 1, rest, 0, rest.length); + commands.add(Command.reconcile(key).in(record).with(first, rest)); + } + } + + @Override + public void inventory() { + commands.add(Command.inventory()); + } + + // -- select methods -- + + @Override + public void select(long record) { + commands.add(Command.select(record)); + } + + @Override + public void select(List records) { + commands.add(Command.selectAll().from(firstRecord(records), + restRecords(records))); + } + + @Override + public void select(List records, Page page) { + commands.add(Command.selectAll() + .from(firstRecord(records), restRecords(records)).page(page)); + } + + @Override + public void select(List records, Order order) { + commands.add(Command.selectAll() + .from(firstRecord(records), restRecords(records)).order(order)); + } + + @Override + public void select(List records, Order order, Page page) { + commands.add(Command.selectAll() + .from(firstRecord(records), restRecords(records)).order(order) + .page(page)); + } + + @Override + public void select(long record, long timestamp) { + commands.add( + Command.select(record).at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void select(long record, String timestamp) { + commands.add( + Command.select(record).at(Timestamp.fromString(timestamp))); + } + + @Override + public void select(List records, long timestamp) { + commands.add(Command.selectAll() + .from(firstRecord(records), restRecords(records)) + .at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void select(List records, long timestamp, Page page) { + commands.add(Command.selectAll() + .from(firstRecord(records), restRecords(records)) + .at(Timestamp.fromMicros(timestamp)).page(page)); + } + + @Override + public void select(List records, long timestamp, Order order) { + commands.add(Command.selectAll() + .from(firstRecord(records), restRecords(records)) + .at(Timestamp.fromMicros(timestamp)).order(order)); + } + + @Override + public void select(List records, long timestamp, Order order, + Page page) { + commands.add(Command.selectAll() + .from(firstRecord(records), restRecords(records)) + .at(Timestamp.fromMicros(timestamp)).order(order).page(page)); + } + + @Override + public void select(List records, String timestamp) { + commands.add(Command.selectAll() + .from(firstRecord(records), restRecords(records)) + .at(Timestamp.fromString(timestamp))); + } + + @Override + public void select(List records, String timestamp, Page page) { + commands.add(Command.selectAll() + .from(firstRecord(records), restRecords(records)) + .at(Timestamp.fromString(timestamp)).page(page)); + } + + @Override + public void select(List records, String timestamp, Order order) { + commands.add(Command.selectAll() + .from(firstRecord(records), restRecords(records)) + .at(Timestamp.fromString(timestamp)).order(order)); + } + + @Override + public void select(List records, String timestamp, Order order, + Page page) { + commands.add(Command.selectAll() + .from(firstRecord(records), restRecords(records)) + .at(Timestamp.fromString(timestamp)).order(order).page(page)); + } + + @Override + public void select(String key, long record) { + commands.add(Command.select(key).from(record)); + } + + @Override + public void select(String key, long record, long timestamp) { + commands.add(Command.select(key).from(record) + .at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void select(String key, long record, String timestamp) { + commands.add(Command.select(key).from(record) + .at(Timestamp.fromString(timestamp))); + } + + @Override + public void select(List keys, long record, long timestamp) { + commands.add(Command.select(firstKey(keys), restKeys(keys)).from(record) + .at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void select(List keys, long record, String timestamp) { + commands.add(Command.select(firstKey(keys), restKeys(keys)).from(record) + .at(Timestamp.fromString(timestamp))); + } + + @Override + public void select(List keys, List records) { + commands.add(Command.select(firstKey(keys), restKeys(keys)) + .from(firstRecord(records), restRecords(records))); + } + + @Override + public void select(List keys, List records, Page page) { + commands.add(Command.select(firstKey(keys), restKeys(keys)) + .from(firstRecord(records), restRecords(records)).page(page)); + } + + @Override + public void select(List keys, List records, Order order) { + commands.add(Command.select(firstKey(keys), restKeys(keys)) + .from(firstRecord(records), restRecords(records)).order(order)); + } + + @Override + public void select(List keys, List records, Order order, + Page page) { + commands.add(Command.select(firstKey(keys), restKeys(keys)) + .from(firstRecord(records), restRecords(records)).order(order) + .page(page)); + } + + @Override + public void select(String key, List records) { + commands.add(Command.select(key).from(firstRecord(records), + restRecords(records))); + } + + @Override + public void select(String key, List records, Page page) { + commands.add(Command.select(key) + .from(firstRecord(records), restRecords(records)).page(page)); + } + + @Override + public void select(String key, List records, Order order) { + commands.add(Command.select(key) + .from(firstRecord(records), restRecords(records)).order(order)); + } + + @Override + public void select(String key, List records, Order order, Page page) { + commands.add(Command.select(key) + .from(firstRecord(records), restRecords(records)).order(order) + .page(page)); + } + + @Override + public void select(String key, List records, long timestamp) { + commands.add(Command.select(key) + .from(firstRecord(records), restRecords(records)) + .at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void select(String key, List records, long timestamp, + Page page) { + commands.add(Command.select(key) + .from(firstRecord(records), restRecords(records)) + .at(Timestamp.fromMicros(timestamp)).page(page)); + } + + @Override + public void select(String key, List records, long timestamp, + Order order) { + commands.add(Command.select(key) + .from(firstRecord(records), restRecords(records)) + .at(Timestamp.fromMicros(timestamp)).order(order)); + } + + @Override + public void select(String key, List records, long timestamp, + Order order, Page page) { + commands.add(Command.select(key) + .from(firstRecord(records), restRecords(records)) + .at(Timestamp.fromMicros(timestamp)).order(order).page(page)); + } + + @Override + public void select(String key, List records, String timestamp) { + commands.add(Command.select(key) + .from(firstRecord(records), restRecords(records)) + .at(Timestamp.fromString(timestamp))); + } + + @Override + public void select(String key, List records, String timestamp, + Page page) { + commands.add(Command.select(key) + .from(firstRecord(records), restRecords(records)) + .at(Timestamp.fromString(timestamp)).page(page)); + } + + @Override + public void select(String key, List records, String timestamp, + Order order) { + commands.add(Command.select(key) + .from(firstRecord(records), restRecords(records)) + .at(Timestamp.fromString(timestamp)).order(order)); + } + + @Override + public void select(String key, List records, String timestamp, + Order order, Page page) { + commands.add(Command.select(key) + .from(firstRecord(records), restRecords(records)) + .at(Timestamp.fromString(timestamp)).order(order).page(page)); + } + + @Override + public void select(List keys, List records, long timestamp) { + commands.add(Command.select(firstKey(keys), restKeys(keys)) + .from(firstRecord(records), restRecords(records)) + .at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void select(List keys, List records, long timestamp, + Page page) { + commands.add(Command.select(firstKey(keys), restKeys(keys)) + .from(firstRecord(records), restRecords(records)) + .at(Timestamp.fromMicros(timestamp)).page(page)); + } + + @Override + public void select(List keys, List records, long timestamp, + Order order) { + commands.add(Command.select(firstKey(keys), restKeys(keys)) + .from(firstRecord(records), restRecords(records)) + .at(Timestamp.fromMicros(timestamp)).order(order)); + } + + @Override + public void select(List keys, List records, long timestamp, + Order order, Page page) { + commands.add(Command.select(firstKey(keys), restKeys(keys)) + .from(firstRecord(records), restRecords(records)) + .at(Timestamp.fromMicros(timestamp)).order(order).page(page)); + } + + @Override + public void select(List keys, List records, + String timestamp) { + commands.add(Command.select(firstKey(keys), restKeys(keys)) + .from(firstRecord(records), restRecords(records)) + .at(Timestamp.fromString(timestamp))); + } + + @Override + public void select(List keys, List records, String timestamp, + Page page) { + commands.add(Command.select(firstKey(keys), restKeys(keys)) + .from(firstRecord(records), restRecords(records)) + .at(Timestamp.fromString(timestamp)).page(page)); + } + + @Override + public void select(List keys, List records, String timestamp, + Order order) { + commands.add(Command.select(firstKey(keys), restKeys(keys)) + .from(firstRecord(records), restRecords(records)) + .at(Timestamp.fromString(timestamp)).order(order)); + } + + @Override + public void select(List keys, List records, String timestamp, + Order order, Page page) { + commands.add(Command.select(firstKey(keys), restKeys(keys)) + .from(firstRecord(records), restRecords(records)) + .at(Timestamp.fromString(timestamp)).order(order).page(page)); + } + + @Override + public void select(Criteria criteria) { + commands.add(Command.selectAll().where(criteria)); + } + + @Override + public void select(Criteria criteria, Page page) { + commands.add(Command.selectAll().where(criteria).page(page)); + } + + @Override + public void select(Criteria criteria, Order order) { + commands.add(Command.selectAll().where(criteria).order(order)); + } + + @Override + public void select(Criteria criteria, Order order, Page page) { + commands.add( + Command.selectAll().where(criteria).order(order).page(page)); + } + + @Override + public void select(String ccl) { + commands.add(Command.selectAll().where(ccl)); + } + + @Override + public void select(String ccl, Page page) { + commands.add(Command.selectAll().where(ccl).page(page)); + } + + @Override + public void select(String ccl, Order order) { + commands.add(Command.selectAll().where(ccl).order(order)); + } + + @Override + public void select(String ccl, Order order, Page page) { + commands.add(Command.selectAll().where(ccl).order(order).page(page)); + } + + @Override + public void select(Criteria criteria, long timestamp) { + commands.add(Command.selectAll().where(criteria) + .at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void select(Criteria criteria, long timestamp, Page page) { + commands.add(Command.selectAll().where(criteria) + .at(Timestamp.fromMicros(timestamp)).page(page)); + } + + @Override + public void select(Criteria criteria, long timestamp, Order order) { + commands.add(Command.selectAll().where(criteria) + .at(Timestamp.fromMicros(timestamp)).order(order)); + } + + @Override + public void select(Criteria criteria, long timestamp, Order order, + Page page) { + commands.add(Command.selectAll().where(criteria) + .at(Timestamp.fromMicros(timestamp)).order(order).page(page)); + } + + @Override + public void select(Criteria criteria, String timestamp) { + commands.add(Command.selectAll().where(criteria) + .at(Timestamp.fromString(timestamp))); + } + + @Override + public void select(Criteria criteria, String timestamp, Page page) { + commands.add(Command.selectAll().where(criteria) + .at(Timestamp.fromString(timestamp)).page(page)); + } + + @Override + public void select(Criteria criteria, String timestamp, Order order) { + commands.add(Command.selectAll().where(criteria) + .at(Timestamp.fromString(timestamp)).order(order)); + } + + @Override + public void select(Criteria criteria, String timestamp, Order order, + Page page) { + commands.add(Command.selectAll().where(criteria) + .at(Timestamp.fromString(timestamp)).order(order).page(page)); + } + + @Override + public void select(String ccl, long timestamp, Page page) { + commands.add(Command.selectAll().where(ccl) + .at(Timestamp.fromMicros(timestamp)).page(page)); + } + + @Override + public void select(String ccl, long timestamp, Order order) { + commands.add(Command.selectAll().where(ccl) + .at(Timestamp.fromMicros(timestamp)).order(order)); + } + + @Override + public void select(String ccl, long timestamp, Order order, Page page) { + commands.add(Command.selectAll().where(ccl) + .at(Timestamp.fromMicros(timestamp)).order(order).page(page)); + } + + @Override + public void select(String ccl, String timestamp) { + commands.add(Command.selectAll().where(ccl) + .at(Timestamp.fromString(timestamp))); + } + + @Override + public void select(String ccl, String timestamp, Page page) { + commands.add(Command.selectAll().where(ccl) + .at(Timestamp.fromString(timestamp)).page(page)); + } + + @Override + public void select(String ccl, String timestamp, Order order) { + commands.add(Command.selectAll().where(ccl) + .at(Timestamp.fromString(timestamp)).order(order)); + } + + @Override + public void select(String ccl, String timestamp, Order order, Page page) { + commands.add(Command.selectAll().where(ccl) + .at(Timestamp.fromString(timestamp)).order(order).page(page)); + } + + @Override + public void select(String key, Criteria criteria) { + commands.add(Command.select(key).where(criteria)); + } + + @Override + public void select(String key, Criteria criteria, Page page) { + commands.add(Command.select(key).where(criteria).page(page)); + } + + @Override + public void select(String key, Criteria criteria, Order order) { + commands.add(Command.select(key).where(criteria).order(order)); + } + + @Override + public void select(String key, Criteria criteria, Order order, Page page) { + commands.add( + Command.select(key).where(criteria).order(order).page(page)); + } + + @Override + public void select(String key, Criteria criteria, long timestamp) { + commands.add(Command.select(key).where(criteria) + .at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void select(String key, Criteria criteria, long timestamp, + Page page) { + commands.add(Command.select(key).where(criteria) + .at(Timestamp.fromMicros(timestamp)).page(page)); + } + + @Override + public void select(String key, Criteria criteria, long timestamp, + Order order) { + commands.add(Command.select(key).where(criteria) + .at(Timestamp.fromMicros(timestamp)).order(order)); + } + + @Override + public void select(String key, Criteria criteria, long timestamp, + Order order, Page page) { + commands.add(Command.select(key).where(criteria) + .at(Timestamp.fromMicros(timestamp)).order(order).page(page)); + } + + @Override + public void select(String key, Criteria criteria, String timestamp) { + commands.add(Command.select(key).where(criteria) + .at(Timestamp.fromString(timestamp))); + } + + @Override + public void select(String key, Criteria criteria, String timestamp, + Page page) { + commands.add(Command.select(key).where(criteria) + .at(Timestamp.fromString(timestamp)).page(page)); + } + + @Override + public void select(String key, Criteria criteria, String timestamp, + Order order) { + commands.add(Command.select(key).where(criteria) + .at(Timestamp.fromString(timestamp)).order(order)); + } + + @Override + public void select(String key, Criteria criteria, String timestamp, + Order order, Page page) { + commands.add(Command.select(key).where(criteria) + .at(Timestamp.fromString(timestamp)).order(order).page(page)); + } + + @Override + public void select(String key, String ccl, long timestamp) { + commands.add(Command.select(key).where(ccl) + .at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void select(String key, String ccl, long timestamp, Page page) { + commands.add(Command.select(key).where(ccl) + .at(Timestamp.fromMicros(timestamp)).page(page)); + } + + @Override + public void select(String key, String ccl, long timestamp, Order order) { + commands.add(Command.select(key).where(ccl) + .at(Timestamp.fromMicros(timestamp)).order(order)); + } + + @Override + public void select(String key, String ccl, long timestamp, Order order, + Page page) { + commands.add(Command.select(key).where(ccl) + .at(Timestamp.fromMicros(timestamp)).order(order).page(page)); + } + + @Override + public void select(String key, String ccl, String timestamp) { + commands.add(Command.select(key).where(ccl) + .at(Timestamp.fromString(timestamp))); + } + + @Override + public void select(String key, String ccl, String timestamp, Page page) { + commands.add(Command.select(key).where(ccl) + .at(Timestamp.fromString(timestamp)).page(page)); + } + + @Override + public void select(String key, String ccl, String timestamp, Order order) { + commands.add(Command.select(key).where(ccl) + .at(Timestamp.fromString(timestamp)).order(order)); + } + + @Override + public void select(String key, String ccl, String timestamp, Order order, + Page page) { + commands.add(Command.select(key).where(ccl) + .at(Timestamp.fromString(timestamp)).order(order).page(page)); + } + + @Override + public void select(List keys, Criteria criteria) { + commands.add( + Command.select(firstKey(keys), restKeys(keys)).where(criteria)); + } + + @Override + public void select(List keys, Criteria criteria, Page page) { + commands.add(Command.select(firstKey(keys), restKeys(keys)) + .where(criteria).page(page)); + } + + @Override + public void select(List keys, Criteria criteria, Order order) { + commands.add(Command.select(firstKey(keys), restKeys(keys)) + .where(criteria).order(order)); + } + + @Override + public void select(List keys, Criteria criteria, Order order, + Page page) { + commands.add(Command.select(firstKey(keys), restKeys(keys)) + .where(criteria).order(order).page(page)); + } + + @Override + public void select(List keys, Criteria criteria, long timestamp) { + commands.add(Command.select(firstKey(keys), restKeys(keys)) + .where(criteria).at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void select(List keys, Criteria criteria, long timestamp, + Page page) { + commands.add( + Command.select(firstKey(keys), restKeys(keys)).where(criteria) + .at(Timestamp.fromMicros(timestamp)).page(page)); + } + + @Override + public void select(List keys, Criteria criteria, long timestamp, + Order order) { + commands.add( + Command.select(firstKey(keys), restKeys(keys)).where(criteria) + .at(Timestamp.fromMicros(timestamp)).order(order)); + } + + @Override + public void select(List keys, Criteria criteria, long timestamp, + Order order, Page page) { + commands.add(Command.select(firstKey(keys), restKeys(keys)) + .where(criteria).at(Timestamp.fromMicros(timestamp)) + .order(order).page(page)); + } + + @Override + public void select(List keys, Criteria criteria, String timestamp) { + commands.add(Command.select(firstKey(keys), restKeys(keys)) + .where(criteria).at(Timestamp.fromString(timestamp))); + } + + @Override + public void select(List keys, Criteria criteria, String timestamp, + Page page) { + commands.add( + Command.select(firstKey(keys), restKeys(keys)).where(criteria) + .at(Timestamp.fromString(timestamp)).page(page)); + } + + @Override + public void select(List keys, Criteria criteria, String timestamp, + Order order) { + commands.add( + Command.select(firstKey(keys), restKeys(keys)).where(criteria) + .at(Timestamp.fromString(timestamp)).order(order)); + } + + @Override + public void select(List keys, Criteria criteria, String timestamp, + Order order, Page page) { + commands.add(Command.select(firstKey(keys), restKeys(keys)) + .where(criteria).at(Timestamp.fromString(timestamp)) + .order(order).page(page)); + } + + @Override + public void select(List keys, String ccl, long timestamp) { + commands.add(Command.select(firstKey(keys), restKeys(keys)).where(ccl) + .at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void select(List keys, String ccl, long timestamp, + Page page) { + commands.add(Command.select(firstKey(keys), restKeys(keys)).where(ccl) + .at(Timestamp.fromMicros(timestamp)).page(page)); + } + + @Override + public void select(List keys, String ccl, long timestamp, + Order order) { + commands.add(Command.select(firstKey(keys), restKeys(keys)).where(ccl) + .at(Timestamp.fromMicros(timestamp)).order(order)); + } + + @Override + public void select(List keys, String ccl, long timestamp, + Order order, Page page) { + commands.add(Command.select(firstKey(keys), restKeys(keys)).where(ccl) + .at(Timestamp.fromMicros(timestamp)).order(order).page(page)); + } + + @Override + public void select(List keys, String ccl, String timestamp) { + commands.add(Command.select(firstKey(keys), restKeys(keys)).where(ccl) + .at(Timestamp.fromString(timestamp))); + } + + @Override + public void select(List keys, String ccl, String timestamp, + Page page) { + commands.add(Command.select(firstKey(keys), restKeys(keys)).where(ccl) + .at(Timestamp.fromString(timestamp)).page(page)); + } + + @Override + public void select(List keys, String ccl, String timestamp, + Order order) { + commands.add(Command.select(firstKey(keys), restKeys(keys)).where(ccl) + .at(Timestamp.fromString(timestamp)).order(order)); + } + + @Override + public void select(List keys, String ccl, String timestamp, + Order order, Page page) { + commands.add(Command.select(firstKey(keys), restKeys(keys)).where(ccl) + .at(Timestamp.fromString(timestamp)).order(order).page(page)); + } + + // -- get methods -- + + @Override + public void get(String key, long record) { + commands.add(Command.get(key).from(record)); + } + + @Override + public void get(String key, long record, long timestamp) { + commands.add(Command.get(key).from(record) + .at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void get(String key, long record, String timestamp) { + commands.add(Command.get(key).from(record) + .at(Timestamp.fromString(timestamp))); + } + + @Override + public void get(List keys, long record) { + commands.add(Command.get(firstKey(keys), restKeys(keys)).from(record)); + } + + @Override + public void get(List keys, long record, long timestamp) { + commands.add(Command.get(firstKey(keys), restKeys(keys)).from(record) + .at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void get(List keys, long record, String timestamp) { + commands.add(Command.get(firstKey(keys), restKeys(keys)).from(record) + .at(Timestamp.fromString(timestamp))); + } + + @Override + public void get(List keys, List records) { + commands.add(Command.get(firstKey(keys), restKeys(keys)) + .from(firstRecord(records), restRecords(records))); + } + + @Override + public void get(List keys, List records, Page page) { + commands.add(Command.get(firstKey(keys), restKeys(keys)) + .from(firstRecord(records), restRecords(records)).page(page)); + } + + @Override + public void get(List keys, List records, Order order) { + commands.add(Command.get(firstKey(keys), restKeys(keys)) + .from(firstRecord(records), restRecords(records)).order(order)); + } + + @Override + public void get(List keys, List records, Order order, + Page page) { + commands.add(Command.get(firstKey(keys), restKeys(keys)) + .from(firstRecord(records), restRecords(records)).order(order) + .page(page)); + } + + @Override + public void get(String key, List records) { + commands.add(Command.get(key).from(firstRecord(records), + restRecords(records))); + } + + @Override + public void get(String key, List records, Page page) { + commands.add(Command.get(key) + .from(firstRecord(records), restRecords(records)).page(page)); + } + + @Override + public void get(String key, List records, Order order) { + commands.add(Command.get(key) + .from(firstRecord(records), restRecords(records)).order(order)); + } + + @Override + public void get(String key, List records, Order order, Page page) { + commands.add(Command.get(key) + .from(firstRecord(records), restRecords(records)).order(order) + .page(page)); + } + + @Override + public void get(String key, List records, long timestamp) { + commands.add(Command.get(key) + .from(firstRecord(records), restRecords(records)) + .at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void get(String key, List records, long timestamp, Page page) { + commands.add(Command.get(key) + .from(firstRecord(records), restRecords(records)) + .at(Timestamp.fromMicros(timestamp)).page(page)); + } + + @Override + public void get(String key, List records, long timestamp, + Order order) { + commands.add(Command.get(key) + .from(firstRecord(records), restRecords(records)) + .at(Timestamp.fromMicros(timestamp)).order(order)); + } + + @Override + public void get(String key, List records, long timestamp, Order order, + Page page) { + commands.add(Command.get(key) + .from(firstRecord(records), restRecords(records)) + .at(Timestamp.fromMicros(timestamp)).order(order).page(page)); + } + + @Override + public void get(String key, List records, String timestamp) { + commands.add(Command.get(key) + .from(firstRecord(records), restRecords(records)) + .at(Timestamp.fromString(timestamp))); + } + + @Override + public void get(String key, List records, String timestamp, + Page page) { + commands.add(Command.get(key) + .from(firstRecord(records), restRecords(records)) + .at(Timestamp.fromString(timestamp)).page(page)); + } + + @Override + public void get(String key, List records, String timestamp, + Order order) { + commands.add(Command.get(key) + .from(firstRecord(records), restRecords(records)) + .at(Timestamp.fromString(timestamp)).order(order)); + } + + @Override + public void get(String key, List records, String timestamp, + Order order, Page page) { + commands.add(Command.get(key) + .from(firstRecord(records), restRecords(records)) + .at(Timestamp.fromString(timestamp)).order(order).page(page)); + } + + @Override + public void get(List keys, List records, long timestamp) { + commands.add(Command.get(firstKey(keys), restKeys(keys)) + .from(firstRecord(records), restRecords(records)) + .at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void get(List keys, List records, long timestamp, + Page page) { + commands.add(Command.get(firstKey(keys), restKeys(keys)) + .from(firstRecord(records), restRecords(records)) + .at(Timestamp.fromMicros(timestamp)).page(page)); + } + + @Override + public void get(List keys, List records, long timestamp, + Order order) { + commands.add(Command.get(firstKey(keys), restKeys(keys)) + .from(firstRecord(records), restRecords(records)) + .at(Timestamp.fromMicros(timestamp)).order(order)); + } + + @Override + public void get(List keys, List records, long timestamp, + Order order, Page page) { + commands.add(Command.get(firstKey(keys), restKeys(keys)) + .from(firstRecord(records), restRecords(records)) + .at(Timestamp.fromMicros(timestamp)).order(order).page(page)); + } + + @Override + public void get(List keys, List records, String timestamp) { + commands.add(Command.get(firstKey(keys), restKeys(keys)) + .from(firstRecord(records), restRecords(records)) + .at(Timestamp.fromString(timestamp))); + } + + @Override + public void get(List keys, List records, String timestamp, + Page page) { + commands.add(Command.get(firstKey(keys), restKeys(keys)) + .from(firstRecord(records), restRecords(records)) + .at(Timestamp.fromString(timestamp)).page(page)); + } + + @Override + public void get(List keys, List records, String timestamp, + Order order) { + commands.add(Command.get(firstKey(keys), restKeys(keys)) + .from(firstRecord(records), restRecords(records)) + .at(Timestamp.fromString(timestamp)).order(order)); + } + + @Override + public void get(List keys, List records, String timestamp, + Order order, Page page) { + commands.add(Command.get(firstKey(keys), restKeys(keys)) + .from(firstRecord(records), restRecords(records)) + .at(Timestamp.fromString(timestamp)).order(order).page(page)); + } + + @Override + public void get(String key, Criteria criteria) { + commands.add(Command.get(key).where(criteria)); + } + + @Override + public void get(String key, Criteria criteria, Page page) { + commands.add(Command.get(key).where(criteria).page(page)); + } + + @Override + public void get(String key, Criteria criteria, Order order) { + commands.add(Command.get(key).where(criteria).order(order)); + } + + @Override + public void get(String key, Criteria criteria, Order order, Page page) { + commands.add(Command.get(key).where(criteria).order(order).page(page)); + } + + @Override + public void get(Criteria criteria) { + commands.add(Command.getAll().where(criteria)); + } + + @Override + public void get(Criteria criteria, Page page) { + commands.add(Command.getAll().where(criteria).page(page)); + } + + @Override + public void get(Criteria criteria, Order order) { + commands.add(Command.getAll().where(criteria).order(order)); + } + + @Override + public void get(Criteria criteria, Order order, Page page) { + commands.add(Command.getAll().where(criteria).order(order).page(page)); + } + + @Override + public void get(String ccl) { + commands.add(Command.getAll().where(ccl)); + } + + @Override + public void get(String ccl, Page page) { + commands.add(Command.getAll().where(ccl).page(page)); + } + + @Override + public void get(String ccl, Order order) { + commands.add(Command.getAll().where(ccl).order(order)); + } + + @Override + public void get(String ccl, Order order, Page page) { + commands.add(Command.getAll().where(ccl).order(order).page(page)); + } + + @Override + public void get(Criteria criteria, long timestamp) { + commands.add(Command.getAll().where(criteria) + .at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void get(Criteria criteria, long timestamp, Page page) { + commands.add(Command.getAll().where(criteria) + .at(Timestamp.fromMicros(timestamp)).page(page)); + } + + @Override + public void get(Criteria criteria, long timestamp, Order order) { + commands.add(Command.getAll().where(criteria) + .at(Timestamp.fromMicros(timestamp)).order(order)); + } + + @Override + public void get(Criteria criteria, long timestamp, Order order, Page page) { + commands.add(Command.getAll().where(criteria) + .at(Timestamp.fromMicros(timestamp)).order(order).page(page)); + } + + @Override + public void get(Criteria criteria, String timestamp) { + commands.add(Command.getAll().where(criteria) + .at(Timestamp.fromString(timestamp))); + } + + @Override + public void get(Criteria criteria, String timestamp, Page page) { + commands.add(Command.getAll().where(criteria) + .at(Timestamp.fromString(timestamp)).page(page)); + } + + @Override + public void get(Criteria criteria, String timestamp, Order order) { + commands.add(Command.getAll().where(criteria) + .at(Timestamp.fromString(timestamp)).order(order)); + } + + @Override + public void get(Criteria criteria, String timestamp, Order order, + Page page) { + commands.add(Command.getAll().where(criteria) + .at(Timestamp.fromString(timestamp)).order(order).page(page)); + } + + @Override + public void get(String ccl, long timestamp, Page page) { + commands.add(Command.getAll().where(ccl) + .at(Timestamp.fromMicros(timestamp)).page(page)); + } + + @Override + public void get(String ccl, long timestamp, Order order) { + commands.add(Command.getAll().where(ccl) + .at(Timestamp.fromMicros(timestamp)).order(order)); + } + + @Override + public void get(String ccl, long timestamp, Order order, Page page) { + commands.add(Command.getAll().where(ccl) + .at(Timestamp.fromMicros(timestamp)).order(order).page(page)); + } + + @Override + public void get(String ccl, String timestamp) { + commands.add(Command.getAll().where(ccl) + .at(Timestamp.fromString(timestamp))); + } + + @Override + public void get(String ccl, String timestamp, Page page) { + commands.add(Command.getAll().where(ccl) + .at(Timestamp.fromString(timestamp)).page(page)); + } + + @Override + public void get(String ccl, String timestamp, Order order) { + commands.add(Command.getAll().where(ccl) + .at(Timestamp.fromString(timestamp)).order(order)); + } + + @Override + public void get(String ccl, String timestamp, Order order, Page page) { + commands.add(Command.getAll().where(ccl) + .at(Timestamp.fromString(timestamp)).order(order).page(page)); + } + + @Override + public void get(String key, Criteria criteria, long timestamp) { + commands.add(Command.get(key).where(criteria) + .at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void get(String key, Criteria criteria, long timestamp, Page page) { + commands.add(Command.get(key).where(criteria) + .at(Timestamp.fromMicros(timestamp)).page(page)); + } + + @Override + public void get(String key, Criteria criteria, long timestamp, + Order order) { + commands.add(Command.get(key).where(criteria) + .at(Timestamp.fromMicros(timestamp)).order(order)); + } + + @Override + public void get(String key, Criteria criteria, long timestamp, Order order, + Page page) { + commands.add(Command.get(key).where(criteria) + .at(Timestamp.fromMicros(timestamp)).order(order).page(page)); + } + + @Override + public void get(String key, Criteria criteria, String timestamp) { + commands.add(Command.get(key).where(criteria) + .at(Timestamp.fromString(timestamp))); + } + + @Override + public void get(String key, Criteria criteria, String timestamp, + Page page) { + commands.add(Command.get(key).where(criteria) + .at(Timestamp.fromString(timestamp)).page(page)); + } + + @Override + public void get(String key, Criteria criteria, String timestamp, + Order order) { + commands.add(Command.get(key).where(criteria) + .at(Timestamp.fromString(timestamp)).order(order)); + } + + @Override + public void get(String key, Criteria criteria, String timestamp, + Order order, Page page) { + commands.add(Command.get(key).where(criteria) + .at(Timestamp.fromString(timestamp)).order(order).page(page)); + } + + @Override + public void get(String key, String ccl, long timestamp) { + commands.add(Command.get(key).where(ccl) + .at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void get(String key, String ccl, long timestamp, Page page) { + commands.add(Command.get(key).where(ccl) + .at(Timestamp.fromMicros(timestamp)).page(page)); + } + + @Override + public void get(String key, String ccl, long timestamp, Order order) { + commands.add(Command.get(key).where(ccl) + .at(Timestamp.fromMicros(timestamp)).order(order)); + } + + @Override + public void get(String key, String ccl, long timestamp, Order order, + Page page) { + commands.add(Command.get(key).where(ccl) + .at(Timestamp.fromMicros(timestamp)).order(order).page(page)); + } + + @Override + public void get(String key, String ccl, String timestamp) { + commands.add(Command.get(key).where(ccl) + .at(Timestamp.fromString(timestamp))); + } + + @Override + public void get(String key, String ccl, String timestamp, Page page) { + commands.add(Command.get(key).where(ccl) + .at(Timestamp.fromString(timestamp)).page(page)); + } + + @Override + public void get(String key, String ccl, String timestamp, Order order) { + commands.add(Command.get(key).where(ccl) + .at(Timestamp.fromString(timestamp)).order(order)); + } + + @Override + public void get(String key, String ccl, String timestamp, Order order, + Page page) { + commands.add(Command.get(key).where(ccl) + .at(Timestamp.fromString(timestamp)).order(order).page(page)); + } + + @Override + public void get(List keys, Criteria criteria) { + commands.add( + Command.get(firstKey(keys), restKeys(keys)).where(criteria)); + } + + @Override + public void get(List keys, Criteria criteria, Page page) { + commands.add(Command.get(firstKey(keys), restKeys(keys)).where(criteria) + .page(page)); + } + + @Override + public void get(List keys, Criteria criteria, Order order) { + commands.add(Command.get(firstKey(keys), restKeys(keys)).where(criteria) + .order(order)); + } + + @Override + public void get(List keys, Criteria criteria, Order order, + Page page) { + commands.add(Command.get(firstKey(keys), restKeys(keys)).where(criteria) + .order(order).page(page)); + } + + @Override + public void get(List keys, String ccl) { + commands.add(Command.get(firstKey(keys), restKeys(keys)).where(ccl)); + } + + @Override + public void get(List keys, String ccl, Page page) { + commands.add(Command.get(firstKey(keys), restKeys(keys)).where(ccl) + .page(page)); + } + + @Override + public void get(List keys, String ccl, Order order) { + commands.add(Command.get(firstKey(keys), restKeys(keys)).where(ccl) + .order(order)); + } + + @Override + public void get(List keys, String ccl, Order order, Page page) { + commands.add(Command.get(firstKey(keys), restKeys(keys)).where(ccl) + .order(order).page(page)); + } + + @Override + public void get(List keys, Criteria criteria, long timestamp) { + commands.add(Command.get(firstKey(keys), restKeys(keys)).where(criteria) + .at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void get(List keys, Criteria criteria, long timestamp, + Page page) { + commands.add(Command.get(firstKey(keys), restKeys(keys)).where(criteria) + .at(Timestamp.fromMicros(timestamp)).page(page)); + } + + @Override + public void get(List keys, Criteria criteria, long timestamp, + Order order) { + commands.add(Command.get(firstKey(keys), restKeys(keys)).where(criteria) + .at(Timestamp.fromMicros(timestamp)).order(order)); + } + + @Override + public void get(List keys, Criteria criteria, long timestamp, + Order order, Page page) { + commands.add(Command.get(firstKey(keys), restKeys(keys)).where(criteria) + .at(Timestamp.fromMicros(timestamp)).order(order).page(page)); + } + + @Override + public void get(List keys, Criteria criteria, String timestamp) { + commands.add(Command.get(firstKey(keys), restKeys(keys)).where(criteria) + .at(Timestamp.fromString(timestamp))); + } + + @Override + public void get(List keys, Criteria criteria, String timestamp, + Page page) { + commands.add(Command.get(firstKey(keys), restKeys(keys)).where(criteria) + .at(Timestamp.fromString(timestamp)).page(page)); + } + + @Override + public void get(List keys, Criteria criteria, String timestamp, + Order order) { + commands.add(Command.get(firstKey(keys), restKeys(keys)).where(criteria) + .at(Timestamp.fromString(timestamp)).order(order)); + } + + @Override + public void get(List keys, Criteria criteria, String timestamp, + Order order, Page page) { + commands.add(Command.get(firstKey(keys), restKeys(keys)).where(criteria) + .at(Timestamp.fromString(timestamp)).order(order).page(page)); + } + + @Override + public void get(List keys, String ccl, long timestamp) { + commands.add(Command.get(firstKey(keys), restKeys(keys)).where(ccl) + .at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void get(List keys, String ccl, long timestamp, Page page) { + commands.add(Command.get(firstKey(keys), restKeys(keys)).where(ccl) + .at(Timestamp.fromMicros(timestamp)).page(page)); + } + + @Override + public void get(List keys, String ccl, long timestamp, + Order order) { + commands.add(Command.get(firstKey(keys), restKeys(keys)).where(ccl) + .at(Timestamp.fromMicros(timestamp)).order(order)); + } + + @Override + public void get(List keys, String ccl, long timestamp, Order order, + Page page) { + commands.add(Command.get(firstKey(keys), restKeys(keys)).where(ccl) + .at(Timestamp.fromMicros(timestamp)).order(order).page(page)); + } + + @Override + public void get(List keys, String ccl, String timestamp) { + commands.add(Command.get(firstKey(keys), restKeys(keys)).where(ccl) + .at(Timestamp.fromString(timestamp))); + } + + @Override + public void get(List keys, String ccl, String timestamp, + Page page) { + commands.add(Command.get(firstKey(keys), restKeys(keys)).where(ccl) + .at(Timestamp.fromString(timestamp)).page(page)); + } + + @Override + public void get(List keys, String ccl, String timestamp, + Order order) { + commands.add(Command.get(firstKey(keys), restKeys(keys)).where(ccl) + .at(Timestamp.fromString(timestamp)).order(order)); + } + + @Override + public void get(List keys, String ccl, String timestamp, + Order order, Page page) { + commands.add(Command.get(firstKey(keys), restKeys(keys)).where(ccl) + .at(Timestamp.fromString(timestamp)).order(order).page(page)); + } + + // -- verify methods -- + + @Override + public void verify(String key, Object value, long record) { + commands.add(Command.verify(key).as(value).in(record)); + } + + @Override + public void verify(String key, Object value, long record, long timestamp) { + commands.add(Command.verify(key).as(value).in(record) + .at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void verify(String key, Object value, long record, + String timestamp) { + commands.add(Command.verify(key).as(value).in(record) + .at(Timestamp.fromString(timestamp))); + } + + // -- jsonify methods -- + + @Override + public void jsonify(List records, boolean identifier) { + long first = firstRecord(records); + long[] rest = restRecords(records); + if(identifier) { + commands.add(Command.jsonify(first, rest).identifier()); + } + else { + commands.add(Command.jsonify(first, rest)); + } + } + + @Override + public void jsonify(List records, long timestamp, + boolean identifier) { + long first = firstRecord(records); + long[] rest = restRecords(records); + if(identifier) { + commands.add(Command.jsonify(first, rest) + .at(Timestamp.fromMicros(timestamp)).identifier()); + } + else { + commands.add(Command.jsonify(first, rest) + .at(Timestamp.fromMicros(timestamp))); + } + } + + @Override + public void jsonify(List records, String timestamp, + boolean identifier) { + long first = firstRecord(records); + long[] rest = restRecords(records); + if(identifier) { + commands.add(Command.jsonify(first, rest) + .at(Timestamp.fromString(timestamp)).identifier()); + } + else { + commands.add(Command.jsonify(first, rest) + .at(Timestamp.fromString(timestamp))); + } + } + + // -- find methods -- + + @Override + public void find(Criteria criteria) { + commands.add(Command.find(criteria)); + } + + @Override + public void find(Criteria criteria, Page page) { + commands.add(Command.find(criteria).page(page)); + } + + @Override + public void find(Criteria criteria, Order order) { + commands.add(Command.find(criteria).order(order)); + } + + @Override + public void find(Criteria criteria, Order order, Page page) { + commands.add(Command.find(criteria).order(order).page(page)); + } + + @Override + public void find(String ccl) { + commands.add(Command.find(ccl)); + } + + @Override + public void find(String ccl, Page page) { + commands.add(Command.find(ccl).page(page)); + } + + @Override + public void find(String ccl, Order order) { + commands.add(Command.find(ccl).order(order)); + } + + @Override + public void find(String ccl, Order order, Page page) { + commands.add(Command.find(ccl).order(order).page(page)); + } + + @Override + public void find(String key, Operator operator, List values) { + commands.add(new BuiltCommand( + "find " + key + " " + operator + " " + values)); + } + + @Override + public void find(String key, Operator operator, List values, + Page page) { + commands.add(new BuiltCommand( + "find " + key + " " + operator + " " + values)); + } + + @Override + public void find(String key, Operator operator, List values, + Order order) { + commands.add(new BuiltCommand( + "find " + key + " " + operator + " " + values)); + } + + @Override + public void find(String key, Operator operator, List values, + Order order, Page page) { + commands.add(new BuiltCommand( + "find " + key + " " + operator + " " + values)); + } + + @Override + public void find(String key, Operator operator, List values, + long timestamp) { + commands.add(new BuiltCommand( + "find " + key + " " + operator + " " + values)); + } + + @Override + public void find(String key, Operator operator, List values, + long timestamp, Page page) { + commands.add(new BuiltCommand( + "find " + key + " " + operator + " " + values)); + } + + @Override + public void find(String key, Operator operator, List values, + long timestamp, Order order) { + commands.add(new BuiltCommand( + "find " + key + " " + operator + " " + values)); + } + + @Override + public void find(String key, Operator operator, List values, + long timestamp, Order order, Page page) { + commands.add(new BuiltCommand( + "find " + key + " " + operator + " " + values)); + } + + @Override + public void find(String key, Operator operator, List values, + String timestamp) { + commands.add(new BuiltCommand( + "find " + key + " " + operator + " " + values)); + } + + @Override + public void find(String key, Operator operator, List values, + String timestamp, Page page) { + commands.add(new BuiltCommand( + "find " + key + " " + operator + " " + values)); + } + + @Override + public void find(String key, Operator operator, List values, + String timestamp, Order order) { + commands.add(new BuiltCommand( + "find " + key + " " + operator + " " + values)); + } + + @Override + public void find(String key, Operator operator, List values, + String timestamp, Order order, Page page) { + commands.add(new BuiltCommand( + "find " + key + " " + operator + " " + values)); + } + + @Override + public void find(String key, String operator, List values) { + commands.add(new BuiltCommand( + "find " + key + " " + operator + " " + values)); + } + + @Override + public void find(String key, String operator, List values, + Page page) { + commands.add(new BuiltCommand( + "find " + key + " " + operator + " " + values)); + } + + @Override + public void find(String key, String operator, List values, + Order order) { + commands.add(new BuiltCommand( + "find " + key + " " + operator + " " + values)); + } + + @Override + public void find(String key, String operator, List values, + Order order, Page page) { + commands.add(new BuiltCommand( + "find " + key + " " + operator + " " + values)); + } + + @Override + public void find(String key, String operator, List values, + long timestamp) { + commands.add(new BuiltCommand( + "find " + key + " " + operator + " " + values)); + } + + @Override + public void find(String key, String operator, List values, + long timestamp, Page page) { + commands.add(new BuiltCommand( + "find " + key + " " + operator + " " + values)); + } + + @Override + public void find(String key, String operator, List values, + long timestamp, Order order) { + commands.add(new BuiltCommand( + "find " + key + " " + operator + " " + values)); + } + + @Override + public void find(String key, String operator, List values, + long timestamp, Order order, Page page) { + commands.add(new BuiltCommand( + "find " + key + " " + operator + " " + values)); + } + + @Override + public void find(String key, String operator, List values, + String timestamp) { + commands.add(new BuiltCommand( + "find " + key + " " + operator + " " + values)); + } + + @Override + public void find(String key, String operator, List values, + String timestamp, Page page) { + commands.add(new BuiltCommand( + "find " + key + " " + operator + " " + values)); + } + + @Override + public void find(String key, String operator, List values, + String timestamp, Order order) { + commands.add(new BuiltCommand( + "find " + key + " " + operator + " " + values)); + } + + @Override + public void find(String key, String operator, List values, + String timestamp, Order order, Page page) { + commands.add(new BuiltCommand( + "find " + key + " " + operator + " " + values)); + } + + // -- search -- + + @Override + public void search(String key, String query) { + commands.add(Command.search(key).forQuery(query)); + } + + // -- revert methods -- + + @Override + public void revert(List keys, List records, long timestamp) { + for (String key : keys) { + for (long record : records) { + commands.add(Command.revert(key).in(record) + .to(Timestamp.fromMicros(timestamp))); + } + } + } + + @Override + public void revert(List keys, List records, + String timestamp) { + for (String key : keys) { + for (long record : records) { + commands.add(Command.revert(key).in(record) + .to(Timestamp.fromString(timestamp))); + } + } + } + + @Override + public void revert(List keys, long record, long timestamp) { + for (String key : keys) { + commands.add(Command.revert(key).in(record) + .to(Timestamp.fromMicros(timestamp))); + } + } + + @Override + public void revert(List keys, long record, String timestamp) { + for (String key : keys) { + commands.add(Command.revert(key).in(record) + .to(Timestamp.fromString(timestamp))); + } + } + + @Override + public void revert(String key, List records, long timestamp) { + for (long record : records) { + commands.add(Command.revert(key).in(record) + .to(Timestamp.fromMicros(timestamp))); + } + } + + @Override + public void revert(String key, List records, String timestamp) { + for (long record : records) { + commands.add(Command.revert(key).in(record) + .to(Timestamp.fromString(timestamp))); + } + } + + @Override + public void revert(String key, long record, long timestamp) { + commands.add(Command.revert(key).in(record) + .to(Timestamp.fromMicros(timestamp))); + } + + @Override + public void revert(String key, long record, String timestamp) { + commands.add(Command.revert(key).in(record) + .to(Timestamp.fromString(timestamp))); + } + + // -- holds methods -- + + @Override + public void holds(List records) { + for (long record : records) { + commands.add(Command.holds(record)); + } + } + + @Override + public void holds(long record) { + commands.add(Command.holds(record)); + } + + // -- verifyAndSwap -- + + @Override + public void verifyAndSwap(String key, Object expected, long record, + Object replacement) { + commands.add(Command.verifyAndSwap(key).as(expected).in(record) + .with(replacement)); + } + + // -- verifyOrSet -- + + @Override + public void verifyOrSet(String key, Object value, long record) { + commands.add(Command.verifyOrSet(key).as(value).in(record)); + } + + // -- findOrAdd -- + + @Override + public void findOrAdd(String key, Object value) { + commands.add(Command.findOrAdd(key).as(value)); + } + + // -- findOrInsert methods -- + + @Override + public void findOrInsert(Criteria criteria, String json) { + commands.add(Command.findOrInsert(criteria).json(json)); + } + + @Override + public void findOrInsert(String ccl, String json) { + commands.add(Command.findOrInsert(ccl).json(json)); + } + + // -- time methods -- + + @Override + public void time() { + commands.add(Command.time()); + } + + @Override + public void time(String phrase) { + commands.add(Command.time(phrase)); + } + + // -- trace methods -- + + @Override + public void trace(long record) { + commands.add(Command.trace(record)); + } + + @Override + public void trace(long record, long timestamp) { + commands.add(Command.trace(record).at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void trace(long record, String timestamp) { + commands.add(Command.trace(record).at(Timestamp.fromString(timestamp))); + } + + @Override + public void trace(List records) { + for (long record : records) { + commands.add(Command.trace(record)); + } + } + + @Override + public void trace(List records, long timestamp) { + for (long record : records) { + commands.add( + Command.trace(record).at(Timestamp.fromMicros(timestamp))); + } + } + + @Override + public void trace(List records, String timestamp) { + for (long record : records) { + commands.add( + Command.trace(record).at(Timestamp.fromString(timestamp))); + } + } + + // -- consolidate -- + + @Override + public void consolidate(List records) { + if(records.size() >= 2) { + long first = records.get(0); + long second = records.get(1); + long[] remaining = new long[records.size() - 2]; + for (int i = 2; i < records.size(); ++i) { + remaining[i - 2] = records.get(i); + } + commands.add(Command.consolidate(first, second, remaining)); + } + } + + // -- ping -- + + @Override + public void ping() { + commands.add(Command.ping()); + } + + // -- calculate methods -- + + @Override + public void sum(String key, long record) { + commands.add(Command.calculate("sum", key).in(record)); + } + + @Override + public void sum(String key, long record, long timestamp) { + commands.add(Command.calculate("sum", key).in(record) + .at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void sum(String key, long record, String timestamp) { + commands.add(Command.calculate("sum", key).in(record) + .at(Timestamp.fromString(timestamp))); + } + + @Override + public void sum(String key, List records) { + commands.add(Command.calculate("sum", key).in(firstRecord(records), + restRecords(records))); + } + + @Override + public void sum(String key, List records, long timestamp) { + commands.add(Command.calculate("sum", key) + .in(firstRecord(records), restRecords(records)) + .at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void sum(String key, List records, String timestamp) { + commands.add(Command.calculate("sum", key) + .in(firstRecord(records), restRecords(records)) + .at(Timestamp.fromString(timestamp))); + } + + @Override + public void sum(String key) { + commands.add(Command.calculate("sum", key)); + } + + @Override + public void sum(String key, String timestamp) { + commands.add(Command.calculate("sum", key) + .at(Timestamp.fromString(timestamp))); + } + + @Override + public void sum(String key, Criteria criteria) { + commands.add(Command.calculate("sum", key).where(criteria)); + } + + @Override + public void sum(String key, Criteria criteria, long timestamp) { + commands.add(Command.calculate("sum", key).where(criteria) + .at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void sum(String key, Criteria criteria, String timestamp) { + commands.add(Command.calculate("sum", key).where(criteria) + .at(Timestamp.fromString(timestamp))); + } + + @Override + public void sum(String key, String ccl, long timestamp) { + commands.add(Command.calculate("sum", key).where(ccl) + .at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void sum(String key, String ccl, String timestamp) { + commands.add(Command.calculate("sum", key).where(ccl) + .at(Timestamp.fromString(timestamp))); + } + + @Override + public void average(String key, long record) { + commands.add(Command.calculate("average", key).in(record)); + } + + @Override + public void average(String key, long record, long timestamp) { + commands.add(Command.calculate("average", key).in(record) + .at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void average(String key, long record, String timestamp) { + commands.add(Command.calculate("average", key).in(record) + .at(Timestamp.fromString(timestamp))); + } + + @Override + public void average(String key, List records) { + commands.add(Command.calculate("average", key).in(firstRecord(records), + restRecords(records))); + } + + @Override + public void average(String key, List records, long timestamp) { + commands.add(Command.calculate("average", key) + .in(firstRecord(records), restRecords(records)) + .at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void average(String key, List records, String timestamp) { + commands.add(Command.calculate("average", key) + .in(firstRecord(records), restRecords(records)) + .at(Timestamp.fromString(timestamp))); + } + + @Override + public void average(String key) { + commands.add(Command.calculate("average", key)); + } + + @Override + public void average(String key, String timestamp) { + commands.add(Command.calculate("average", key) + .at(Timestamp.fromString(timestamp))); + } + + @Override + public void average(String key, Criteria criteria) { + commands.add(Command.calculate("average", key).where(criteria)); + } + + @Override + public void average(String key, Criteria criteria, long timestamp) { + commands.add(Command.calculate("average", key).where(criteria) + .at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void average(String key, Criteria criteria, String timestamp) { + commands.add(Command.calculate("average", key).where(criteria) + .at(Timestamp.fromString(timestamp))); + } + + @Override + public void average(String key, String ccl, long timestamp) { + commands.add(Command.calculate("average", key).where(ccl) + .at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void average(String key, String ccl, String timestamp) { + commands.add(Command.calculate("average", key).where(ccl) + .at(Timestamp.fromString(timestamp))); + } + + @Override + public void count(String key, long record) { + commands.add(Command.calculate("count", key).in(record)); + } + + @Override + public void count(String key, long record, long timestamp) { + commands.add(Command.calculate("count", key).in(record) + .at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void count(String key, long record, String timestamp) { + commands.add(Command.calculate("count", key).in(record) + .at(Timestamp.fromString(timestamp))); + } + + @Override + public void count(String key, List records) { + commands.add(Command.calculate("count", key).in(firstRecord(records), + restRecords(records))); + } + + @Override + public void count(String key, List records, long timestamp) { + commands.add(Command.calculate("count", key) + .in(firstRecord(records), restRecords(records)) + .at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void count(String key, List records, String timestamp) { + commands.add(Command.calculate("count", key) + .in(firstRecord(records), restRecords(records)) + .at(Timestamp.fromString(timestamp))); + } + + @Override + public void count(String key) { + commands.add(Command.calculate("count", key)); + } + + @Override + public void count(String key, String timestamp) { + commands.add(Command.calculate("count", key) + .at(Timestamp.fromString(timestamp))); + } + + @Override + public void count(String key, Criteria criteria) { + commands.add(Command.calculate("count", key).where(criteria)); + } + + @Override + public void count(String key, Criteria criteria, long timestamp) { + commands.add(Command.calculate("count", key).where(criteria) + .at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void count(String key, Criteria criteria, String timestamp) { + commands.add(Command.calculate("count", key).where(criteria) + .at(Timestamp.fromString(timestamp))); + } + + @Override + public void count(String key, String ccl, long timestamp) { + commands.add(Command.calculate("count", key).where(ccl) + .at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void count(String key, String ccl, String timestamp) { + commands.add(Command.calculate("count", key).where(ccl) + .at(Timestamp.fromString(timestamp))); + } + + @Override + public void max(String key, long record) { + commands.add(Command.calculate("max", key).in(record)); + } + + @Override + public void max(String key, long record, long timestamp) { + commands.add(Command.calculate("max", key).in(record) + .at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void max(String key, long record, String timestamp) { + commands.add(Command.calculate("max", key).in(record) + .at(Timestamp.fromString(timestamp))); + } + + @Override + public void max(String key, List records) { + commands.add(Command.calculate("max", key).in(firstRecord(records), + restRecords(records))); + } + + @Override + public void max(String key, List records, long timestamp) { + commands.add(Command.calculate("max", key) + .in(firstRecord(records), restRecords(records)) + .at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void max(String key, List records, String timestamp) { + commands.add(Command.calculate("max", key) + .in(firstRecord(records), restRecords(records)) + .at(Timestamp.fromString(timestamp))); + } + + @Override + public void max(String key, Criteria criteria) { + commands.add(Command.calculate("max", key).where(criteria)); + } + + @Override + public void max(String key, Criteria criteria, long timestamp) { + commands.add(Command.calculate("max", key).where(criteria) + .at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void max(String key, Criteria criteria, String timestamp) { + commands.add(Command.calculate("max", key).where(criteria) + .at(Timestamp.fromString(timestamp))); + } + + @Override + public void max(String key, String ccl) { + commands.add(Command.calculate("max", key).where(ccl)); + } + + @Override + public void max(String key, String ccl, long timestamp) { + commands.add(Command.calculate("max", key).where(ccl) + .at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void max(String key, String ccl, String timestamp) { + commands.add(Command.calculate("max", key).where(ccl) + .at(Timestamp.fromString(timestamp))); + } + + @Override + public void max(String key) { + commands.add(Command.calculate("max", key)); + } + + @Override + public void min(String key, long record) { + commands.add(Command.calculate("min", key).in(record)); + } + + @Override + public void min(String key, long record, long timestamp) { + commands.add(Command.calculate("min", key).in(record) + .at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void min(String key, long record, String timestamp) { + commands.add(Command.calculate("min", key).in(record) + .at(Timestamp.fromString(timestamp))); + } + + @Override + public void min(String key) { + commands.add(Command.calculate("min", key)); + } + + @Override + public void min(String key, List records, long timestamp) { + commands.add(Command.calculate("min", key) + .in(firstRecord(records), restRecords(records)) + .at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void min(String key, List records, String timestamp) { + commands.add(Command.calculate("min", key) + .in(firstRecord(records), restRecords(records)) + .at(Timestamp.fromString(timestamp))); + } + + @Override + public void min(String key, Criteria criteria) { + commands.add(Command.calculate("min", key).where(criteria)); + } + + @Override + public void min(String key, Criteria criteria, long timestamp) { + commands.add(Command.calculate("min", key).where(criteria) + .at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void min(String key, Criteria criteria, String timestamp) { + commands.add(Command.calculate("min", key).where(criteria) + .at(Timestamp.fromString(timestamp))); + } + + @Override + public void min(String key, String ccl) { + commands.add(Command.calculate("min", key).where(ccl)); + } + + @Override + public void min(String key, String ccl, long timestamp) { + commands.add(Command.calculate("min", key).where(ccl) + .at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void min(String key, String ccl, String timestamp) { + commands.add(Command.calculate("min", key).where(ccl) + .at(Timestamp.fromString(timestamp))); + } + + @Override + public void min(String key, List records) { + commands.add(Command.calculate("min", key).in(firstRecord(records), + restRecords(records))); + } + + // -- navigate methods -- + + @Override + public void navigate(String key, long record) { + commands.add(Command.navigate(key).from(record)); + } + + @Override + public void navigate(String key, long record, long timestamp) { + commands.add(Command.navigate(key).from(record) + .at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void navigate(String key, long record, String timestamp) { + commands.add(Command.navigate(key).from(record) + .at(Timestamp.fromString(timestamp))); + } + + @Override + public void navigate(List keys, long record) { + commands.add( + Command.navigate(firstKey(keys), restKeys(keys)).from(record)); + } + + @Override + public void navigate(List keys, long record, long timestamp) { + commands.add(Command.navigate(firstKey(keys), restKeys(keys)) + .from(record).at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void navigate(List keys, long record, String timestamp) { + commands.add(Command.navigate(firstKey(keys), restKeys(keys)) + .from(record).at(Timestamp.fromString(timestamp))); + } + + @Override + public void navigate(List keys, List records) { + commands.add(Command.navigate(firstKey(keys), restKeys(keys)) + .from(firstRecord(records), restRecords(records))); + } + + @Override + public void navigate(String key, List records) { + commands.add(Command.navigate(key).from(firstRecord(records), + restRecords(records))); + } + + @Override + public void navigate(String key, List records, long timestamp) { + commands.add(Command.navigate(key) + .from(firstRecord(records), restRecords(records)) + .at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void navigate(String key, List records, String timestamp) { + commands.add(Command.navigate(key) + .from(firstRecord(records), restRecords(records)) + .at(Timestamp.fromString(timestamp))); + } + + @Override + public void navigate(List keys, List records, + long timestamp) { + commands.add(Command.navigate(firstKey(keys), restKeys(keys)) + .from(firstRecord(records), restRecords(records)) + .at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void navigate(List keys, List records, + String timestamp) { + commands.add(Command.navigate(firstKey(keys), restKeys(keys)) + .from(firstRecord(records), restRecords(records)) + .at(Timestamp.fromString(timestamp))); + } + + @Override + public void navigate(String key, String ccl) { + commands.add(Command.navigate(key).where(ccl)); + } + + @Override + public void navigate(String key, String ccl, long timestamp) { + commands.add(Command.navigate(key).where(ccl) + .at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void navigate(String key, String ccl, String timestamp) { + commands.add(Command.navigate(key).where(ccl) + .at(Timestamp.fromString(timestamp))); + } + + @Override + public void navigate(List keys, String ccl) { + commands.add( + Command.navigate(firstKey(keys), restKeys(keys)).where(ccl)); + } + + @Override + public void navigate(List keys, String ccl, long timestamp) { + commands.add(Command.navigate(firstKey(keys), restKeys(keys)).where(ccl) + .at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void navigate(List keys, String ccl, String timestamp) { + commands.add(Command.navigate(firstKey(keys), restKeys(keys)).where(ccl) + .at(Timestamp.fromString(timestamp))); + } + + @Override + public void navigate(String key, Criteria criteria) { + commands.add(Command.navigate(key).where(criteria)); + } + + @Override + public void navigate(String key, Criteria criteria, long timestamp) { + commands.add(Command.navigate(key).where(criteria) + .at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void navigate(String key, Criteria criteria, String timestamp) { + commands.add(Command.navigate(key).where(criteria) + .at(Timestamp.fromString(timestamp))); + } + + @Override + public void navigate(List keys, Criteria criteria) { + commands.add(Command.navigate(firstKey(keys), restKeys(keys)) + .where(criteria)); + } + + @Override + public void navigate(List keys, Criteria criteria, long timestamp) { + commands.add(Command.navigate(firstKey(keys), restKeys(keys)) + .where(criteria).at(Timestamp.fromMicros(timestamp))); + } + + @Override + public void navigate(List keys, Criteria criteria, + String timestamp) { + commands.add(Command.navigate(firstKey(keys), restKeys(keys)) + .where(criteria).at(Timestamp.fromString(timestamp))); + } + +} diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/thrift/ConcourseCalculateService.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/thrift/ConcourseCalculateService.java index d7b2ebb20..577b3fa28 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/thrift/ConcourseCalculateService.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/thrift/ConcourseCalculateService.java @@ -6,7 +6,7 @@ */ package com.cinchapi.concourse.thrift; -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.20.0)", date = "2026-03-13") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.20.0)", date = "2026-03-15") @SuppressWarnings({ "unchecked", "rawtypes", "serial", "unused" }) public class ConcourseCalculateService { diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/thrift/ConcourseNavigateService.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/thrift/ConcourseNavigateService.java index 46d6c3b2a..9c6a603d5 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/thrift/ConcourseNavigateService.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/thrift/ConcourseNavigateService.java @@ -15,7 +15,7 @@ */ package com.cinchapi.concourse.thrift; -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.20.0)", date = "2026-03-13") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.20.0)", date = "2026-03-15") @SuppressWarnings({ "unchecked", "rawtypes", "serial", "unused" }) public class ConcourseNavigateService { diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/thrift/ConcourseService.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/thrift/ConcourseService.java index 358818237..07edf4bf0 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/thrift/ConcourseService.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/thrift/ConcourseService.java @@ -6,7 +6,7 @@ */ package com.cinchapi.concourse.thrift; -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.20.0)", date = "2026-03-13") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.20.0)", date = "2026-03-15") @SuppressWarnings({ "unchecked", "rawtypes", "serial", "unused" }) public class ConcourseService { @@ -2285,6 +2285,10 @@ public interface Iface { public boolean consolidateRecords(java.util.List records, com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment) throws com.cinchapi.concourse.thrift.SecurityException, com.cinchapi.concourse.thrift.TransactionException, com.cinchapi.concourse.thrift.PermissionException, org.apache.thrift.TException; + public com.cinchapi.concourse.thrift.ComplexTObject exec(java.util.List commands, com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment) throws com.cinchapi.concourse.thrift.SecurityException, com.cinchapi.concourse.thrift.TransactionException, com.cinchapi.concourse.thrift.InvalidArgumentException, com.cinchapi.concourse.thrift.PermissionException, com.cinchapi.concourse.thrift.ParseException, org.apache.thrift.TException; + + public java.util.List submit(java.util.List commands, com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment) throws com.cinchapi.concourse.thrift.SecurityException, com.cinchapi.concourse.thrift.TransactionException, com.cinchapi.concourse.thrift.InvalidArgumentException, com.cinchapi.concourse.thrift.PermissionException, com.cinchapi.concourse.thrift.ParseException, org.apache.thrift.TException; + public com.cinchapi.concourse.thrift.ComplexTObject invokeManagement(java.lang.String method, java.util.List params, com.cinchapi.concourse.thrift.AccessToken creds) throws com.cinchapi.concourse.thrift.SecurityException, com.cinchapi.concourse.thrift.ManagementException, org.apache.thrift.TException; public boolean ping(com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment) throws com.cinchapi.concourse.thrift.SecurityException, com.cinchapi.concourse.thrift.PermissionException, org.apache.thrift.TException; @@ -2995,6 +2999,10 @@ public interface AsyncIface { public void consolidateRecords(java.util.List records, com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void exec(java.util.List commands, com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void submit(java.util.List commands, com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws org.apache.thrift.TException; + public void invokeManagement(java.lang.String method, java.util.List params, com.cinchapi.concourse.thrift.AccessToken creds, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void ping(com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; @@ -16853,6 +16861,90 @@ public boolean recv_consolidateRecords() throws com.cinchapi.concourse.thrift.Se throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "consolidateRecords failed: unknown result"); } + @Override + public com.cinchapi.concourse.thrift.ComplexTObject exec(java.util.List commands, com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment) throws com.cinchapi.concourse.thrift.SecurityException, com.cinchapi.concourse.thrift.TransactionException, com.cinchapi.concourse.thrift.InvalidArgumentException, com.cinchapi.concourse.thrift.PermissionException, com.cinchapi.concourse.thrift.ParseException, org.apache.thrift.TException + { + send_exec(commands, creds, transaction, environment); + return recv_exec(); + } + + public void send_exec(java.util.List commands, com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment) throws org.apache.thrift.TException + { + exec_args args = new exec_args(); + args.setCommands(commands); + args.setCreds(creds); + args.setTransaction(transaction); + args.setEnvironment(environment); + sendBase("exec", args); + } + + public com.cinchapi.concourse.thrift.ComplexTObject recv_exec() throws com.cinchapi.concourse.thrift.SecurityException, com.cinchapi.concourse.thrift.TransactionException, com.cinchapi.concourse.thrift.InvalidArgumentException, com.cinchapi.concourse.thrift.PermissionException, com.cinchapi.concourse.thrift.ParseException, org.apache.thrift.TException + { + exec_result result = new exec_result(); + receiveBase(result, "exec"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.ex != null) { + throw result.ex; + } + if (result.ex2 != null) { + throw result.ex2; + } + if (result.ex3 != null) { + throw result.ex3; + } + if (result.ex4 != null) { + throw result.ex4; + } + if (result.ex5 != null) { + throw result.ex5; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "exec failed: unknown result"); + } + + @Override + public java.util.List submit(java.util.List commands, com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment) throws com.cinchapi.concourse.thrift.SecurityException, com.cinchapi.concourse.thrift.TransactionException, com.cinchapi.concourse.thrift.InvalidArgumentException, com.cinchapi.concourse.thrift.PermissionException, com.cinchapi.concourse.thrift.ParseException, org.apache.thrift.TException + { + send_submit(commands, creds, transaction, environment); + return recv_submit(); + } + + public void send_submit(java.util.List commands, com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment) throws org.apache.thrift.TException + { + submit_args args = new submit_args(); + args.setCommands(commands); + args.setCreds(creds); + args.setTransaction(transaction); + args.setEnvironment(environment); + sendBase("submit", args); + } + + public java.util.List recv_submit() throws com.cinchapi.concourse.thrift.SecurityException, com.cinchapi.concourse.thrift.TransactionException, com.cinchapi.concourse.thrift.InvalidArgumentException, com.cinchapi.concourse.thrift.PermissionException, com.cinchapi.concourse.thrift.ParseException, org.apache.thrift.TException + { + submit_result result = new submit_result(); + receiveBase(result, "submit"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.ex != null) { + throw result.ex; + } + if (result.ex2 != null) { + throw result.ex2; + } + if (result.ex3 != null) { + throw result.ex3; + } + if (result.ex4 != null) { + throw result.ex4; + } + if (result.ex5 != null) { + throw result.ex5; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "submit failed: unknown result"); + } + @Override public com.cinchapi.concourse.thrift.ComplexTObject invokeManagement(java.lang.String method, java.util.List params, com.cinchapi.concourse.thrift.AccessToken creds) throws com.cinchapi.concourse.thrift.SecurityException, com.cinchapi.concourse.thrift.ManagementException, org.apache.thrift.TException { @@ -34533,6 +34625,94 @@ public java.lang.Boolean getResult() throws com.cinchapi.concourse.thrift.Securi } } + @Override + public void exec(java.util.List commands, com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + exec_call method_call = new exec_call(commands, creds, transaction, environment, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class exec_call extends org.apache.thrift.async.TAsyncMethodCall { + private java.util.List commands; + private com.cinchapi.concourse.thrift.AccessToken creds; + private com.cinchapi.concourse.thrift.TransactionToken transaction; + private java.lang.String environment; + public exec_call(java.util.List commands, com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment, 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.commands = commands; + this.creds = creds; + this.transaction = transaction; + this.environment = environment; + } + + @Override + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("exec", org.apache.thrift.protocol.TMessageType.CALL, 0)); + exec_args args = new exec_args(); + args.setCommands(commands); + args.setCreds(creds); + args.setTransaction(transaction); + args.setEnvironment(environment); + args.write(prot); + prot.writeMessageEnd(); + } + + @Override + public com.cinchapi.concourse.thrift.ComplexTObject getResult() throws com.cinchapi.concourse.thrift.SecurityException, com.cinchapi.concourse.thrift.TransactionException, com.cinchapi.concourse.thrift.InvalidArgumentException, com.cinchapi.concourse.thrift.PermissionException, com.cinchapi.concourse.thrift.ParseException, 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_exec(); + } + } + + @Override + public void submit(java.util.List commands, com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws org.apache.thrift.TException { + checkReady(); + submit_call method_call = new submit_call(commands, creds, transaction, environment, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class submit_call extends org.apache.thrift.async.TAsyncMethodCall> { + private java.util.List commands; + private com.cinchapi.concourse.thrift.AccessToken creds; + private com.cinchapi.concourse.thrift.TransactionToken transaction; + private java.lang.String environment; + public submit_call(java.util.List commands, com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment, 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.commands = commands; + this.creds = creds; + this.transaction = transaction; + this.environment = environment; + } + + @Override + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("submit", org.apache.thrift.protocol.TMessageType.CALL, 0)); + submit_args args = new submit_args(); + args.setCommands(commands); + args.setCreds(creds); + args.setTransaction(transaction); + args.setEnvironment(environment); + args.write(prot); + prot.writeMessageEnd(); + } + + @Override + public java.util.List getResult() throws com.cinchapi.concourse.thrift.SecurityException, com.cinchapi.concourse.thrift.TransactionException, com.cinchapi.concourse.thrift.InvalidArgumentException, com.cinchapi.concourse.thrift.PermissionException, com.cinchapi.concourse.thrift.ParseException, 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_submit(); + } + } + @Override public void invokeManagement(java.lang.String method, java.util.List params, com.cinchapi.concourse.thrift.AccessToken creds, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); @@ -34979,6 +35159,8 @@ protected Processor(I iface, java.util.Map extends org.apache.thrift.ProcessFunction { + public exec() { + super("exec"); + } + + @Override + public exec_args getEmptyArgsInstance() { + return new exec_args(); + } + + @Override + protected boolean isOneway() { + return false; + } + + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + @Override + public exec_result getResult(I iface, exec_args args) throws org.apache.thrift.TException { + exec_result result = new exec_result(); + try { + result.success = iface.exec(args.commands, args.creds, args.transaction, args.environment); + } catch (com.cinchapi.concourse.thrift.SecurityException ex) { + result.ex = ex; + } catch (com.cinchapi.concourse.thrift.TransactionException ex2) { + result.ex2 = ex2; + } catch (com.cinchapi.concourse.thrift.InvalidArgumentException ex3) { + result.ex3 = ex3; + } catch (com.cinchapi.concourse.thrift.PermissionException ex4) { + result.ex4 = ex4; + } catch (com.cinchapi.concourse.thrift.ParseException ex5) { + result.ex5 = ex5; + } + return result; + } + } + + public static class submit extends org.apache.thrift.ProcessFunction { + public submit() { + super("submit"); + } + + @Override + public submit_args getEmptyArgsInstance() { + return new submit_args(); + } + + @Override + protected boolean isOneway() { + return false; + } + + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + @Override + public submit_result getResult(I iface, submit_args args) throws org.apache.thrift.TException { + submit_result result = new submit_result(); + try { + result.success = iface.submit(args.commands, args.creds, args.transaction, args.environment); + } catch (com.cinchapi.concourse.thrift.SecurityException ex) { + result.ex = ex; + } catch (com.cinchapi.concourse.thrift.TransactionException ex2) { + result.ex2 = ex2; + } catch (com.cinchapi.concourse.thrift.InvalidArgumentException ex3) { + result.ex3 = ex3; + } catch (com.cinchapi.concourse.thrift.PermissionException ex4) { + result.ex4 = ex4; + } catch (com.cinchapi.concourse.thrift.ParseException ex5) { + result.ex5 = ex5; + } + return result; + } + } + public static class invokeManagement extends org.apache.thrift.ProcessFunction { public invokeManagement() { super("invokeManagement"); @@ -48432,6 +48694,8 @@ protected AsyncProcessor(I iface, java.util.Map extends org.apache.thrift.AsyncProcessFunction { - public invokeManagement() { - super("invokeManagement"); + public static class exec extends org.apache.thrift.AsyncProcessFunction { + public exec() { + super("exec"); } @Override - public invokeManagement_args getEmptyArgsInstance() { - return new invokeManagement_args(); + public exec_args getEmptyArgsInstance() { + return new exec_args(); } @Override @@ -76903,7 +77167,7 @@ public org.apache.thrift.async.AsyncMethodCallback() { @Override public void onComplete(com.cinchapi.concourse.thrift.ComplexTObject o) { - invokeManagement_result result = new invokeManagement_result(); + exec_result result = new exec_result(); result.success = o; try { fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); @@ -76919,90 +77183,264 @@ public void onComplete(com.cinchapi.concourse.thrift.ComplexTObject o) { public void onError(java.lang.Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TSerializable msg; - invokeManagement_result result = new invokeManagement_result(); + exec_result result = new exec_result(); if (e instanceof com.cinchapi.concourse.thrift.SecurityException) { result.ex = (com.cinchapi.concourse.thrift.SecurityException) e; result.setExIsSet(true); msg = result; - } else if (e instanceof com.cinchapi.concourse.thrift.ManagementException) { - result.ex2 = (com.cinchapi.concourse.thrift.ManagementException) e; + } else if (e instanceof com.cinchapi.concourse.thrift.TransactionException) { + result.ex2 = (com.cinchapi.concourse.thrift.TransactionException) e; result.setEx2IsSet(true); msg = result; - } else 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, invokeManagement_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - iface.invokeManagement(args.method, args.params, args.creds,resultHandler); - } - } - - public static class ping extends org.apache.thrift.AsyncProcessFunction { - public ping() { - super("ping"); - } - - @Override - public ping_args getEmptyArgsInstance() { - return new ping_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) { - ping_result result = new ping_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; - ping_result result = new ping_result(); - if (e instanceof com.cinchapi.concourse.thrift.SecurityException) { - result.ex = (com.cinchapi.concourse.thrift.SecurityException) e; - result.setExIsSet(true); + } else if (e instanceof com.cinchapi.concourse.thrift.InvalidArgumentException) { + result.ex3 = (com.cinchapi.concourse.thrift.InvalidArgumentException) e; + result.setEx3IsSet(true); msg = result; } else if (e instanceof com.cinchapi.concourse.thrift.PermissionException) { - result.ex2 = (com.cinchapi.concourse.thrift.PermissionException) e; - result.setEx2IsSet(true); + result.ex4 = (com.cinchapi.concourse.thrift.PermissionException) e; + result.setEx4IsSet(true); + msg = result; + } else if (e instanceof com.cinchapi.concourse.thrift.ParseException) { + result.ex5 = (com.cinchapi.concourse.thrift.ParseException) e; + result.setEx5IsSet(true); + msg = result; + } else 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, exec_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + iface.exec(args.commands, args.creds, args.transaction, args.environment,resultHandler); + } + } + + public static class submit extends org.apache.thrift.AsyncProcessFunction> { + public submit() { + super("submit"); + } + + @Override + public submit_args getEmptyArgsInstance() { + return new submit_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) { + submit_result result = new submit_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; + submit_result result = new submit_result(); + if (e instanceof com.cinchapi.concourse.thrift.SecurityException) { + result.ex = (com.cinchapi.concourse.thrift.SecurityException) e; + result.setExIsSet(true); + msg = result; + } else if (e instanceof com.cinchapi.concourse.thrift.TransactionException) { + result.ex2 = (com.cinchapi.concourse.thrift.TransactionException) e; + result.setEx2IsSet(true); + msg = result; + } else if (e instanceof com.cinchapi.concourse.thrift.InvalidArgumentException) { + result.ex3 = (com.cinchapi.concourse.thrift.InvalidArgumentException) e; + result.setEx3IsSet(true); + msg = result; + } else if (e instanceof com.cinchapi.concourse.thrift.PermissionException) { + result.ex4 = (com.cinchapi.concourse.thrift.PermissionException) e; + result.setEx4IsSet(true); + msg = result; + } else if (e instanceof com.cinchapi.concourse.thrift.ParseException) { + result.ex5 = (com.cinchapi.concourse.thrift.ParseException) e; + result.setEx5IsSet(true); + msg = result; + } else 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, submit_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws org.apache.thrift.TException { + iface.submit(args.commands, args.creds, args.transaction, args.environment,resultHandler); + } + } + + public static class invokeManagement extends org.apache.thrift.AsyncProcessFunction { + public invokeManagement() { + super("invokeManagement"); + } + + @Override + public invokeManagement_args getEmptyArgsInstance() { + return new invokeManagement_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(com.cinchapi.concourse.thrift.ComplexTObject o) { + invokeManagement_result result = new invokeManagement_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; + invokeManagement_result result = new invokeManagement_result(); + if (e instanceof com.cinchapi.concourse.thrift.SecurityException) { + result.ex = (com.cinchapi.concourse.thrift.SecurityException) e; + result.setExIsSet(true); + msg = result; + } else if (e instanceof com.cinchapi.concourse.thrift.ManagementException) { + result.ex2 = (com.cinchapi.concourse.thrift.ManagementException) e; + result.setEx2IsSet(true); + msg = result; + } else 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, invokeManagement_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + iface.invokeManagement(args.method, args.params, args.creds,resultHandler); + } + } + + public static class ping extends org.apache.thrift.AsyncProcessFunction { + public ping() { + super("ping"); + } + + @Override + public ping_args getEmptyArgsInstance() { + return new ping_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) { + ping_result result = new ping_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; + ping_result result = new ping_result(); + if (e instanceof com.cinchapi.concourse.thrift.SecurityException) { + result.ex = (com.cinchapi.concourse.thrift.SecurityException) e; + result.setExIsSet(true); + msg = result; + } else if (e instanceof com.cinchapi.concourse.thrift.PermissionException) { + result.ex2 = (com.cinchapi.concourse.thrift.PermissionException) e; + result.setEx2IsSet(true); msg = result; } else if (e instanceof org.apache.thrift.transport.TTransportException) { _LOGGER.error("TTransportException inside handler", e); @@ -686548,7 +686986,2450 @@ public com.cinchapi.concourse.thrift.TransactionException getEx2() { return this.ex2; } - public findOrInsertCclJson_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { + public findOrInsertCclJson_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { + this.ex2 = ex2; + return this; + } + + public void unsetEx2() { + this.ex2 = null; + } + + /** Returns true if field ex2 is set (has been assigned a value) and false otherwise */ + public boolean isSetEx2() { + return this.ex2 != null; + } + + public void setEx2IsSet(boolean value) { + if (!value) { + this.ex2 = null; + } + } + + @org.apache.thrift.annotation.Nullable + public com.cinchapi.concourse.thrift.ParseException getEx3() { + return this.ex3; + } + + public findOrInsertCclJson_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ParseException ex3) { + this.ex3 = ex3; + return this; + } + + public void unsetEx3() { + this.ex3 = null; + } + + /** Returns true if field ex3 is set (has been assigned a value) and false otherwise */ + public boolean isSetEx3() { + return this.ex3 != null; + } + + public void setEx3IsSet(boolean value) { + if (!value) { + this.ex3 = null; + } + } + + @org.apache.thrift.annotation.Nullable + public com.cinchapi.concourse.thrift.DuplicateEntryException getEx4() { + return this.ex4; + } + + public findOrInsertCclJson_result setEx4(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.DuplicateEntryException ex4) { + this.ex4 = ex4; + return this; + } + + public void unsetEx4() { + this.ex4 = null; + } + + /** Returns true if field ex4 is set (has been assigned a value) and false otherwise */ + public boolean isSetEx4() { + return this.ex4 != null; + } + + public void setEx4IsSet(boolean value) { + if (!value) { + this.ex4 = null; + } + } + + @org.apache.thrift.annotation.Nullable + public com.cinchapi.concourse.thrift.PermissionException getEx5() { + return this.ex5; + } + + public findOrInsertCclJson_result setEx5(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex5) { + this.ex5 = ex5; + return this; + } + + public void unsetEx5() { + this.ex5 = null; + } + + /** Returns true if field ex5 is set (has been assigned a value) and false otherwise */ + public boolean isSetEx5() { + return this.ex5 != null; + } + + public void setEx5IsSet(boolean value) { + if (!value) { + this.ex5 = 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.lang.Long)value); + } + break; + + case EX: + if (value == null) { + unsetEx(); + } else { + setEx((com.cinchapi.concourse.thrift.SecurityException)value); + } + break; + + case EX2: + if (value == null) { + unsetEx2(); + } else { + setEx2((com.cinchapi.concourse.thrift.TransactionException)value); + } + break; + + case EX3: + if (value == null) { + unsetEx3(); + } else { + setEx3((com.cinchapi.concourse.thrift.ParseException)value); + } + break; + + case EX4: + if (value == null) { + unsetEx4(); + } else { + setEx4((com.cinchapi.concourse.thrift.DuplicateEntryException)value); + } + break; + + case EX5: + if (value == null) { + unsetEx5(); + } else { + setEx5((com.cinchapi.concourse.thrift.PermissionException)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case EX: + return getEx(); + + case EX2: + return getEx2(); + + case EX3: + return getEx3(); + + case EX4: + return getEx4(); + + case EX5: + return getEx5(); + + } + 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(); + case EX: + return isSetEx(); + case EX2: + return isSetEx2(); + case EX3: + return isSetEx3(); + case EX4: + return isSetEx4(); + case EX5: + return isSetEx5(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that instanceof findOrInsertCclJson_result) + return this.equals((findOrInsertCclJson_result)that); + return false; + } + + public boolean equals(findOrInsertCclJson_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; + } + + boolean this_present_ex = true && this.isSetEx(); + boolean that_present_ex = true && that.isSetEx(); + if (this_present_ex || that_present_ex) { + if (!(this_present_ex && that_present_ex)) + return false; + if (!this.ex.equals(that.ex)) + return false; + } + + boolean this_present_ex2 = true && this.isSetEx2(); + boolean that_present_ex2 = true && that.isSetEx2(); + if (this_present_ex2 || that_present_ex2) { + if (!(this_present_ex2 && that_present_ex2)) + return false; + if (!this.ex2.equals(that.ex2)) + return false; + } + + boolean this_present_ex3 = true && this.isSetEx3(); + boolean that_present_ex3 = true && that.isSetEx3(); + if (this_present_ex3 || that_present_ex3) { + if (!(this_present_ex3 && that_present_ex3)) + return false; + if (!this.ex3.equals(that.ex3)) + return false; + } + + boolean this_present_ex4 = true && this.isSetEx4(); + boolean that_present_ex4 = true && that.isSetEx4(); + if (this_present_ex4 || that_present_ex4) { + if (!(this_present_ex4 && that_present_ex4)) + return false; + if (!this.ex4.equals(that.ex4)) + return false; + } + + boolean this_present_ex5 = true && this.isSetEx5(); + boolean that_present_ex5 = true && that.isSetEx5(); + if (this_present_ex5 || that_present_ex5) { + if (!(this_present_ex5 && that_present_ex5)) + return false; + if (!this.ex5.equals(that.ex5)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(success); + + hashCode = hashCode * 8191 + ((isSetEx()) ? 131071 : 524287); + if (isSetEx()) + hashCode = hashCode * 8191 + ex.hashCode(); + + hashCode = hashCode * 8191 + ((isSetEx2()) ? 131071 : 524287); + if (isSetEx2()) + hashCode = hashCode * 8191 + ex2.hashCode(); + + hashCode = hashCode * 8191 + ((isSetEx3()) ? 131071 : 524287); + if (isSetEx3()) + hashCode = hashCode * 8191 + ex3.hashCode(); + + hashCode = hashCode * 8191 + ((isSetEx4()) ? 131071 : 524287); + if (isSetEx4()) + hashCode = hashCode * 8191 + ex4.hashCode(); + + hashCode = hashCode * 8191 + ((isSetEx5()) ? 131071 : 524287); + if (isSetEx5()) + hashCode = hashCode * 8191 + ex5.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(findOrInsertCclJson_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; + } + } + lastComparison = java.lang.Boolean.compare(isSetEx(), other.isSetEx()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEx()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex, other.ex); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetEx2(), other.isSetEx2()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEx2()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex2, other.ex2); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetEx3(), other.isSetEx3()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEx3()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex3, other.ex3); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetEx4(), other.isSetEx4()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEx4()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex4, other.ex4); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetEx5(), other.isSetEx5()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEx5()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex5, other.ex5); + 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("findOrInsertCclJson_result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + first = false; + if (!first) sb.append(", "); + sb.append("ex:"); + if (this.ex == null) { + sb.append("null"); + } else { + sb.append(this.ex); + } + first = false; + if (!first) sb.append(", "); + sb.append("ex2:"); + if (this.ex2 == null) { + sb.append("null"); + } else { + sb.append(this.ex2); + } + first = false; + if (!first) sb.append(", "); + sb.append("ex3:"); + if (this.ex3 == null) { + sb.append("null"); + } else { + sb.append(this.ex3); + } + first = false; + if (!first) sb.append(", "); + sb.append("ex4:"); + if (this.ex4 == null) { + sb.append("null"); + } else { + sb.append(this.ex4); + } + first = false; + if (!first) sb.append(", "); + sb.append("ex5:"); + if (this.ex5 == null) { + sb.append("null"); + } else { + sb.append(this.ex5); + } + 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 findOrInsertCclJson_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public findOrInsertCclJson_resultStandardScheme getScheme() { + return new findOrInsertCclJson_resultStandardScheme(); + } + } + + private static class findOrInsertCclJson_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, findOrInsertCclJson_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; + case 1: // EX + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ex = new com.cinchapi.concourse.thrift.SecurityException(); + struct.ex.read(iprot); + struct.setExIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // EX2 + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ex2 = new com.cinchapi.concourse.thrift.TransactionException(); + struct.ex2.read(iprot); + struct.setEx2IsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // EX3 + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ex3 = new com.cinchapi.concourse.thrift.ParseException(); + struct.ex3.read(iprot); + struct.setEx3IsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // EX4 + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ex4 = new com.cinchapi.concourse.thrift.DuplicateEntryException(); + struct.ex4.read(iprot); + struct.setEx4IsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // EX5 + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ex5 = new com.cinchapi.concourse.thrift.PermissionException(); + struct.ex5.read(iprot); + struct.setEx5IsSet(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, findOrInsertCclJson_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(); + } + if (struct.ex != null) { + oprot.writeFieldBegin(EX_FIELD_DESC); + struct.ex.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ex2 != null) { + oprot.writeFieldBegin(EX2_FIELD_DESC); + struct.ex2.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ex3 != null) { + oprot.writeFieldBegin(EX3_FIELD_DESC); + struct.ex3.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ex4 != null) { + oprot.writeFieldBegin(EX4_FIELD_DESC); + struct.ex4.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ex5 != null) { + oprot.writeFieldBegin(EX5_FIELD_DESC); + struct.ex5.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class findOrInsertCclJson_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public findOrInsertCclJson_resultTupleScheme getScheme() { + return new findOrInsertCclJson_resultTupleScheme(); + } + } + + private static class findOrInsertCclJson_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, findOrInsertCclJson_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); + } + if (struct.isSetEx()) { + optionals.set(1); + } + if (struct.isSetEx2()) { + optionals.set(2); + } + if (struct.isSetEx3()) { + optionals.set(3); + } + if (struct.isSetEx4()) { + optionals.set(4); + } + if (struct.isSetEx5()) { + optionals.set(5); + } + oprot.writeBitSet(optionals, 6); + if (struct.isSetSuccess()) { + oprot.writeI64(struct.success); + } + if (struct.isSetEx()) { + struct.ex.write(oprot); + } + if (struct.isSetEx2()) { + struct.ex2.write(oprot); + } + if (struct.isSetEx3()) { + struct.ex3.write(oprot); + } + if (struct.isSetEx4()) { + struct.ex4.write(oprot); + } + if (struct.isSetEx5()) { + struct.ex5.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, findOrInsertCclJson_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(6); + if (incoming.get(0)) { + struct.success = iprot.readI64(); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.ex = new com.cinchapi.concourse.thrift.SecurityException(); + struct.ex.read(iprot); + struct.setExIsSet(true); + } + if (incoming.get(2)) { + struct.ex2 = new com.cinchapi.concourse.thrift.TransactionException(); + struct.ex2.read(iprot); + struct.setEx2IsSet(true); + } + if (incoming.get(3)) { + struct.ex3 = new com.cinchapi.concourse.thrift.ParseException(); + struct.ex3.read(iprot); + struct.setEx3IsSet(true); + } + if (incoming.get(4)) { + struct.ex4 = new com.cinchapi.concourse.thrift.DuplicateEntryException(); + struct.ex4.read(iprot); + struct.setEx4IsSet(true); + } + if (incoming.get(5)) { + struct.ex5 = new com.cinchapi.concourse.thrift.PermissionException(); + struct.ex5.read(iprot); + struct.setEx5IsSet(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(); + } + } + + public static class getServerEnvironment_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("getServerEnvironment_args"); + + private static final org.apache.thrift.protocol.TField CREDS_FIELD_DESC = new org.apache.thrift.protocol.TField("creds", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final org.apache.thrift.protocol.TField ENVIRONMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("environment", org.apache.thrift.protocol.TType.STRING, (short)3); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getServerEnvironment_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getServerEnvironment_argsTupleSchemeFactory(); + + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds; // required + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken token; // required + public @org.apache.thrift.annotation.Nullable java.lang.String environment; // 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 { + CREDS((short)1, "creds"), + TOKEN((short)2, "token"), + ENVIRONMENT((short)3, "environment"); + + private static final java.util.Map byName = new java.util.LinkedHashMap(); + + 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: // CREDS + return CREDS; + case 2: // TOKEN + return TOKEN; + case 3: // ENVIRONMENT + return ENVIRONMENT; + 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.CREDS, new org.apache.thrift.meta_data.FieldMetaData("creds", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.AccessToken.class))); + tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.TransactionToken.class))); + tmpMap.put(_Fields.ENVIRONMENT, new org.apache.thrift.meta_data.FieldMetaData("environment", 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(getServerEnvironment_args.class, metaDataMap); + } + + public getServerEnvironment_args() { + } + + public getServerEnvironment_args( + com.cinchapi.concourse.thrift.AccessToken creds, + com.cinchapi.concourse.thrift.TransactionToken token, + java.lang.String environment) + { + this(); + this.creds = creds; + this.token = token; + this.environment = environment; + } + + /** + * Performs a deep copy on other. + */ + public getServerEnvironment_args(getServerEnvironment_args other) { + if (other.isSetCreds()) { + this.creds = new com.cinchapi.concourse.thrift.AccessToken(other.creds); + } + if (other.isSetToken()) { + this.token = new com.cinchapi.concourse.thrift.TransactionToken(other.token); + } + if (other.isSetEnvironment()) { + this.environment = other.environment; + } + } + + @Override + public getServerEnvironment_args deepCopy() { + return new getServerEnvironment_args(this); + } + + @Override + public void clear() { + this.creds = null; + this.token = null; + this.environment = null; + } + + @org.apache.thrift.annotation.Nullable + public com.cinchapi.concourse.thrift.AccessToken getCreds() { + return this.creds; + } + + public getServerEnvironment_args setCreds(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds) { + this.creds = creds; + return this; + } + + public void unsetCreds() { + this.creds = null; + } + + /** Returns true if field creds is set (has been assigned a value) and false otherwise */ + public boolean isSetCreds() { + return this.creds != null; + } + + public void setCredsIsSet(boolean value) { + if (!value) { + this.creds = null; + } + } + + @org.apache.thrift.annotation.Nullable + public com.cinchapi.concourse.thrift.TransactionToken getToken() { + return this.token; + } + + public getServerEnvironment_args setToken(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken token) { + this.token = token; + return this; + } + + public void unsetToken() { + this.token = null; + } + + /** Returns true if field token is set (has been assigned a value) and false otherwise */ + public boolean isSetToken() { + return this.token != null; + } + + public void setTokenIsSet(boolean value) { + if (!value) { + this.token = null; + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getEnvironment() { + return this.environment; + } + + public getServerEnvironment_args setEnvironment(@org.apache.thrift.annotation.Nullable java.lang.String environment) { + this.environment = environment; + return this; + } + + public void unsetEnvironment() { + this.environment = null; + } + + /** Returns true if field environment is set (has been assigned a value) and false otherwise */ + public boolean isSetEnvironment() { + return this.environment != null; + } + + public void setEnvironmentIsSet(boolean value) { + if (!value) { + this.environment = null; + } + } + + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case CREDS: + if (value == null) { + unsetCreds(); + } else { + setCreds((com.cinchapi.concourse.thrift.AccessToken)value); + } + break; + + case TOKEN: + if (value == null) { + unsetToken(); + } else { + setToken((com.cinchapi.concourse.thrift.TransactionToken)value); + } + break; + + case ENVIRONMENT: + if (value == null) { + unsetEnvironment(); + } else { + setEnvironment((java.lang.String)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case CREDS: + return getCreds(); + + case TOKEN: + return getToken(); + + case ENVIRONMENT: + return getEnvironment(); + + } + 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 CREDS: + return isSetCreds(); + case TOKEN: + return isSetToken(); + case ENVIRONMENT: + return isSetEnvironment(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that instanceof getServerEnvironment_args) + return this.equals((getServerEnvironment_args)that); + return false; + } + + public boolean equals(getServerEnvironment_args that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_creds = true && this.isSetCreds(); + boolean that_present_creds = true && that.isSetCreds(); + if (this_present_creds || that_present_creds) { + if (!(this_present_creds && that_present_creds)) + return false; + if (!this.creds.equals(that.creds)) + return false; + } + + boolean this_present_token = true && this.isSetToken(); + boolean that_present_token = true && that.isSetToken(); + if (this_present_token || that_present_token) { + if (!(this_present_token && that_present_token)) + return false; + if (!this.token.equals(that.token)) + return false; + } + + boolean this_present_environment = true && this.isSetEnvironment(); + boolean that_present_environment = true && that.isSetEnvironment(); + if (this_present_environment || that_present_environment) { + if (!(this_present_environment && that_present_environment)) + return false; + if (!this.environment.equals(that.environment)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetCreds()) ? 131071 : 524287); + if (isSetCreds()) + hashCode = hashCode * 8191 + creds.hashCode(); + + hashCode = hashCode * 8191 + ((isSetToken()) ? 131071 : 524287); + if (isSetToken()) + hashCode = hashCode * 8191 + token.hashCode(); + + hashCode = hashCode * 8191 + ((isSetEnvironment()) ? 131071 : 524287); + if (isSetEnvironment()) + hashCode = hashCode * 8191 + environment.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(getServerEnvironment_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.compare(isSetCreds(), other.isSetCreds()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetCreds()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.creds, other.creds); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetToken(), other.isSetToken()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetToken()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetEnvironment(), other.isSetEnvironment()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEnvironment()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.environment, other.environment); + 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("getServerEnvironment_args("); + boolean first = true; + + sb.append("creds:"); + if (this.creds == null) { + sb.append("null"); + } else { + sb.append(this.creds); + } + first = false; + if (!first) sb.append(", "); + sb.append("token:"); + if (this.token == null) { + sb.append("null"); + } else { + sb.append(this.token); + } + first = false; + if (!first) sb.append(", "); + sb.append("environment:"); + if (this.environment == null) { + sb.append("null"); + } else { + sb.append(this.environment); + } + 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 (creds != null) { + creds.validate(); + } + if (token != null) { + token.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 getServerEnvironment_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public getServerEnvironment_argsStandardScheme getScheme() { + return new getServerEnvironment_argsStandardScheme(); + } + } + + private static class getServerEnvironment_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, getServerEnvironment_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: // CREDS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); + struct.creds.read(iprot); + struct.setCredsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // TOKEN + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.token = new com.cinchapi.concourse.thrift.TransactionToken(); + struct.token.read(iprot); + struct.setTokenIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // ENVIRONMENT + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.environment = iprot.readString(); + struct.setEnvironmentIsSet(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, getServerEnvironment_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.creds != null) { + oprot.writeFieldBegin(CREDS_FIELD_DESC); + struct.creds.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.token != null) { + oprot.writeFieldBegin(TOKEN_FIELD_DESC); + struct.token.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.environment != null) { + oprot.writeFieldBegin(ENVIRONMENT_FIELD_DESC); + oprot.writeString(struct.environment); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getServerEnvironment_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public getServerEnvironment_argsTupleScheme getScheme() { + return new getServerEnvironment_argsTupleScheme(); + } + } + + private static class getServerEnvironment_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getServerEnvironment_args 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.isSetCreds()) { + optionals.set(0); + } + if (struct.isSetToken()) { + optionals.set(1); + } + if (struct.isSetEnvironment()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetCreds()) { + struct.creds.write(oprot); + } + if (struct.isSetToken()) { + struct.token.write(oprot); + } + if (struct.isSetEnvironment()) { + oprot.writeString(struct.environment); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getServerEnvironment_args 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)) { + struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); + struct.creds.read(iprot); + struct.setCredsIsSet(true); + } + if (incoming.get(1)) { + struct.token = new com.cinchapi.concourse.thrift.TransactionToken(); + struct.token.read(iprot); + struct.setTokenIsSet(true); + } + if (incoming.get(2)) { + struct.environment = iprot.readString(); + struct.setEnvironmentIsSet(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(); + } + } + + public static class getServerEnvironment_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("getServerEnvironment_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0); + private static final org.apache.thrift.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final org.apache.thrift.protocol.TField EX2_FIELD_DESC = new org.apache.thrift.protocol.TField("ex2", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final org.apache.thrift.protocol.TField EX3_FIELD_DESC = new org.apache.thrift.protocol.TField("ex3", org.apache.thrift.protocol.TType.STRUCT, (short)3); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getServerEnvironment_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getServerEnvironment_resultTupleSchemeFactory(); + + public @org.apache.thrift.annotation.Nullable java.lang.String success; // required + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex; // required + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2; // required + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3; // 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"), + EX((short)1, "ex"), + EX2((short)2, "ex2"), + EX3((short)3, "ex3"); + + private static final java.util.Map byName = new java.util.LinkedHashMap(); + + 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; + case 1: // EX + return EX; + case 2: // EX2 + return EX2; + case 3: // EX3 + return EX3; + 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.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.EX, new org.apache.thrift.meta_data.FieldMetaData("ex", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.SecurityException.class))); + tmpMap.put(_Fields.EX2, new org.apache.thrift.meta_data.FieldMetaData("ex2", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.TransactionException.class))); + tmpMap.put(_Fields.EX3, new org.apache.thrift.meta_data.FieldMetaData("ex3", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.PermissionException.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getServerEnvironment_result.class, metaDataMap); + } + + public getServerEnvironment_result() { + } + + public getServerEnvironment_result( + java.lang.String success, + com.cinchapi.concourse.thrift.SecurityException ex, + com.cinchapi.concourse.thrift.TransactionException ex2, + com.cinchapi.concourse.thrift.PermissionException ex3) + { + this(); + this.success = success; + this.ex = ex; + this.ex2 = ex2; + this.ex3 = ex3; + } + + /** + * Performs a deep copy on other. + */ + public getServerEnvironment_result(getServerEnvironment_result other) { + if (other.isSetSuccess()) { + this.success = other.success; + } + if (other.isSetEx()) { + this.ex = new com.cinchapi.concourse.thrift.SecurityException(other.ex); + } + if (other.isSetEx2()) { + this.ex2 = new com.cinchapi.concourse.thrift.TransactionException(other.ex2); + } + if (other.isSetEx3()) { + this.ex3 = new com.cinchapi.concourse.thrift.PermissionException(other.ex3); + } + } + + @Override + public getServerEnvironment_result deepCopy() { + return new getServerEnvironment_result(this); + } + + @Override + public void clear() { + this.success = null; + this.ex = null; + this.ex2 = null; + this.ex3 = null; + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getSuccess() { + return this.success; + } + + public getServerEnvironment_result setSuccess(@org.apache.thrift.annotation.Nullable java.lang.String 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; + } + } + + @org.apache.thrift.annotation.Nullable + public com.cinchapi.concourse.thrift.SecurityException getEx() { + return this.ex; + } + + public getServerEnvironment_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { + this.ex = ex; + return this; + } + + public void unsetEx() { + this.ex = null; + } + + /** Returns true if field ex is set (has been assigned a value) and false otherwise */ + public boolean isSetEx() { + return this.ex != null; + } + + public void setExIsSet(boolean value) { + if (!value) { + this.ex = null; + } + } + + @org.apache.thrift.annotation.Nullable + public com.cinchapi.concourse.thrift.TransactionException getEx2() { + return this.ex2; + } + + public getServerEnvironment_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { + this.ex2 = ex2; + return this; + } + + public void unsetEx2() { + this.ex2 = null; + } + + /** Returns true if field ex2 is set (has been assigned a value) and false otherwise */ + public boolean isSetEx2() { + return this.ex2 != null; + } + + public void setEx2IsSet(boolean value) { + if (!value) { + this.ex2 = null; + } + } + + @org.apache.thrift.annotation.Nullable + public com.cinchapi.concourse.thrift.PermissionException getEx3() { + return this.ex3; + } + + public getServerEnvironment_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3) { + this.ex3 = ex3; + return this; + } + + public void unsetEx3() { + this.ex3 = null; + } + + /** Returns true if field ex3 is set (has been assigned a value) and false otherwise */ + public boolean isSetEx3() { + return this.ex3 != null; + } + + public void setEx3IsSet(boolean value) { + if (!value) { + this.ex3 = 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.lang.String)value); + } + break; + + case EX: + if (value == null) { + unsetEx(); + } else { + setEx((com.cinchapi.concourse.thrift.SecurityException)value); + } + break; + + case EX2: + if (value == null) { + unsetEx2(); + } else { + setEx2((com.cinchapi.concourse.thrift.TransactionException)value); + } + break; + + case EX3: + if (value == null) { + unsetEx3(); + } else { + setEx3((com.cinchapi.concourse.thrift.PermissionException)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case EX: + return getEx(); + + case EX2: + return getEx2(); + + case EX3: + return getEx3(); + + } + 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(); + case EX: + return isSetEx(); + case EX2: + return isSetEx2(); + case EX3: + return isSetEx3(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that instanceof getServerEnvironment_result) + return this.equals((getServerEnvironment_result)that); + return false; + } + + public boolean equals(getServerEnvironment_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; + } + + boolean this_present_ex = true && this.isSetEx(); + boolean that_present_ex = true && that.isSetEx(); + if (this_present_ex || that_present_ex) { + if (!(this_present_ex && that_present_ex)) + return false; + if (!this.ex.equals(that.ex)) + return false; + } + + boolean this_present_ex2 = true && this.isSetEx2(); + boolean that_present_ex2 = true && that.isSetEx2(); + if (this_present_ex2 || that_present_ex2) { + if (!(this_present_ex2 && that_present_ex2)) + return false; + if (!this.ex2.equals(that.ex2)) + return false; + } + + boolean this_present_ex3 = true && this.isSetEx3(); + boolean that_present_ex3 = true && that.isSetEx3(); + if (this_present_ex3 || that_present_ex3) { + if (!(this_present_ex3 && that_present_ex3)) + return false; + if (!this.ex3.equals(that.ex3)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); + + hashCode = hashCode * 8191 + ((isSetEx()) ? 131071 : 524287); + if (isSetEx()) + hashCode = hashCode * 8191 + ex.hashCode(); + + hashCode = hashCode * 8191 + ((isSetEx2()) ? 131071 : 524287); + if (isSetEx2()) + hashCode = hashCode * 8191 + ex2.hashCode(); + + hashCode = hashCode * 8191 + ((isSetEx3()) ? 131071 : 524287); + if (isSetEx3()) + hashCode = hashCode * 8191 + ex3.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(getServerEnvironment_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; + } + } + lastComparison = java.lang.Boolean.compare(isSetEx(), other.isSetEx()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEx()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex, other.ex); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetEx2(), other.isSetEx2()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEx2()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex2, other.ex2); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetEx3(), other.isSetEx3()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEx3()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex3, other.ex3); + 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("getServerEnvironment_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("ex:"); + if (this.ex == null) { + sb.append("null"); + } else { + sb.append(this.ex); + } + first = false; + if (!first) sb.append(", "); + sb.append("ex2:"); + if (this.ex2 == null) { + sb.append("null"); + } else { + sb.append(this.ex2); + } + first = false; + if (!first) sb.append(", "); + sb.append("ex3:"); + if (this.ex3 == null) { + sb.append("null"); + } else { + sb.append(this.ex3); + } + 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 getServerEnvironment_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public getServerEnvironment_resultStandardScheme getScheme() { + return new getServerEnvironment_resultStandardScheme(); + } + } + + private static class getServerEnvironment_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, getServerEnvironment_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.STRING) { + struct.success = iprot.readString(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // EX + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ex = new com.cinchapi.concourse.thrift.SecurityException(); + struct.ex.read(iprot); + struct.setExIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // EX2 + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ex2 = new com.cinchapi.concourse.thrift.TransactionException(); + struct.ex2.read(iprot); + struct.setEx2IsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // EX3 + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ex3 = new com.cinchapi.concourse.thrift.PermissionException(); + struct.ex3.read(iprot); + struct.setEx3IsSet(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, getServerEnvironment_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeString(struct.success); + oprot.writeFieldEnd(); + } + if (struct.ex != null) { + oprot.writeFieldBegin(EX_FIELD_DESC); + struct.ex.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ex2 != null) { + oprot.writeFieldBegin(EX2_FIELD_DESC); + struct.ex2.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ex3 != null) { + oprot.writeFieldBegin(EX3_FIELD_DESC); + struct.ex3.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getServerEnvironment_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public getServerEnvironment_resultTupleScheme getScheme() { + return new getServerEnvironment_resultTupleScheme(); + } + } + + private static class getServerEnvironment_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getServerEnvironment_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); + } + if (struct.isSetEx()) { + optionals.set(1); + } + if (struct.isSetEx2()) { + optionals.set(2); + } + if (struct.isSetEx3()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.isSetSuccess()) { + oprot.writeString(struct.success); + } + if (struct.isSetEx()) { + struct.ex.write(oprot); + } + if (struct.isSetEx2()) { + struct.ex2.write(oprot); + } + if (struct.isSetEx3()) { + struct.ex3.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getServerEnvironment_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(4); + if (incoming.get(0)) { + struct.success = iprot.readString(); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.ex = new com.cinchapi.concourse.thrift.SecurityException(); + struct.ex.read(iprot); + struct.setExIsSet(true); + } + if (incoming.get(2)) { + struct.ex2 = new com.cinchapi.concourse.thrift.TransactionException(); + struct.ex2.read(iprot); + struct.setEx2IsSet(true); + } + if (incoming.get(3)) { + struct.ex3 = new com.cinchapi.concourse.thrift.PermissionException(); + struct.ex3.read(iprot); + struct.setEx3IsSet(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(); + } + } + + public static class getServerVersion_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("getServerVersion_args"); + + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getServerVersion_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getServerVersion_argsTupleSchemeFactory(); + + + /** 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.LinkedHashMap(); + + 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(getServerVersion_args.class, metaDataMap); + } + + public getServerVersion_args() { + } + + /** + * Performs a deep copy on other. + */ + public getServerVersion_args(getServerVersion_args other) { + } + + @Override + public getServerVersion_args deepCopy() { + return new getServerVersion_args(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 getServerVersion_args) + return this.equals((getServerVersion_args)that); + return false; + } + + public boolean equals(getServerVersion_args 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(getServerVersion_args 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); + } + + @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("getServerVersion_args("); + 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 getServerVersion_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public getServerVersion_argsStandardScheme getScheme() { + return new getServerVersion_argsStandardScheme(); + } + } + + private static class getServerVersion_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, getServerVersion_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) { + 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, getServerVersion_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getServerVersion_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public getServerVersion_argsTupleScheme getScheme() { + return new getServerVersion_argsTupleScheme(); + } + } + + private static class getServerVersion_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getServerVersion_args 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, getServerVersion_args 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(); + } + } + + public static class getServerVersion_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("getServerVersion_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0); + private static final org.apache.thrift.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final org.apache.thrift.protocol.TField EX2_FIELD_DESC = new org.apache.thrift.protocol.TField("ex2", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final org.apache.thrift.protocol.TField EX3_FIELD_DESC = new org.apache.thrift.protocol.TField("ex3", org.apache.thrift.protocol.TType.STRUCT, (short)3); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getServerVersion_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getServerVersion_resultTupleSchemeFactory(); + + public @org.apache.thrift.annotation.Nullable java.lang.String success; // required + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex; // required + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2; // required + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3; // 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"), + EX((short)1, "ex"), + EX2((short)2, "ex2"), + EX3((short)3, "ex3"); + + private static final java.util.Map byName = new java.util.LinkedHashMap(); + + 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; + case 1: // EX + return EX; + case 2: // EX2 + return EX2; + case 3: // EX3 + return EX3; + 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.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.EX, new org.apache.thrift.meta_data.FieldMetaData("ex", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.SecurityException.class))); + tmpMap.put(_Fields.EX2, new org.apache.thrift.meta_data.FieldMetaData("ex2", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.TransactionException.class))); + tmpMap.put(_Fields.EX3, new org.apache.thrift.meta_data.FieldMetaData("ex3", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.PermissionException.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getServerVersion_result.class, metaDataMap); + } + + public getServerVersion_result() { + } + + public getServerVersion_result( + java.lang.String success, + com.cinchapi.concourse.thrift.SecurityException ex, + com.cinchapi.concourse.thrift.TransactionException ex2, + com.cinchapi.concourse.thrift.PermissionException ex3) + { + this(); + this.success = success; + this.ex = ex; + this.ex2 = ex2; + this.ex3 = ex3; + } + + /** + * Performs a deep copy on other. + */ + public getServerVersion_result(getServerVersion_result other) { + if (other.isSetSuccess()) { + this.success = other.success; + } + if (other.isSetEx()) { + this.ex = new com.cinchapi.concourse.thrift.SecurityException(other.ex); + } + if (other.isSetEx2()) { + this.ex2 = new com.cinchapi.concourse.thrift.TransactionException(other.ex2); + } + if (other.isSetEx3()) { + this.ex3 = new com.cinchapi.concourse.thrift.PermissionException(other.ex3); + } + } + + @Override + public getServerVersion_result deepCopy() { + return new getServerVersion_result(this); + } + + @Override + public void clear() { + this.success = null; + this.ex = null; + this.ex2 = null; + this.ex3 = null; + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getSuccess() { + return this.success; + } + + public getServerVersion_result setSuccess(@org.apache.thrift.annotation.Nullable java.lang.String 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; + } + } + + @org.apache.thrift.annotation.Nullable + public com.cinchapi.concourse.thrift.SecurityException getEx() { + return this.ex; + } + + public getServerVersion_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { + this.ex = ex; + return this; + } + + public void unsetEx() { + this.ex = null; + } + + /** Returns true if field ex is set (has been assigned a value) and false otherwise */ + public boolean isSetEx() { + return this.ex != null; + } + + public void setExIsSet(boolean value) { + if (!value) { + this.ex = null; + } + } + + @org.apache.thrift.annotation.Nullable + public com.cinchapi.concourse.thrift.TransactionException getEx2() { + return this.ex2; + } + + public getServerVersion_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { this.ex2 = ex2; return this; } @@ -686569,11 +689450,11 @@ public void setEx2IsSet(boolean value) { } @org.apache.thrift.annotation.Nullable - public com.cinchapi.concourse.thrift.ParseException getEx3() { + public com.cinchapi.concourse.thrift.PermissionException getEx3() { return this.ex3; } - public findOrInsertCclJson_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ParseException ex3) { + public getServerVersion_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3) { this.ex3 = ex3; return this; } @@ -686593,56 +689474,6 @@ public void setEx3IsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable - public com.cinchapi.concourse.thrift.DuplicateEntryException getEx4() { - return this.ex4; - } - - public findOrInsertCclJson_result setEx4(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.DuplicateEntryException ex4) { - this.ex4 = ex4; - return this; - } - - public void unsetEx4() { - this.ex4 = null; - } - - /** Returns true if field ex4 is set (has been assigned a value) and false otherwise */ - public boolean isSetEx4() { - return this.ex4 != null; - } - - public void setEx4IsSet(boolean value) { - if (!value) { - this.ex4 = null; - } - } - - @org.apache.thrift.annotation.Nullable - public com.cinchapi.concourse.thrift.PermissionException getEx5() { - return this.ex5; - } - - public findOrInsertCclJson_result setEx5(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex5) { - this.ex5 = ex5; - return this; - } - - public void unsetEx5() { - this.ex5 = null; - } - - /** Returns true if field ex5 is set (has been assigned a value) and false otherwise */ - public boolean isSetEx5() { - return this.ex5 != null; - } - - public void setEx5IsSet(boolean value) { - if (!value) { - this.ex5 = null; - } - } - @Override public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { @@ -686650,7 +689481,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetSuccess(); } else { - setSuccess((java.lang.Long)value); + setSuccess((java.lang.String)value); } break; @@ -686674,23 +689505,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetEx3(); } else { - setEx3((com.cinchapi.concourse.thrift.ParseException)value); - } - break; - - case EX4: - if (value == null) { - unsetEx4(); - } else { - setEx4((com.cinchapi.concourse.thrift.DuplicateEntryException)value); - } - break; - - case EX5: - if (value == null) { - unsetEx5(); - } else { - setEx5((com.cinchapi.concourse.thrift.PermissionException)value); + setEx3((com.cinchapi.concourse.thrift.PermissionException)value); } break; @@ -686713,12 +689528,6 @@ public java.lang.Object getFieldValue(_Fields field) { case EX3: return getEx3(); - case EX4: - return getEx4(); - - case EX5: - return getEx5(); - } throw new java.lang.IllegalStateException(); } @@ -686739,33 +689548,29 @@ public boolean isSet(_Fields field) { return isSetEx2(); case EX3: return isSetEx3(); - case EX4: - return isSetEx4(); - case EX5: - return isSetEx5(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { - if (that instanceof findOrInsertCclJson_result) - return this.equals((findOrInsertCclJson_result)that); + if (that instanceof getServerVersion_result) + return this.equals((getServerVersion_result)that); return false; } - public boolean equals(findOrInsertCclJson_result that) { + public boolean equals(getServerVersion_result that) { if (that == null) return false; if (this == that) return true; - boolean this_present_success = true; - boolean that_present_success = 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 != that.success) + if (!this.success.equals(that.success)) return false; } @@ -686796,24 +689601,6 @@ public boolean equals(findOrInsertCclJson_result that) { return false; } - boolean this_present_ex4 = true && this.isSetEx4(); - boolean that_present_ex4 = true && that.isSetEx4(); - if (this_present_ex4 || that_present_ex4) { - if (!(this_present_ex4 && that_present_ex4)) - return false; - if (!this.ex4.equals(that.ex4)) - return false; - } - - boolean this_present_ex5 = true && this.isSetEx5(); - boolean that_present_ex5 = true && that.isSetEx5(); - if (this_present_ex5 || that_present_ex5) { - if (!(this_present_ex5 && that_present_ex5)) - return false; - if (!this.ex5.equals(that.ex5)) - return false; - } - return true; } @@ -686821,7 +689608,9 @@ public boolean equals(findOrInsertCclJson_result that) { public int hashCode() { int hashCode = 1; - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(success); + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); hashCode = hashCode * 8191 + ((isSetEx()) ? 131071 : 524287); if (isSetEx()) @@ -686835,19 +689624,11 @@ public int hashCode() { if (isSetEx3()) hashCode = hashCode * 8191 + ex3.hashCode(); - hashCode = hashCode * 8191 + ((isSetEx4()) ? 131071 : 524287); - if (isSetEx4()) - hashCode = hashCode * 8191 + ex4.hashCode(); - - hashCode = hashCode * 8191 + ((isSetEx5()) ? 131071 : 524287); - if (isSetEx5()) - hashCode = hashCode * 8191 + ex5.hashCode(); - return hashCode; } @Override - public int compareTo(findOrInsertCclJson_result other) { + public int compareTo(getServerVersion_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -686894,26 +689675,6 @@ public int compareTo(findOrInsertCclJson_result other) { return lastComparison; } } - lastComparison = java.lang.Boolean.compare(isSetEx4(), other.isSetEx4()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetEx4()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex4, other.ex4); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.compare(isSetEx5(), other.isSetEx5()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetEx5()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex5, other.ex5); - if (lastComparison != 0) { - return lastComparison; - } - } return 0; } @@ -686934,11 +689695,15 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("findOrInsertCclJson_result("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("getServerVersion_result("); boolean first = true; sb.append("success:"); - sb.append(this.success); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } first = false; if (!first) sb.append(", "); sb.append("ex:"); @@ -686964,22 +689729,6 @@ public java.lang.String toString() { sb.append(this.ex3); } first = false; - if (!first) sb.append(", "); - sb.append("ex4:"); - if (this.ex4 == null) { - sb.append("null"); - } else { - sb.append(this.ex4); - } - first = false; - if (!first) sb.append(", "); - sb.append("ex5:"); - if (this.ex5 == null) { - sb.append("null"); - } else { - sb.append(this.ex5); - } - first = false; sb.append(")"); return sb.toString(); } @@ -686999,25 +689748,23 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept 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 findOrInsertCclJson_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class getServerVersion_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public findOrInsertCclJson_resultStandardScheme getScheme() { - return new findOrInsertCclJson_resultStandardScheme(); + public getServerVersion_resultStandardScheme getScheme() { + return new getServerVersion_resultStandardScheme(); } } - private static class findOrInsertCclJson_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class getServerVersion_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, findOrInsertCclJson_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, getServerVersion_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -687028,8 +689775,8 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, findOrInsertCclJson } switch (schemeField.id) { case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.success = iprot.readI64(); + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.success = iprot.readString(); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); @@ -687055,31 +689802,13 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, findOrInsertCclJson break; case 3: // EX3 if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.ex3 = new com.cinchapi.concourse.thrift.ParseException(); + struct.ex3 = new com.cinchapi.concourse.thrift.PermissionException(); struct.ex3.read(iprot); struct.setEx3IsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 4: // EX4 - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.ex4 = new com.cinchapi.concourse.thrift.DuplicateEntryException(); - struct.ex4.read(iprot); - struct.setEx4IsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // EX5 - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.ex5 = new com.cinchapi.concourse.thrift.PermissionException(); - struct.ex5.read(iprot); - struct.setEx5IsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -687092,13 +689821,13 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, findOrInsertCclJson } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, findOrInsertCclJson_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, getServerVersion_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); - if (struct.isSetSuccess()) { + if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeI64(struct.success); + oprot.writeString(struct.success); oprot.writeFieldEnd(); } if (struct.ex != null) { @@ -687116,33 +689845,23 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, findOrInsertCclJso struct.ex3.write(oprot); oprot.writeFieldEnd(); } - if (struct.ex4 != null) { - oprot.writeFieldBegin(EX4_FIELD_DESC); - struct.ex4.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.ex5 != null) { - oprot.writeFieldBegin(EX5_FIELD_DESC); - struct.ex5.write(oprot); - oprot.writeFieldEnd(); - } oprot.writeFieldStop(); oprot.writeStructEnd(); } } - private static class findOrInsertCclJson_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class getServerVersion_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public findOrInsertCclJson_resultTupleScheme getScheme() { - return new findOrInsertCclJson_resultTupleScheme(); + public getServerVersion_resultTupleScheme getScheme() { + return new getServerVersion_resultTupleScheme(); } } - private static class findOrInsertCclJson_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class getServerVersion_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, findOrInsertCclJson_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, getServerVersion_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()) { @@ -687157,15 +689876,9 @@ public void write(org.apache.thrift.protocol.TProtocol prot, findOrInsertCclJson if (struct.isSetEx3()) { optionals.set(3); } - if (struct.isSetEx4()) { - optionals.set(4); - } - if (struct.isSetEx5()) { - optionals.set(5); - } - oprot.writeBitSet(optionals, 6); + oprot.writeBitSet(optionals, 4); if (struct.isSetSuccess()) { - oprot.writeI64(struct.success); + oprot.writeString(struct.success); } if (struct.isSetEx()) { struct.ex.write(oprot); @@ -687176,20 +689889,14 @@ public void write(org.apache.thrift.protocol.TProtocol prot, findOrInsertCclJson if (struct.isSetEx3()) { struct.ex3.write(oprot); } - if (struct.isSetEx4()) { - struct.ex4.write(oprot); - } - if (struct.isSetEx5()) { - struct.ex5.write(oprot); - } } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, findOrInsertCclJson_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, getServerVersion_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(6); + java.util.BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { - struct.success = iprot.readI64(); + struct.success = iprot.readString(); struct.setSuccessIsSet(true); } if (incoming.get(1)) { @@ -687203,20 +689910,10 @@ public void read(org.apache.thrift.protocol.TProtocol prot, findOrInsertCclJson_ struct.setEx2IsSet(true); } if (incoming.get(3)) { - struct.ex3 = new com.cinchapi.concourse.thrift.ParseException(); + struct.ex3 = new com.cinchapi.concourse.thrift.PermissionException(); struct.ex3.read(iprot); struct.setEx3IsSet(true); } - if (incoming.get(4)) { - struct.ex4 = new com.cinchapi.concourse.thrift.DuplicateEntryException(); - struct.ex4.read(iprot); - struct.setEx4IsSet(true); - } - if (incoming.get(5)) { - struct.ex5 = new com.cinchapi.concourse.thrift.PermissionException(); - struct.ex5.read(iprot); - struct.setEx5IsSet(true); - } } } @@ -687225,15 +689922,15 @@ private static S scheme(org.apache. } } - public static class getServerEnvironment_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("getServerEnvironment_args"); + public static class time_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("time_args"); private static final org.apache.thrift.protocol.TField CREDS_FIELD_DESC = new org.apache.thrift.protocol.TField("creds", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField ENVIRONMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("environment", org.apache.thrift.protocol.TType.STRING, (short)3); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getServerEnvironment_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getServerEnvironment_argsTupleSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new time_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new time_argsTupleSchemeFactory(); public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken token; // required @@ -687318,13 +690015,13 @@ public java.lang.String getFieldName() { tmpMap.put(_Fields.ENVIRONMENT, new org.apache.thrift.meta_data.FieldMetaData("environment", 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(getServerEnvironment_args.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(time_args.class, metaDataMap); } - public getServerEnvironment_args() { + public time_args() { } - public getServerEnvironment_args( + public time_args( com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken token, java.lang.String environment) @@ -687338,7 +690035,7 @@ public getServerEnvironment_args( /** * Performs a deep copy on other. */ - public getServerEnvironment_args(getServerEnvironment_args other) { + public time_args(time_args other) { if (other.isSetCreds()) { this.creds = new com.cinchapi.concourse.thrift.AccessToken(other.creds); } @@ -687351,8 +690048,8 @@ public getServerEnvironment_args(getServerEnvironment_args other) { } @Override - public getServerEnvironment_args deepCopy() { - return new getServerEnvironment_args(this); + public time_args deepCopy() { + return new time_args(this); } @Override @@ -687367,7 +690064,7 @@ public com.cinchapi.concourse.thrift.AccessToken getCreds() { return this.creds; } - public getServerEnvironment_args setCreds(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds) { + public time_args setCreds(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds) { this.creds = creds; return this; } @@ -687392,7 +690089,7 @@ public com.cinchapi.concourse.thrift.TransactionToken getToken() { return this.token; } - public getServerEnvironment_args setToken(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken token) { + public time_args setToken(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken token) { this.token = token; return this; } @@ -687417,7 +690114,7 @@ public java.lang.String getEnvironment() { return this.environment; } - public getServerEnvironment_args setEnvironment(@org.apache.thrift.annotation.Nullable java.lang.String environment) { + public time_args setEnvironment(@org.apache.thrift.annotation.Nullable java.lang.String environment) { this.environment = environment; return this; } @@ -687504,12 +690201,12 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that instanceof getServerEnvironment_args) - return this.equals((getServerEnvironment_args)that); + if (that instanceof time_args) + return this.equals((time_args)that); return false; } - public boolean equals(getServerEnvironment_args that) { + public boolean equals(time_args that) { if (that == null) return false; if (this == that) @@ -687565,7 +690262,7 @@ public int hashCode() { } @Override - public int compareTo(getServerEnvironment_args other) { + public int compareTo(time_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -687623,7 +690320,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("getServerEnvironment_args("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("time_args("); boolean first = true; sb.append("creds:"); @@ -687680,17 +690377,17 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class getServerEnvironment_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class time_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public getServerEnvironment_argsStandardScheme getScheme() { - return new getServerEnvironment_argsStandardScheme(); + public time_argsStandardScheme getScheme() { + return new time_argsStandardScheme(); } } - private static class getServerEnvironment_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class time_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, getServerEnvironment_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, time_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -687738,7 +690435,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, getServerEnvironmen } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, getServerEnvironment_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, time_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); @@ -687763,17 +690460,17 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, getServerEnvironme } - private static class getServerEnvironment_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class time_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public getServerEnvironment_argsTupleScheme getScheme() { - return new getServerEnvironment_argsTupleScheme(); + public time_argsTupleScheme getScheme() { + return new time_argsTupleScheme(); } } - private static class getServerEnvironment_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class time_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, getServerEnvironment_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, time_args 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.isSetCreds()) { @@ -687798,7 +690495,7 @@ public void write(org.apache.thrift.protocol.TProtocol prot, getServerEnvironmen } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, getServerEnvironment_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, time_args 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)) { @@ -687823,18 +690520,18 @@ private static S scheme(org.apache. } } - public static class getServerEnvironment_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("getServerEnvironment_result"); + public static class time_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("time_result"); - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0); + 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.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField EX2_FIELD_DESC = new org.apache.thrift.protocol.TField("ex2", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField EX3_FIELD_DESC = new org.apache.thrift.protocol.TField("ex3", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getServerEnvironment_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getServerEnvironment_resultTupleSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new time_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new time_resultTupleSchemeFactory(); - public @org.apache.thrift.annotation.Nullable java.lang.String success; // required + public long success; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3; // required @@ -687911,11 +690608,13 @@ public java.lang.String getFieldName() { } // 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.STRING))); + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.EX, new org.apache.thrift.meta_data.FieldMetaData("ex", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.SecurityException.class))); tmpMap.put(_Fields.EX2, new org.apache.thrift.meta_data.FieldMetaData("ex2", org.apache.thrift.TFieldRequirementType.DEFAULT, @@ -687923,20 +690622,21 @@ public java.lang.String getFieldName() { tmpMap.put(_Fields.EX3, new org.apache.thrift.meta_data.FieldMetaData("ex3", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.PermissionException.class))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getServerEnvironment_result.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(time_result.class, metaDataMap); } - public getServerEnvironment_result() { + public time_result() { } - public getServerEnvironment_result( - java.lang.String success, + public time_result( + long success, com.cinchapi.concourse.thrift.SecurityException ex, com.cinchapi.concourse.thrift.TransactionException ex2, com.cinchapi.concourse.thrift.PermissionException ex3) { this(); this.success = success; + setSuccessIsSet(true); this.ex = ex; this.ex2 = ex2; this.ex3 = ex3; @@ -687945,10 +690645,9 @@ public getServerEnvironment_result( /** * Performs a deep copy on other. */ - public getServerEnvironment_result(getServerEnvironment_result other) { - if (other.isSetSuccess()) { - this.success = other.success; - } + public time_result(time_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; if (other.isSetEx()) { this.ex = new com.cinchapi.concourse.thrift.SecurityException(other.ex); } @@ -687961,41 +690660,40 @@ public getServerEnvironment_result(getServerEnvironment_result other) { } @Override - public getServerEnvironment_result deepCopy() { - return new getServerEnvironment_result(this); + public time_result deepCopy() { + return new time_result(this); } @Override public void clear() { - this.success = null; + setSuccessIsSet(false); + this.success = 0; this.ex = null; this.ex2 = null; this.ex3 = null; } - @org.apache.thrift.annotation.Nullable - public java.lang.String getSuccess() { + public long getSuccess() { return this.success; } - public getServerEnvironment_result setSuccess(@org.apache.thrift.annotation.Nullable java.lang.String success) { + public time_result setSuccess(long success) { this.success = success; + setSuccessIsSet(true); return this; } public void unsetSuccess() { - this.success = null; + __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 this.success != null; + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } @org.apache.thrift.annotation.Nullable @@ -688003,7 +690701,7 @@ public com.cinchapi.concourse.thrift.SecurityException getEx() { return this.ex; } - public getServerEnvironment_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { + public time_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { this.ex = ex; return this; } @@ -688028,7 +690726,7 @@ public com.cinchapi.concourse.thrift.TransactionException getEx2() { return this.ex2; } - public getServerEnvironment_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { + public time_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { this.ex2 = ex2; return this; } @@ -688053,7 +690751,7 @@ public com.cinchapi.concourse.thrift.PermissionException getEx3() { return this.ex3; } - public getServerEnvironment_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3) { + public time_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3) { this.ex3 = ex3; return this; } @@ -688080,7 +690778,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetSuccess(); } else { - setSuccess((java.lang.String)value); + setSuccess((java.lang.Long)value); } break; @@ -688153,23 +690851,23 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that instanceof getServerEnvironment_result) - return this.equals((getServerEnvironment_result)that); + if (that instanceof time_result) + return this.equals((time_result)that); return false; } - public boolean equals(getServerEnvironment_result that) { + public boolean equals(time_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(); + 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.equals(that.success)) + if (this.success != that.success) return false; } @@ -688207,9 +690905,7 @@ public boolean equals(getServerEnvironment_result that) { public int hashCode() { int hashCode = 1; - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(success); hashCode = hashCode * 8191 + ((isSetEx()) ? 131071 : 524287); if (isSetEx()) @@ -688227,7 +690923,7 @@ public int hashCode() { } @Override - public int compareTo(getServerEnvironment_result other) { + public int compareTo(time_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -688294,15 +690990,11 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("getServerEnvironment_result("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("time_result("); boolean first = true; sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } + sb.append(this.success); first = false; if (!first) sb.append(", "); sb.append("ex:"); @@ -688347,23 +691039,25 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept 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 getServerEnvironment_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class time_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public getServerEnvironment_resultStandardScheme getScheme() { - return new getServerEnvironment_resultStandardScheme(); + public time_resultStandardScheme getScheme() { + return new time_resultStandardScheme(); } } - private static class getServerEnvironment_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class time_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, getServerEnvironment_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, time_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -688374,8 +691068,8 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, getServerEnvironmen } switch (schemeField.id) { case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.success = iprot.readString(); + 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); @@ -688420,13 +691114,13 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, getServerEnvironmen } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, getServerEnvironment_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, time_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { + if (struct.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeString(struct.success); + oprot.writeI64(struct.success); oprot.writeFieldEnd(); } if (struct.ex != null) { @@ -688450,17 +691144,17 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, getServerEnvironme } - private static class getServerEnvironment_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class time_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public getServerEnvironment_resultTupleScheme getScheme() { - return new getServerEnvironment_resultTupleScheme(); + public time_resultTupleScheme getScheme() { + return new time_resultTupleScheme(); } } - private static class getServerEnvironment_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class time_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, getServerEnvironment_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, time_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()) { @@ -688477,7 +691171,7 @@ public void write(org.apache.thrift.protocol.TProtocol prot, getServerEnvironmen } oprot.writeBitSet(optionals, 4); if (struct.isSetSuccess()) { - oprot.writeString(struct.success); + oprot.writeI64(struct.success); } if (struct.isSetEx()) { struct.ex.write(oprot); @@ -688491,11 +691185,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, getServerEnvironmen } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, getServerEnvironment_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, time_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(4); if (incoming.get(0)) { - struct.success = iprot.readString(); + struct.success = iprot.readI64(); struct.setSuccessIsSet(true); } if (incoming.get(1)) { @@ -688521,17 +691215,28 @@ private static S scheme(org.apache. } } - public static class getServerVersion_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("getServerVersion_args"); + public static class timePhrase_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("timePhrase_args"); + private static final org.apache.thrift.protocol.TField PHRASE_FIELD_DESC = new org.apache.thrift.protocol.TField("phrase", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField CREDS_FIELD_DESC = new org.apache.thrift.protocol.TField("creds", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final org.apache.thrift.protocol.TField ENVIRONMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("environment", org.apache.thrift.protocol.TType.STRING, (short)4); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getServerVersion_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getServerVersion_argsTupleSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new timePhrase_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new timePhrase_argsTupleSchemeFactory(); + public @org.apache.thrift.annotation.Nullable java.lang.String phrase; // required + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds; // required + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken token; // required + public @org.apache.thrift.annotation.Nullable java.lang.String environment; // 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 { -; + PHRASE((short)1, "phrase"), + CREDS((short)2, "creds"), + TOKEN((short)3, "token"), + ENVIRONMENT((short)4, "environment"); private static final java.util.Map byName = new java.util.LinkedHashMap(); @@ -688547,6 +691252,14 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { + case 1: // PHRASE + return PHRASE; + case 2: // CREDS + return CREDS; + case 3: // TOKEN + return TOKEN; + case 4: // ENVIRONMENT + return ENVIRONMENT; default: return null; } @@ -688588,34 +691301,205 @@ 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.PHRASE, new org.apache.thrift.meta_data.FieldMetaData("phrase", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.CREDS, new org.apache.thrift.meta_data.FieldMetaData("creds", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.AccessToken.class))); + tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.TransactionToken.class))); + tmpMap.put(_Fields.ENVIRONMENT, new org.apache.thrift.meta_data.FieldMetaData("environment", 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(getServerVersion_args.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(timePhrase_args.class, metaDataMap); } - public getServerVersion_args() { + public timePhrase_args() { + } + + public timePhrase_args( + java.lang.String phrase, + com.cinchapi.concourse.thrift.AccessToken creds, + com.cinchapi.concourse.thrift.TransactionToken token, + java.lang.String environment) + { + this(); + this.phrase = phrase; + this.creds = creds; + this.token = token; + this.environment = environment; } /** * Performs a deep copy on other. */ - public getServerVersion_args(getServerVersion_args other) { + public timePhrase_args(timePhrase_args other) { + if (other.isSetPhrase()) { + this.phrase = other.phrase; + } + if (other.isSetCreds()) { + this.creds = new com.cinchapi.concourse.thrift.AccessToken(other.creds); + } + if (other.isSetToken()) { + this.token = new com.cinchapi.concourse.thrift.TransactionToken(other.token); + } + if (other.isSetEnvironment()) { + this.environment = other.environment; + } } @Override - public getServerVersion_args deepCopy() { - return new getServerVersion_args(this); + public timePhrase_args deepCopy() { + return new timePhrase_args(this); } @Override public void clear() { + this.phrase = null; + this.creds = null; + this.token = null; + this.environment = null; + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getPhrase() { + return this.phrase; + } + + public timePhrase_args setPhrase(@org.apache.thrift.annotation.Nullable java.lang.String phrase) { + this.phrase = phrase; + return this; + } + + public void unsetPhrase() { + this.phrase = null; + } + + /** Returns true if field phrase is set (has been assigned a value) and false otherwise */ + public boolean isSetPhrase() { + return this.phrase != null; + } + + public void setPhraseIsSet(boolean value) { + if (!value) { + this.phrase = null; + } + } + + @org.apache.thrift.annotation.Nullable + public com.cinchapi.concourse.thrift.AccessToken getCreds() { + return this.creds; + } + + public timePhrase_args setCreds(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds) { + this.creds = creds; + return this; + } + + public void unsetCreds() { + this.creds = null; + } + + /** Returns true if field creds is set (has been assigned a value) and false otherwise */ + public boolean isSetCreds() { + return this.creds != null; + } + + public void setCredsIsSet(boolean value) { + if (!value) { + this.creds = null; + } + } + + @org.apache.thrift.annotation.Nullable + public com.cinchapi.concourse.thrift.TransactionToken getToken() { + return this.token; + } + + public timePhrase_args setToken(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken token) { + this.token = token; + return this; + } + + public void unsetToken() { + this.token = null; + } + + /** Returns true if field token is set (has been assigned a value) and false otherwise */ + public boolean isSetToken() { + return this.token != null; + } + + public void setTokenIsSet(boolean value) { + if (!value) { + this.token = null; + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getEnvironment() { + return this.environment; + } + + public timePhrase_args setEnvironment(@org.apache.thrift.annotation.Nullable java.lang.String environment) { + this.environment = environment; + return this; + } + + public void unsetEnvironment() { + this.environment = null; + } + + /** Returns true if field environment is set (has been assigned a value) and false otherwise */ + public boolean isSetEnvironment() { + return this.environment != null; + } + + public void setEnvironmentIsSet(boolean value) { + if (!value) { + this.environment = null; + } } @Override public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { + case PHRASE: + if (value == null) { + unsetPhrase(); + } else { + setPhrase((java.lang.String)value); + } + break; + + case CREDS: + if (value == null) { + unsetCreds(); + } else { + setCreds((com.cinchapi.concourse.thrift.AccessToken)value); + } + break; + + case TOKEN: + if (value == null) { + unsetToken(); + } else { + setToken((com.cinchapi.concourse.thrift.TransactionToken)value); + } + break; + + case ENVIRONMENT: + if (value == null) { + unsetEnvironment(); + } else { + setEnvironment((java.lang.String)value); + } + break; + } } @@ -688623,6 +691507,18 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable @Override public java.lang.Object getFieldValue(_Fields field) { switch (field) { + case PHRASE: + return getPhrase(); + + case CREDS: + return getCreds(); + + case TOKEN: + return getToken(); + + case ENVIRONMENT: + return getEnvironment(); + } throw new java.lang.IllegalStateException(); } @@ -688635,23 +691531,67 @@ public boolean isSet(_Fields field) { } switch (field) { + case PHRASE: + return isSetPhrase(); + case CREDS: + return isSetCreds(); + case TOKEN: + return isSetToken(); + case ENVIRONMENT: + return isSetEnvironment(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { - if (that instanceof getServerVersion_args) - return this.equals((getServerVersion_args)that); + if (that instanceof timePhrase_args) + return this.equals((timePhrase_args)that); return false; } - public boolean equals(getServerVersion_args that) { + public boolean equals(timePhrase_args that) { if (that == null) return false; if (this == that) return true; + boolean this_present_phrase = true && this.isSetPhrase(); + boolean that_present_phrase = true && that.isSetPhrase(); + if (this_present_phrase || that_present_phrase) { + if (!(this_present_phrase && that_present_phrase)) + return false; + if (!this.phrase.equals(that.phrase)) + return false; + } + + boolean this_present_creds = true && this.isSetCreds(); + boolean that_present_creds = true && that.isSetCreds(); + if (this_present_creds || that_present_creds) { + if (!(this_present_creds && that_present_creds)) + return false; + if (!this.creds.equals(that.creds)) + return false; + } + + boolean this_present_token = true && this.isSetToken(); + boolean that_present_token = true && that.isSetToken(); + if (this_present_token || that_present_token) { + if (!(this_present_token && that_present_token)) + return false; + if (!this.token.equals(that.token)) + return false; + } + + boolean this_present_environment = true && this.isSetEnvironment(); + boolean that_present_environment = true && that.isSetEnvironment(); + if (this_present_environment || that_present_environment) { + if (!(this_present_environment && that_present_environment)) + return false; + if (!this.environment.equals(that.environment)) + return false; + } + return true; } @@ -688659,17 +691599,73 @@ public boolean equals(getServerVersion_args that) { public int hashCode() { int hashCode = 1; + hashCode = hashCode * 8191 + ((isSetPhrase()) ? 131071 : 524287); + if (isSetPhrase()) + hashCode = hashCode * 8191 + phrase.hashCode(); + + hashCode = hashCode * 8191 + ((isSetCreds()) ? 131071 : 524287); + if (isSetCreds()) + hashCode = hashCode * 8191 + creds.hashCode(); + + hashCode = hashCode * 8191 + ((isSetToken()) ? 131071 : 524287); + if (isSetToken()) + hashCode = hashCode * 8191 + token.hashCode(); + + hashCode = hashCode * 8191 + ((isSetEnvironment()) ? 131071 : 524287); + if (isSetEnvironment()) + hashCode = hashCode * 8191 + environment.hashCode(); + return hashCode; } @Override - public int compareTo(getServerVersion_args other) { + public int compareTo(timePhrase_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; + lastComparison = java.lang.Boolean.compare(isSetPhrase(), other.isSetPhrase()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetPhrase()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.phrase, other.phrase); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetCreds(), other.isSetCreds()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetCreds()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.creds, other.creds); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetToken(), other.isSetToken()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetToken()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetEnvironment(), other.isSetEnvironment()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEnvironment()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.environment, other.environment); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -688691,9 +691687,40 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("getServerVersion_args("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("timePhrase_args("); boolean first = true; + sb.append("phrase:"); + if (this.phrase == null) { + sb.append("null"); + } else { + sb.append(this.phrase); + } + first = false; + if (!first) sb.append(", "); + sb.append("creds:"); + if (this.creds == null) { + sb.append("null"); + } else { + sb.append(this.creds); + } + first = false; + if (!first) sb.append(", "); + sb.append("token:"); + if (this.token == null) { + sb.append("null"); + } else { + sb.append(this.token); + } + first = false; + if (!first) sb.append(", "); + sb.append("environment:"); + if (this.environment == null) { + sb.append("null"); + } else { + sb.append(this.environment); + } + first = false; sb.append(")"); return sb.toString(); } @@ -688701,6 +691728,12 @@ public java.lang.String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity + if (creds != null) { + creds.validate(); + } + if (token != null) { + token.validate(); + } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -688719,17 +691752,17 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class getServerVersion_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class timePhrase_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public getServerVersion_argsStandardScheme getScheme() { - return new getServerVersion_argsStandardScheme(); + public timePhrase_argsStandardScheme getScheme() { + return new timePhrase_argsStandardScheme(); } } - private static class getServerVersion_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class timePhrase_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, getServerVersion_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, timePhrase_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -688739,6 +691772,40 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, getServerVersion_ar break; } switch (schemeField.id) { + case 1: // PHRASE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.phrase = iprot.readString(); + struct.setPhraseIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // CREDS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); + struct.creds.read(iprot); + struct.setCredsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // TOKEN + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.token = new com.cinchapi.concourse.thrift.TransactionToken(); + struct.token.read(iprot); + struct.setTokenIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // ENVIRONMENT + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.environment = iprot.readString(); + struct.setEnvironmentIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -688751,33 +691818,98 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, getServerVersion_ar } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, getServerVersion_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, timePhrase_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); + if (struct.phrase != null) { + oprot.writeFieldBegin(PHRASE_FIELD_DESC); + oprot.writeString(struct.phrase); + oprot.writeFieldEnd(); + } + if (struct.creds != null) { + oprot.writeFieldBegin(CREDS_FIELD_DESC); + struct.creds.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.token != null) { + oprot.writeFieldBegin(TOKEN_FIELD_DESC); + struct.token.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.environment != null) { + oprot.writeFieldBegin(ENVIRONMENT_FIELD_DESC); + oprot.writeString(struct.environment); + oprot.writeFieldEnd(); + } oprot.writeFieldStop(); oprot.writeStructEnd(); } } - private static class getServerVersion_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class timePhrase_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public getServerVersion_argsTupleScheme getScheme() { - return new getServerVersion_argsTupleScheme(); + public timePhrase_argsTupleScheme getScheme() { + return new timePhrase_argsTupleScheme(); } } - private static class getServerVersion_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class timePhrase_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, getServerVersion_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, timePhrase_args 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.isSetPhrase()) { + optionals.set(0); + } + if (struct.isSetCreds()) { + optionals.set(1); + } + if (struct.isSetToken()) { + optionals.set(2); + } + if (struct.isSetEnvironment()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.isSetPhrase()) { + oprot.writeString(struct.phrase); + } + if (struct.isSetCreds()) { + struct.creds.write(oprot); + } + if (struct.isSetToken()) { + struct.token.write(oprot); + } + if (struct.isSetEnvironment()) { + oprot.writeString(struct.environment); + } } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, getServerVersion_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, timePhrase_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(4); + if (incoming.get(0)) { + struct.phrase = iprot.readString(); + struct.setPhraseIsSet(true); + } + if (incoming.get(1)) { + struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); + struct.creds.read(iprot); + struct.setCredsIsSet(true); + } + if (incoming.get(2)) { + struct.token = new com.cinchapi.concourse.thrift.TransactionToken(); + struct.token.read(iprot); + struct.setTokenIsSet(true); + } + if (incoming.get(3)) { + struct.environment = iprot.readString(); + struct.setEnvironmentIsSet(true); + } } } @@ -688786,28 +691918,31 @@ private static S scheme(org.apache. } } - public static class getServerVersion_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("getServerVersion_result"); + public static class timePhrase_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("timePhrase_result"); - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0); + 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.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField EX2_FIELD_DESC = new org.apache.thrift.protocol.TField("ex2", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField EX3_FIELD_DESC = new org.apache.thrift.protocol.TField("ex3", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final org.apache.thrift.protocol.TField EX4_FIELD_DESC = new org.apache.thrift.protocol.TField("ex4", org.apache.thrift.protocol.TType.STRUCT, (short)4); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getServerVersion_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getServerVersion_resultTupleSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new timePhrase_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new timePhrase_resultTupleSchemeFactory(); - public @org.apache.thrift.annotation.Nullable java.lang.String success; // required + public long success; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2; // required - public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3; // required + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ParseException ex3; // required + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex4; // 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"), EX((short)1, "ex"), EX2((short)2, "ex2"), - EX3((short)3, "ex3"); + EX3((short)3, "ex3"), + EX4((short)4, "ex4"); private static final java.util.Map byName = new java.util.LinkedHashMap(); @@ -688831,6 +691966,8 @@ public static _Fields findByThriftId(int fieldId) { return EX2; case 3: // EX3 return EX3; + case 4: // EX4 + return EX4; default: return null; } @@ -688874,44 +692011,50 @@ public java.lang.String getFieldName() { } // 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.STRING))); + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.EX, new org.apache.thrift.meta_data.FieldMetaData("ex", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.SecurityException.class))); tmpMap.put(_Fields.EX2, new org.apache.thrift.meta_data.FieldMetaData("ex2", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.TransactionException.class))); tmpMap.put(_Fields.EX3, new org.apache.thrift.meta_data.FieldMetaData("ex3", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.ParseException.class))); + tmpMap.put(_Fields.EX4, new org.apache.thrift.meta_data.FieldMetaData("ex4", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.PermissionException.class))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getServerVersion_result.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(timePhrase_result.class, metaDataMap); } - public getServerVersion_result() { + public timePhrase_result() { } - public getServerVersion_result( - java.lang.String success, + public timePhrase_result( + long success, com.cinchapi.concourse.thrift.SecurityException ex, com.cinchapi.concourse.thrift.TransactionException ex2, - com.cinchapi.concourse.thrift.PermissionException ex3) + com.cinchapi.concourse.thrift.ParseException ex3, + com.cinchapi.concourse.thrift.PermissionException ex4) { this(); this.success = success; + setSuccessIsSet(true); this.ex = ex; this.ex2 = ex2; this.ex3 = ex3; + this.ex4 = ex4; } /** * Performs a deep copy on other. */ - public getServerVersion_result(getServerVersion_result other) { - if (other.isSetSuccess()) { - this.success = other.success; - } + public timePhrase_result(timePhrase_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; if (other.isSetEx()) { this.ex = new com.cinchapi.concourse.thrift.SecurityException(other.ex); } @@ -688919,46 +692062,49 @@ public getServerVersion_result(getServerVersion_result other) { this.ex2 = new com.cinchapi.concourse.thrift.TransactionException(other.ex2); } if (other.isSetEx3()) { - this.ex3 = new com.cinchapi.concourse.thrift.PermissionException(other.ex3); + this.ex3 = new com.cinchapi.concourse.thrift.ParseException(other.ex3); + } + if (other.isSetEx4()) { + this.ex4 = new com.cinchapi.concourse.thrift.PermissionException(other.ex4); } } @Override - public getServerVersion_result deepCopy() { - return new getServerVersion_result(this); + public timePhrase_result deepCopy() { + return new timePhrase_result(this); } @Override public void clear() { - this.success = null; + setSuccessIsSet(false); + this.success = 0; this.ex = null; this.ex2 = null; this.ex3 = null; + this.ex4 = null; } - @org.apache.thrift.annotation.Nullable - public java.lang.String getSuccess() { + public long getSuccess() { return this.success; } - public getServerVersion_result setSuccess(@org.apache.thrift.annotation.Nullable java.lang.String success) { + public timePhrase_result setSuccess(long success) { this.success = success; + setSuccessIsSet(true); return this; } public void unsetSuccess() { - this.success = null; + __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 this.success != null; + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } @org.apache.thrift.annotation.Nullable @@ -688966,7 +692112,7 @@ public com.cinchapi.concourse.thrift.SecurityException getEx() { return this.ex; } - public getServerVersion_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { + public timePhrase_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { this.ex = ex; return this; } @@ -688991,7 +692137,7 @@ public com.cinchapi.concourse.thrift.TransactionException getEx2() { return this.ex2; } - public getServerVersion_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { + public timePhrase_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { this.ex2 = ex2; return this; } @@ -689012,11 +692158,11 @@ public void setEx2IsSet(boolean value) { } @org.apache.thrift.annotation.Nullable - public com.cinchapi.concourse.thrift.PermissionException getEx3() { + public com.cinchapi.concourse.thrift.ParseException getEx3() { return this.ex3; } - public getServerVersion_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3) { + public timePhrase_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ParseException ex3) { this.ex3 = ex3; return this; } @@ -689036,6 +692182,31 @@ public void setEx3IsSet(boolean value) { } } + @org.apache.thrift.annotation.Nullable + public com.cinchapi.concourse.thrift.PermissionException getEx4() { + return this.ex4; + } + + public timePhrase_result setEx4(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex4) { + this.ex4 = ex4; + return this; + } + + public void unsetEx4() { + this.ex4 = null; + } + + /** Returns true if field ex4 is set (has been assigned a value) and false otherwise */ + public boolean isSetEx4() { + return this.ex4 != null; + } + + public void setEx4IsSet(boolean value) { + if (!value) { + this.ex4 = null; + } + } + @Override public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { @@ -689043,7 +692214,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetSuccess(); } else { - setSuccess((java.lang.String)value); + setSuccess((java.lang.Long)value); } break; @@ -689067,7 +692238,15 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetEx3(); } else { - setEx3((com.cinchapi.concourse.thrift.PermissionException)value); + setEx3((com.cinchapi.concourse.thrift.ParseException)value); + } + break; + + case EX4: + if (value == null) { + unsetEx4(); + } else { + setEx4((com.cinchapi.concourse.thrift.PermissionException)value); } break; @@ -689090,6 +692269,9 @@ public java.lang.Object getFieldValue(_Fields field) { case EX3: return getEx3(); + case EX4: + return getEx4(); + } throw new java.lang.IllegalStateException(); } @@ -689110,29 +692292,31 @@ public boolean isSet(_Fields field) { return isSetEx2(); case EX3: return isSetEx3(); + case EX4: + return isSetEx4(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { - if (that instanceof getServerVersion_result) - return this.equals((getServerVersion_result)that); + if (that instanceof timePhrase_result) + return this.equals((timePhrase_result)that); return false; } - public boolean equals(getServerVersion_result that) { + public boolean equals(timePhrase_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(); + 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.equals(that.success)) + if (this.success != that.success) return false; } @@ -689163,6 +692347,15 @@ public boolean equals(getServerVersion_result that) { return false; } + boolean this_present_ex4 = true && this.isSetEx4(); + boolean that_present_ex4 = true && that.isSetEx4(); + if (this_present_ex4 || that_present_ex4) { + if (!(this_present_ex4 && that_present_ex4)) + return false; + if (!this.ex4.equals(that.ex4)) + return false; + } + return true; } @@ -689170,9 +692363,7 @@ public boolean equals(getServerVersion_result that) { public int hashCode() { int hashCode = 1; - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(success); hashCode = hashCode * 8191 + ((isSetEx()) ? 131071 : 524287); if (isSetEx()) @@ -689186,11 +692377,15 @@ public int hashCode() { if (isSetEx3()) hashCode = hashCode * 8191 + ex3.hashCode(); + hashCode = hashCode * 8191 + ((isSetEx4()) ? 131071 : 524287); + if (isSetEx4()) + hashCode = hashCode * 8191 + ex4.hashCode(); + return hashCode; } @Override - public int compareTo(getServerVersion_result other) { + public int compareTo(timePhrase_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -689237,6 +692432,16 @@ public int compareTo(getServerVersion_result other) { return lastComparison; } } + lastComparison = java.lang.Boolean.compare(isSetEx4(), other.isSetEx4()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEx4()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex4, other.ex4); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -689257,15 +692462,11 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("getServerVersion_result("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("timePhrase_result("); boolean first = true; sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } + sb.append(this.success); first = false; if (!first) sb.append(", "); sb.append("ex:"); @@ -689291,6 +692492,14 @@ public java.lang.String toString() { sb.append(this.ex3); } first = false; + if (!first) sb.append(", "); + sb.append("ex4:"); + if (this.ex4 == null) { + sb.append("null"); + } else { + sb.append(this.ex4); + } + first = false; sb.append(")"); return sb.toString(); } @@ -689310,23 +692519,25 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept 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 getServerVersion_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class timePhrase_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public getServerVersion_resultStandardScheme getScheme() { - return new getServerVersion_resultStandardScheme(); + public timePhrase_resultStandardScheme getScheme() { + return new timePhrase_resultStandardScheme(); } } - private static class getServerVersion_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class timePhrase_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, getServerVersion_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, timePhrase_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -689337,8 +692548,8 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, getServerVersion_re } switch (schemeField.id) { case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.success = iprot.readString(); + 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); @@ -689364,13 +692575,22 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, getServerVersion_re break; case 3: // EX3 if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.ex3 = new com.cinchapi.concourse.thrift.PermissionException(); + struct.ex3 = new com.cinchapi.concourse.thrift.ParseException(); struct.ex3.read(iprot); struct.setEx3IsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 4: // EX4 + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ex4 = new com.cinchapi.concourse.thrift.PermissionException(); + struct.ex4.read(iprot); + struct.setEx4IsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -689383,13 +692603,13 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, getServerVersion_re } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, getServerVersion_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, timePhrase_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { + if (struct.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeString(struct.success); + oprot.writeI64(struct.success); oprot.writeFieldEnd(); } if (struct.ex != null) { @@ -689407,23 +692627,28 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, getServerVersion_r struct.ex3.write(oprot); oprot.writeFieldEnd(); } + if (struct.ex4 != null) { + oprot.writeFieldBegin(EX4_FIELD_DESC); + struct.ex4.write(oprot); + oprot.writeFieldEnd(); + } oprot.writeFieldStop(); oprot.writeStructEnd(); } } - private static class getServerVersion_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class timePhrase_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public getServerVersion_resultTupleScheme getScheme() { - return new getServerVersion_resultTupleScheme(); + public timePhrase_resultTupleScheme getScheme() { + return new timePhrase_resultTupleScheme(); } } - private static class getServerVersion_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class timePhrase_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, getServerVersion_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, timePhrase_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()) { @@ -689438,9 +692663,12 @@ public void write(org.apache.thrift.protocol.TProtocol prot, getServerVersion_re if (struct.isSetEx3()) { optionals.set(3); } - oprot.writeBitSet(optionals, 4); + if (struct.isSetEx4()) { + optionals.set(4); + } + oprot.writeBitSet(optionals, 5); if (struct.isSetSuccess()) { - oprot.writeString(struct.success); + oprot.writeI64(struct.success); } if (struct.isSetEx()) { struct.ex.write(oprot); @@ -689451,14 +692679,17 @@ public void write(org.apache.thrift.protocol.TProtocol prot, getServerVersion_re if (struct.isSetEx3()) { struct.ex3.write(oprot); } + if (struct.isSetEx4()) { + struct.ex4.write(oprot); + } } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, getServerVersion_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, timePhrase_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(4); + java.util.BitSet incoming = iprot.readBitSet(5); if (incoming.get(0)) { - struct.success = iprot.readString(); + struct.success = iprot.readI64(); struct.setSuccessIsSet(true); } if (incoming.get(1)) { @@ -689472,10 +692703,15 @@ public void read(org.apache.thrift.protocol.TProtocol prot, getServerVersion_res struct.setEx2IsSet(true); } if (incoming.get(3)) { - struct.ex3 = new com.cinchapi.concourse.thrift.PermissionException(); + struct.ex3 = new com.cinchapi.concourse.thrift.ParseException(); struct.ex3.read(iprot); struct.setEx3IsSet(true); } + if (incoming.get(4)) { + struct.ex4 = new com.cinchapi.concourse.thrift.PermissionException(); + struct.ex4.read(iprot); + struct.setEx4IsSet(true); + } } } @@ -689484,25 +692720,28 @@ private static S scheme(org.apache. } } - public static class time_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("time_args"); + public static class traceRecord_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("traceRecord_args"); - private static final org.apache.thrift.protocol.TField CREDS_FIELD_DESC = new org.apache.thrift.protocol.TField("creds", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRUCT, (short)2); - private static final org.apache.thrift.protocol.TField ENVIRONMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("environment", org.apache.thrift.protocol.TType.STRING, (short)3); + private static final org.apache.thrift.protocol.TField RECORD_FIELD_DESC = new org.apache.thrift.protocol.TField("record", org.apache.thrift.protocol.TType.I64, (short)1); + private static final org.apache.thrift.protocol.TField CREDS_FIELD_DESC = new org.apache.thrift.protocol.TField("creds", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final org.apache.thrift.protocol.TField TRANSACTION_FIELD_DESC = new org.apache.thrift.protocol.TField("transaction", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final org.apache.thrift.protocol.TField ENVIRONMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("environment", org.apache.thrift.protocol.TType.STRING, (short)4); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new time_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new time_argsTupleSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new traceRecord_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new traceRecord_argsTupleSchemeFactory(); + public long record; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds; // required - public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken token; // required + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction; // required public @org.apache.thrift.annotation.Nullable java.lang.String environment; // 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 { - CREDS((short)1, "creds"), - TOKEN((short)2, "token"), - ENVIRONMENT((short)3, "environment"); + RECORD((short)1, "record"), + CREDS((short)2, "creds"), + TRANSACTION((short)3, "transaction"), + ENVIRONMENT((short)4, "environment"); private static final java.util.Map byName = new java.util.LinkedHashMap(); @@ -689518,11 +692757,13 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { - case 1: // CREDS + case 1: // RECORD + return RECORD; + case 2: // CREDS return CREDS; - case 2: // TOKEN - return TOKEN; - case 3: // ENVIRONMENT + case 3: // TRANSACTION + return TRANSACTION; + case 4: // ENVIRONMENT return ENVIRONMENT; default: return null; @@ -689567,42 +692808,51 @@ public java.lang.String getFieldName() { } // isset id assignments + private static final int __RECORD_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.RECORD, new org.apache.thrift.meta_data.FieldMetaData("record", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.CREDS, new org.apache.thrift.meta_data.FieldMetaData("creds", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.AccessToken.class))); - tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.TRANSACTION, new org.apache.thrift.meta_data.FieldMetaData("transaction", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.TransactionToken.class))); tmpMap.put(_Fields.ENVIRONMENT, new org.apache.thrift.meta_data.FieldMetaData("environment", 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(time_args.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(traceRecord_args.class, metaDataMap); } - public time_args() { + public traceRecord_args() { } - public time_args( + public traceRecord_args( + long record, com.cinchapi.concourse.thrift.AccessToken creds, - com.cinchapi.concourse.thrift.TransactionToken token, + com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment) { this(); + this.record = record; + setRecordIsSet(true); this.creds = creds; - this.token = token; + this.transaction = transaction; this.environment = environment; } /** * Performs a deep copy on other. */ - public time_args(time_args other) { + public traceRecord_args(traceRecord_args other) { + __isset_bitfield = other.__isset_bitfield; + this.record = other.record; if (other.isSetCreds()) { this.creds = new com.cinchapi.concourse.thrift.AccessToken(other.creds); } - if (other.isSetToken()) { - this.token = new com.cinchapi.concourse.thrift.TransactionToken(other.token); + if (other.isSetTransaction()) { + this.transaction = new com.cinchapi.concourse.thrift.TransactionToken(other.transaction); } if (other.isSetEnvironment()) { this.environment = other.environment; @@ -689610,23 +692860,48 @@ public time_args(time_args other) { } @Override - public time_args deepCopy() { - return new time_args(this); + public traceRecord_args deepCopy() { + return new traceRecord_args(this); } @Override public void clear() { + setRecordIsSet(false); + this.record = 0; this.creds = null; - this.token = null; + this.transaction = null; this.environment = null; } + public long getRecord() { + return this.record; + } + + public traceRecord_args setRecord(long record) { + this.record = record; + setRecordIsSet(true); + return this; + } + + public void unsetRecord() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __RECORD_ISSET_ID); + } + + /** Returns true if field record is set (has been assigned a value) and false otherwise */ + public boolean isSetRecord() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __RECORD_ISSET_ID); + } + + public void setRecordIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __RECORD_ISSET_ID, value); + } + @org.apache.thrift.annotation.Nullable public com.cinchapi.concourse.thrift.AccessToken getCreds() { return this.creds; } - public time_args setCreds(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds) { + public traceRecord_args setCreds(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds) { this.creds = creds; return this; } @@ -689647,27 +692922,27 @@ public void setCredsIsSet(boolean value) { } @org.apache.thrift.annotation.Nullable - public com.cinchapi.concourse.thrift.TransactionToken getToken() { - return this.token; + public com.cinchapi.concourse.thrift.TransactionToken getTransaction() { + return this.transaction; } - public time_args setToken(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken token) { - this.token = token; + public traceRecord_args setTransaction(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction) { + this.transaction = transaction; return this; } - public void unsetToken() { - this.token = null; + public void unsetTransaction() { + this.transaction = null; } - /** Returns true if field token is set (has been assigned a value) and false otherwise */ - public boolean isSetToken() { - return this.token != null; + /** Returns true if field transaction is set (has been assigned a value) and false otherwise */ + public boolean isSetTransaction() { + return this.transaction != null; } - public void setTokenIsSet(boolean value) { + public void setTransactionIsSet(boolean value) { if (!value) { - this.token = null; + this.transaction = null; } } @@ -689676,7 +692951,7 @@ public java.lang.String getEnvironment() { return this.environment; } - public time_args setEnvironment(@org.apache.thrift.annotation.Nullable java.lang.String environment) { + public traceRecord_args setEnvironment(@org.apache.thrift.annotation.Nullable java.lang.String environment) { this.environment = environment; return this; } @@ -689699,6 +692974,14 @@ public void setEnvironmentIsSet(boolean value) { @Override public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { + case RECORD: + if (value == null) { + unsetRecord(); + } else { + setRecord((java.lang.Long)value); + } + break; + case CREDS: if (value == null) { unsetCreds(); @@ -689707,11 +692990,11 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } break; - case TOKEN: + case TRANSACTION: if (value == null) { - unsetToken(); + unsetTransaction(); } else { - setToken((com.cinchapi.concourse.thrift.TransactionToken)value); + setTransaction((com.cinchapi.concourse.thrift.TransactionToken)value); } break; @@ -689730,11 +693013,14 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable @Override public java.lang.Object getFieldValue(_Fields field) { switch (field) { + case RECORD: + return getRecord(); + case CREDS: return getCreds(); - case TOKEN: - return getToken(); + case TRANSACTION: + return getTransaction(); case ENVIRONMENT: return getEnvironment(); @@ -689751,10 +693037,12 @@ public boolean isSet(_Fields field) { } switch (field) { + case RECORD: + return isSetRecord(); case CREDS: return isSetCreds(); - case TOKEN: - return isSetToken(); + case TRANSACTION: + return isSetTransaction(); case ENVIRONMENT: return isSetEnvironment(); } @@ -689763,17 +693051,26 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that instanceof time_args) - return this.equals((time_args)that); + if (that instanceof traceRecord_args) + return this.equals((traceRecord_args)that); return false; } - public boolean equals(time_args that) { + public boolean equals(traceRecord_args that) { if (that == null) return false; if (this == that) return true; + boolean this_present_record = true; + boolean that_present_record = true; + if (this_present_record || that_present_record) { + if (!(this_present_record && that_present_record)) + return false; + if (this.record != that.record) + return false; + } + boolean this_present_creds = true && this.isSetCreds(); boolean that_present_creds = true && that.isSetCreds(); if (this_present_creds || that_present_creds) { @@ -689783,12 +693080,12 @@ public boolean equals(time_args that) { return false; } - boolean this_present_token = true && this.isSetToken(); - boolean that_present_token = true && that.isSetToken(); - if (this_present_token || that_present_token) { - if (!(this_present_token && that_present_token)) + boolean this_present_transaction = true && this.isSetTransaction(); + boolean that_present_transaction = true && that.isSetTransaction(); + if (this_present_transaction || that_present_transaction) { + if (!(this_present_transaction && that_present_transaction)) return false; - if (!this.token.equals(that.token)) + if (!this.transaction.equals(that.transaction)) return false; } @@ -689808,13 +693105,15 @@ public boolean equals(time_args that) { public int hashCode() { int hashCode = 1; + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(record); + hashCode = hashCode * 8191 + ((isSetCreds()) ? 131071 : 524287); if (isSetCreds()) hashCode = hashCode * 8191 + creds.hashCode(); - hashCode = hashCode * 8191 + ((isSetToken()) ? 131071 : 524287); - if (isSetToken()) - hashCode = hashCode * 8191 + token.hashCode(); + hashCode = hashCode * 8191 + ((isSetTransaction()) ? 131071 : 524287); + if (isSetTransaction()) + hashCode = hashCode * 8191 + transaction.hashCode(); hashCode = hashCode * 8191 + ((isSetEnvironment()) ? 131071 : 524287); if (isSetEnvironment()) @@ -689824,13 +693123,23 @@ public int hashCode() { } @Override - public int compareTo(time_args other) { + public int compareTo(traceRecord_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; + lastComparison = java.lang.Boolean.compare(isSetRecord(), other.isSetRecord()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRecord()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.record, other.record); + if (lastComparison != 0) { + return lastComparison; + } + } lastComparison = java.lang.Boolean.compare(isSetCreds(), other.isSetCreds()); if (lastComparison != 0) { return lastComparison; @@ -689841,12 +693150,12 @@ public int compareTo(time_args other) { return lastComparison; } } - lastComparison = java.lang.Boolean.compare(isSetToken(), other.isSetToken()); + lastComparison = java.lang.Boolean.compare(isSetTransaction(), other.isSetTransaction()); if (lastComparison != 0) { return lastComparison; } - if (isSetToken()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token); + if (isSetTransaction()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transaction, other.transaction); if (lastComparison != 0) { return lastComparison; } @@ -689882,9 +693191,13 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("time_args("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("traceRecord_args("); boolean first = true; + sb.append("record:"); + sb.append(this.record); + first = false; + if (!first) sb.append(", "); sb.append("creds:"); if (this.creds == null) { sb.append("null"); @@ -689893,11 +693206,11 @@ public java.lang.String toString() { } first = false; if (!first) sb.append(", "); - sb.append("token:"); - if (this.token == null) { + sb.append("transaction:"); + if (this.transaction == null) { sb.append("null"); } else { - sb.append(this.token); + sb.append(this.transaction); } first = false; if (!first) sb.append(", "); @@ -689918,8 +693231,8 @@ public void validate() throws org.apache.thrift.TException { if (creds != null) { creds.validate(); } - if (token != null) { - token.validate(); + if (transaction != null) { + transaction.validate(); } } @@ -689933,23 +693246,25 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept 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 time_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class traceRecord_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public time_argsStandardScheme getScheme() { - return new time_argsStandardScheme(); + public traceRecord_argsStandardScheme getScheme() { + return new traceRecord_argsStandardScheme(); } } - private static class time_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class traceRecord_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, time_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecord_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -689959,7 +693274,15 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, time_args struct) t break; } switch (schemeField.id) { - case 1: // CREDS + case 1: // RECORD + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.record = iprot.readI64(); + struct.setRecordIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // CREDS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); struct.creds.read(iprot); @@ -689968,16 +693291,16 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, time_args struct) t org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 2: // TOKEN + case 3: // TRANSACTION if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.token = new com.cinchapi.concourse.thrift.TransactionToken(); - struct.token.read(iprot); - struct.setTokenIsSet(true); + struct.transaction = new com.cinchapi.concourse.thrift.TransactionToken(); + struct.transaction.read(iprot); + struct.setTransactionIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 3: // ENVIRONMENT + case 4: // ENVIRONMENT if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.environment = iprot.readString(); struct.setEnvironmentIsSet(true); @@ -689997,18 +693320,21 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, time_args struct) t } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, time_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecord_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(RECORD_FIELD_DESC); + oprot.writeI64(struct.record); + oprot.writeFieldEnd(); if (struct.creds != null) { oprot.writeFieldBegin(CREDS_FIELD_DESC); struct.creds.write(oprot); oprot.writeFieldEnd(); } - if (struct.token != null) { - oprot.writeFieldBegin(TOKEN_FIELD_DESC); - struct.token.write(oprot); + if (struct.transaction != null) { + oprot.writeFieldBegin(TRANSACTION_FIELD_DESC); + struct.transaction.write(oprot); oprot.writeFieldEnd(); } if (struct.environment != null) { @@ -690022,34 +693348,40 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, time_args struct) } - private static class time_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class traceRecord_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public time_argsTupleScheme getScheme() { - return new time_argsTupleScheme(); + public traceRecord_argsTupleScheme getScheme() { + return new traceRecord_argsTupleScheme(); } } - private static class time_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class traceRecord_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, time_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, traceRecord_args 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.isSetCreds()) { + if (struct.isSetRecord()) { optionals.set(0); } - if (struct.isSetToken()) { + if (struct.isSetCreds()) { optionals.set(1); } - if (struct.isSetEnvironment()) { + if (struct.isSetTransaction()) { optionals.set(2); } - oprot.writeBitSet(optionals, 3); + if (struct.isSetEnvironment()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.isSetRecord()) { + oprot.writeI64(struct.record); + } if (struct.isSetCreds()) { struct.creds.write(oprot); } - if (struct.isSetToken()) { - struct.token.write(oprot); + if (struct.isSetTransaction()) { + struct.transaction.write(oprot); } if (struct.isSetEnvironment()) { oprot.writeString(struct.environment); @@ -690057,20 +693389,24 @@ public void write(org.apache.thrift.protocol.TProtocol prot, time_args struct) t } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, time_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, traceRecord_args 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); + java.util.BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { + struct.record = iprot.readI64(); + struct.setRecordIsSet(true); + } + if (incoming.get(1)) { struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); struct.creds.read(iprot); struct.setCredsIsSet(true); } - if (incoming.get(1)) { - struct.token = new com.cinchapi.concourse.thrift.TransactionToken(); - struct.token.read(iprot); - struct.setTokenIsSet(true); - } if (incoming.get(2)) { + struct.transaction = new com.cinchapi.concourse.thrift.TransactionToken(); + struct.transaction.read(iprot); + struct.setTransactionIsSet(true); + } + if (incoming.get(3)) { struct.environment = iprot.readString(); struct.setEnvironmentIsSet(true); } @@ -690082,18 +693418,18 @@ private static S scheme(org.apache. } } - public static class time_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("time_result"); + public static class traceRecord_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("traceRecord_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.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.MAP, (short)0); private static final org.apache.thrift.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField EX2_FIELD_DESC = new org.apache.thrift.protocol.TField("ex2", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField EX3_FIELD_DESC = new org.apache.thrift.protocol.TField("ex3", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new time_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new time_resultTupleSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new traceRecord_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new traceRecord_resultTupleSchemeFactory(); - public long success; // required + public @org.apache.thrift.annotation.Nullable java.util.Map> success; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3; // required @@ -690170,13 +693506,14 @@ public java.lang.String getFieldName() { } // 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))); + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), + new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))))); tmpMap.put(_Fields.EX, new org.apache.thrift.meta_data.FieldMetaData("ex", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.SecurityException.class))); tmpMap.put(_Fields.EX2, new org.apache.thrift.meta_data.FieldMetaData("ex2", org.apache.thrift.TFieldRequirementType.DEFAULT, @@ -690184,21 +693521,20 @@ public java.lang.String getFieldName() { tmpMap.put(_Fields.EX3, new org.apache.thrift.meta_data.FieldMetaData("ex3", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.PermissionException.class))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(time_result.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(traceRecord_result.class, metaDataMap); } - public time_result() { + public traceRecord_result() { } - public time_result( - long success, + public traceRecord_result( + java.util.Map> success, com.cinchapi.concourse.thrift.SecurityException ex, com.cinchapi.concourse.thrift.TransactionException ex2, com.cinchapi.concourse.thrift.PermissionException ex3) { this(); this.success = success; - setSuccessIsSet(true); this.ex = ex; this.ex2 = ex2; this.ex3 = ex3; @@ -690207,9 +693543,22 @@ public time_result( /** * Performs a deep copy on other. */ - public time_result(time_result other) { - __isset_bitfield = other.__isset_bitfield; - this.success = other.success; + public traceRecord_result(traceRecord_result other) { + if (other.isSetSuccess()) { + java.util.Map> __this__success = new java.util.LinkedHashMap>(other.success.size()); + for (java.util.Map.Entry> other_element : other.success.entrySet()) { + + java.lang.String other_element_key = other_element.getKey(); + java.util.Set other_element_value = other_element.getValue(); + + java.lang.String __this__success_copy_key = other_element_key; + + java.util.Set __this__success_copy_value = new java.util.LinkedHashSet(other_element_value); + + __this__success.put(__this__success_copy_key, __this__success_copy_value); + } + this.success = __this__success; + } if (other.isSetEx()) { this.ex = new com.cinchapi.concourse.thrift.SecurityException(other.ex); } @@ -690222,40 +693571,52 @@ public time_result(time_result other) { } @Override - public time_result deepCopy() { - return new time_result(this); + public traceRecord_result deepCopy() { + return new traceRecord_result(this); } @Override public void clear() { - setSuccessIsSet(false); - this.success = 0; + this.success = null; this.ex = null; this.ex2 = null; this.ex3 = null; } - public long getSuccess() { + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public void putToSuccess(java.lang.String key, java.util.Set val) { + if (this.success == null) { + this.success = new java.util.LinkedHashMap>(); + } + this.success.put(key, val); + } + + @org.apache.thrift.annotation.Nullable + public java.util.Map> getSuccess() { return this.success; } - public time_result setSuccess(long success) { + public traceRecord_result setSuccess(@org.apache.thrift.annotation.Nullable java.util.Map> success) { this.success = success; - setSuccessIsSet(true); return this; } public void unsetSuccess() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + this.success = null; } /** 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); + return this.success != null; } public void setSuccessIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + if (!value) { + this.success = null; + } } @org.apache.thrift.annotation.Nullable @@ -690263,7 +693624,7 @@ public com.cinchapi.concourse.thrift.SecurityException getEx() { return this.ex; } - public time_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { + public traceRecord_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { this.ex = ex; return this; } @@ -690288,7 +693649,7 @@ public com.cinchapi.concourse.thrift.TransactionException getEx2() { return this.ex2; } - public time_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { + public traceRecord_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { this.ex2 = ex2; return this; } @@ -690313,7 +693674,7 @@ public com.cinchapi.concourse.thrift.PermissionException getEx3() { return this.ex3; } - public time_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3) { + public traceRecord_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3) { this.ex3 = ex3; return this; } @@ -690340,7 +693701,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetSuccess(); } else { - setSuccess((java.lang.Long)value); + setSuccess((java.util.Map>)value); } break; @@ -690413,23 +693774,23 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that instanceof time_result) - return this.equals((time_result)that); + if (that instanceof traceRecord_result) + return this.equals((traceRecord_result)that); return false; } - public boolean equals(time_result that) { + public boolean equals(traceRecord_result that) { if (that == null) return false; if (this == that) return true; - boolean this_present_success = true; - boolean that_present_success = 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 != that.success) + if (!this.success.equals(that.success)) return false; } @@ -690467,7 +693828,9 @@ public boolean equals(time_result that) { public int hashCode() { int hashCode = 1; - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(success); + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); hashCode = hashCode * 8191 + ((isSetEx()) ? 131071 : 524287); if (isSetEx()) @@ -690485,7 +693848,7 @@ public int hashCode() { } @Override - public int compareTo(time_result other) { + public int compareTo(traceRecord_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -690552,11 +693915,15 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("time_result("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("traceRecord_result("); boolean first = true; sb.append("success:"); - sb.append(this.success); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } first = false; if (!first) sb.append(", "); sb.append("ex:"); @@ -690601,25 +693968,23 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept 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 time_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class traceRecord_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public time_resultStandardScheme getScheme() { - return new time_resultStandardScheme(); + public traceRecord_resultStandardScheme getScheme() { + return new traceRecord_resultStandardScheme(); } } - private static class time_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class traceRecord_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, time_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecord_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -690630,8 +693995,30 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, time_result struct) } switch (schemeField.id) { case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.success = iprot.readI64(); + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map7040 = iprot.readMapBegin(); + struct.success = new java.util.LinkedHashMap>(2*_map7040.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key7041; + @org.apache.thrift.annotation.Nullable java.util.Set _val7042; + for (int _i7043 = 0; _i7043 < _map7040.size; ++_i7043) + { + _key7041 = iprot.readString(); + { + org.apache.thrift.protocol.TSet _set7044 = iprot.readSetBegin(); + _val7042 = new java.util.LinkedHashSet(2*_set7044.size); + long _elem7045; + for (int _i7046 = 0; _i7046 < _set7044.size; ++_i7046) + { + _elem7045 = iprot.readI64(); + _val7042.add(_elem7045); + } + iprot.readSetEnd(); + } + struct.success.put(_key7041, _val7042); + } + iprot.readMapEnd(); + } struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); @@ -690676,13 +694063,28 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, time_result struct) } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, time_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecord_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); - if (struct.isSetSuccess()) { + if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeI64(struct.success); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.SET, struct.success.size())); + for (java.util.Map.Entry> _iter7047 : struct.success.entrySet()) + { + oprot.writeString(_iter7047.getKey()); + { + oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I64, _iter7047.getValue().size())); + for (long _iter7048 : _iter7047.getValue()) + { + oprot.writeI64(_iter7048); + } + oprot.writeSetEnd(); + } + } + oprot.writeMapEnd(); + } oprot.writeFieldEnd(); } if (struct.ex != null) { @@ -690706,17 +694108,17 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, time_result struct } - private static class time_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class traceRecord_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public time_resultTupleScheme getScheme() { - return new time_resultTupleScheme(); + public traceRecord_resultTupleScheme getScheme() { + return new traceRecord_resultTupleScheme(); } } - private static class time_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class traceRecord_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, time_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, traceRecord_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()) { @@ -690733,7 +694135,20 @@ public void write(org.apache.thrift.protocol.TProtocol prot, time_result struct) } oprot.writeBitSet(optionals, 4); if (struct.isSetSuccess()) { - oprot.writeI64(struct.success); + { + oprot.writeI32(struct.success.size()); + for (java.util.Map.Entry> _iter7049 : struct.success.entrySet()) + { + oprot.writeString(_iter7049.getKey()); + { + oprot.writeI32(_iter7049.getValue().size()); + for (long _iter7050 : _iter7049.getValue()) + { + oprot.writeI64(_iter7050); + } + } + } + } } if (struct.isSetEx()) { struct.ex.write(oprot); @@ -690747,11 +694162,31 @@ public void write(org.apache.thrift.protocol.TProtocol prot, time_result struct) } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, time_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, traceRecord_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(4); if (incoming.get(0)) { - struct.success = iprot.readI64(); + { + org.apache.thrift.protocol.TMap _map7051 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.SET); + struct.success = new java.util.LinkedHashMap>(2*_map7051.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key7052; + @org.apache.thrift.annotation.Nullable java.util.Set _val7053; + for (int _i7054 = 0; _i7054 < _map7051.size; ++_i7054) + { + _key7052 = iprot.readString(); + { + org.apache.thrift.protocol.TSet _set7055 = iprot.readSetBegin(org.apache.thrift.protocol.TType.I64); + _val7053 = new java.util.LinkedHashSet(2*_set7055.size); + long _elem7056; + for (int _i7057 = 0; _i7057 < _set7055.size; ++_i7057) + { + _elem7056 = iprot.readI64(); + _val7053.add(_elem7056); + } + } + struct.success.put(_key7052, _val7053); + } + } struct.setSuccessIsSet(true); } if (incoming.get(1)) { @@ -690777,28 +694212,31 @@ private static S scheme(org.apache. } } - public static class timePhrase_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("timePhrase_args"); + public static class traceRecordTime_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("traceRecordTime_args"); - private static final org.apache.thrift.protocol.TField PHRASE_FIELD_DESC = new org.apache.thrift.protocol.TField("phrase", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField CREDS_FIELD_DESC = new org.apache.thrift.protocol.TField("creds", org.apache.thrift.protocol.TType.STRUCT, (short)2); - private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.protocol.TField ENVIRONMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("environment", org.apache.thrift.protocol.TType.STRING, (short)4); + private static final org.apache.thrift.protocol.TField RECORD_FIELD_DESC = new org.apache.thrift.protocol.TField("record", org.apache.thrift.protocol.TType.I64, (short)1); + private static final org.apache.thrift.protocol.TField TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("timestamp", org.apache.thrift.protocol.TType.I64, (short)2); + private static final org.apache.thrift.protocol.TField CREDS_FIELD_DESC = new org.apache.thrift.protocol.TField("creds", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final org.apache.thrift.protocol.TField TRANSACTION_FIELD_DESC = new org.apache.thrift.protocol.TField("transaction", org.apache.thrift.protocol.TType.STRUCT, (short)4); + private static final org.apache.thrift.protocol.TField ENVIRONMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("environment", org.apache.thrift.protocol.TType.STRING, (short)5); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new timePhrase_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new timePhrase_argsTupleSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new traceRecordTime_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new traceRecordTime_argsTupleSchemeFactory(); - public @org.apache.thrift.annotation.Nullable java.lang.String phrase; // required + public long record; // required + public long timestamp; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds; // required - public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken token; // required + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction; // required public @org.apache.thrift.annotation.Nullable java.lang.String environment; // 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 { - PHRASE((short)1, "phrase"), - CREDS((short)2, "creds"), - TOKEN((short)3, "token"), - ENVIRONMENT((short)4, "environment"); + RECORD((short)1, "record"), + TIMESTAMP((short)2, "timestamp"), + CREDS((short)3, "creds"), + TRANSACTION((short)4, "transaction"), + ENVIRONMENT((short)5, "environment"); private static final java.util.Map byName = new java.util.LinkedHashMap(); @@ -690814,13 +694252,15 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { - case 1: // PHRASE - return PHRASE; - case 2: // CREDS + case 1: // RECORD + return RECORD; + case 2: // TIMESTAMP + return TIMESTAMP; + case 3: // CREDS return CREDS; - case 3: // TOKEN - return TOKEN; - case 4: // ENVIRONMENT + case 4: // TRANSACTION + return TRANSACTION; + case 5: // ENVIRONMENT return ENVIRONMENT; default: return null; @@ -690865,49 +694305,58 @@ public java.lang.String getFieldName() { } // isset id assignments + private static final int __RECORD_ISSET_ID = 0; + private static final int __TIMESTAMP_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.PHRASE, new org.apache.thrift.meta_data.FieldMetaData("phrase", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.RECORD, new org.apache.thrift.meta_data.FieldMetaData("record", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.CREDS, new org.apache.thrift.meta_data.FieldMetaData("creds", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.AccessToken.class))); - tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.TRANSACTION, new org.apache.thrift.meta_data.FieldMetaData("transaction", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.TransactionToken.class))); tmpMap.put(_Fields.ENVIRONMENT, new org.apache.thrift.meta_data.FieldMetaData("environment", 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(timePhrase_args.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(traceRecordTime_args.class, metaDataMap); } - public timePhrase_args() { + public traceRecordTime_args() { } - public timePhrase_args( - java.lang.String phrase, + public traceRecordTime_args( + long record, + long timestamp, com.cinchapi.concourse.thrift.AccessToken creds, - com.cinchapi.concourse.thrift.TransactionToken token, + com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment) { this(); - this.phrase = phrase; + this.record = record; + setRecordIsSet(true); + this.timestamp = timestamp; + setTimestampIsSet(true); this.creds = creds; - this.token = token; + this.transaction = transaction; this.environment = environment; } /** * Performs a deep copy on other. */ - public timePhrase_args(timePhrase_args other) { - if (other.isSetPhrase()) { - this.phrase = other.phrase; - } + public traceRecordTime_args(traceRecordTime_args other) { + __isset_bitfield = other.__isset_bitfield; + this.record = other.record; + this.timestamp = other.timestamp; if (other.isSetCreds()) { this.creds = new com.cinchapi.concourse.thrift.AccessToken(other.creds); } - if (other.isSetToken()) { - this.token = new com.cinchapi.concourse.thrift.TransactionToken(other.token); + if (other.isSetTransaction()) { + this.transaction = new com.cinchapi.concourse.thrift.TransactionToken(other.transaction); } if (other.isSetEnvironment()) { this.environment = other.environment; @@ -690915,41 +694364,65 @@ public timePhrase_args(timePhrase_args other) { } @Override - public timePhrase_args deepCopy() { - return new timePhrase_args(this); + public traceRecordTime_args deepCopy() { + return new traceRecordTime_args(this); } @Override public void clear() { - this.phrase = null; + setRecordIsSet(false); + this.record = 0; + setTimestampIsSet(false); + this.timestamp = 0; this.creds = null; - this.token = null; + this.transaction = null; this.environment = null; } - @org.apache.thrift.annotation.Nullable - public java.lang.String getPhrase() { - return this.phrase; + public long getRecord() { + return this.record; } - public timePhrase_args setPhrase(@org.apache.thrift.annotation.Nullable java.lang.String phrase) { - this.phrase = phrase; + public traceRecordTime_args setRecord(long record) { + this.record = record; + setRecordIsSet(true); return this; } - public void unsetPhrase() { - this.phrase = null; + public void unsetRecord() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __RECORD_ISSET_ID); } - /** Returns true if field phrase is set (has been assigned a value) and false otherwise */ - public boolean isSetPhrase() { - return this.phrase != null; + /** Returns true if field record is set (has been assigned a value) and false otherwise */ + public boolean isSetRecord() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __RECORD_ISSET_ID); } - public void setPhraseIsSet(boolean value) { - if (!value) { - this.phrase = null; - } + public void setRecordIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __RECORD_ISSET_ID, value); + } + + public long getTimestamp() { + return this.timestamp; + } + + public traceRecordTime_args setTimestamp(long timestamp) { + this.timestamp = timestamp; + setTimestampIsSet(true); + return this; + } + + public void unsetTimestamp() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + } + + /** Returns true if field timestamp is set (has been assigned a value) and false otherwise */ + public boolean isSetTimestamp() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + } + + public void setTimestampIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TIMESTAMP_ISSET_ID, value); } @org.apache.thrift.annotation.Nullable @@ -690957,7 +694430,7 @@ public com.cinchapi.concourse.thrift.AccessToken getCreds() { return this.creds; } - public timePhrase_args setCreds(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds) { + public traceRecordTime_args setCreds(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds) { this.creds = creds; return this; } @@ -690978,27 +694451,27 @@ public void setCredsIsSet(boolean value) { } @org.apache.thrift.annotation.Nullable - public com.cinchapi.concourse.thrift.TransactionToken getToken() { - return this.token; + public com.cinchapi.concourse.thrift.TransactionToken getTransaction() { + return this.transaction; } - public timePhrase_args setToken(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken token) { - this.token = token; + public traceRecordTime_args setTransaction(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction) { + this.transaction = transaction; return this; } - public void unsetToken() { - this.token = null; + public void unsetTransaction() { + this.transaction = null; } - /** Returns true if field token is set (has been assigned a value) and false otherwise */ - public boolean isSetToken() { - return this.token != null; + /** Returns true if field transaction is set (has been assigned a value) and false otherwise */ + public boolean isSetTransaction() { + return this.transaction != null; } - public void setTokenIsSet(boolean value) { + public void setTransactionIsSet(boolean value) { if (!value) { - this.token = null; + this.transaction = null; } } @@ -691007,7 +694480,7 @@ public java.lang.String getEnvironment() { return this.environment; } - public timePhrase_args setEnvironment(@org.apache.thrift.annotation.Nullable java.lang.String environment) { + public traceRecordTime_args setEnvironment(@org.apache.thrift.annotation.Nullable java.lang.String environment) { this.environment = environment; return this; } @@ -691030,11 +694503,19 @@ public void setEnvironmentIsSet(boolean value) { @Override public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { - case PHRASE: + case RECORD: if (value == null) { - unsetPhrase(); + unsetRecord(); } else { - setPhrase((java.lang.String)value); + setRecord((java.lang.Long)value); + } + break; + + case TIMESTAMP: + if (value == null) { + unsetTimestamp(); + } else { + setTimestamp((java.lang.Long)value); } break; @@ -691046,11 +694527,11 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } break; - case TOKEN: + case TRANSACTION: if (value == null) { - unsetToken(); + unsetTransaction(); } else { - setToken((com.cinchapi.concourse.thrift.TransactionToken)value); + setTransaction((com.cinchapi.concourse.thrift.TransactionToken)value); } break; @@ -691069,14 +694550,17 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable @Override public java.lang.Object getFieldValue(_Fields field) { switch (field) { - case PHRASE: - return getPhrase(); + case RECORD: + return getRecord(); + + case TIMESTAMP: + return getTimestamp(); case CREDS: return getCreds(); - case TOKEN: - return getToken(); + case TRANSACTION: + return getTransaction(); case ENVIRONMENT: return getEnvironment(); @@ -691093,12 +694577,14 @@ public boolean isSet(_Fields field) { } switch (field) { - case PHRASE: - return isSetPhrase(); + case RECORD: + return isSetRecord(); + case TIMESTAMP: + return isSetTimestamp(); case CREDS: return isSetCreds(); - case TOKEN: - return isSetToken(); + case TRANSACTION: + return isSetTransaction(); case ENVIRONMENT: return isSetEnvironment(); } @@ -691107,23 +694593,32 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that instanceof timePhrase_args) - return this.equals((timePhrase_args)that); + if (that instanceof traceRecordTime_args) + return this.equals((traceRecordTime_args)that); return false; } - public boolean equals(timePhrase_args that) { + public boolean equals(traceRecordTime_args that) { if (that == null) return false; if (this == that) return true; - boolean this_present_phrase = true && this.isSetPhrase(); - boolean that_present_phrase = true && that.isSetPhrase(); - if (this_present_phrase || that_present_phrase) { - if (!(this_present_phrase && that_present_phrase)) + boolean this_present_record = true; + boolean that_present_record = true; + if (this_present_record || that_present_record) { + if (!(this_present_record && that_present_record)) return false; - if (!this.phrase.equals(that.phrase)) + if (this.record != that.record) + return false; + } + + boolean this_present_timestamp = true; + boolean that_present_timestamp = true; + if (this_present_timestamp || that_present_timestamp) { + if (!(this_present_timestamp && that_present_timestamp)) + return false; + if (this.timestamp != that.timestamp) return false; } @@ -691136,12 +694631,12 @@ public boolean equals(timePhrase_args that) { return false; } - boolean this_present_token = true && this.isSetToken(); - boolean that_present_token = true && that.isSetToken(); - if (this_present_token || that_present_token) { - if (!(this_present_token && that_present_token)) + boolean this_present_transaction = true && this.isSetTransaction(); + boolean that_present_transaction = true && that.isSetTransaction(); + if (this_present_transaction || that_present_transaction) { + if (!(this_present_transaction && that_present_transaction)) return false; - if (!this.token.equals(that.token)) + if (!this.transaction.equals(that.transaction)) return false; } @@ -691161,17 +694656,17 @@ public boolean equals(timePhrase_args that) { public int hashCode() { int hashCode = 1; - hashCode = hashCode * 8191 + ((isSetPhrase()) ? 131071 : 524287); - if (isSetPhrase()) - hashCode = hashCode * 8191 + phrase.hashCode(); + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(record); + + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(timestamp); hashCode = hashCode * 8191 + ((isSetCreds()) ? 131071 : 524287); if (isSetCreds()) hashCode = hashCode * 8191 + creds.hashCode(); - hashCode = hashCode * 8191 + ((isSetToken()) ? 131071 : 524287); - if (isSetToken()) - hashCode = hashCode * 8191 + token.hashCode(); + hashCode = hashCode * 8191 + ((isSetTransaction()) ? 131071 : 524287); + if (isSetTransaction()) + hashCode = hashCode * 8191 + transaction.hashCode(); hashCode = hashCode * 8191 + ((isSetEnvironment()) ? 131071 : 524287); if (isSetEnvironment()) @@ -691181,19 +694676,29 @@ public int hashCode() { } @Override - public int compareTo(timePhrase_args other) { + public int compareTo(traceRecordTime_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; - lastComparison = java.lang.Boolean.compare(isSetPhrase(), other.isSetPhrase()); + lastComparison = java.lang.Boolean.compare(isSetRecord(), other.isSetRecord()); if (lastComparison != 0) { return lastComparison; } - if (isSetPhrase()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.phrase, other.phrase); + if (isSetRecord()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.record, other.record); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetTimestamp(), other.isSetTimestamp()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTimestamp()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, other.timestamp); if (lastComparison != 0) { return lastComparison; } @@ -691208,12 +694713,12 @@ public int compareTo(timePhrase_args other) { return lastComparison; } } - lastComparison = java.lang.Boolean.compare(isSetToken(), other.isSetToken()); + lastComparison = java.lang.Boolean.compare(isSetTransaction(), other.isSetTransaction()); if (lastComparison != 0) { return lastComparison; } - if (isSetToken()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token); + if (isSetTransaction()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transaction, other.transaction); if (lastComparison != 0) { return lastComparison; } @@ -691249,15 +694754,15 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("timePhrase_args("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("traceRecordTime_args("); boolean first = true; - sb.append("phrase:"); - if (this.phrase == null) { - sb.append("null"); - } else { - sb.append(this.phrase); - } + sb.append("record:"); + sb.append(this.record); + first = false; + if (!first) sb.append(", "); + sb.append("timestamp:"); + sb.append(this.timestamp); first = false; if (!first) sb.append(", "); sb.append("creds:"); @@ -691268,11 +694773,11 @@ public java.lang.String toString() { } first = false; if (!first) sb.append(", "); - sb.append("token:"); - if (this.token == null) { + sb.append("transaction:"); + if (this.transaction == null) { sb.append("null"); } else { - sb.append(this.token); + sb.append(this.transaction); } first = false; if (!first) sb.append(", "); @@ -691293,8 +694798,8 @@ public void validate() throws org.apache.thrift.TException { if (creds != null) { creds.validate(); } - if (token != null) { - token.validate(); + if (transaction != null) { + transaction.validate(); } } @@ -691308,23 +694813,25 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept 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 timePhrase_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class traceRecordTime_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public timePhrase_argsStandardScheme getScheme() { - return new timePhrase_argsStandardScheme(); + public traceRecordTime_argsStandardScheme getScheme() { + return new traceRecordTime_argsStandardScheme(); } } - private static class timePhrase_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class traceRecordTime_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, timePhrase_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordTime_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -691334,15 +694841,23 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, timePhrase_args str break; } switch (schemeField.id) { - case 1: // PHRASE - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.phrase = iprot.readString(); - struct.setPhraseIsSet(true); + case 1: // RECORD + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.record = iprot.readI64(); + struct.setRecordIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 2: // CREDS + case 2: // TIMESTAMP + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // CREDS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); struct.creds.read(iprot); @@ -691351,16 +694866,16 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, timePhrase_args str org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 3: // TOKEN + case 4: // TRANSACTION if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.token = new com.cinchapi.concourse.thrift.TransactionToken(); - struct.token.read(iprot); - struct.setTokenIsSet(true); + struct.transaction = new com.cinchapi.concourse.thrift.TransactionToken(); + struct.transaction.read(iprot); + struct.setTransactionIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 4: // ENVIRONMENT + case 5: // ENVIRONMENT if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.environment = iprot.readString(); struct.setEnvironmentIsSet(true); @@ -691380,23 +694895,24 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, timePhrase_args str } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, timePhrase_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecordTime_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); - if (struct.phrase != null) { - oprot.writeFieldBegin(PHRASE_FIELD_DESC); - oprot.writeString(struct.phrase); - oprot.writeFieldEnd(); - } + oprot.writeFieldBegin(RECORD_FIELD_DESC); + oprot.writeI64(struct.record); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC); + oprot.writeI64(struct.timestamp); + oprot.writeFieldEnd(); if (struct.creds != null) { oprot.writeFieldBegin(CREDS_FIELD_DESC); struct.creds.write(oprot); oprot.writeFieldEnd(); } - if (struct.token != null) { - oprot.writeFieldBegin(TOKEN_FIELD_DESC); - struct.token.write(oprot); + if (struct.transaction != null) { + oprot.writeFieldBegin(TRANSACTION_FIELD_DESC); + struct.transaction.write(oprot); oprot.writeFieldEnd(); } if (struct.environment != null) { @@ -691410,40 +694926,46 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, timePhrase_args st } - private static class timePhrase_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class traceRecordTime_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public timePhrase_argsTupleScheme getScheme() { - return new timePhrase_argsTupleScheme(); + public traceRecordTime_argsTupleScheme getScheme() { + return new traceRecordTime_argsTupleScheme(); } } - private static class timePhrase_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class traceRecordTime_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, timePhrase_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordTime_args 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.isSetPhrase()) { + if (struct.isSetRecord()) { optionals.set(0); } - if (struct.isSetCreds()) { + if (struct.isSetTimestamp()) { optionals.set(1); } - if (struct.isSetToken()) { + if (struct.isSetCreds()) { optionals.set(2); } - if (struct.isSetEnvironment()) { + if (struct.isSetTransaction()) { optionals.set(3); } - oprot.writeBitSet(optionals, 4); - if (struct.isSetPhrase()) { - oprot.writeString(struct.phrase); + if (struct.isSetEnvironment()) { + optionals.set(4); + } + oprot.writeBitSet(optionals, 5); + if (struct.isSetRecord()) { + oprot.writeI64(struct.record); + } + if (struct.isSetTimestamp()) { + oprot.writeI64(struct.timestamp); } if (struct.isSetCreds()) { struct.creds.write(oprot); } - if (struct.isSetToken()) { - struct.token.write(oprot); + if (struct.isSetTransaction()) { + struct.transaction.write(oprot); } if (struct.isSetEnvironment()) { oprot.writeString(struct.environment); @@ -691451,24 +694973,28 @@ public void write(org.apache.thrift.protocol.TProtocol prot, timePhrase_args str } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, timePhrase_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, traceRecordTime_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(4); + java.util.BitSet incoming = iprot.readBitSet(5); if (incoming.get(0)) { - struct.phrase = iprot.readString(); - struct.setPhraseIsSet(true); + struct.record = iprot.readI64(); + struct.setRecordIsSet(true); } if (incoming.get(1)) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + } + if (incoming.get(2)) { struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); struct.creds.read(iprot); struct.setCredsIsSet(true); } - if (incoming.get(2)) { - struct.token = new com.cinchapi.concourse.thrift.TransactionToken(); - struct.token.read(iprot); - struct.setTokenIsSet(true); - } if (incoming.get(3)) { + struct.transaction = new com.cinchapi.concourse.thrift.TransactionToken(); + struct.transaction.read(iprot); + struct.setTransactionIsSet(true); + } + if (incoming.get(4)) { struct.environment = iprot.readString(); struct.setEnvironmentIsSet(true); } @@ -691480,31 +695006,28 @@ private static S scheme(org.apache. } } - public static class timePhrase_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("timePhrase_result"); + public static class traceRecordTime_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("traceRecordTime_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.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.MAP, (short)0); private static final org.apache.thrift.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField EX2_FIELD_DESC = new org.apache.thrift.protocol.TField("ex2", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField EX3_FIELD_DESC = new org.apache.thrift.protocol.TField("ex3", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.protocol.TField EX4_FIELD_DESC = new org.apache.thrift.protocol.TField("ex4", org.apache.thrift.protocol.TType.STRUCT, (short)4); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new timePhrase_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new timePhrase_resultTupleSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new traceRecordTime_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new traceRecordTime_resultTupleSchemeFactory(); - public long success; // required + public @org.apache.thrift.annotation.Nullable java.util.Map> success; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2; // required - public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ParseException ex3; // required - public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex4; // required + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3; // 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"), EX((short)1, "ex"), EX2((short)2, "ex2"), - EX3((short)3, "ex3"), - EX4((short)4, "ex4"); + EX3((short)3, "ex3"); private static final java.util.Map byName = new java.util.LinkedHashMap(); @@ -691528,8 +695051,6 @@ public static _Fields findByThriftId(int fieldId) { return EX2; case 3: // EX3 return EX3; - case 4: // EX4 - return EX4; default: return null; } @@ -691573,50 +695094,59 @@ public java.lang.String getFieldName() { } // 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))); + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), + new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))))); tmpMap.put(_Fields.EX, new org.apache.thrift.meta_data.FieldMetaData("ex", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.SecurityException.class))); tmpMap.put(_Fields.EX2, new org.apache.thrift.meta_data.FieldMetaData("ex2", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.TransactionException.class))); tmpMap.put(_Fields.EX3, new org.apache.thrift.meta_data.FieldMetaData("ex3", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.ParseException.class))); - tmpMap.put(_Fields.EX4, new org.apache.thrift.meta_data.FieldMetaData("ex4", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.PermissionException.class))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(timePhrase_result.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(traceRecordTime_result.class, metaDataMap); } - public timePhrase_result() { + public traceRecordTime_result() { } - public timePhrase_result( - long success, + public traceRecordTime_result( + java.util.Map> success, com.cinchapi.concourse.thrift.SecurityException ex, com.cinchapi.concourse.thrift.TransactionException ex2, - com.cinchapi.concourse.thrift.ParseException ex3, - com.cinchapi.concourse.thrift.PermissionException ex4) + com.cinchapi.concourse.thrift.PermissionException ex3) { this(); this.success = success; - setSuccessIsSet(true); this.ex = ex; this.ex2 = ex2; this.ex3 = ex3; - this.ex4 = ex4; } /** * Performs a deep copy on other. */ - public timePhrase_result(timePhrase_result other) { - __isset_bitfield = other.__isset_bitfield; - this.success = other.success; + public traceRecordTime_result(traceRecordTime_result other) { + if (other.isSetSuccess()) { + java.util.Map> __this__success = new java.util.LinkedHashMap>(other.success.size()); + for (java.util.Map.Entry> other_element : other.success.entrySet()) { + + java.lang.String other_element_key = other_element.getKey(); + java.util.Set other_element_value = other_element.getValue(); + + java.lang.String __this__success_copy_key = other_element_key; + + java.util.Set __this__success_copy_value = new java.util.LinkedHashSet(other_element_value); + + __this__success.put(__this__success_copy_key, __this__success_copy_value); + } + this.success = __this__success; + } if (other.isSetEx()) { this.ex = new com.cinchapi.concourse.thrift.SecurityException(other.ex); } @@ -691624,49 +695154,57 @@ public timePhrase_result(timePhrase_result other) { this.ex2 = new com.cinchapi.concourse.thrift.TransactionException(other.ex2); } if (other.isSetEx3()) { - this.ex3 = new com.cinchapi.concourse.thrift.ParseException(other.ex3); - } - if (other.isSetEx4()) { - this.ex4 = new com.cinchapi.concourse.thrift.PermissionException(other.ex4); + this.ex3 = new com.cinchapi.concourse.thrift.PermissionException(other.ex3); } } @Override - public timePhrase_result deepCopy() { - return new timePhrase_result(this); + public traceRecordTime_result deepCopy() { + return new traceRecordTime_result(this); } @Override public void clear() { - setSuccessIsSet(false); - this.success = 0; + this.success = null; this.ex = null; this.ex2 = null; this.ex3 = null; - this.ex4 = null; } - public long getSuccess() { + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public void putToSuccess(java.lang.String key, java.util.Set val) { + if (this.success == null) { + this.success = new java.util.LinkedHashMap>(); + } + this.success.put(key, val); + } + + @org.apache.thrift.annotation.Nullable + public java.util.Map> getSuccess() { return this.success; } - public timePhrase_result setSuccess(long success) { + public traceRecordTime_result setSuccess(@org.apache.thrift.annotation.Nullable java.util.Map> success) { this.success = success; - setSuccessIsSet(true); return this; } public void unsetSuccess() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + this.success = null; } /** 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); + return this.success != null; } public void setSuccessIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + if (!value) { + this.success = null; + } } @org.apache.thrift.annotation.Nullable @@ -691674,7 +695212,7 @@ public com.cinchapi.concourse.thrift.SecurityException getEx() { return this.ex; } - public timePhrase_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { + public traceRecordTime_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { this.ex = ex; return this; } @@ -691699,7 +695237,7 @@ public com.cinchapi.concourse.thrift.TransactionException getEx2() { return this.ex2; } - public timePhrase_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { + public traceRecordTime_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { this.ex2 = ex2; return this; } @@ -691720,11 +695258,11 @@ public void setEx2IsSet(boolean value) { } @org.apache.thrift.annotation.Nullable - public com.cinchapi.concourse.thrift.ParseException getEx3() { + public com.cinchapi.concourse.thrift.PermissionException getEx3() { return this.ex3; } - public timePhrase_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ParseException ex3) { + public traceRecordTime_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3) { this.ex3 = ex3; return this; } @@ -691744,31 +695282,6 @@ public void setEx3IsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable - public com.cinchapi.concourse.thrift.PermissionException getEx4() { - return this.ex4; - } - - public timePhrase_result setEx4(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex4) { - this.ex4 = ex4; - return this; - } - - public void unsetEx4() { - this.ex4 = null; - } - - /** Returns true if field ex4 is set (has been assigned a value) and false otherwise */ - public boolean isSetEx4() { - return this.ex4 != null; - } - - public void setEx4IsSet(boolean value) { - if (!value) { - this.ex4 = null; - } - } - @Override public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { @@ -691776,7 +695289,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetSuccess(); } else { - setSuccess((java.lang.Long)value); + setSuccess((java.util.Map>)value); } break; @@ -691800,15 +695313,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetEx3(); } else { - setEx3((com.cinchapi.concourse.thrift.ParseException)value); - } - break; - - case EX4: - if (value == null) { - unsetEx4(); - } else { - setEx4((com.cinchapi.concourse.thrift.PermissionException)value); + setEx3((com.cinchapi.concourse.thrift.PermissionException)value); } break; @@ -691831,9 +695336,6 @@ public java.lang.Object getFieldValue(_Fields field) { case EX3: return getEx3(); - case EX4: - return getEx4(); - } throw new java.lang.IllegalStateException(); } @@ -691854,31 +695356,29 @@ public boolean isSet(_Fields field) { return isSetEx2(); case EX3: return isSetEx3(); - case EX4: - return isSetEx4(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { - if (that instanceof timePhrase_result) - return this.equals((timePhrase_result)that); + if (that instanceof traceRecordTime_result) + return this.equals((traceRecordTime_result)that); return false; } - public boolean equals(timePhrase_result that) { + public boolean equals(traceRecordTime_result that) { if (that == null) return false; if (this == that) return true; - boolean this_present_success = true; - boolean that_present_success = 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 != that.success) + if (!this.success.equals(that.success)) return false; } @@ -691909,15 +695409,6 @@ public boolean equals(timePhrase_result that) { return false; } - boolean this_present_ex4 = true && this.isSetEx4(); - boolean that_present_ex4 = true && that.isSetEx4(); - if (this_present_ex4 || that_present_ex4) { - if (!(this_present_ex4 && that_present_ex4)) - return false; - if (!this.ex4.equals(that.ex4)) - return false; - } - return true; } @@ -691925,7 +695416,9 @@ public boolean equals(timePhrase_result that) { public int hashCode() { int hashCode = 1; - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(success); + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); hashCode = hashCode * 8191 + ((isSetEx()) ? 131071 : 524287); if (isSetEx()) @@ -691939,15 +695432,11 @@ public int hashCode() { if (isSetEx3()) hashCode = hashCode * 8191 + ex3.hashCode(); - hashCode = hashCode * 8191 + ((isSetEx4()) ? 131071 : 524287); - if (isSetEx4()) - hashCode = hashCode * 8191 + ex4.hashCode(); - return hashCode; } @Override - public int compareTo(timePhrase_result other) { + public int compareTo(traceRecordTime_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -691994,16 +695483,6 @@ public int compareTo(timePhrase_result other) { return lastComparison; } } - lastComparison = java.lang.Boolean.compare(isSetEx4(), other.isSetEx4()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetEx4()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex4, other.ex4); - if (lastComparison != 0) { - return lastComparison; - } - } return 0; } @@ -692024,11 +695503,15 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("timePhrase_result("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("traceRecordTime_result("); boolean first = true; sb.append("success:"); - sb.append(this.success); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } first = false; if (!first) sb.append(", "); sb.append("ex:"); @@ -692054,14 +695537,6 @@ public java.lang.String toString() { sb.append(this.ex3); } first = false; - if (!first) sb.append(", "); - sb.append("ex4:"); - if (this.ex4 == null) { - sb.append("null"); - } else { - sb.append(this.ex4); - } - first = false; sb.append(")"); return sb.toString(); } @@ -692081,25 +695556,23 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept 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 timePhrase_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class traceRecordTime_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public timePhrase_resultStandardScheme getScheme() { - return new timePhrase_resultStandardScheme(); + public traceRecordTime_resultStandardScheme getScheme() { + return new traceRecordTime_resultStandardScheme(); } } - private static class timePhrase_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class traceRecordTime_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, timePhrase_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordTime_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -692110,8 +695583,30 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, timePhrase_result s } switch (schemeField.id) { case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.success = iprot.readI64(); + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map7058 = iprot.readMapBegin(); + struct.success = new java.util.LinkedHashMap>(2*_map7058.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key7059; + @org.apache.thrift.annotation.Nullable java.util.Set _val7060; + for (int _i7061 = 0; _i7061 < _map7058.size; ++_i7061) + { + _key7059 = iprot.readString(); + { + org.apache.thrift.protocol.TSet _set7062 = iprot.readSetBegin(); + _val7060 = new java.util.LinkedHashSet(2*_set7062.size); + long _elem7063; + for (int _i7064 = 0; _i7064 < _set7062.size; ++_i7064) + { + _elem7063 = iprot.readI64(); + _val7060.add(_elem7063); + } + iprot.readSetEnd(); + } + struct.success.put(_key7059, _val7060); + } + iprot.readMapEnd(); + } struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); @@ -692137,22 +695632,13 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, timePhrase_result s break; case 3: // EX3 if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.ex3 = new com.cinchapi.concourse.thrift.ParseException(); + struct.ex3 = new com.cinchapi.concourse.thrift.PermissionException(); struct.ex3.read(iprot); struct.setEx3IsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 4: // EX4 - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.ex4 = new com.cinchapi.concourse.thrift.PermissionException(); - struct.ex4.read(iprot); - struct.setEx4IsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -692165,13 +695651,28 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, timePhrase_result s } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, timePhrase_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecordTime_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); - if (struct.isSetSuccess()) { + if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeI64(struct.success); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.SET, struct.success.size())); + for (java.util.Map.Entry> _iter7065 : struct.success.entrySet()) + { + oprot.writeString(_iter7065.getKey()); + { + oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I64, _iter7065.getValue().size())); + for (long _iter7066 : _iter7065.getValue()) + { + oprot.writeI64(_iter7066); + } + oprot.writeSetEnd(); + } + } + oprot.writeMapEnd(); + } oprot.writeFieldEnd(); } if (struct.ex != null) { @@ -692189,28 +695690,23 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, timePhrase_result struct.ex3.write(oprot); oprot.writeFieldEnd(); } - if (struct.ex4 != null) { - oprot.writeFieldBegin(EX4_FIELD_DESC); - struct.ex4.write(oprot); - oprot.writeFieldEnd(); - } oprot.writeFieldStop(); oprot.writeStructEnd(); } } - private static class timePhrase_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class traceRecordTime_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public timePhrase_resultTupleScheme getScheme() { - return new timePhrase_resultTupleScheme(); + public traceRecordTime_resultTupleScheme getScheme() { + return new traceRecordTime_resultTupleScheme(); } } - private static class timePhrase_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class traceRecordTime_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, timePhrase_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordTime_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()) { @@ -692225,12 +695721,22 @@ public void write(org.apache.thrift.protocol.TProtocol prot, timePhrase_result s if (struct.isSetEx3()) { optionals.set(3); } - if (struct.isSetEx4()) { - optionals.set(4); - } - oprot.writeBitSet(optionals, 5); + oprot.writeBitSet(optionals, 4); if (struct.isSetSuccess()) { - oprot.writeI64(struct.success); + { + oprot.writeI32(struct.success.size()); + for (java.util.Map.Entry> _iter7067 : struct.success.entrySet()) + { + oprot.writeString(_iter7067.getKey()); + { + oprot.writeI32(_iter7067.getValue().size()); + for (long _iter7068 : _iter7067.getValue()) + { + oprot.writeI64(_iter7068); + } + } + } + } } if (struct.isSetEx()) { struct.ex.write(oprot); @@ -692241,17 +695747,34 @@ public void write(org.apache.thrift.protocol.TProtocol prot, timePhrase_result s if (struct.isSetEx3()) { struct.ex3.write(oprot); } - if (struct.isSetEx4()) { - struct.ex4.write(oprot); - } } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, timePhrase_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, traceRecordTime_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(5); + java.util.BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { - struct.success = iprot.readI64(); + { + org.apache.thrift.protocol.TMap _map7069 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.SET); + struct.success = new java.util.LinkedHashMap>(2*_map7069.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key7070; + @org.apache.thrift.annotation.Nullable java.util.Set _val7071; + for (int _i7072 = 0; _i7072 < _map7069.size; ++_i7072) + { + _key7070 = iprot.readString(); + { + org.apache.thrift.protocol.TSet _set7073 = iprot.readSetBegin(org.apache.thrift.protocol.TType.I64); + _val7071 = new java.util.LinkedHashSet(2*_set7073.size); + long _elem7074; + for (int _i7075 = 0; _i7075 < _set7073.size; ++_i7075) + { + _elem7074 = iprot.readI64(); + _val7071.add(_elem7074); + } + } + struct.success.put(_key7070, _val7071); + } + } struct.setSuccessIsSet(true); } if (incoming.get(1)) { @@ -692265,15 +695788,10 @@ public void read(org.apache.thrift.protocol.TProtocol prot, timePhrase_result st struct.setEx2IsSet(true); } if (incoming.get(3)) { - struct.ex3 = new com.cinchapi.concourse.thrift.ParseException(); + struct.ex3 = new com.cinchapi.concourse.thrift.PermissionException(); struct.ex3.read(iprot); struct.setEx3IsSet(true); } - if (incoming.get(4)) { - struct.ex4 = new com.cinchapi.concourse.thrift.PermissionException(); - struct.ex4.read(iprot); - struct.setEx4IsSet(true); - } } } @@ -692282,18 +695800,20 @@ private static S scheme(org.apache. } } - public static class traceRecord_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("traceRecord_args"); + public static class traceRecordTimestr_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("traceRecordTimestr_args"); private static final org.apache.thrift.protocol.TField RECORD_FIELD_DESC = new org.apache.thrift.protocol.TField("record", org.apache.thrift.protocol.TType.I64, (short)1); - private static final org.apache.thrift.protocol.TField CREDS_FIELD_DESC = new org.apache.thrift.protocol.TField("creds", org.apache.thrift.protocol.TType.STRUCT, (short)2); - private static final org.apache.thrift.protocol.TField TRANSACTION_FIELD_DESC = new org.apache.thrift.protocol.TField("transaction", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.protocol.TField ENVIRONMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("environment", org.apache.thrift.protocol.TType.STRING, (short)4); + private static final org.apache.thrift.protocol.TField TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("timestamp", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField CREDS_FIELD_DESC = new org.apache.thrift.protocol.TField("creds", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final org.apache.thrift.protocol.TField TRANSACTION_FIELD_DESC = new org.apache.thrift.protocol.TField("transaction", org.apache.thrift.protocol.TType.STRUCT, (short)4); + private static final org.apache.thrift.protocol.TField ENVIRONMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("environment", org.apache.thrift.protocol.TType.STRING, (short)5); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new traceRecord_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new traceRecord_argsTupleSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new traceRecordTimestr_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new traceRecordTimestr_argsTupleSchemeFactory(); public long record; // required + public @org.apache.thrift.annotation.Nullable java.lang.String timestamp; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction; // required public @org.apache.thrift.annotation.Nullable java.lang.String environment; // required @@ -692301,9 +695821,10 @@ public static class traceRecord_args implements org.apache.thrift.TBase byName = new java.util.LinkedHashMap(); @@ -692321,11 +695842,13 @@ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // RECORD return RECORD; - case 2: // CREDS + case 2: // TIMESTAMP + return TIMESTAMP; + case 3: // CREDS return CREDS; - case 3: // TRANSACTION + case 4: // TRANSACTION return TRANSACTION; - case 4: // ENVIRONMENT + case 5: // ENVIRONMENT return ENVIRONMENT; default: return null; @@ -692377,6 +695900,8 @@ public java.lang.String getFieldName() { 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.RECORD, new org.apache.thrift.meta_data.FieldMetaData("record", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.CREDS, new org.apache.thrift.meta_data.FieldMetaData("creds", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.AccessToken.class))); tmpMap.put(_Fields.TRANSACTION, new org.apache.thrift.meta_data.FieldMetaData("transaction", org.apache.thrift.TFieldRequirementType.DEFAULT, @@ -692384,14 +695909,15 @@ public java.lang.String getFieldName() { tmpMap.put(_Fields.ENVIRONMENT, new org.apache.thrift.meta_data.FieldMetaData("environment", 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(traceRecord_args.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(traceRecordTimestr_args.class, metaDataMap); } - public traceRecord_args() { + public traceRecordTimestr_args() { } - public traceRecord_args( + public traceRecordTimestr_args( long record, + java.lang.String timestamp, com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment) @@ -692399,6 +695925,7 @@ public traceRecord_args( this(); this.record = record; setRecordIsSet(true); + this.timestamp = timestamp; this.creds = creds; this.transaction = transaction; this.environment = environment; @@ -692407,9 +695934,12 @@ public traceRecord_args( /** * Performs a deep copy on other. */ - public traceRecord_args(traceRecord_args other) { + public traceRecordTimestr_args(traceRecordTimestr_args other) { __isset_bitfield = other.__isset_bitfield; this.record = other.record; + if (other.isSetTimestamp()) { + this.timestamp = other.timestamp; + } if (other.isSetCreds()) { this.creds = new com.cinchapi.concourse.thrift.AccessToken(other.creds); } @@ -692422,14 +695952,15 @@ public traceRecord_args(traceRecord_args other) { } @Override - public traceRecord_args deepCopy() { - return new traceRecord_args(this); + public traceRecordTimestr_args deepCopy() { + return new traceRecordTimestr_args(this); } @Override public void clear() { setRecordIsSet(false); this.record = 0; + this.timestamp = null; this.creds = null; this.transaction = null; this.environment = null; @@ -692439,7 +695970,7 @@ public long getRecord() { return this.record; } - public traceRecord_args setRecord(long record) { + public traceRecordTimestr_args setRecord(long record) { this.record = record; setRecordIsSet(true); return this; @@ -692458,12 +695989,37 @@ public void setRecordIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __RECORD_ISSET_ID, value); } + @org.apache.thrift.annotation.Nullable + public java.lang.String getTimestamp() { + return this.timestamp; + } + + public traceRecordTimestr_args setTimestamp(@org.apache.thrift.annotation.Nullable java.lang.String timestamp) { + this.timestamp = timestamp; + return this; + } + + public void unsetTimestamp() { + this.timestamp = null; + } + + /** Returns true if field timestamp is set (has been assigned a value) and false otherwise */ + public boolean isSetTimestamp() { + return this.timestamp != null; + } + + public void setTimestampIsSet(boolean value) { + if (!value) { + this.timestamp = null; + } + } + @org.apache.thrift.annotation.Nullable public com.cinchapi.concourse.thrift.AccessToken getCreds() { return this.creds; } - public traceRecord_args setCreds(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds) { + public traceRecordTimestr_args setCreds(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds) { this.creds = creds; return this; } @@ -692488,7 +696044,7 @@ public com.cinchapi.concourse.thrift.TransactionToken getTransaction() { return this.transaction; } - public traceRecord_args setTransaction(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction) { + public traceRecordTimestr_args setTransaction(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction) { this.transaction = transaction; return this; } @@ -692513,7 +696069,7 @@ public java.lang.String getEnvironment() { return this.environment; } - public traceRecord_args setEnvironment(@org.apache.thrift.annotation.Nullable java.lang.String environment) { + public traceRecordTimestr_args setEnvironment(@org.apache.thrift.annotation.Nullable java.lang.String environment) { this.environment = environment; return this; } @@ -692544,6 +696100,14 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } break; + case TIMESTAMP: + if (value == null) { + unsetTimestamp(); + } else { + setTimestamp((java.lang.String)value); + } + break; + case CREDS: if (value == null) { unsetCreds(); @@ -692578,6 +696142,9 @@ public java.lang.Object getFieldValue(_Fields field) { case RECORD: return getRecord(); + case TIMESTAMP: + return getTimestamp(); + case CREDS: return getCreds(); @@ -692601,6 +696168,8 @@ public boolean isSet(_Fields field) { switch (field) { case RECORD: return isSetRecord(); + case TIMESTAMP: + return isSetTimestamp(); case CREDS: return isSetCreds(); case TRANSACTION: @@ -692613,12 +696182,12 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that instanceof traceRecord_args) - return this.equals((traceRecord_args)that); + if (that instanceof traceRecordTimestr_args) + return this.equals((traceRecordTimestr_args)that); return false; } - public boolean equals(traceRecord_args that) { + public boolean equals(traceRecordTimestr_args that) { if (that == null) return false; if (this == that) @@ -692633,6 +696202,15 @@ public boolean equals(traceRecord_args that) { return false; } + boolean this_present_timestamp = true && this.isSetTimestamp(); + boolean that_present_timestamp = true && that.isSetTimestamp(); + if (this_present_timestamp || that_present_timestamp) { + if (!(this_present_timestamp && that_present_timestamp)) + return false; + if (!this.timestamp.equals(that.timestamp)) + return false; + } + boolean this_present_creds = true && this.isSetCreds(); boolean that_present_creds = true && that.isSetCreds(); if (this_present_creds || that_present_creds) { @@ -692669,6 +696247,10 @@ public int hashCode() { hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(record); + hashCode = hashCode * 8191 + ((isSetTimestamp()) ? 131071 : 524287); + if (isSetTimestamp()) + hashCode = hashCode * 8191 + timestamp.hashCode(); + hashCode = hashCode * 8191 + ((isSetCreds()) ? 131071 : 524287); if (isSetCreds()) hashCode = hashCode * 8191 + creds.hashCode(); @@ -692685,7 +696267,7 @@ public int hashCode() { } @Override - public int compareTo(traceRecord_args other) { + public int compareTo(traceRecordTimestr_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -692702,6 +696284,16 @@ public int compareTo(traceRecord_args other) { return lastComparison; } } + lastComparison = java.lang.Boolean.compare(isSetTimestamp(), other.isSetTimestamp()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTimestamp()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, other.timestamp); + if (lastComparison != 0) { + return lastComparison; + } + } lastComparison = java.lang.Boolean.compare(isSetCreds(), other.isSetCreds()); if (lastComparison != 0) { return lastComparison; @@ -692753,13 +696345,21 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("traceRecord_args("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("traceRecordTimestr_args("); boolean first = true; sb.append("record:"); sb.append(this.record); first = false; if (!first) sb.append(", "); + sb.append("timestamp:"); + if (this.timestamp == null) { + sb.append("null"); + } else { + sb.append(this.timestamp); + } + first = false; + if (!first) sb.append(", "); sb.append("creds:"); if (this.creds == null) { sb.append("null"); @@ -692816,17 +696416,17 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class traceRecord_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class traceRecordTimestr_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public traceRecord_argsStandardScheme getScheme() { - return new traceRecord_argsStandardScheme(); + public traceRecordTimestr_argsStandardScheme getScheme() { + return new traceRecordTimestr_argsStandardScheme(); } } - private static class traceRecord_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class traceRecordTimestr_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecord_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordTimestr_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -692844,7 +696444,15 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecord_args st org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 2: // CREDS + case 2: // TIMESTAMP + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.timestamp = iprot.readString(); + struct.setTimestampIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // CREDS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); struct.creds.read(iprot); @@ -692853,7 +696461,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecord_args st org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 3: // TRANSACTION + case 4: // TRANSACTION if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.transaction = new com.cinchapi.concourse.thrift.TransactionToken(); struct.transaction.read(iprot); @@ -692862,7 +696470,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecord_args st org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 4: // ENVIRONMENT + case 5: // ENVIRONMENT if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.environment = iprot.readString(); struct.setEnvironmentIsSet(true); @@ -692882,13 +696490,18 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecord_args st } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecord_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecordTimestr_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(RECORD_FIELD_DESC); oprot.writeI64(struct.record); oprot.writeFieldEnd(); + if (struct.timestamp != null) { + oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC); + oprot.writeString(struct.timestamp); + oprot.writeFieldEnd(); + } if (struct.creds != null) { oprot.writeFieldBegin(CREDS_FIELD_DESC); struct.creds.write(oprot); @@ -692910,35 +696523,41 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecord_args s } - private static class traceRecord_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class traceRecordTimestr_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public traceRecord_argsTupleScheme getScheme() { - return new traceRecord_argsTupleScheme(); + public traceRecordTimestr_argsTupleScheme getScheme() { + return new traceRecordTimestr_argsTupleScheme(); } } - private static class traceRecord_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class traceRecordTimestr_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, traceRecord_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordTimestr_args 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.isSetRecord()) { optionals.set(0); } - if (struct.isSetCreds()) { + if (struct.isSetTimestamp()) { optionals.set(1); } - if (struct.isSetTransaction()) { + if (struct.isSetCreds()) { optionals.set(2); } - if (struct.isSetEnvironment()) { + if (struct.isSetTransaction()) { optionals.set(3); } - oprot.writeBitSet(optionals, 4); + if (struct.isSetEnvironment()) { + optionals.set(4); + } + oprot.writeBitSet(optionals, 5); if (struct.isSetRecord()) { oprot.writeI64(struct.record); } + if (struct.isSetTimestamp()) { + oprot.writeString(struct.timestamp); + } if (struct.isSetCreds()) { struct.creds.write(oprot); } @@ -692951,24 +696570,28 @@ public void write(org.apache.thrift.protocol.TProtocol prot, traceRecord_args st } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, traceRecord_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, traceRecordTimestr_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(4); + java.util.BitSet incoming = iprot.readBitSet(5); if (incoming.get(0)) { struct.record = iprot.readI64(); struct.setRecordIsSet(true); } if (incoming.get(1)) { + struct.timestamp = iprot.readString(); + struct.setTimestampIsSet(true); + } + if (incoming.get(2)) { struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); struct.creds.read(iprot); struct.setCredsIsSet(true); } - if (incoming.get(2)) { + if (incoming.get(3)) { struct.transaction = new com.cinchapi.concourse.thrift.TransactionToken(); struct.transaction.read(iprot); struct.setTransactionIsSet(true); } - if (incoming.get(3)) { + if (incoming.get(4)) { struct.environment = iprot.readString(); struct.setEnvironmentIsSet(true); } @@ -692980,16 +696603,16 @@ private static S scheme(org.apache. } } - public static class traceRecord_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("traceRecord_result"); + public static class traceRecordTimestr_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("traceRecordTimestr_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.MAP, (short)0); private static final org.apache.thrift.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField EX2_FIELD_DESC = new org.apache.thrift.protocol.TField("ex2", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField EX3_FIELD_DESC = new org.apache.thrift.protocol.TField("ex3", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new traceRecord_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new traceRecord_resultTupleSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new traceRecordTimestr_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new traceRecordTimestr_resultTupleSchemeFactory(); public @org.apache.thrift.annotation.Nullable java.util.Map> success; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex; // required @@ -693083,13 +696706,13 @@ public java.lang.String getFieldName() { tmpMap.put(_Fields.EX3, new org.apache.thrift.meta_data.FieldMetaData("ex3", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.PermissionException.class))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(traceRecord_result.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(traceRecordTimestr_result.class, metaDataMap); } - public traceRecord_result() { + public traceRecordTimestr_result() { } - public traceRecord_result( + public traceRecordTimestr_result( java.util.Map> success, com.cinchapi.concourse.thrift.SecurityException ex, com.cinchapi.concourse.thrift.TransactionException ex2, @@ -693105,7 +696728,7 @@ public traceRecord_result( /** * Performs a deep copy on other. */ - public traceRecord_result(traceRecord_result other) { + public traceRecordTimestr_result(traceRecordTimestr_result other) { if (other.isSetSuccess()) { java.util.Map> __this__success = new java.util.LinkedHashMap>(other.success.size()); for (java.util.Map.Entry> other_element : other.success.entrySet()) { @@ -693133,8 +696756,8 @@ public traceRecord_result(traceRecord_result other) { } @Override - public traceRecord_result deepCopy() { - return new traceRecord_result(this); + public traceRecordTimestr_result deepCopy() { + return new traceRecordTimestr_result(this); } @Override @@ -693161,7 +696784,7 @@ public java.util.Map> getSuccess( return this.success; } - public traceRecord_result setSuccess(@org.apache.thrift.annotation.Nullable java.util.Map> success) { + public traceRecordTimestr_result setSuccess(@org.apache.thrift.annotation.Nullable java.util.Map> success) { this.success = success; return this; } @@ -693186,7 +696809,7 @@ public com.cinchapi.concourse.thrift.SecurityException getEx() { return this.ex; } - public traceRecord_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { + public traceRecordTimestr_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { this.ex = ex; return this; } @@ -693211,7 +696834,7 @@ public com.cinchapi.concourse.thrift.TransactionException getEx2() { return this.ex2; } - public traceRecord_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { + public traceRecordTimestr_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { this.ex2 = ex2; return this; } @@ -693236,7 +696859,7 @@ public com.cinchapi.concourse.thrift.PermissionException getEx3() { return this.ex3; } - public traceRecord_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3) { + public traceRecordTimestr_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3) { this.ex3 = ex3; return this; } @@ -693336,12 +696959,12 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that instanceof traceRecord_result) - return this.equals((traceRecord_result)that); + if (that instanceof traceRecordTimestr_result) + return this.equals((traceRecordTimestr_result)that); return false; } - public boolean equals(traceRecord_result that) { + public boolean equals(traceRecordTimestr_result that) { if (that == null) return false; if (this == that) @@ -693410,7 +697033,7 @@ public int hashCode() { } @Override - public int compareTo(traceRecord_result other) { + public int compareTo(traceRecordTimestr_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -693477,7 +697100,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("traceRecord_result("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("traceRecordTimestr_result("); boolean first = true; sb.append("success:"); @@ -693536,17 +697159,17 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class traceRecord_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class traceRecordTimestr_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public traceRecord_resultStandardScheme getScheme() { - return new traceRecord_resultStandardScheme(); + public traceRecordTimestr_resultStandardScheme getScheme() { + return new traceRecordTimestr_resultStandardScheme(); } } - private static class traceRecord_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class traceRecordTimestr_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecord_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordTimestr_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -693559,25 +697182,25 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecord_result case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { - org.apache.thrift.protocol.TMap _map7040 = iprot.readMapBegin(); - struct.success = new java.util.LinkedHashMap>(2*_map7040.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key7041; - @org.apache.thrift.annotation.Nullable java.util.Set _val7042; - for (int _i7043 = 0; _i7043 < _map7040.size; ++_i7043) + org.apache.thrift.protocol.TMap _map7076 = iprot.readMapBegin(); + struct.success = new java.util.LinkedHashMap>(2*_map7076.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key7077; + @org.apache.thrift.annotation.Nullable java.util.Set _val7078; + for (int _i7079 = 0; _i7079 < _map7076.size; ++_i7079) { - _key7041 = iprot.readString(); + _key7077 = iprot.readString(); { - org.apache.thrift.protocol.TSet _set7044 = iprot.readSetBegin(); - _val7042 = new java.util.LinkedHashSet(2*_set7044.size); - long _elem7045; - for (int _i7046 = 0; _i7046 < _set7044.size; ++_i7046) + org.apache.thrift.protocol.TSet _set7080 = iprot.readSetBegin(); + _val7078 = new java.util.LinkedHashSet(2*_set7080.size); + long _elem7081; + for (int _i7082 = 0; _i7082 < _set7080.size; ++_i7082) { - _elem7045 = iprot.readI64(); - _val7042.add(_elem7045); + _elem7081 = iprot.readI64(); + _val7078.add(_elem7081); } iprot.readSetEnd(); } - struct.success.put(_key7041, _val7042); + struct.success.put(_key7077, _val7078); } iprot.readMapEnd(); } @@ -693625,7 +697248,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecord_result } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecord_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecordTimestr_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); @@ -693633,14 +697256,14 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecord_result oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.SET, struct.success.size())); - for (java.util.Map.Entry> _iter7047 : struct.success.entrySet()) + for (java.util.Map.Entry> _iter7083 : struct.success.entrySet()) { - oprot.writeString(_iter7047.getKey()); + oprot.writeString(_iter7083.getKey()); { - oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I64, _iter7047.getValue().size())); - for (long _iter7048 : _iter7047.getValue()) + oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I64, _iter7083.getValue().size())); + for (long _iter7084 : _iter7083.getValue()) { - oprot.writeI64(_iter7048); + oprot.writeI64(_iter7084); } oprot.writeSetEnd(); } @@ -693670,17 +697293,17 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecord_result } - private static class traceRecord_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class traceRecordTimestr_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public traceRecord_resultTupleScheme getScheme() { - return new traceRecord_resultTupleScheme(); + public traceRecordTimestr_resultTupleScheme getScheme() { + return new traceRecordTimestr_resultTupleScheme(); } } - private static class traceRecord_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class traceRecordTimestr_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, traceRecord_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordTimestr_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()) { @@ -693699,14 +697322,14 @@ public void write(org.apache.thrift.protocol.TProtocol prot, traceRecord_result if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); - for (java.util.Map.Entry> _iter7049 : struct.success.entrySet()) + for (java.util.Map.Entry> _iter7085 : struct.success.entrySet()) { - oprot.writeString(_iter7049.getKey()); + oprot.writeString(_iter7085.getKey()); { - oprot.writeI32(_iter7049.getValue().size()); - for (long _iter7050 : _iter7049.getValue()) + oprot.writeI32(_iter7085.getValue().size()); + for (long _iter7086 : _iter7085.getValue()) { - oprot.writeI64(_iter7050); + oprot.writeI64(_iter7086); } } } @@ -693724,29 +697347,29 @@ public void write(org.apache.thrift.protocol.TProtocol prot, traceRecord_result } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, traceRecord_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, traceRecordTimestr_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(4); if (incoming.get(0)) { { - org.apache.thrift.protocol.TMap _map7051 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.SET); - struct.success = new java.util.LinkedHashMap>(2*_map7051.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key7052; - @org.apache.thrift.annotation.Nullable java.util.Set _val7053; - for (int _i7054 = 0; _i7054 < _map7051.size; ++_i7054) + org.apache.thrift.protocol.TMap _map7087 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.SET); + struct.success = new java.util.LinkedHashMap>(2*_map7087.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key7088; + @org.apache.thrift.annotation.Nullable java.util.Set _val7089; + for (int _i7090 = 0; _i7090 < _map7087.size; ++_i7090) { - _key7052 = iprot.readString(); + _key7088 = iprot.readString(); { - org.apache.thrift.protocol.TSet _set7055 = iprot.readSetBegin(org.apache.thrift.protocol.TType.I64); - _val7053 = new java.util.LinkedHashSet(2*_set7055.size); - long _elem7056; - for (int _i7057 = 0; _i7057 < _set7055.size; ++_i7057) + org.apache.thrift.protocol.TSet _set7091 = iprot.readSetBegin(org.apache.thrift.protocol.TType.I64); + _val7089 = new java.util.LinkedHashSet(2*_set7091.size); + long _elem7092; + for (int _i7093 = 0; _i7093 < _set7091.size; ++_i7093) { - _elem7056 = iprot.readI64(); - _val7053.add(_elem7056); + _elem7092 = iprot.readI64(); + _val7089.add(_elem7092); } } - struct.success.put(_key7052, _val7053); + struct.success.put(_key7088, _val7089); } } struct.setSuccessIsSet(true); @@ -693774,31 +697397,28 @@ private static S scheme(org.apache. } } - public static class traceRecordTime_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("traceRecordTime_args"); + public static class traceRecords_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("traceRecords_args"); - private static final org.apache.thrift.protocol.TField RECORD_FIELD_DESC = new org.apache.thrift.protocol.TField("record", org.apache.thrift.protocol.TType.I64, (short)1); - private static final org.apache.thrift.protocol.TField TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("timestamp", org.apache.thrift.protocol.TType.I64, (short)2); - private static final org.apache.thrift.protocol.TField CREDS_FIELD_DESC = new org.apache.thrift.protocol.TField("creds", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.protocol.TField TRANSACTION_FIELD_DESC = new org.apache.thrift.protocol.TField("transaction", org.apache.thrift.protocol.TType.STRUCT, (short)4); - private static final org.apache.thrift.protocol.TField ENVIRONMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("environment", org.apache.thrift.protocol.TType.STRING, (short)5); + private static final org.apache.thrift.protocol.TField RECORDS_FIELD_DESC = new org.apache.thrift.protocol.TField("records", org.apache.thrift.protocol.TType.LIST, (short)1); + private static final org.apache.thrift.protocol.TField CREDS_FIELD_DESC = new org.apache.thrift.protocol.TField("creds", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final org.apache.thrift.protocol.TField TRANSACTION_FIELD_DESC = new org.apache.thrift.protocol.TField("transaction", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final org.apache.thrift.protocol.TField ENVIRONMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("environment", org.apache.thrift.protocol.TType.STRING, (short)4); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new traceRecordTime_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new traceRecordTime_argsTupleSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new traceRecords_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new traceRecords_argsTupleSchemeFactory(); - public long record; // required - public long timestamp; // required + public @org.apache.thrift.annotation.Nullable java.util.List records; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction; // required public @org.apache.thrift.annotation.Nullable java.lang.String environment; // 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 { - RECORD((short)1, "record"), - TIMESTAMP((short)2, "timestamp"), - CREDS((short)3, "creds"), - TRANSACTION((short)4, "transaction"), - ENVIRONMENT((short)5, "environment"); + RECORDS((short)1, "records"), + CREDS((short)2, "creds"), + TRANSACTION((short)3, "transaction"), + ENVIRONMENT((short)4, "environment"); private static final java.util.Map byName = new java.util.LinkedHashMap(); @@ -693814,15 +697434,13 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { - case 1: // RECORD - return RECORD; - case 2: // TIMESTAMP - return TIMESTAMP; - case 3: // CREDS + case 1: // RECORDS + return RECORDS; + case 2: // CREDS return CREDS; - case 4: // TRANSACTION + case 3: // TRANSACTION return TRANSACTION; - case 5: // ENVIRONMENT + case 4: // ENVIRONMENT return ENVIRONMENT; default: return null; @@ -693867,16 +697485,12 @@ public java.lang.String getFieldName() { } // isset id assignments - private static final int __RECORD_ISSET_ID = 0; - private static final int __TIMESTAMP_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.RECORD, new org.apache.thrift.meta_data.FieldMetaData("record", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.RECORDS, new org.apache.thrift.meta_data.FieldMetaData("records", 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.I64)))); tmpMap.put(_Fields.CREDS, new org.apache.thrift.meta_data.FieldMetaData("creds", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.AccessToken.class))); tmpMap.put(_Fields.TRANSACTION, new org.apache.thrift.meta_data.FieldMetaData("transaction", org.apache.thrift.TFieldRequirementType.DEFAULT, @@ -693884,24 +697498,20 @@ public java.lang.String getFieldName() { tmpMap.put(_Fields.ENVIRONMENT, new org.apache.thrift.meta_data.FieldMetaData("environment", 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(traceRecordTime_args.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(traceRecords_args.class, metaDataMap); } - public traceRecordTime_args() { + public traceRecords_args() { } - public traceRecordTime_args( - long record, - long timestamp, + public traceRecords_args( + java.util.List records, com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment) { this(); - this.record = record; - setRecordIsSet(true); - this.timestamp = timestamp; - setTimestampIsSet(true); + this.records = records; this.creds = creds; this.transaction = transaction; this.environment = environment; @@ -693910,10 +697520,11 @@ public traceRecordTime_args( /** * Performs a deep copy on other. */ - public traceRecordTime_args(traceRecordTime_args other) { - __isset_bitfield = other.__isset_bitfield; - this.record = other.record; - this.timestamp = other.timestamp; + public traceRecords_args(traceRecords_args other) { + if (other.isSetRecords()) { + java.util.List __this__records = new java.util.ArrayList(other.records); + this.records = __this__records; + } if (other.isSetCreds()) { this.creds = new com.cinchapi.concourse.thrift.AccessToken(other.creds); } @@ -693926,65 +697537,57 @@ public traceRecordTime_args(traceRecordTime_args other) { } @Override - public traceRecordTime_args deepCopy() { - return new traceRecordTime_args(this); + public traceRecords_args deepCopy() { + return new traceRecords_args(this); } @Override public void clear() { - setRecordIsSet(false); - this.record = 0; - setTimestampIsSet(false); - this.timestamp = 0; + this.records = null; this.creds = null; this.transaction = null; this.environment = null; } - public long getRecord() { - return this.record; - } - - public traceRecordTime_args setRecord(long record) { - this.record = record; - setRecordIsSet(true); - return this; - } - - public void unsetRecord() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __RECORD_ISSET_ID); + public int getRecordsSize() { + return (this.records == null) ? 0 : this.records.size(); } - /** Returns true if field record is set (has been assigned a value) and false otherwise */ - public boolean isSetRecord() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __RECORD_ISSET_ID); + @org.apache.thrift.annotation.Nullable + public java.util.Iterator getRecordsIterator() { + return (this.records == null) ? null : this.records.iterator(); } - public void setRecordIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __RECORD_ISSET_ID, value); + public void addToRecords(long elem) { + if (this.records == null) { + this.records = new java.util.ArrayList(); + } + this.records.add(elem); } - public long getTimestamp() { - return this.timestamp; + @org.apache.thrift.annotation.Nullable + public java.util.List getRecords() { + return this.records; } - public traceRecordTime_args setTimestamp(long timestamp) { - this.timestamp = timestamp; - setTimestampIsSet(true); + public traceRecords_args setRecords(@org.apache.thrift.annotation.Nullable java.util.List records) { + this.records = records; return this; } - public void unsetTimestamp() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + public void unsetRecords() { + this.records = null; } - /** Returns true if field timestamp is set (has been assigned a value) and false otherwise */ - public boolean isSetTimestamp() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + /** Returns true if field records is set (has been assigned a value) and false otherwise */ + public boolean isSetRecords() { + return this.records != null; } - public void setTimestampIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TIMESTAMP_ISSET_ID, value); + public void setRecordsIsSet(boolean value) { + if (!value) { + this.records = null; + } } @org.apache.thrift.annotation.Nullable @@ -693992,7 +697595,7 @@ public com.cinchapi.concourse.thrift.AccessToken getCreds() { return this.creds; } - public traceRecordTime_args setCreds(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds) { + public traceRecords_args setCreds(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds) { this.creds = creds; return this; } @@ -694017,7 +697620,7 @@ public com.cinchapi.concourse.thrift.TransactionToken getTransaction() { return this.transaction; } - public traceRecordTime_args setTransaction(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction) { + public traceRecords_args setTransaction(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction) { this.transaction = transaction; return this; } @@ -694042,7 +697645,7 @@ public java.lang.String getEnvironment() { return this.environment; } - public traceRecordTime_args setEnvironment(@org.apache.thrift.annotation.Nullable java.lang.String environment) { + public traceRecords_args setEnvironment(@org.apache.thrift.annotation.Nullable java.lang.String environment) { this.environment = environment; return this; } @@ -694065,19 +697668,11 @@ public void setEnvironmentIsSet(boolean value) { @Override public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { - case RECORD: - if (value == null) { - unsetRecord(); - } else { - setRecord((java.lang.Long)value); - } - break; - - case TIMESTAMP: + case RECORDS: if (value == null) { - unsetTimestamp(); + unsetRecords(); } else { - setTimestamp((java.lang.Long)value); + setRecords((java.util.List)value); } break; @@ -694112,11 +697707,8 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable @Override public java.lang.Object getFieldValue(_Fields field) { switch (field) { - case RECORD: - return getRecord(); - - case TIMESTAMP: - return getTimestamp(); + case RECORDS: + return getRecords(); case CREDS: return getCreds(); @@ -694139,10 +697731,8 @@ public boolean isSet(_Fields field) { } switch (field) { - case RECORD: - return isSetRecord(); - case TIMESTAMP: - return isSetTimestamp(); + case RECORDS: + return isSetRecords(); case CREDS: return isSetCreds(); case TRANSACTION: @@ -694155,32 +697745,23 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that instanceof traceRecordTime_args) - return this.equals((traceRecordTime_args)that); + if (that instanceof traceRecords_args) + return this.equals((traceRecords_args)that); return false; } - public boolean equals(traceRecordTime_args that) { + public boolean equals(traceRecords_args that) { if (that == null) return false; if (this == that) return true; - boolean this_present_record = true; - boolean that_present_record = true; - if (this_present_record || that_present_record) { - if (!(this_present_record && that_present_record)) - return false; - if (this.record != that.record) - return false; - } - - boolean this_present_timestamp = true; - boolean that_present_timestamp = true; - if (this_present_timestamp || that_present_timestamp) { - if (!(this_present_timestamp && that_present_timestamp)) + boolean this_present_records = true && this.isSetRecords(); + boolean that_present_records = true && that.isSetRecords(); + if (this_present_records || that_present_records) { + if (!(this_present_records && that_present_records)) return false; - if (this.timestamp != that.timestamp) + if (!this.records.equals(that.records)) return false; } @@ -694218,9 +697799,9 @@ public boolean equals(traceRecordTime_args that) { public int hashCode() { int hashCode = 1; - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(record); - - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(timestamp); + hashCode = hashCode * 8191 + ((isSetRecords()) ? 131071 : 524287); + if (isSetRecords()) + hashCode = hashCode * 8191 + records.hashCode(); hashCode = hashCode * 8191 + ((isSetCreds()) ? 131071 : 524287); if (isSetCreds()) @@ -694238,29 +697819,19 @@ public int hashCode() { } @Override - public int compareTo(traceRecordTime_args other) { + public int compareTo(traceRecords_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; - lastComparison = java.lang.Boolean.compare(isSetRecord(), other.isSetRecord()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRecord()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.record, other.record); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.compare(isSetTimestamp(), other.isSetTimestamp()); + lastComparison = java.lang.Boolean.compare(isSetRecords(), other.isSetRecords()); if (lastComparison != 0) { return lastComparison; } - if (isSetTimestamp()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, other.timestamp); + if (isSetRecords()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.records, other.records); if (lastComparison != 0) { return lastComparison; } @@ -694316,15 +697887,15 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("traceRecordTime_args("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("traceRecords_args("); boolean first = true; - sb.append("record:"); - sb.append(this.record); - first = false; - if (!first) sb.append(", "); - sb.append("timestamp:"); - sb.append(this.timestamp); + sb.append("records:"); + if (this.records == null) { + sb.append("null"); + } else { + sb.append(this.records); + } first = false; if (!first) sb.append(", "); sb.append("creds:"); @@ -694375,25 +697946,23 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept 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 traceRecordTime_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class traceRecords_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public traceRecordTime_argsStandardScheme getScheme() { - return new traceRecordTime_argsStandardScheme(); + public traceRecords_argsStandardScheme getScheme() { + return new traceRecords_argsStandardScheme(); } } - private static class traceRecordTime_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class traceRecords_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordTime_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecords_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -694403,23 +697972,25 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordTime_arg break; } switch (schemeField.id) { - case 1: // RECORD - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.record = iprot.readI64(); - struct.setRecordIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // TIMESTAMP - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.timestamp = iprot.readI64(); - struct.setTimestampIsSet(true); + case 1: // RECORDS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list7094 = iprot.readListBegin(); + struct.records = new java.util.ArrayList(_list7094.size); + long _elem7095; + for (int _i7096 = 0; _i7096 < _list7094.size; ++_i7096) + { + _elem7095 = iprot.readI64(); + struct.records.add(_elem7095); + } + iprot.readListEnd(); + } + struct.setRecordsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 3: // CREDS + case 2: // CREDS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); struct.creds.read(iprot); @@ -694428,7 +697999,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordTime_arg org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 4: // TRANSACTION + case 3: // TRANSACTION if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.transaction = new com.cinchapi.concourse.thrift.TransactionToken(); struct.transaction.read(iprot); @@ -694437,7 +698008,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordTime_arg org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 5: // ENVIRONMENT + case 4: // ENVIRONMENT if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.environment = iprot.readString(); struct.setEnvironmentIsSet(true); @@ -694457,16 +698028,22 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordTime_arg } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecordTime_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecords_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(RECORD_FIELD_DESC); - oprot.writeI64(struct.record); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC); - oprot.writeI64(struct.timestamp); - oprot.writeFieldEnd(); + if (struct.records != null) { + oprot.writeFieldBegin(RECORDS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, struct.records.size())); + for (long _iter7097 : struct.records) + { + oprot.writeI64(_iter7097); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } if (struct.creds != null) { oprot.writeFieldBegin(CREDS_FIELD_DESC); struct.creds.write(oprot); @@ -694488,40 +698065,40 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecordTime_ar } - private static class traceRecordTime_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class traceRecords_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public traceRecordTime_argsTupleScheme getScheme() { - return new traceRecordTime_argsTupleScheme(); + public traceRecords_argsTupleScheme getScheme() { + return new traceRecords_argsTupleScheme(); } } - private static class traceRecordTime_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class traceRecords_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordTime_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, traceRecords_args 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.isSetRecord()) { + if (struct.isSetRecords()) { optionals.set(0); } - if (struct.isSetTimestamp()) { - optionals.set(1); - } if (struct.isSetCreds()) { - optionals.set(2); + optionals.set(1); } if (struct.isSetTransaction()) { - optionals.set(3); + optionals.set(2); } if (struct.isSetEnvironment()) { - optionals.set(4); - } - oprot.writeBitSet(optionals, 5); - if (struct.isSetRecord()) { - oprot.writeI64(struct.record); + optionals.set(3); } - if (struct.isSetTimestamp()) { - oprot.writeI64(struct.timestamp); + oprot.writeBitSet(optionals, 4); + if (struct.isSetRecords()) { + { + oprot.writeI32(struct.records.size()); + for (long _iter7098 : struct.records) + { + oprot.writeI64(_iter7098); + } + } } if (struct.isSetCreds()) { struct.creds.write(oprot); @@ -694535,28 +698112,33 @@ public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordTime_arg } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, traceRecordTime_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, traceRecords_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(5); + java.util.BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { - struct.record = iprot.readI64(); - struct.setRecordIsSet(true); + { + org.apache.thrift.protocol.TList _list7099 = iprot.readListBegin(org.apache.thrift.protocol.TType.I64); + struct.records = new java.util.ArrayList(_list7099.size); + long _elem7100; + for (int _i7101 = 0; _i7101 < _list7099.size; ++_i7101) + { + _elem7100 = iprot.readI64(); + struct.records.add(_elem7100); + } + } + struct.setRecordsIsSet(true); } if (incoming.get(1)) { - struct.timestamp = iprot.readI64(); - struct.setTimestampIsSet(true); - } - if (incoming.get(2)) { struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); struct.creds.read(iprot); struct.setCredsIsSet(true); } - if (incoming.get(3)) { + if (incoming.get(2)) { struct.transaction = new com.cinchapi.concourse.thrift.TransactionToken(); struct.transaction.read(iprot); struct.setTransactionIsSet(true); } - if (incoming.get(4)) { + if (incoming.get(3)) { struct.environment = iprot.readString(); struct.setEnvironmentIsSet(true); } @@ -694568,18 +698150,18 @@ private static S scheme(org.apache. } } - public static class traceRecordTime_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("traceRecordTime_result"); + public static class traceRecords_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("traceRecords_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.MAP, (short)0); private static final org.apache.thrift.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField EX2_FIELD_DESC = new org.apache.thrift.protocol.TField("ex2", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField EX3_FIELD_DESC = new org.apache.thrift.protocol.TField("ex3", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new traceRecordTime_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new traceRecordTime_resultTupleSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new traceRecords_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new traceRecords_resultTupleSchemeFactory(); - public @org.apache.thrift.annotation.Nullable java.util.Map> success; // required + public @org.apache.thrift.annotation.Nullable java.util.Map>> success; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3; // required @@ -694661,9 +698243,11 @@ public java.lang.String getFieldName() { 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.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), - new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))))); + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64), + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), + new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)))))); tmpMap.put(_Fields.EX, new org.apache.thrift.meta_data.FieldMetaData("ex", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.SecurityException.class))); tmpMap.put(_Fields.EX2, new org.apache.thrift.meta_data.FieldMetaData("ex2", org.apache.thrift.TFieldRequirementType.DEFAULT, @@ -694671,14 +698255,14 @@ public java.lang.String getFieldName() { tmpMap.put(_Fields.EX3, new org.apache.thrift.meta_data.FieldMetaData("ex3", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.PermissionException.class))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(traceRecordTime_result.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(traceRecords_result.class, metaDataMap); } - public traceRecordTime_result() { + public traceRecords_result() { } - public traceRecordTime_result( - java.util.Map> success, + public traceRecords_result( + java.util.Map>> success, com.cinchapi.concourse.thrift.SecurityException ex, com.cinchapi.concourse.thrift.TransactionException ex2, com.cinchapi.concourse.thrift.PermissionException ex3) @@ -694693,17 +698277,28 @@ public traceRecordTime_result( /** * Performs a deep copy on other. */ - public traceRecordTime_result(traceRecordTime_result other) { + public traceRecords_result(traceRecords_result other) { if (other.isSetSuccess()) { - java.util.Map> __this__success = new java.util.LinkedHashMap>(other.success.size()); - for (java.util.Map.Entry> other_element : other.success.entrySet()) { + java.util.Map>> __this__success = new java.util.LinkedHashMap>>(other.success.size()); + for (java.util.Map.Entry>> other_element : other.success.entrySet()) { - java.lang.String other_element_key = other_element.getKey(); - java.util.Set other_element_value = other_element.getValue(); + java.lang.Long other_element_key = other_element.getKey(); + java.util.Map> other_element_value = other_element.getValue(); - java.lang.String __this__success_copy_key = other_element_key; + java.lang.Long __this__success_copy_key = other_element_key; - java.util.Set __this__success_copy_value = new java.util.LinkedHashSet(other_element_value); + java.util.Map> __this__success_copy_value = new java.util.LinkedHashMap>(other_element_value.size()); + for (java.util.Map.Entry> other_element_value_element : other_element_value.entrySet()) { + + java.lang.String other_element_value_element_key = other_element_value_element.getKey(); + java.util.Set other_element_value_element_value = other_element_value_element.getValue(); + + java.lang.String __this__success_copy_value_copy_key = other_element_value_element_key; + + java.util.Set __this__success_copy_value_copy_value = new java.util.LinkedHashSet(other_element_value_element_value); + + __this__success_copy_value.put(__this__success_copy_value_copy_key, __this__success_copy_value_copy_value); + } __this__success.put(__this__success_copy_key, __this__success_copy_value); } @@ -694721,8 +698316,8 @@ public traceRecordTime_result(traceRecordTime_result other) { } @Override - public traceRecordTime_result deepCopy() { - return new traceRecordTime_result(this); + public traceRecords_result deepCopy() { + return new traceRecords_result(this); } @Override @@ -694737,19 +698332,19 @@ public int getSuccessSize() { return (this.success == null) ? 0 : this.success.size(); } - public void putToSuccess(java.lang.String key, java.util.Set val) { + public void putToSuccess(long key, java.util.Map> val) { if (this.success == null) { - this.success = new java.util.LinkedHashMap>(); + this.success = new java.util.LinkedHashMap>>(); } this.success.put(key, val); } @org.apache.thrift.annotation.Nullable - public java.util.Map> getSuccess() { + public java.util.Map>> getSuccess() { return this.success; } - public traceRecordTime_result setSuccess(@org.apache.thrift.annotation.Nullable java.util.Map> success) { + public traceRecords_result setSuccess(@org.apache.thrift.annotation.Nullable java.util.Map>> success) { this.success = success; return this; } @@ -694774,7 +698369,7 @@ public com.cinchapi.concourse.thrift.SecurityException getEx() { return this.ex; } - public traceRecordTime_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { + public traceRecords_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { this.ex = ex; return this; } @@ -694799,7 +698394,7 @@ public com.cinchapi.concourse.thrift.TransactionException getEx2() { return this.ex2; } - public traceRecordTime_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { + public traceRecords_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { this.ex2 = ex2; return this; } @@ -694824,7 +698419,7 @@ public com.cinchapi.concourse.thrift.PermissionException getEx3() { return this.ex3; } - public traceRecordTime_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3) { + public traceRecords_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3) { this.ex3 = ex3; return this; } @@ -694851,7 +698446,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetSuccess(); } else { - setSuccess((java.util.Map>)value); + setSuccess((java.util.Map>>)value); } break; @@ -694924,12 +698519,12 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that instanceof traceRecordTime_result) - return this.equals((traceRecordTime_result)that); + if (that instanceof traceRecords_result) + return this.equals((traceRecords_result)that); return false; } - public boolean equals(traceRecordTime_result that) { + public boolean equals(traceRecords_result that) { if (that == null) return false; if (this == that) @@ -694998,7 +698593,7 @@ public int hashCode() { } @Override - public int compareTo(traceRecordTime_result other) { + public int compareTo(traceRecords_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -695065,7 +698660,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("traceRecordTime_result("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("traceRecords_result("); boolean first = true; sb.append("success:"); @@ -695124,17 +698719,17 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class traceRecordTime_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class traceRecords_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public traceRecordTime_resultStandardScheme getScheme() { - return new traceRecordTime_resultStandardScheme(); + public traceRecords_resultStandardScheme getScheme() { + return new traceRecords_resultStandardScheme(); } } - private static class traceRecordTime_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class traceRecords_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordTime_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecords_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -695147,25 +698742,37 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordTime_res case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { - org.apache.thrift.protocol.TMap _map7058 = iprot.readMapBegin(); - struct.success = new java.util.LinkedHashMap>(2*_map7058.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key7059; - @org.apache.thrift.annotation.Nullable java.util.Set _val7060; - for (int _i7061 = 0; _i7061 < _map7058.size; ++_i7061) + org.apache.thrift.protocol.TMap _map7102 = iprot.readMapBegin(); + struct.success = new java.util.LinkedHashMap>>(2*_map7102.size); + long _key7103; + @org.apache.thrift.annotation.Nullable java.util.Map> _val7104; + for (int _i7105 = 0; _i7105 < _map7102.size; ++_i7105) { - _key7059 = iprot.readString(); + _key7103 = iprot.readI64(); { - org.apache.thrift.protocol.TSet _set7062 = iprot.readSetBegin(); - _val7060 = new java.util.LinkedHashSet(2*_set7062.size); - long _elem7063; - for (int _i7064 = 0; _i7064 < _set7062.size; ++_i7064) + org.apache.thrift.protocol.TMap _map7106 = iprot.readMapBegin(); + _val7104 = new java.util.LinkedHashMap>(2*_map7106.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key7107; + @org.apache.thrift.annotation.Nullable java.util.Set _val7108; + for (int _i7109 = 0; _i7109 < _map7106.size; ++_i7109) { - _elem7063 = iprot.readI64(); - _val7060.add(_elem7063); + _key7107 = iprot.readString(); + { + org.apache.thrift.protocol.TSet _set7110 = iprot.readSetBegin(); + _val7108 = new java.util.LinkedHashSet(2*_set7110.size); + long _elem7111; + for (int _i7112 = 0; _i7112 < _set7110.size; ++_i7112) + { + _elem7111 = iprot.readI64(); + _val7108.add(_elem7111); + } + iprot.readSetEnd(); + } + _val7104.put(_key7107, _val7108); } - iprot.readSetEnd(); + iprot.readMapEnd(); } - struct.success.put(_key7059, _val7060); + struct.success.put(_key7103, _val7104); } iprot.readMapEnd(); } @@ -695213,24 +698820,32 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordTime_res } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecordTime_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecords_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.SET, struct.success.size())); - for (java.util.Map.Entry> _iter7065 : struct.success.entrySet()) + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.MAP, struct.success.size())); + for (java.util.Map.Entry>> _iter7113 : struct.success.entrySet()) { - oprot.writeString(_iter7065.getKey()); + oprot.writeI64(_iter7113.getKey()); { - oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I64, _iter7065.getValue().size())); - for (long _iter7066 : _iter7065.getValue()) + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.SET, _iter7113.getValue().size())); + for (java.util.Map.Entry> _iter7114 : _iter7113.getValue().entrySet()) { - oprot.writeI64(_iter7066); + oprot.writeString(_iter7114.getKey()); + { + oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I64, _iter7114.getValue().size())); + for (long _iter7115 : _iter7114.getValue()) + { + oprot.writeI64(_iter7115); + } + oprot.writeSetEnd(); + } } - oprot.writeSetEnd(); + oprot.writeMapEnd(); } } oprot.writeMapEnd(); @@ -695258,17 +698873,17 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecordTime_re } - private static class traceRecordTime_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class traceRecords_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public traceRecordTime_resultTupleScheme getScheme() { - return new traceRecordTime_resultTupleScheme(); + public traceRecords_resultTupleScheme getScheme() { + return new traceRecords_resultTupleScheme(); } } - private static class traceRecordTime_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class traceRecords_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordTime_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, traceRecords_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()) { @@ -695287,14 +698902,21 @@ public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordTime_res if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); - for (java.util.Map.Entry> _iter7067 : struct.success.entrySet()) + for (java.util.Map.Entry>> _iter7116 : struct.success.entrySet()) { - oprot.writeString(_iter7067.getKey()); + oprot.writeI64(_iter7116.getKey()); { - oprot.writeI32(_iter7067.getValue().size()); - for (long _iter7068 : _iter7067.getValue()) + oprot.writeI32(_iter7116.getValue().size()); + for (java.util.Map.Entry> _iter7117 : _iter7116.getValue().entrySet()) { - oprot.writeI64(_iter7068); + oprot.writeString(_iter7117.getKey()); + { + oprot.writeI32(_iter7117.getValue().size()); + for (long _iter7118 : _iter7117.getValue()) + { + oprot.writeI64(_iter7118); + } + } } } } @@ -695312,29 +698934,40 @@ public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordTime_res } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, traceRecordTime_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, traceRecords_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(4); if (incoming.get(0)) { { - org.apache.thrift.protocol.TMap _map7069 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.SET); - struct.success = new java.util.LinkedHashMap>(2*_map7069.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key7070; - @org.apache.thrift.annotation.Nullable java.util.Set _val7071; - for (int _i7072 = 0; _i7072 < _map7069.size; ++_i7072) + org.apache.thrift.protocol.TMap _map7119 = iprot.readMapBegin(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.MAP); + struct.success = new java.util.LinkedHashMap>>(2*_map7119.size); + long _key7120; + @org.apache.thrift.annotation.Nullable java.util.Map> _val7121; + for (int _i7122 = 0; _i7122 < _map7119.size; ++_i7122) { - _key7070 = iprot.readString(); + _key7120 = iprot.readI64(); { - org.apache.thrift.protocol.TSet _set7073 = iprot.readSetBegin(org.apache.thrift.protocol.TType.I64); - _val7071 = new java.util.LinkedHashSet(2*_set7073.size); - long _elem7074; - for (int _i7075 = 0; _i7075 < _set7073.size; ++_i7075) + org.apache.thrift.protocol.TMap _map7123 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.SET); + _val7121 = new java.util.LinkedHashMap>(2*_map7123.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key7124; + @org.apache.thrift.annotation.Nullable java.util.Set _val7125; + for (int _i7126 = 0; _i7126 < _map7123.size; ++_i7126) { - _elem7074 = iprot.readI64(); - _val7071.add(_elem7074); + _key7124 = iprot.readString(); + { + org.apache.thrift.protocol.TSet _set7127 = iprot.readSetBegin(org.apache.thrift.protocol.TType.I64); + _val7125 = new java.util.LinkedHashSet(2*_set7127.size); + long _elem7128; + for (int _i7129 = 0; _i7129 < _set7127.size; ++_i7129) + { + _elem7128 = iprot.readI64(); + _val7125.add(_elem7128); + } + } + _val7121.put(_key7124, _val7125); } } - struct.success.put(_key7070, _val7071); + struct.success.put(_key7120, _val7121); } } struct.setSuccessIsSet(true); @@ -695362,27 +698995,27 @@ private static S scheme(org.apache. } } - public static class traceRecordTimestr_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("traceRecordTimestr_args"); + public static class traceRecordsTime_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("traceRecordsTime_args"); - private static final org.apache.thrift.protocol.TField RECORD_FIELD_DESC = new org.apache.thrift.protocol.TField("record", org.apache.thrift.protocol.TType.I64, (short)1); - private static final org.apache.thrift.protocol.TField TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("timestamp", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField RECORDS_FIELD_DESC = new org.apache.thrift.protocol.TField("records", org.apache.thrift.protocol.TType.LIST, (short)1); + private static final org.apache.thrift.protocol.TField TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("timestamp", org.apache.thrift.protocol.TType.I64, (short)2); private static final org.apache.thrift.protocol.TField CREDS_FIELD_DESC = new org.apache.thrift.protocol.TField("creds", org.apache.thrift.protocol.TType.STRUCT, (short)3); private static final org.apache.thrift.protocol.TField TRANSACTION_FIELD_DESC = new org.apache.thrift.protocol.TField("transaction", org.apache.thrift.protocol.TType.STRUCT, (short)4); private static final org.apache.thrift.protocol.TField ENVIRONMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("environment", org.apache.thrift.protocol.TType.STRING, (short)5); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new traceRecordTimestr_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new traceRecordTimestr_argsTupleSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new traceRecordsTime_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new traceRecordsTime_argsTupleSchemeFactory(); - public long record; // required - public @org.apache.thrift.annotation.Nullable java.lang.String timestamp; // required + public @org.apache.thrift.annotation.Nullable java.util.List records; // required + public long timestamp; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction; // required public @org.apache.thrift.annotation.Nullable java.lang.String environment; // 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 { - RECORD((short)1, "record"), + RECORDS((short)1, "records"), TIMESTAMP((short)2, "timestamp"), CREDS((short)3, "creds"), TRANSACTION((short)4, "transaction"), @@ -695402,8 +699035,8 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { - case 1: // RECORD - return RECORD; + case 1: // RECORDS + return RECORDS; case 2: // TIMESTAMP return TIMESTAMP; case 3: // CREDS @@ -695455,15 +699088,16 @@ public java.lang.String getFieldName() { } // isset id assignments - private static final int __RECORD_ISSET_ID = 0; + private static final int __TIMESTAMP_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.RECORD, new org.apache.thrift.meta_data.FieldMetaData("record", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.RECORDS, new org.apache.thrift.meta_data.FieldMetaData("records", 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.I64)))); tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.CREDS, new org.apache.thrift.meta_data.FieldMetaData("creds", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.AccessToken.class))); tmpMap.put(_Fields.TRANSACTION, new org.apache.thrift.meta_data.FieldMetaData("transaction", org.apache.thrift.TFieldRequirementType.DEFAULT, @@ -695471,23 +699105,23 @@ public java.lang.String getFieldName() { tmpMap.put(_Fields.ENVIRONMENT, new org.apache.thrift.meta_data.FieldMetaData("environment", 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(traceRecordTimestr_args.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(traceRecordsTime_args.class, metaDataMap); } - public traceRecordTimestr_args() { + public traceRecordsTime_args() { } - public traceRecordTimestr_args( - long record, - java.lang.String timestamp, + public traceRecordsTime_args( + java.util.List records, + long timestamp, com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment) { this(); - this.record = record; - setRecordIsSet(true); + this.records = records; this.timestamp = timestamp; + setTimestampIsSet(true); this.creds = creds; this.transaction = transaction; this.environment = environment; @@ -695496,12 +699130,13 @@ public traceRecordTimestr_args( /** * Performs a deep copy on other. */ - public traceRecordTimestr_args(traceRecordTimestr_args other) { + public traceRecordsTime_args(traceRecordsTime_args other) { __isset_bitfield = other.__isset_bitfield; - this.record = other.record; - if (other.isSetTimestamp()) { - this.timestamp = other.timestamp; + if (other.isSetRecords()) { + java.util.List __this__records = new java.util.ArrayList(other.records); + this.records = __this__records; } + this.timestamp = other.timestamp; if (other.isSetCreds()) { this.creds = new com.cinchapi.concourse.thrift.AccessToken(other.creds); } @@ -695514,66 +699149,82 @@ public traceRecordTimestr_args(traceRecordTimestr_args other) { } @Override - public traceRecordTimestr_args deepCopy() { - return new traceRecordTimestr_args(this); + public traceRecordsTime_args deepCopy() { + return new traceRecordsTime_args(this); } @Override public void clear() { - setRecordIsSet(false); - this.record = 0; - this.timestamp = null; + this.records = null; + setTimestampIsSet(false); + this.timestamp = 0; this.creds = null; this.transaction = null; this.environment = null; } - public long getRecord() { - return this.record; + public int getRecordsSize() { + return (this.records == null) ? 0 : this.records.size(); } - public traceRecordTimestr_args setRecord(long record) { - this.record = record; - setRecordIsSet(true); + @org.apache.thrift.annotation.Nullable + public java.util.Iterator getRecordsIterator() { + return (this.records == null) ? null : this.records.iterator(); + } + + public void addToRecords(long elem) { + if (this.records == null) { + this.records = new java.util.ArrayList(); + } + this.records.add(elem); + } + + @org.apache.thrift.annotation.Nullable + public java.util.List getRecords() { + return this.records; + } + + public traceRecordsTime_args setRecords(@org.apache.thrift.annotation.Nullable java.util.List records) { + this.records = records; return this; } - public void unsetRecord() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __RECORD_ISSET_ID); + public void unsetRecords() { + this.records = null; } - /** Returns true if field record is set (has been assigned a value) and false otherwise */ - public boolean isSetRecord() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __RECORD_ISSET_ID); + /** Returns true if field records is set (has been assigned a value) and false otherwise */ + public boolean isSetRecords() { + return this.records != null; } - public void setRecordIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __RECORD_ISSET_ID, value); + public void setRecordsIsSet(boolean value) { + if (!value) { + this.records = null; + } } - @org.apache.thrift.annotation.Nullable - public java.lang.String getTimestamp() { + public long getTimestamp() { return this.timestamp; } - public traceRecordTimestr_args setTimestamp(@org.apache.thrift.annotation.Nullable java.lang.String timestamp) { + public traceRecordsTime_args setTimestamp(long timestamp) { this.timestamp = timestamp; + setTimestampIsSet(true); return this; } public void unsetTimestamp() { - this.timestamp = null; + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); } /** Returns true if field timestamp is set (has been assigned a value) and false otherwise */ public boolean isSetTimestamp() { - return this.timestamp != null; + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); } public void setTimestampIsSet(boolean value) { - if (!value) { - this.timestamp = null; - } + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TIMESTAMP_ISSET_ID, value); } @org.apache.thrift.annotation.Nullable @@ -695581,7 +699232,7 @@ public com.cinchapi.concourse.thrift.AccessToken getCreds() { return this.creds; } - public traceRecordTimestr_args setCreds(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds) { + public traceRecordsTime_args setCreds(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds) { this.creds = creds; return this; } @@ -695606,7 +699257,7 @@ public com.cinchapi.concourse.thrift.TransactionToken getTransaction() { return this.transaction; } - public traceRecordTimestr_args setTransaction(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction) { + public traceRecordsTime_args setTransaction(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction) { this.transaction = transaction; return this; } @@ -695631,7 +699282,7 @@ public java.lang.String getEnvironment() { return this.environment; } - public traceRecordTimestr_args setEnvironment(@org.apache.thrift.annotation.Nullable java.lang.String environment) { + public traceRecordsTime_args setEnvironment(@org.apache.thrift.annotation.Nullable java.lang.String environment) { this.environment = environment; return this; } @@ -695654,11 +699305,11 @@ public void setEnvironmentIsSet(boolean value) { @Override public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { - case RECORD: + case RECORDS: if (value == null) { - unsetRecord(); + unsetRecords(); } else { - setRecord((java.lang.Long)value); + setRecords((java.util.List)value); } break; @@ -695666,7 +699317,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetTimestamp(); } else { - setTimestamp((java.lang.String)value); + setTimestamp((java.lang.Long)value); } break; @@ -695701,8 +699352,8 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable @Override public java.lang.Object getFieldValue(_Fields field) { switch (field) { - case RECORD: - return getRecord(); + case RECORDS: + return getRecords(); case TIMESTAMP: return getTimestamp(); @@ -695728,8 +699379,8 @@ public boolean isSet(_Fields field) { } switch (field) { - case RECORD: - return isSetRecord(); + case RECORDS: + return isSetRecords(); case TIMESTAMP: return isSetTimestamp(); case CREDS: @@ -695744,32 +699395,32 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that instanceof traceRecordTimestr_args) - return this.equals((traceRecordTimestr_args)that); + if (that instanceof traceRecordsTime_args) + return this.equals((traceRecordsTime_args)that); return false; } - public boolean equals(traceRecordTimestr_args that) { + public boolean equals(traceRecordsTime_args that) { if (that == null) return false; if (this == that) return true; - boolean this_present_record = true; - boolean that_present_record = true; - if (this_present_record || that_present_record) { - if (!(this_present_record && that_present_record)) + boolean this_present_records = true && this.isSetRecords(); + boolean that_present_records = true && that.isSetRecords(); + if (this_present_records || that_present_records) { + if (!(this_present_records && that_present_records)) return false; - if (this.record != that.record) + if (!this.records.equals(that.records)) return false; } - boolean this_present_timestamp = true && this.isSetTimestamp(); - boolean that_present_timestamp = true && that.isSetTimestamp(); + boolean this_present_timestamp = true; + boolean that_present_timestamp = true; if (this_present_timestamp || that_present_timestamp) { if (!(this_present_timestamp && that_present_timestamp)) return false; - if (!this.timestamp.equals(that.timestamp)) + if (this.timestamp != that.timestamp) return false; } @@ -695807,11 +699458,11 @@ public boolean equals(traceRecordTimestr_args that) { public int hashCode() { int hashCode = 1; - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(record); + hashCode = hashCode * 8191 + ((isSetRecords()) ? 131071 : 524287); + if (isSetRecords()) + hashCode = hashCode * 8191 + records.hashCode(); - hashCode = hashCode * 8191 + ((isSetTimestamp()) ? 131071 : 524287); - if (isSetTimestamp()) - hashCode = hashCode * 8191 + timestamp.hashCode(); + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(timestamp); hashCode = hashCode * 8191 + ((isSetCreds()) ? 131071 : 524287); if (isSetCreds()) @@ -695829,19 +699480,19 @@ public int hashCode() { } @Override - public int compareTo(traceRecordTimestr_args other) { + public int compareTo(traceRecordsTime_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; - lastComparison = java.lang.Boolean.compare(isSetRecord(), other.isSetRecord()); + lastComparison = java.lang.Boolean.compare(isSetRecords(), other.isSetRecords()); if (lastComparison != 0) { return lastComparison; } - if (isSetRecord()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.record, other.record); + if (isSetRecords()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.records, other.records); if (lastComparison != 0) { return lastComparison; } @@ -695907,21 +699558,21 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("traceRecordTimestr_args("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("traceRecordsTime_args("); boolean first = true; - sb.append("record:"); - sb.append(this.record); - first = false; - if (!first) sb.append(", "); - sb.append("timestamp:"); - if (this.timestamp == null) { + sb.append("records:"); + if (this.records == null) { sb.append("null"); } else { - sb.append(this.timestamp); + sb.append(this.records); } first = false; if (!first) sb.append(", "); + sb.append("timestamp:"); + sb.append(this.timestamp); + first = false; + if (!first) sb.append(", "); sb.append("creds:"); if (this.creds == null) { sb.append("null"); @@ -695978,17 +699629,17 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class traceRecordTimestr_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class traceRecordsTime_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public traceRecordTimestr_argsStandardScheme getScheme() { - return new traceRecordTimestr_argsStandardScheme(); + public traceRecordsTime_argsStandardScheme getScheme() { + return new traceRecordsTime_argsStandardScheme(); } } - private static class traceRecordTimestr_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class traceRecordsTime_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordTimestr_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordsTime_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -695998,17 +699649,27 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordTimestr_ break; } switch (schemeField.id) { - case 1: // RECORD - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.record = iprot.readI64(); - struct.setRecordIsSet(true); + case 1: // RECORDS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list7130 = iprot.readListBegin(); + struct.records = new java.util.ArrayList(_list7130.size); + long _elem7131; + for (int _i7132 = 0; _i7132 < _list7130.size; ++_i7132) + { + _elem7131 = iprot.readI64(); + struct.records.add(_elem7131); + } + iprot.readListEnd(); + } + struct.setRecordsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // TIMESTAMP - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.timestamp = iprot.readString(); + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.timestamp = iprot.readI64(); struct.setTimestampIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); @@ -696052,18 +699713,25 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordTimestr_ } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecordTimestr_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecordsTime_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(RECORD_FIELD_DESC); - oprot.writeI64(struct.record); - oprot.writeFieldEnd(); - if (struct.timestamp != null) { - oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC); - oprot.writeString(struct.timestamp); + if (struct.records != null) { + oprot.writeFieldBegin(RECORDS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, struct.records.size())); + for (long _iter7133 : struct.records) + { + oprot.writeI64(_iter7133); + } + oprot.writeListEnd(); + } oprot.writeFieldEnd(); } + oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC); + oprot.writeI64(struct.timestamp); + oprot.writeFieldEnd(); if (struct.creds != null) { oprot.writeFieldBegin(CREDS_FIELD_DESC); struct.creds.write(oprot); @@ -696085,20 +699753,20 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecordTimestr } - private static class traceRecordTimestr_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class traceRecordsTime_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public traceRecordTimestr_argsTupleScheme getScheme() { - return new traceRecordTimestr_argsTupleScheme(); + public traceRecordsTime_argsTupleScheme getScheme() { + return new traceRecordsTime_argsTupleScheme(); } } - private static class traceRecordTimestr_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class traceRecordsTime_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordTimestr_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordsTime_args 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.isSetRecord()) { + if (struct.isSetRecords()) { optionals.set(0); } if (struct.isSetTimestamp()) { @@ -696114,11 +699782,17 @@ public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordTimestr_ optionals.set(4); } oprot.writeBitSet(optionals, 5); - if (struct.isSetRecord()) { - oprot.writeI64(struct.record); + if (struct.isSetRecords()) { + { + oprot.writeI32(struct.records.size()); + for (long _iter7134 : struct.records) + { + oprot.writeI64(_iter7134); + } + } } if (struct.isSetTimestamp()) { - oprot.writeString(struct.timestamp); + oprot.writeI64(struct.timestamp); } if (struct.isSetCreds()) { struct.creds.write(oprot); @@ -696132,15 +699806,24 @@ public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordTimestr_ } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, traceRecordTimestr_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, traceRecordsTime_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(5); if (incoming.get(0)) { - struct.record = iprot.readI64(); - struct.setRecordIsSet(true); + { + org.apache.thrift.protocol.TList _list7135 = iprot.readListBegin(org.apache.thrift.protocol.TType.I64); + struct.records = new java.util.ArrayList(_list7135.size); + long _elem7136; + for (int _i7137 = 0; _i7137 < _list7135.size; ++_i7137) + { + _elem7136 = iprot.readI64(); + struct.records.add(_elem7136); + } + } + struct.setRecordsIsSet(true); } if (incoming.get(1)) { - struct.timestamp = iprot.readString(); + struct.timestamp = iprot.readI64(); struct.setTimestampIsSet(true); } if (incoming.get(2)) { @@ -696165,18 +699848,18 @@ private static S scheme(org.apache. } } - public static class traceRecordTimestr_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("traceRecordTimestr_result"); + public static class traceRecordsTime_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("traceRecordsTime_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.MAP, (short)0); private static final org.apache.thrift.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField EX2_FIELD_DESC = new org.apache.thrift.protocol.TField("ex2", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField EX3_FIELD_DESC = new org.apache.thrift.protocol.TField("ex3", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new traceRecordTimestr_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new traceRecordTimestr_resultTupleSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new traceRecordsTime_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new traceRecordsTime_resultTupleSchemeFactory(); - public @org.apache.thrift.annotation.Nullable java.util.Map> success; // required + public @org.apache.thrift.annotation.Nullable java.util.Map>> success; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3; // required @@ -696258,9 +699941,11 @@ public java.lang.String getFieldName() { 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.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), - new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))))); + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64), + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), + new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)))))); tmpMap.put(_Fields.EX, new org.apache.thrift.meta_data.FieldMetaData("ex", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.SecurityException.class))); tmpMap.put(_Fields.EX2, new org.apache.thrift.meta_data.FieldMetaData("ex2", org.apache.thrift.TFieldRequirementType.DEFAULT, @@ -696268,14 +699953,14 @@ public java.lang.String getFieldName() { tmpMap.put(_Fields.EX3, new org.apache.thrift.meta_data.FieldMetaData("ex3", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.PermissionException.class))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(traceRecordTimestr_result.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(traceRecordsTime_result.class, metaDataMap); } - public traceRecordTimestr_result() { + public traceRecordsTime_result() { } - public traceRecordTimestr_result( - java.util.Map> success, + public traceRecordsTime_result( + java.util.Map>> success, com.cinchapi.concourse.thrift.SecurityException ex, com.cinchapi.concourse.thrift.TransactionException ex2, com.cinchapi.concourse.thrift.PermissionException ex3) @@ -696290,17 +699975,28 @@ public traceRecordTimestr_result( /** * Performs a deep copy on other. */ - public traceRecordTimestr_result(traceRecordTimestr_result other) { + public traceRecordsTime_result(traceRecordsTime_result other) { if (other.isSetSuccess()) { - java.util.Map> __this__success = new java.util.LinkedHashMap>(other.success.size()); - for (java.util.Map.Entry> other_element : other.success.entrySet()) { + java.util.Map>> __this__success = new java.util.LinkedHashMap>>(other.success.size()); + for (java.util.Map.Entry>> other_element : other.success.entrySet()) { - java.lang.String other_element_key = other_element.getKey(); - java.util.Set other_element_value = other_element.getValue(); + java.lang.Long other_element_key = other_element.getKey(); + java.util.Map> other_element_value = other_element.getValue(); - java.lang.String __this__success_copy_key = other_element_key; + java.lang.Long __this__success_copy_key = other_element_key; - java.util.Set __this__success_copy_value = new java.util.LinkedHashSet(other_element_value); + java.util.Map> __this__success_copy_value = new java.util.LinkedHashMap>(other_element_value.size()); + for (java.util.Map.Entry> other_element_value_element : other_element_value.entrySet()) { + + java.lang.String other_element_value_element_key = other_element_value_element.getKey(); + java.util.Set other_element_value_element_value = other_element_value_element.getValue(); + + java.lang.String __this__success_copy_value_copy_key = other_element_value_element_key; + + java.util.Set __this__success_copy_value_copy_value = new java.util.LinkedHashSet(other_element_value_element_value); + + __this__success_copy_value.put(__this__success_copy_value_copy_key, __this__success_copy_value_copy_value); + } __this__success.put(__this__success_copy_key, __this__success_copy_value); } @@ -696318,8 +700014,8 @@ public traceRecordTimestr_result(traceRecordTimestr_result other) { } @Override - public traceRecordTimestr_result deepCopy() { - return new traceRecordTimestr_result(this); + public traceRecordsTime_result deepCopy() { + return new traceRecordsTime_result(this); } @Override @@ -696334,19 +700030,19 @@ public int getSuccessSize() { return (this.success == null) ? 0 : this.success.size(); } - public void putToSuccess(java.lang.String key, java.util.Set val) { + public void putToSuccess(long key, java.util.Map> val) { if (this.success == null) { - this.success = new java.util.LinkedHashMap>(); + this.success = new java.util.LinkedHashMap>>(); } this.success.put(key, val); } @org.apache.thrift.annotation.Nullable - public java.util.Map> getSuccess() { + public java.util.Map>> getSuccess() { return this.success; } - public traceRecordTimestr_result setSuccess(@org.apache.thrift.annotation.Nullable java.util.Map> success) { + public traceRecordsTime_result setSuccess(@org.apache.thrift.annotation.Nullable java.util.Map>> success) { this.success = success; return this; } @@ -696371,7 +700067,7 @@ public com.cinchapi.concourse.thrift.SecurityException getEx() { return this.ex; } - public traceRecordTimestr_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { + public traceRecordsTime_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { this.ex = ex; return this; } @@ -696396,7 +700092,7 @@ public com.cinchapi.concourse.thrift.TransactionException getEx2() { return this.ex2; } - public traceRecordTimestr_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { + public traceRecordsTime_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { this.ex2 = ex2; return this; } @@ -696421,7 +700117,7 @@ public com.cinchapi.concourse.thrift.PermissionException getEx3() { return this.ex3; } - public traceRecordTimestr_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3) { + public traceRecordsTime_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3) { this.ex3 = ex3; return this; } @@ -696448,7 +700144,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetSuccess(); } else { - setSuccess((java.util.Map>)value); + setSuccess((java.util.Map>>)value); } break; @@ -696521,12 +700217,12 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that instanceof traceRecordTimestr_result) - return this.equals((traceRecordTimestr_result)that); + if (that instanceof traceRecordsTime_result) + return this.equals((traceRecordsTime_result)that); return false; } - public boolean equals(traceRecordTimestr_result that) { + public boolean equals(traceRecordsTime_result that) { if (that == null) return false; if (this == that) @@ -696595,7 +700291,7 @@ public int hashCode() { } @Override - public int compareTo(traceRecordTimestr_result other) { + public int compareTo(traceRecordsTime_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -696662,7 +700358,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("traceRecordTimestr_result("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("traceRecordsTime_result("); boolean first = true; sb.append("success:"); @@ -696721,17 +700417,17 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class traceRecordTimestr_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class traceRecordsTime_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public traceRecordTimestr_resultStandardScheme getScheme() { - return new traceRecordTimestr_resultStandardScheme(); + public traceRecordsTime_resultStandardScheme getScheme() { + return new traceRecordsTime_resultStandardScheme(); } } - private static class traceRecordTimestr_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class traceRecordsTime_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordTimestr_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordsTime_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -696744,25 +700440,37 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordTimestr_ case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { - org.apache.thrift.protocol.TMap _map7076 = iprot.readMapBegin(); - struct.success = new java.util.LinkedHashMap>(2*_map7076.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key7077; - @org.apache.thrift.annotation.Nullable java.util.Set _val7078; - for (int _i7079 = 0; _i7079 < _map7076.size; ++_i7079) + org.apache.thrift.protocol.TMap _map7138 = iprot.readMapBegin(); + struct.success = new java.util.LinkedHashMap>>(2*_map7138.size); + long _key7139; + @org.apache.thrift.annotation.Nullable java.util.Map> _val7140; + for (int _i7141 = 0; _i7141 < _map7138.size; ++_i7141) { - _key7077 = iprot.readString(); + _key7139 = iprot.readI64(); { - org.apache.thrift.protocol.TSet _set7080 = iprot.readSetBegin(); - _val7078 = new java.util.LinkedHashSet(2*_set7080.size); - long _elem7081; - for (int _i7082 = 0; _i7082 < _set7080.size; ++_i7082) + org.apache.thrift.protocol.TMap _map7142 = iprot.readMapBegin(); + _val7140 = new java.util.LinkedHashMap>(2*_map7142.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key7143; + @org.apache.thrift.annotation.Nullable java.util.Set _val7144; + for (int _i7145 = 0; _i7145 < _map7142.size; ++_i7145) { - _elem7081 = iprot.readI64(); - _val7078.add(_elem7081); + _key7143 = iprot.readString(); + { + org.apache.thrift.protocol.TSet _set7146 = iprot.readSetBegin(); + _val7144 = new java.util.LinkedHashSet(2*_set7146.size); + long _elem7147; + for (int _i7148 = 0; _i7148 < _set7146.size; ++_i7148) + { + _elem7147 = iprot.readI64(); + _val7144.add(_elem7147); + } + iprot.readSetEnd(); + } + _val7140.put(_key7143, _val7144); } - iprot.readSetEnd(); + iprot.readMapEnd(); } - struct.success.put(_key7077, _val7078); + struct.success.put(_key7139, _val7140); } iprot.readMapEnd(); } @@ -696810,24 +700518,32 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordTimestr_ } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecordTimestr_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecordsTime_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.SET, struct.success.size())); - for (java.util.Map.Entry> _iter7083 : struct.success.entrySet()) + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.MAP, struct.success.size())); + for (java.util.Map.Entry>> _iter7149 : struct.success.entrySet()) { - oprot.writeString(_iter7083.getKey()); + oprot.writeI64(_iter7149.getKey()); { - oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I64, _iter7083.getValue().size())); - for (long _iter7084 : _iter7083.getValue()) + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.SET, _iter7149.getValue().size())); + for (java.util.Map.Entry> _iter7150 : _iter7149.getValue().entrySet()) { - oprot.writeI64(_iter7084); + oprot.writeString(_iter7150.getKey()); + { + oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I64, _iter7150.getValue().size())); + for (long _iter7151 : _iter7150.getValue()) + { + oprot.writeI64(_iter7151); + } + oprot.writeSetEnd(); + } } - oprot.writeSetEnd(); + oprot.writeMapEnd(); } } oprot.writeMapEnd(); @@ -696855,17 +700571,17 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecordTimestr } - private static class traceRecordTimestr_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class traceRecordsTime_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public traceRecordTimestr_resultTupleScheme getScheme() { - return new traceRecordTimestr_resultTupleScheme(); + public traceRecordsTime_resultTupleScheme getScheme() { + return new traceRecordsTime_resultTupleScheme(); } } - private static class traceRecordTimestr_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class traceRecordsTime_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordTimestr_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordsTime_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()) { @@ -696884,14 +700600,21 @@ public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordTimestr_ if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); - for (java.util.Map.Entry> _iter7085 : struct.success.entrySet()) + for (java.util.Map.Entry>> _iter7152 : struct.success.entrySet()) { - oprot.writeString(_iter7085.getKey()); + oprot.writeI64(_iter7152.getKey()); { - oprot.writeI32(_iter7085.getValue().size()); - for (long _iter7086 : _iter7085.getValue()) + oprot.writeI32(_iter7152.getValue().size()); + for (java.util.Map.Entry> _iter7153 : _iter7152.getValue().entrySet()) { - oprot.writeI64(_iter7086); + oprot.writeString(_iter7153.getKey()); + { + oprot.writeI32(_iter7153.getValue().size()); + for (long _iter7154 : _iter7153.getValue()) + { + oprot.writeI64(_iter7154); + } + } } } } @@ -696909,29 +700632,40 @@ public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordTimestr_ } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, traceRecordTimestr_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, traceRecordsTime_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(4); if (incoming.get(0)) { { - org.apache.thrift.protocol.TMap _map7087 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.SET); - struct.success = new java.util.LinkedHashMap>(2*_map7087.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key7088; - @org.apache.thrift.annotation.Nullable java.util.Set _val7089; - for (int _i7090 = 0; _i7090 < _map7087.size; ++_i7090) + org.apache.thrift.protocol.TMap _map7155 = iprot.readMapBegin(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.MAP); + struct.success = new java.util.LinkedHashMap>>(2*_map7155.size); + long _key7156; + @org.apache.thrift.annotation.Nullable java.util.Map> _val7157; + for (int _i7158 = 0; _i7158 < _map7155.size; ++_i7158) { - _key7088 = iprot.readString(); + _key7156 = iprot.readI64(); { - org.apache.thrift.protocol.TSet _set7091 = iprot.readSetBegin(org.apache.thrift.protocol.TType.I64); - _val7089 = new java.util.LinkedHashSet(2*_set7091.size); - long _elem7092; - for (int _i7093 = 0; _i7093 < _set7091.size; ++_i7093) + org.apache.thrift.protocol.TMap _map7159 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.SET); + _val7157 = new java.util.LinkedHashMap>(2*_map7159.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key7160; + @org.apache.thrift.annotation.Nullable java.util.Set _val7161; + for (int _i7162 = 0; _i7162 < _map7159.size; ++_i7162) { - _elem7092 = iprot.readI64(); - _val7089.add(_elem7092); + _key7160 = iprot.readString(); + { + org.apache.thrift.protocol.TSet _set7163 = iprot.readSetBegin(org.apache.thrift.protocol.TType.I64); + _val7161 = new java.util.LinkedHashSet(2*_set7163.size); + long _elem7164; + for (int _i7165 = 0; _i7165 < _set7163.size; ++_i7165) + { + _elem7164 = iprot.readI64(); + _val7161.add(_elem7164); + } + } + _val7157.put(_key7160, _val7161); } } - struct.success.put(_key7088, _val7089); + struct.success.put(_key7156, _val7157); } } struct.setSuccessIsSet(true); @@ -696959,18 +700693,20 @@ private static S scheme(org.apache. } } - public static class traceRecords_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("traceRecords_args"); + public static class traceRecordsTimestr_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("traceRecordsTimestr_args"); private static final org.apache.thrift.protocol.TField RECORDS_FIELD_DESC = new org.apache.thrift.protocol.TField("records", org.apache.thrift.protocol.TType.LIST, (short)1); - private static final org.apache.thrift.protocol.TField CREDS_FIELD_DESC = new org.apache.thrift.protocol.TField("creds", org.apache.thrift.protocol.TType.STRUCT, (short)2); - private static final org.apache.thrift.protocol.TField TRANSACTION_FIELD_DESC = new org.apache.thrift.protocol.TField("transaction", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.protocol.TField ENVIRONMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("environment", org.apache.thrift.protocol.TType.STRING, (short)4); + private static final org.apache.thrift.protocol.TField TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("timestamp", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField CREDS_FIELD_DESC = new org.apache.thrift.protocol.TField("creds", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final org.apache.thrift.protocol.TField TRANSACTION_FIELD_DESC = new org.apache.thrift.protocol.TField("transaction", org.apache.thrift.protocol.TType.STRUCT, (short)4); + private static final org.apache.thrift.protocol.TField ENVIRONMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("environment", org.apache.thrift.protocol.TType.STRING, (short)5); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new traceRecords_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new traceRecords_argsTupleSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new traceRecordsTimestr_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new traceRecordsTimestr_argsTupleSchemeFactory(); public @org.apache.thrift.annotation.Nullable java.util.List records; // required + public @org.apache.thrift.annotation.Nullable java.lang.String timestamp; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction; // required public @org.apache.thrift.annotation.Nullable java.lang.String environment; // required @@ -696978,9 +700714,10 @@ public static class traceRecords_args implements org.apache.thrift.TBase byName = new java.util.LinkedHashMap(); @@ -696998,11 +700735,13 @@ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // RECORDS return RECORDS; - case 2: // CREDS + case 2: // TIMESTAMP + return TIMESTAMP; + case 3: // CREDS return CREDS; - case 3: // TRANSACTION + case 4: // TRANSACTION return TRANSACTION; - case 4: // ENVIRONMENT + case 5: // ENVIRONMENT return ENVIRONMENT; default: return null; @@ -697053,6 +700792,8 @@ public java.lang.String getFieldName() { tmpMap.put(_Fields.RECORDS, new org.apache.thrift.meta_data.FieldMetaData("records", 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.I64)))); + tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.CREDS, new org.apache.thrift.meta_data.FieldMetaData("creds", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.AccessToken.class))); tmpMap.put(_Fields.TRANSACTION, new org.apache.thrift.meta_data.FieldMetaData("transaction", org.apache.thrift.TFieldRequirementType.DEFAULT, @@ -697060,20 +700801,22 @@ public java.lang.String getFieldName() { tmpMap.put(_Fields.ENVIRONMENT, new org.apache.thrift.meta_data.FieldMetaData("environment", 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(traceRecords_args.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(traceRecordsTimestr_args.class, metaDataMap); } - public traceRecords_args() { + public traceRecordsTimestr_args() { } - public traceRecords_args( + public traceRecordsTimestr_args( java.util.List records, + java.lang.String timestamp, com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment) { this(); this.records = records; + this.timestamp = timestamp; this.creds = creds; this.transaction = transaction; this.environment = environment; @@ -697082,11 +700825,14 @@ public traceRecords_args( /** * Performs a deep copy on other. */ - public traceRecords_args(traceRecords_args other) { + public traceRecordsTimestr_args(traceRecordsTimestr_args other) { if (other.isSetRecords()) { java.util.List __this__records = new java.util.ArrayList(other.records); this.records = __this__records; } + if (other.isSetTimestamp()) { + this.timestamp = other.timestamp; + } if (other.isSetCreds()) { this.creds = new com.cinchapi.concourse.thrift.AccessToken(other.creds); } @@ -697099,13 +700845,14 @@ public traceRecords_args(traceRecords_args other) { } @Override - public traceRecords_args deepCopy() { - return new traceRecords_args(this); + public traceRecordsTimestr_args deepCopy() { + return new traceRecordsTimestr_args(this); } @Override public void clear() { this.records = null; + this.timestamp = null; this.creds = null; this.transaction = null; this.environment = null; @@ -697132,7 +700879,7 @@ public java.util.List getRecords() { return this.records; } - public traceRecords_args setRecords(@org.apache.thrift.annotation.Nullable java.util.List records) { + public traceRecordsTimestr_args setRecords(@org.apache.thrift.annotation.Nullable java.util.List records) { this.records = records; return this; } @@ -697152,12 +700899,37 @@ public void setRecordsIsSet(boolean value) { } } + @org.apache.thrift.annotation.Nullable + public java.lang.String getTimestamp() { + return this.timestamp; + } + + public traceRecordsTimestr_args setTimestamp(@org.apache.thrift.annotation.Nullable java.lang.String timestamp) { + this.timestamp = timestamp; + return this; + } + + public void unsetTimestamp() { + this.timestamp = null; + } + + /** Returns true if field timestamp is set (has been assigned a value) and false otherwise */ + public boolean isSetTimestamp() { + return this.timestamp != null; + } + + public void setTimestampIsSet(boolean value) { + if (!value) { + this.timestamp = null; + } + } + @org.apache.thrift.annotation.Nullable public com.cinchapi.concourse.thrift.AccessToken getCreds() { return this.creds; } - public traceRecords_args setCreds(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds) { + public traceRecordsTimestr_args setCreds(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds) { this.creds = creds; return this; } @@ -697182,7 +700954,7 @@ public com.cinchapi.concourse.thrift.TransactionToken getTransaction() { return this.transaction; } - public traceRecords_args setTransaction(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction) { + public traceRecordsTimestr_args setTransaction(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction) { this.transaction = transaction; return this; } @@ -697207,7 +700979,7 @@ public java.lang.String getEnvironment() { return this.environment; } - public traceRecords_args setEnvironment(@org.apache.thrift.annotation.Nullable java.lang.String environment) { + public traceRecordsTimestr_args setEnvironment(@org.apache.thrift.annotation.Nullable java.lang.String environment) { this.environment = environment; return this; } @@ -697238,6 +701010,14 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } break; + case TIMESTAMP: + if (value == null) { + unsetTimestamp(); + } else { + setTimestamp((java.lang.String)value); + } + break; + case CREDS: if (value == null) { unsetCreds(); @@ -697272,6 +701052,9 @@ public java.lang.Object getFieldValue(_Fields field) { case RECORDS: return getRecords(); + case TIMESTAMP: + return getTimestamp(); + case CREDS: return getCreds(); @@ -697295,6 +701078,8 @@ public boolean isSet(_Fields field) { switch (field) { case RECORDS: return isSetRecords(); + case TIMESTAMP: + return isSetTimestamp(); case CREDS: return isSetCreds(); case TRANSACTION: @@ -697307,12 +701092,12 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that instanceof traceRecords_args) - return this.equals((traceRecords_args)that); + if (that instanceof traceRecordsTimestr_args) + return this.equals((traceRecordsTimestr_args)that); return false; } - public boolean equals(traceRecords_args that) { + public boolean equals(traceRecordsTimestr_args that) { if (that == null) return false; if (this == that) @@ -697327,6 +701112,15 @@ public boolean equals(traceRecords_args that) { return false; } + boolean this_present_timestamp = true && this.isSetTimestamp(); + boolean that_present_timestamp = true && that.isSetTimestamp(); + if (this_present_timestamp || that_present_timestamp) { + if (!(this_present_timestamp && that_present_timestamp)) + return false; + if (!this.timestamp.equals(that.timestamp)) + return false; + } + boolean this_present_creds = true && this.isSetCreds(); boolean that_present_creds = true && that.isSetCreds(); if (this_present_creds || that_present_creds) { @@ -697365,6 +701159,10 @@ public int hashCode() { if (isSetRecords()) hashCode = hashCode * 8191 + records.hashCode(); + hashCode = hashCode * 8191 + ((isSetTimestamp()) ? 131071 : 524287); + if (isSetTimestamp()) + hashCode = hashCode * 8191 + timestamp.hashCode(); + hashCode = hashCode * 8191 + ((isSetCreds()) ? 131071 : 524287); if (isSetCreds()) hashCode = hashCode * 8191 + creds.hashCode(); @@ -697381,7 +701179,7 @@ public int hashCode() { } @Override - public int compareTo(traceRecords_args other) { + public int compareTo(traceRecordsTimestr_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -697398,6 +701196,16 @@ public int compareTo(traceRecords_args other) { return lastComparison; } } + lastComparison = java.lang.Boolean.compare(isSetTimestamp(), other.isSetTimestamp()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTimestamp()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, other.timestamp); + if (lastComparison != 0) { + return lastComparison; + } + } lastComparison = java.lang.Boolean.compare(isSetCreds(), other.isSetCreds()); if (lastComparison != 0) { return lastComparison; @@ -697449,7 +701257,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("traceRecords_args("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("traceRecordsTimestr_args("); boolean first = true; sb.append("records:"); @@ -697460,6 +701268,14 @@ public java.lang.String toString() { } first = false; if (!first) sb.append(", "); + sb.append("timestamp:"); + if (this.timestamp == null) { + sb.append("null"); + } else { + sb.append(this.timestamp); + } + first = false; + if (!first) sb.append(", "); sb.append("creds:"); if (this.creds == null) { sb.append("null"); @@ -697514,17 +701330,17 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class traceRecords_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class traceRecordsTimestr_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public traceRecords_argsStandardScheme getScheme() { - return new traceRecords_argsStandardScheme(); + public traceRecordsTimestr_argsStandardScheme getScheme() { + return new traceRecordsTimestr_argsStandardScheme(); } } - private static class traceRecords_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class traceRecordsTimestr_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecords_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordsTimestr_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -697537,13 +701353,13 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecords_args s case 1: // RECORDS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list7094 = iprot.readListBegin(); - struct.records = new java.util.ArrayList(_list7094.size); - long _elem7095; - for (int _i7096 = 0; _i7096 < _list7094.size; ++_i7096) + org.apache.thrift.protocol.TList _list7166 = iprot.readListBegin(); + struct.records = new java.util.ArrayList(_list7166.size); + long _elem7167; + for (int _i7168 = 0; _i7168 < _list7166.size; ++_i7168) { - _elem7095 = iprot.readI64(); - struct.records.add(_elem7095); + _elem7167 = iprot.readI64(); + struct.records.add(_elem7167); } iprot.readListEnd(); } @@ -697552,7 +701368,15 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecords_args s org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 2: // CREDS + case 2: // TIMESTAMP + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.timestamp = iprot.readString(); + struct.setTimestampIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // CREDS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); struct.creds.read(iprot); @@ -697561,7 +701385,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecords_args s org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 3: // TRANSACTION + case 4: // TRANSACTION if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.transaction = new com.cinchapi.concourse.thrift.TransactionToken(); struct.transaction.read(iprot); @@ -697570,7 +701394,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecords_args s org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 4: // ENVIRONMENT + case 5: // ENVIRONMENT if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.environment = iprot.readString(); struct.setEnvironmentIsSet(true); @@ -697590,7 +701414,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecords_args s } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecords_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecordsTimestr_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); @@ -697598,14 +701422,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecords_args oprot.writeFieldBegin(RECORDS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, struct.records.size())); - for (long _iter7097 : struct.records) + for (long _iter7169 : struct.records) { - oprot.writeI64(_iter7097); + oprot.writeI64(_iter7169); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } + if (struct.timestamp != null) { + oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC); + oprot.writeString(struct.timestamp); + oprot.writeFieldEnd(); + } if (struct.creds != null) { oprot.writeFieldBegin(CREDS_FIELD_DESC); struct.creds.write(oprot); @@ -697627,41 +701456,47 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecords_args } - private static class traceRecords_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class traceRecordsTimestr_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public traceRecords_argsTupleScheme getScheme() { - return new traceRecords_argsTupleScheme(); + public traceRecordsTimestr_argsTupleScheme getScheme() { + return new traceRecordsTimestr_argsTupleScheme(); } } - private static class traceRecords_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class traceRecordsTimestr_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, traceRecords_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordsTimestr_args 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.isSetRecords()) { optionals.set(0); } - if (struct.isSetCreds()) { + if (struct.isSetTimestamp()) { optionals.set(1); } - if (struct.isSetTransaction()) { + if (struct.isSetCreds()) { optionals.set(2); } - if (struct.isSetEnvironment()) { + if (struct.isSetTransaction()) { optionals.set(3); } - oprot.writeBitSet(optionals, 4); + if (struct.isSetEnvironment()) { + optionals.set(4); + } + oprot.writeBitSet(optionals, 5); if (struct.isSetRecords()) { { oprot.writeI32(struct.records.size()); - for (long _iter7098 : struct.records) + for (long _iter7170 : struct.records) { - oprot.writeI64(_iter7098); + oprot.writeI64(_iter7170); } } } + if (struct.isSetTimestamp()) { + oprot.writeString(struct.timestamp); + } if (struct.isSetCreds()) { struct.creds.write(oprot); } @@ -697674,33 +701509,37 @@ public void write(org.apache.thrift.protocol.TProtocol prot, traceRecords_args s } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, traceRecords_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, traceRecordsTimestr_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(4); + java.util.BitSet incoming = iprot.readBitSet(5); if (incoming.get(0)) { { - org.apache.thrift.protocol.TList _list7099 = iprot.readListBegin(org.apache.thrift.protocol.TType.I64); - struct.records = new java.util.ArrayList(_list7099.size); - long _elem7100; - for (int _i7101 = 0; _i7101 < _list7099.size; ++_i7101) + org.apache.thrift.protocol.TList _list7171 = iprot.readListBegin(org.apache.thrift.protocol.TType.I64); + struct.records = new java.util.ArrayList(_list7171.size); + long _elem7172; + for (int _i7173 = 0; _i7173 < _list7171.size; ++_i7173) { - _elem7100 = iprot.readI64(); - struct.records.add(_elem7100); + _elem7172 = iprot.readI64(); + struct.records.add(_elem7172); } } struct.setRecordsIsSet(true); } if (incoming.get(1)) { + struct.timestamp = iprot.readString(); + struct.setTimestampIsSet(true); + } + if (incoming.get(2)) { struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); struct.creds.read(iprot); struct.setCredsIsSet(true); } - if (incoming.get(2)) { + if (incoming.get(3)) { struct.transaction = new com.cinchapi.concourse.thrift.TransactionToken(); struct.transaction.read(iprot); struct.setTransactionIsSet(true); } - if (incoming.get(3)) { + if (incoming.get(4)) { struct.environment = iprot.readString(); struct.setEnvironmentIsSet(true); } @@ -697712,16 +701551,16 @@ private static S scheme(org.apache. } } - public static class traceRecords_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("traceRecords_result"); + public static class traceRecordsTimestr_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("traceRecordsTimestr_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.MAP, (short)0); private static final org.apache.thrift.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField EX2_FIELD_DESC = new org.apache.thrift.protocol.TField("ex2", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField EX3_FIELD_DESC = new org.apache.thrift.protocol.TField("ex3", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new traceRecords_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new traceRecords_resultTupleSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new traceRecordsTimestr_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new traceRecordsTimestr_resultTupleSchemeFactory(); public @org.apache.thrift.annotation.Nullable java.util.Map>> success; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex; // required @@ -697817,13 +701656,13 @@ public java.lang.String getFieldName() { tmpMap.put(_Fields.EX3, new org.apache.thrift.meta_data.FieldMetaData("ex3", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.PermissionException.class))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(traceRecords_result.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(traceRecordsTimestr_result.class, metaDataMap); } - public traceRecords_result() { + public traceRecordsTimestr_result() { } - public traceRecords_result( + public traceRecordsTimestr_result( java.util.Map>> success, com.cinchapi.concourse.thrift.SecurityException ex, com.cinchapi.concourse.thrift.TransactionException ex2, @@ -697839,7 +701678,7 @@ public traceRecords_result( /** * Performs a deep copy on other. */ - public traceRecords_result(traceRecords_result other) { + public traceRecordsTimestr_result(traceRecordsTimestr_result other) { if (other.isSetSuccess()) { java.util.Map>> __this__success = new java.util.LinkedHashMap>>(other.success.size()); for (java.util.Map.Entry>> other_element : other.success.entrySet()) { @@ -697878,8 +701717,8 @@ public traceRecords_result(traceRecords_result other) { } @Override - public traceRecords_result deepCopy() { - return new traceRecords_result(this); + public traceRecordsTimestr_result deepCopy() { + return new traceRecordsTimestr_result(this); } @Override @@ -697906,7 +701745,7 @@ public java.util.Map>> success) { + public traceRecordsTimestr_result setSuccess(@org.apache.thrift.annotation.Nullable java.util.Map>> success) { this.success = success; return this; } @@ -697931,7 +701770,7 @@ public com.cinchapi.concourse.thrift.SecurityException getEx() { return this.ex; } - public traceRecords_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { + public traceRecordsTimestr_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { this.ex = ex; return this; } @@ -697956,7 +701795,7 @@ public com.cinchapi.concourse.thrift.TransactionException getEx2() { return this.ex2; } - public traceRecords_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { + public traceRecordsTimestr_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { this.ex2 = ex2; return this; } @@ -697981,7 +701820,7 @@ public com.cinchapi.concourse.thrift.PermissionException getEx3() { return this.ex3; } - public traceRecords_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3) { + public traceRecordsTimestr_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3) { this.ex3 = ex3; return this; } @@ -698081,12 +701920,12 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that instanceof traceRecords_result) - return this.equals((traceRecords_result)that); + if (that instanceof traceRecordsTimestr_result) + return this.equals((traceRecordsTimestr_result)that); return false; } - public boolean equals(traceRecords_result that) { + public boolean equals(traceRecordsTimestr_result that) { if (that == null) return false; if (this == that) @@ -698155,7 +701994,7 @@ public int hashCode() { } @Override - public int compareTo(traceRecords_result other) { + public int compareTo(traceRecordsTimestr_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -698222,7 +702061,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("traceRecords_result("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("traceRecordsTimestr_result("); boolean first = true; sb.append("success:"); @@ -698281,17 +702120,17 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class traceRecords_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class traceRecordsTimestr_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public traceRecords_resultStandardScheme getScheme() { - return new traceRecords_resultStandardScheme(); + public traceRecordsTimestr_resultStandardScheme getScheme() { + return new traceRecordsTimestr_resultStandardScheme(); } } - private static class traceRecords_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class traceRecordsTimestr_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecords_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordsTimestr_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -698304,37 +702143,37 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecords_result case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { - org.apache.thrift.protocol.TMap _map7102 = iprot.readMapBegin(); - struct.success = new java.util.LinkedHashMap>>(2*_map7102.size); - long _key7103; - @org.apache.thrift.annotation.Nullable java.util.Map> _val7104; - for (int _i7105 = 0; _i7105 < _map7102.size; ++_i7105) + org.apache.thrift.protocol.TMap _map7174 = iprot.readMapBegin(); + struct.success = new java.util.LinkedHashMap>>(2*_map7174.size); + long _key7175; + @org.apache.thrift.annotation.Nullable java.util.Map> _val7176; + for (int _i7177 = 0; _i7177 < _map7174.size; ++_i7177) { - _key7103 = iprot.readI64(); + _key7175 = iprot.readI64(); { - org.apache.thrift.protocol.TMap _map7106 = iprot.readMapBegin(); - _val7104 = new java.util.LinkedHashMap>(2*_map7106.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key7107; - @org.apache.thrift.annotation.Nullable java.util.Set _val7108; - for (int _i7109 = 0; _i7109 < _map7106.size; ++_i7109) + org.apache.thrift.protocol.TMap _map7178 = iprot.readMapBegin(); + _val7176 = new java.util.LinkedHashMap>(2*_map7178.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key7179; + @org.apache.thrift.annotation.Nullable java.util.Set _val7180; + for (int _i7181 = 0; _i7181 < _map7178.size; ++_i7181) { - _key7107 = iprot.readString(); + _key7179 = iprot.readString(); { - org.apache.thrift.protocol.TSet _set7110 = iprot.readSetBegin(); - _val7108 = new java.util.LinkedHashSet(2*_set7110.size); - long _elem7111; - for (int _i7112 = 0; _i7112 < _set7110.size; ++_i7112) + org.apache.thrift.protocol.TSet _set7182 = iprot.readSetBegin(); + _val7180 = new java.util.LinkedHashSet(2*_set7182.size); + long _elem7183; + for (int _i7184 = 0; _i7184 < _set7182.size; ++_i7184) { - _elem7111 = iprot.readI64(); - _val7108.add(_elem7111); + _elem7183 = iprot.readI64(); + _val7180.add(_elem7183); } iprot.readSetEnd(); } - _val7104.put(_key7107, _val7108); + _val7176.put(_key7179, _val7180); } iprot.readMapEnd(); } - struct.success.put(_key7103, _val7104); + struct.success.put(_key7175, _val7176); } iprot.readMapEnd(); } @@ -698382,7 +702221,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecords_result } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecords_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecordsTimestr_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); @@ -698390,19 +702229,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecords_resul oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.MAP, struct.success.size())); - for (java.util.Map.Entry>> _iter7113 : struct.success.entrySet()) + for (java.util.Map.Entry>> _iter7185 : struct.success.entrySet()) { - oprot.writeI64(_iter7113.getKey()); + oprot.writeI64(_iter7185.getKey()); { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.SET, _iter7113.getValue().size())); - for (java.util.Map.Entry> _iter7114 : _iter7113.getValue().entrySet()) + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.SET, _iter7185.getValue().size())); + for (java.util.Map.Entry> _iter7186 : _iter7185.getValue().entrySet()) { - oprot.writeString(_iter7114.getKey()); + oprot.writeString(_iter7186.getKey()); { - oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I64, _iter7114.getValue().size())); - for (long _iter7115 : _iter7114.getValue()) + oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I64, _iter7186.getValue().size())); + for (long _iter7187 : _iter7186.getValue()) { - oprot.writeI64(_iter7115); + oprot.writeI64(_iter7187); } oprot.writeSetEnd(); } @@ -698435,17 +702274,17 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecords_resul } - private static class traceRecords_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class traceRecordsTimestr_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public traceRecords_resultTupleScheme getScheme() { - return new traceRecords_resultTupleScheme(); + public traceRecordsTimestr_resultTupleScheme getScheme() { + return new traceRecordsTimestr_resultTupleScheme(); } } - private static class traceRecords_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class traceRecordsTimestr_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, traceRecords_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordsTimestr_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()) { @@ -698464,19 +702303,19 @@ public void write(org.apache.thrift.protocol.TProtocol prot, traceRecords_result if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); - for (java.util.Map.Entry>> _iter7116 : struct.success.entrySet()) + for (java.util.Map.Entry>> _iter7188 : struct.success.entrySet()) { - oprot.writeI64(_iter7116.getKey()); + oprot.writeI64(_iter7188.getKey()); { - oprot.writeI32(_iter7116.getValue().size()); - for (java.util.Map.Entry> _iter7117 : _iter7116.getValue().entrySet()) + oprot.writeI32(_iter7188.getValue().size()); + for (java.util.Map.Entry> _iter7189 : _iter7188.getValue().entrySet()) { - oprot.writeString(_iter7117.getKey()); + oprot.writeString(_iter7189.getKey()); { - oprot.writeI32(_iter7117.getValue().size()); - for (long _iter7118 : _iter7117.getValue()) + oprot.writeI32(_iter7189.getValue().size()); + for (long _iter7190 : _iter7189.getValue()) { - oprot.writeI64(_iter7118); + oprot.writeI64(_iter7190); } } } @@ -698496,40 +702335,40 @@ public void write(org.apache.thrift.protocol.TProtocol prot, traceRecords_result } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, traceRecords_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, traceRecordsTimestr_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(4); if (incoming.get(0)) { { - org.apache.thrift.protocol.TMap _map7119 = iprot.readMapBegin(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.MAP); - struct.success = new java.util.LinkedHashMap>>(2*_map7119.size); - long _key7120; - @org.apache.thrift.annotation.Nullable java.util.Map> _val7121; - for (int _i7122 = 0; _i7122 < _map7119.size; ++_i7122) + org.apache.thrift.protocol.TMap _map7191 = iprot.readMapBegin(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.MAP); + struct.success = new java.util.LinkedHashMap>>(2*_map7191.size); + long _key7192; + @org.apache.thrift.annotation.Nullable java.util.Map> _val7193; + for (int _i7194 = 0; _i7194 < _map7191.size; ++_i7194) { - _key7120 = iprot.readI64(); + _key7192 = iprot.readI64(); { - org.apache.thrift.protocol.TMap _map7123 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.SET); - _val7121 = new java.util.LinkedHashMap>(2*_map7123.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key7124; - @org.apache.thrift.annotation.Nullable java.util.Set _val7125; - for (int _i7126 = 0; _i7126 < _map7123.size; ++_i7126) + org.apache.thrift.protocol.TMap _map7195 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.SET); + _val7193 = new java.util.LinkedHashMap>(2*_map7195.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key7196; + @org.apache.thrift.annotation.Nullable java.util.Set _val7197; + for (int _i7198 = 0; _i7198 < _map7195.size; ++_i7198) { - _key7124 = iprot.readString(); + _key7196 = iprot.readString(); { - org.apache.thrift.protocol.TSet _set7127 = iprot.readSetBegin(org.apache.thrift.protocol.TType.I64); - _val7125 = new java.util.LinkedHashSet(2*_set7127.size); - long _elem7128; - for (int _i7129 = 0; _i7129 < _set7127.size; ++_i7129) + org.apache.thrift.protocol.TSet _set7199 = iprot.readSetBegin(org.apache.thrift.protocol.TType.I64); + _val7197 = new java.util.LinkedHashSet(2*_set7199.size); + long _elem7200; + for (int _i7201 = 0; _i7201 < _set7199.size; ++_i7201) { - _elem7128 = iprot.readI64(); - _val7125.add(_elem7128); + _elem7200 = iprot.readI64(); + _val7197.add(_elem7200); } } - _val7121.put(_key7124, _val7125); + _val7193.put(_key7196, _val7197); } } - struct.success.put(_key7120, _val7121); + struct.success.put(_key7192, _val7193); } } struct.setSuccessIsSet(true); @@ -698557,20 +702396,18 @@ private static S scheme(org.apache. } } - public static class traceRecordsTime_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("traceRecordsTime_args"); + public static class consolidateRecords_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("consolidateRecords_args"); private static final org.apache.thrift.protocol.TField RECORDS_FIELD_DESC = new org.apache.thrift.protocol.TField("records", org.apache.thrift.protocol.TType.LIST, (short)1); - private static final org.apache.thrift.protocol.TField TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("timestamp", org.apache.thrift.protocol.TType.I64, (short)2); - private static final org.apache.thrift.protocol.TField CREDS_FIELD_DESC = new org.apache.thrift.protocol.TField("creds", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.protocol.TField TRANSACTION_FIELD_DESC = new org.apache.thrift.protocol.TField("transaction", org.apache.thrift.protocol.TType.STRUCT, (short)4); - private static final org.apache.thrift.protocol.TField ENVIRONMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("environment", org.apache.thrift.protocol.TType.STRING, (short)5); + private static final org.apache.thrift.protocol.TField CREDS_FIELD_DESC = new org.apache.thrift.protocol.TField("creds", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final org.apache.thrift.protocol.TField TRANSACTION_FIELD_DESC = new org.apache.thrift.protocol.TField("transaction", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final org.apache.thrift.protocol.TField ENVIRONMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("environment", org.apache.thrift.protocol.TType.STRING, (short)4); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new traceRecordsTime_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new traceRecordsTime_argsTupleSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new consolidateRecords_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new consolidateRecords_argsTupleSchemeFactory(); public @org.apache.thrift.annotation.Nullable java.util.List records; // required - public long timestamp; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction; // required public @org.apache.thrift.annotation.Nullable java.lang.String environment; // required @@ -698578,10 +702415,9 @@ public static class traceRecordsTime_args implements org.apache.thrift.TBase byName = new java.util.LinkedHashMap(); @@ -698599,13 +702435,11 @@ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // RECORDS return RECORDS; - case 2: // TIMESTAMP - return TIMESTAMP; - case 3: // CREDS + case 2: // CREDS return CREDS; - case 4: // TRANSACTION + case 3: // TRANSACTION return TRANSACTION; - case 5: // ENVIRONMENT + case 4: // ENVIRONMENT return ENVIRONMENT; default: return null; @@ -698650,16 +702484,12 @@ public java.lang.String getFieldName() { } // isset id assignments - private static final int __TIMESTAMP_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.RECORDS, new org.apache.thrift.meta_data.FieldMetaData("records", 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.I64)))); - tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.CREDS, new org.apache.thrift.meta_data.FieldMetaData("creds", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.AccessToken.class))); tmpMap.put(_Fields.TRANSACTION, new org.apache.thrift.meta_data.FieldMetaData("transaction", org.apache.thrift.TFieldRequirementType.DEFAULT, @@ -698667,23 +702497,20 @@ public java.lang.String getFieldName() { tmpMap.put(_Fields.ENVIRONMENT, new org.apache.thrift.meta_data.FieldMetaData("environment", 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(traceRecordsTime_args.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(consolidateRecords_args.class, metaDataMap); } - public traceRecordsTime_args() { + public consolidateRecords_args() { } - public traceRecordsTime_args( + public consolidateRecords_args( java.util.List records, - long timestamp, com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment) { this(); this.records = records; - this.timestamp = timestamp; - setTimestampIsSet(true); this.creds = creds; this.transaction = transaction; this.environment = environment; @@ -698692,13 +702519,11 @@ public traceRecordsTime_args( /** * Performs a deep copy on other. */ - public traceRecordsTime_args(traceRecordsTime_args other) { - __isset_bitfield = other.__isset_bitfield; + public consolidateRecords_args(consolidateRecords_args other) { if (other.isSetRecords()) { java.util.List __this__records = new java.util.ArrayList(other.records); this.records = __this__records; } - this.timestamp = other.timestamp; if (other.isSetCreds()) { this.creds = new com.cinchapi.concourse.thrift.AccessToken(other.creds); } @@ -698711,15 +702536,13 @@ public traceRecordsTime_args(traceRecordsTime_args other) { } @Override - public traceRecordsTime_args deepCopy() { - return new traceRecordsTime_args(this); + public consolidateRecords_args deepCopy() { + return new consolidateRecords_args(this); } @Override public void clear() { this.records = null; - setTimestampIsSet(false); - this.timestamp = 0; this.creds = null; this.transaction = null; this.environment = null; @@ -698746,7 +702569,7 @@ public java.util.List getRecords() { return this.records; } - public traceRecordsTime_args setRecords(@org.apache.thrift.annotation.Nullable java.util.List records) { + public consolidateRecords_args setRecords(@org.apache.thrift.annotation.Nullable java.util.List records) { this.records = records; return this; } @@ -698766,35 +702589,12 @@ public void setRecordsIsSet(boolean value) { } } - public long getTimestamp() { - return this.timestamp; - } - - public traceRecordsTime_args setTimestamp(long timestamp) { - this.timestamp = timestamp; - setTimestampIsSet(true); - return this; - } - - public void unsetTimestamp() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); - } - - /** Returns true if field timestamp is set (has been assigned a value) and false otherwise */ - public boolean isSetTimestamp() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); - } - - public void setTimestampIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TIMESTAMP_ISSET_ID, value); - } - @org.apache.thrift.annotation.Nullable public com.cinchapi.concourse.thrift.AccessToken getCreds() { return this.creds; } - public traceRecordsTime_args setCreds(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds) { + public consolidateRecords_args setCreds(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds) { this.creds = creds; return this; } @@ -698819,7 +702619,7 @@ public com.cinchapi.concourse.thrift.TransactionToken getTransaction() { return this.transaction; } - public traceRecordsTime_args setTransaction(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction) { + public consolidateRecords_args setTransaction(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction) { this.transaction = transaction; return this; } @@ -698844,7 +702644,7 @@ public java.lang.String getEnvironment() { return this.environment; } - public traceRecordsTime_args setEnvironment(@org.apache.thrift.annotation.Nullable java.lang.String environment) { + public consolidateRecords_args setEnvironment(@org.apache.thrift.annotation.Nullable java.lang.String environment) { this.environment = environment; return this; } @@ -698875,14 +702675,6 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } break; - case TIMESTAMP: - if (value == null) { - unsetTimestamp(); - } else { - setTimestamp((java.lang.Long)value); - } - break; - case CREDS: if (value == null) { unsetCreds(); @@ -698917,9 +702709,6 @@ public java.lang.Object getFieldValue(_Fields field) { case RECORDS: return getRecords(); - case TIMESTAMP: - return getTimestamp(); - case CREDS: return getCreds(); @@ -698943,8 +702732,6 @@ public boolean isSet(_Fields field) { switch (field) { case RECORDS: return isSetRecords(); - case TIMESTAMP: - return isSetTimestamp(); case CREDS: return isSetCreds(); case TRANSACTION: @@ -698957,12 +702744,12 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that instanceof traceRecordsTime_args) - return this.equals((traceRecordsTime_args)that); + if (that instanceof consolidateRecords_args) + return this.equals((consolidateRecords_args)that); return false; } - public boolean equals(traceRecordsTime_args that) { + public boolean equals(consolidateRecords_args that) { if (that == null) return false; if (this == that) @@ -698977,15 +702764,6 @@ public boolean equals(traceRecordsTime_args that) { return false; } - boolean this_present_timestamp = true; - boolean that_present_timestamp = true; - if (this_present_timestamp || that_present_timestamp) { - if (!(this_present_timestamp && that_present_timestamp)) - return false; - if (this.timestamp != that.timestamp) - return false; - } - boolean this_present_creds = true && this.isSetCreds(); boolean that_present_creds = true && that.isSetCreds(); if (this_present_creds || that_present_creds) { @@ -699024,8 +702802,6 @@ public int hashCode() { if (isSetRecords()) hashCode = hashCode * 8191 + records.hashCode(); - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(timestamp); - hashCode = hashCode * 8191 + ((isSetCreds()) ? 131071 : 524287); if (isSetCreds()) hashCode = hashCode * 8191 + creds.hashCode(); @@ -699042,7 +702818,7 @@ public int hashCode() { } @Override - public int compareTo(traceRecordsTime_args other) { + public int compareTo(consolidateRecords_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -699059,16 +702835,6 @@ public int compareTo(traceRecordsTime_args other) { return lastComparison; } } - lastComparison = java.lang.Boolean.compare(isSetTimestamp(), other.isSetTimestamp()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTimestamp()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, other.timestamp); - if (lastComparison != 0) { - return lastComparison; - } - } lastComparison = java.lang.Boolean.compare(isSetCreds(), other.isSetCreds()); if (lastComparison != 0) { return lastComparison; @@ -699120,7 +702886,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("traceRecordsTime_args("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("consolidateRecords_args("); boolean first = true; sb.append("records:"); @@ -699131,10 +702897,6 @@ public java.lang.String toString() { } first = false; if (!first) sb.append(", "); - sb.append("timestamp:"); - sb.append(this.timestamp); - first = false; - if (!first) sb.append(", "); sb.append("creds:"); if (this.creds == null) { sb.append("null"); @@ -699183,25 +702945,23 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept 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 traceRecordsTime_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class consolidateRecords_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public traceRecordsTime_argsStandardScheme getScheme() { - return new traceRecordsTime_argsStandardScheme(); + public consolidateRecords_argsStandardScheme getScheme() { + return new consolidateRecords_argsStandardScheme(); } } - private static class traceRecordsTime_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class consolidateRecords_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordsTime_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, consolidateRecords_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -699214,13 +702974,13 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordsTime_ar case 1: // RECORDS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list7130 = iprot.readListBegin(); - struct.records = new java.util.ArrayList(_list7130.size); - long _elem7131; - for (int _i7132 = 0; _i7132 < _list7130.size; ++_i7132) + org.apache.thrift.protocol.TList _list7202 = iprot.readListBegin(); + struct.records = new java.util.ArrayList(_list7202.size); + long _elem7203; + for (int _i7204 = 0; _i7204 < _list7202.size; ++_i7204) { - _elem7131 = iprot.readI64(); - struct.records.add(_elem7131); + _elem7203 = iprot.readI64(); + struct.records.add(_elem7203); } iprot.readListEnd(); } @@ -699229,15 +702989,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordsTime_ar org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 2: // TIMESTAMP - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.timestamp = iprot.readI64(); - struct.setTimestampIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // CREDS + case 2: // CREDS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); struct.creds.read(iprot); @@ -699246,7 +702998,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordsTime_ar org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 4: // TRANSACTION + case 3: // TRANSACTION if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.transaction = new com.cinchapi.concourse.thrift.TransactionToken(); struct.transaction.read(iprot); @@ -699255,7 +703007,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordsTime_ar org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 5: // ENVIRONMENT + case 4: // ENVIRONMENT if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.environment = iprot.readString(); struct.setEnvironmentIsSet(true); @@ -699275,7 +703027,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordsTime_ar } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecordsTime_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, consolidateRecords_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); @@ -699283,17 +703035,14 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecordsTime_a oprot.writeFieldBegin(RECORDS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, struct.records.size())); - for (long _iter7133 : struct.records) + for (long _iter7205 : struct.records) { - oprot.writeI64(_iter7133); + oprot.writeI64(_iter7205); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } - oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC); - oprot.writeI64(struct.timestamp); - oprot.writeFieldEnd(); if (struct.creds != null) { oprot.writeFieldBegin(CREDS_FIELD_DESC); struct.creds.write(oprot); @@ -699315,47 +703064,41 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecordsTime_a } - private static class traceRecordsTime_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class consolidateRecords_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public traceRecordsTime_argsTupleScheme getScheme() { - return new traceRecordsTime_argsTupleScheme(); + public consolidateRecords_argsTupleScheme getScheme() { + return new consolidateRecords_argsTupleScheme(); } } - private static class traceRecordsTime_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class consolidateRecords_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordsTime_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, consolidateRecords_args 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.isSetRecords()) { optionals.set(0); } - if (struct.isSetTimestamp()) { - optionals.set(1); - } if (struct.isSetCreds()) { - optionals.set(2); + optionals.set(1); } if (struct.isSetTransaction()) { - optionals.set(3); + optionals.set(2); } if (struct.isSetEnvironment()) { - optionals.set(4); + optionals.set(3); } - oprot.writeBitSet(optionals, 5); + oprot.writeBitSet(optionals, 4); if (struct.isSetRecords()) { { oprot.writeI32(struct.records.size()); - for (long _iter7134 : struct.records) + for (long _iter7206 : struct.records) { - oprot.writeI64(_iter7134); + oprot.writeI64(_iter7206); } } } - if (struct.isSetTimestamp()) { - oprot.writeI64(struct.timestamp); - } if (struct.isSetCreds()) { struct.creds.write(oprot); } @@ -699368,37 +703111,33 @@ public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordsTime_ar } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, traceRecordsTime_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, consolidateRecords_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(5); + java.util.BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { { - org.apache.thrift.protocol.TList _list7135 = iprot.readListBegin(org.apache.thrift.protocol.TType.I64); - struct.records = new java.util.ArrayList(_list7135.size); - long _elem7136; - for (int _i7137 = 0; _i7137 < _list7135.size; ++_i7137) + org.apache.thrift.protocol.TList _list7207 = iprot.readListBegin(org.apache.thrift.protocol.TType.I64); + struct.records = new java.util.ArrayList(_list7207.size); + long _elem7208; + for (int _i7209 = 0; _i7209 < _list7207.size; ++_i7209) { - _elem7136 = iprot.readI64(); - struct.records.add(_elem7136); + _elem7208 = iprot.readI64(); + struct.records.add(_elem7208); } } struct.setRecordsIsSet(true); } if (incoming.get(1)) { - struct.timestamp = iprot.readI64(); - struct.setTimestampIsSet(true); - } - if (incoming.get(2)) { struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); struct.creds.read(iprot); struct.setCredsIsSet(true); } - if (incoming.get(3)) { + if (incoming.get(2)) { struct.transaction = new com.cinchapi.concourse.thrift.TransactionToken(); struct.transaction.read(iprot); struct.setTransactionIsSet(true); } - if (incoming.get(4)) { + if (incoming.get(3)) { struct.environment = iprot.readString(); struct.setEnvironmentIsSet(true); } @@ -699410,18 +703149,18 @@ private static S scheme(org.apache. } } - public static class traceRecordsTime_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("traceRecordsTime_result"); + public static class consolidateRecords_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("consolidateRecords_result"); - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.MAP, (short)0); + 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.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField EX2_FIELD_DESC = new org.apache.thrift.protocol.TField("ex2", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField EX3_FIELD_DESC = new org.apache.thrift.protocol.TField("ex3", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new traceRecordsTime_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new traceRecordsTime_resultTupleSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new consolidateRecords_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new consolidateRecords_resultTupleSchemeFactory(); - public @org.apache.thrift.annotation.Nullable java.util.Map>> success; // required + public boolean success; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3; // required @@ -699498,16 +703237,13 @@ public java.lang.String getFieldName() { } // 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.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64), - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), - new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)))))); + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.EX, new org.apache.thrift.meta_data.FieldMetaData("ex", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.SecurityException.class))); tmpMap.put(_Fields.EX2, new org.apache.thrift.meta_data.FieldMetaData("ex2", org.apache.thrift.TFieldRequirementType.DEFAULT, @@ -699515,20 +703251,21 @@ public java.lang.String getFieldName() { tmpMap.put(_Fields.EX3, new org.apache.thrift.meta_data.FieldMetaData("ex3", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.PermissionException.class))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(traceRecordsTime_result.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(consolidateRecords_result.class, metaDataMap); } - public traceRecordsTime_result() { + public consolidateRecords_result() { } - public traceRecordsTime_result( - java.util.Map>> success, + public consolidateRecords_result( + boolean success, com.cinchapi.concourse.thrift.SecurityException ex, com.cinchapi.concourse.thrift.TransactionException ex2, com.cinchapi.concourse.thrift.PermissionException ex3) { this(); this.success = success; + setSuccessIsSet(true); this.ex = ex; this.ex2 = ex2; this.ex3 = ex3; @@ -699537,33 +703274,9 @@ public traceRecordsTime_result( /** * Performs a deep copy on other. */ - public traceRecordsTime_result(traceRecordsTime_result other) { - if (other.isSetSuccess()) { - java.util.Map>> __this__success = new java.util.LinkedHashMap>>(other.success.size()); - for (java.util.Map.Entry>> other_element : other.success.entrySet()) { - - java.lang.Long other_element_key = other_element.getKey(); - java.util.Map> other_element_value = other_element.getValue(); - - java.lang.Long __this__success_copy_key = other_element_key; - - java.util.Map> __this__success_copy_value = new java.util.LinkedHashMap>(other_element_value.size()); - for (java.util.Map.Entry> other_element_value_element : other_element_value.entrySet()) { - - java.lang.String other_element_value_element_key = other_element_value_element.getKey(); - java.util.Set other_element_value_element_value = other_element_value_element.getValue(); - - java.lang.String __this__success_copy_value_copy_key = other_element_value_element_key; - - java.util.Set __this__success_copy_value_copy_value = new java.util.LinkedHashSet(other_element_value_element_value); - - __this__success_copy_value.put(__this__success_copy_value_copy_key, __this__success_copy_value_copy_value); - } - - __this__success.put(__this__success_copy_key, __this__success_copy_value); - } - this.success = __this__success; - } + public consolidateRecords_result(consolidateRecords_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; if (other.isSetEx()) { this.ex = new com.cinchapi.concourse.thrift.SecurityException(other.ex); } @@ -699576,52 +703289,40 @@ public traceRecordsTime_result(traceRecordsTime_result other) { } @Override - public traceRecordsTime_result deepCopy() { - return new traceRecordsTime_result(this); + public consolidateRecords_result deepCopy() { + return new consolidateRecords_result(this); } @Override public void clear() { - this.success = null; + setSuccessIsSet(false); + this.success = false; this.ex = null; this.ex2 = null; this.ex3 = null; } - public int getSuccessSize() { - return (this.success == null) ? 0 : this.success.size(); - } - - public void putToSuccess(long key, java.util.Map> val) { - if (this.success == null) { - this.success = new java.util.LinkedHashMap>>(); - } - this.success.put(key, val); - } - - @org.apache.thrift.annotation.Nullable - public java.util.Map>> getSuccess() { + public boolean isSuccess() { return this.success; } - public traceRecordsTime_result setSuccess(@org.apache.thrift.annotation.Nullable java.util.Map>> success) { + public consolidateRecords_result setSuccess(boolean success) { this.success = success; + setSuccessIsSet(true); return this; } public void unsetSuccess() { - this.success = null; + __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 this.success != null; + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } @org.apache.thrift.annotation.Nullable @@ -699629,7 +703330,7 @@ public com.cinchapi.concourse.thrift.SecurityException getEx() { return this.ex; } - public traceRecordsTime_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { + public consolidateRecords_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { this.ex = ex; return this; } @@ -699654,7 +703355,7 @@ public com.cinchapi.concourse.thrift.TransactionException getEx2() { return this.ex2; } - public traceRecordsTime_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { + public consolidateRecords_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { this.ex2 = ex2; return this; } @@ -699679,7 +703380,7 @@ public com.cinchapi.concourse.thrift.PermissionException getEx3() { return this.ex3; } - public traceRecordsTime_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3) { + public consolidateRecords_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3) { this.ex3 = ex3; return this; } @@ -699706,7 +703407,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetSuccess(); } else { - setSuccess((java.util.Map>>)value); + setSuccess((java.lang.Boolean)value); } break; @@ -699742,7 +703443,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: - return getSuccess(); + return isSuccess(); case EX: return getEx(); @@ -699779,23 +703480,23 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that instanceof traceRecordsTime_result) - return this.equals((traceRecordsTime_result)that); + if (that instanceof consolidateRecords_result) + return this.equals((consolidateRecords_result)that); return false; } - public boolean equals(traceRecordsTime_result that) { + public boolean equals(consolidateRecords_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(); + 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.equals(that.success)) + if (this.success != that.success) return false; } @@ -699833,9 +703534,7 @@ public boolean equals(traceRecordsTime_result that) { public int hashCode() { int hashCode = 1; - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); + hashCode = hashCode * 8191 + ((success) ? 131071 : 524287); hashCode = hashCode * 8191 + ((isSetEx()) ? 131071 : 524287); if (isSetEx()) @@ -699853,7 +703552,7 @@ public int hashCode() { } @Override - public int compareTo(traceRecordsTime_result other) { + public int compareTo(consolidateRecords_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -699920,15 +703619,11 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("traceRecordsTime_result("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("consolidateRecords_result("); boolean first = true; sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } + sb.append(this.success); first = false; if (!first) sb.append(", "); sb.append("ex:"); @@ -699973,23 +703668,25 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept 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 traceRecordsTime_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class consolidateRecords_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public traceRecordsTime_resultStandardScheme getScheme() { - return new traceRecordsTime_resultStandardScheme(); + public consolidateRecords_resultStandardScheme getScheme() { + return new consolidateRecords_resultStandardScheme(); } } - private static class traceRecordsTime_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class consolidateRecords_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordsTime_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, consolidateRecords_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -700000,42 +703697,8 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordsTime_re } switch (schemeField.id) { case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map7138 = iprot.readMapBegin(); - struct.success = new java.util.LinkedHashMap>>(2*_map7138.size); - long _key7139; - @org.apache.thrift.annotation.Nullable java.util.Map> _val7140; - for (int _i7141 = 0; _i7141 < _map7138.size; ++_i7141) - { - _key7139 = iprot.readI64(); - { - org.apache.thrift.protocol.TMap _map7142 = iprot.readMapBegin(); - _val7140 = new java.util.LinkedHashMap>(2*_map7142.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key7143; - @org.apache.thrift.annotation.Nullable java.util.Set _val7144; - for (int _i7145 = 0; _i7145 < _map7142.size; ++_i7145) - { - _key7143 = iprot.readString(); - { - org.apache.thrift.protocol.TSet _set7146 = iprot.readSetBegin(); - _val7144 = new java.util.LinkedHashSet(2*_set7146.size); - long _elem7147; - for (int _i7148 = 0; _i7148 < _set7146.size; ++_i7148) - { - _elem7147 = iprot.readI64(); - _val7144.add(_elem7147); - } - iprot.readSetEnd(); - } - _val7140.put(_key7143, _val7144); - } - iprot.readMapEnd(); - } - struct.success.put(_key7139, _val7140); - } - iprot.readMapEnd(); - } + 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); @@ -700080,36 +703743,13 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordsTime_re } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecordsTime_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, consolidateRecords_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { + if (struct.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.MAP, struct.success.size())); - for (java.util.Map.Entry>> _iter7149 : struct.success.entrySet()) - { - oprot.writeI64(_iter7149.getKey()); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.SET, _iter7149.getValue().size())); - for (java.util.Map.Entry> _iter7150 : _iter7149.getValue().entrySet()) - { - oprot.writeString(_iter7150.getKey()); - { - oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I64, _iter7150.getValue().size())); - for (long _iter7151 : _iter7150.getValue()) - { - oprot.writeI64(_iter7151); - } - oprot.writeSetEnd(); - } - } - oprot.writeMapEnd(); - } - } - oprot.writeMapEnd(); - } + oprot.writeBool(struct.success); oprot.writeFieldEnd(); } if (struct.ex != null) { @@ -700133,17 +703773,17 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecordsTime_r } - private static class traceRecordsTime_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class consolidateRecords_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public traceRecordsTime_resultTupleScheme getScheme() { - return new traceRecordsTime_resultTupleScheme(); + public consolidateRecords_resultTupleScheme getScheme() { + return new consolidateRecords_resultTupleScheme(); } } - private static class traceRecordsTime_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class consolidateRecords_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordsTime_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, consolidateRecords_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()) { @@ -700160,27 +703800,7 @@ public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordsTime_re } oprot.writeBitSet(optionals, 4); if (struct.isSetSuccess()) { - { - oprot.writeI32(struct.success.size()); - for (java.util.Map.Entry>> _iter7152 : struct.success.entrySet()) - { - oprot.writeI64(_iter7152.getKey()); - { - oprot.writeI32(_iter7152.getValue().size()); - for (java.util.Map.Entry> _iter7153 : _iter7152.getValue().entrySet()) - { - oprot.writeString(_iter7153.getKey()); - { - oprot.writeI32(_iter7153.getValue().size()); - for (long _iter7154 : _iter7153.getValue()) - { - oprot.writeI64(_iter7154); - } - } - } - } - } - } + oprot.writeBool(struct.success); } if (struct.isSetEx()) { struct.ex.write(oprot); @@ -700194,42 +703814,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordsTime_re } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, traceRecordsTime_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, consolidateRecords_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(4); if (incoming.get(0)) { - { - org.apache.thrift.protocol.TMap _map7155 = iprot.readMapBegin(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.MAP); - struct.success = new java.util.LinkedHashMap>>(2*_map7155.size); - long _key7156; - @org.apache.thrift.annotation.Nullable java.util.Map> _val7157; - for (int _i7158 = 0; _i7158 < _map7155.size; ++_i7158) - { - _key7156 = iprot.readI64(); - { - org.apache.thrift.protocol.TMap _map7159 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.SET); - _val7157 = new java.util.LinkedHashMap>(2*_map7159.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key7160; - @org.apache.thrift.annotation.Nullable java.util.Set _val7161; - for (int _i7162 = 0; _i7162 < _map7159.size; ++_i7162) - { - _key7160 = iprot.readString(); - { - org.apache.thrift.protocol.TSet _set7163 = iprot.readSetBegin(org.apache.thrift.protocol.TType.I64); - _val7161 = new java.util.LinkedHashSet(2*_set7163.size); - long _elem7164; - for (int _i7165 = 0; _i7165 < _set7163.size; ++_i7165) - { - _elem7164 = iprot.readI64(); - _val7161.add(_elem7164); - } - } - _val7157.put(_key7160, _val7161); - } - } - struct.success.put(_key7156, _val7157); - } - } + struct.success = iprot.readBool(); struct.setSuccessIsSet(true); } if (incoming.get(1)) { @@ -700255,31 +703844,28 @@ private static S scheme(org.apache. } } - public static class traceRecordsTimestr_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("traceRecordsTimestr_args"); + public static class exec_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("exec_args"); - private static final org.apache.thrift.protocol.TField RECORDS_FIELD_DESC = new org.apache.thrift.protocol.TField("records", org.apache.thrift.protocol.TType.LIST, (short)1); - private static final org.apache.thrift.protocol.TField TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("timestamp", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField CREDS_FIELD_DESC = new org.apache.thrift.protocol.TField("creds", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.protocol.TField TRANSACTION_FIELD_DESC = new org.apache.thrift.protocol.TField("transaction", org.apache.thrift.protocol.TType.STRUCT, (short)4); - private static final org.apache.thrift.protocol.TField ENVIRONMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("environment", org.apache.thrift.protocol.TType.STRING, (short)5); + private static final org.apache.thrift.protocol.TField COMMANDS_FIELD_DESC = new org.apache.thrift.protocol.TField("commands", org.apache.thrift.protocol.TType.LIST, (short)1); + private static final org.apache.thrift.protocol.TField CREDS_FIELD_DESC = new org.apache.thrift.protocol.TField("creds", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final org.apache.thrift.protocol.TField TRANSACTION_FIELD_DESC = new org.apache.thrift.protocol.TField("transaction", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final org.apache.thrift.protocol.TField ENVIRONMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("environment", org.apache.thrift.protocol.TType.STRING, (short)4); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new traceRecordsTimestr_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new traceRecordsTimestr_argsTupleSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new exec_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new exec_argsTupleSchemeFactory(); - public @org.apache.thrift.annotation.Nullable java.util.List records; // required - public @org.apache.thrift.annotation.Nullable java.lang.String timestamp; // required + public @org.apache.thrift.annotation.Nullable java.util.List commands; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction; // required public @org.apache.thrift.annotation.Nullable java.lang.String environment; // 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 { - RECORDS((short)1, "records"), - TIMESTAMP((short)2, "timestamp"), - CREDS((short)3, "creds"), - TRANSACTION((short)4, "transaction"), - ENVIRONMENT((short)5, "environment"); + COMMANDS((short)1, "commands"), + CREDS((short)2, "creds"), + TRANSACTION((short)3, "transaction"), + ENVIRONMENT((short)4, "environment"); private static final java.util.Map byName = new java.util.LinkedHashMap(); @@ -700295,15 +703881,13 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { - case 1: // RECORDS - return RECORDS; - case 2: // TIMESTAMP - return TIMESTAMP; - case 3: // CREDS + case 1: // COMMANDS + return COMMANDS; + case 2: // CREDS return CREDS; - case 4: // TRANSACTION + case 3: // TRANSACTION return TRANSACTION; - case 5: // ENVIRONMENT + case 4: // ENVIRONMENT return ENVIRONMENT; default: return null; @@ -700351,11 +703935,9 @@ public java.lang.String getFieldName() { 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.RECORDS, new org.apache.thrift.meta_data.FieldMetaData("records", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.COMMANDS, new org.apache.thrift.meta_data.FieldMetaData("commands", 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.I64)))); - tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.TCommand.class)))); tmpMap.put(_Fields.CREDS, new org.apache.thrift.meta_data.FieldMetaData("creds", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.AccessToken.class))); tmpMap.put(_Fields.TRANSACTION, new org.apache.thrift.meta_data.FieldMetaData("transaction", org.apache.thrift.TFieldRequirementType.DEFAULT, @@ -700363,22 +703945,20 @@ public java.lang.String getFieldName() { tmpMap.put(_Fields.ENVIRONMENT, new org.apache.thrift.meta_data.FieldMetaData("environment", 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(traceRecordsTimestr_args.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(exec_args.class, metaDataMap); } - public traceRecordsTimestr_args() { + public exec_args() { } - public traceRecordsTimestr_args( - java.util.List records, - java.lang.String timestamp, + public exec_args( + java.util.List commands, com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment) { this(); - this.records = records; - this.timestamp = timestamp; + this.commands = commands; this.creds = creds; this.transaction = transaction; this.environment = environment; @@ -700387,13 +703967,13 @@ public traceRecordsTimestr_args( /** * Performs a deep copy on other. */ - public traceRecordsTimestr_args(traceRecordsTimestr_args other) { - if (other.isSetRecords()) { - java.util.List __this__records = new java.util.ArrayList(other.records); - this.records = __this__records; - } - if (other.isSetTimestamp()) { - this.timestamp = other.timestamp; + public exec_args(exec_args other) { + if (other.isSetCommands()) { + java.util.List __this__commands = new java.util.ArrayList(other.commands.size()); + for (com.cinchapi.concourse.thrift.TCommand other_element : other.commands) { + __this__commands.add(new com.cinchapi.concourse.thrift.TCommand(other_element)); + } + this.commands = __this__commands; } if (other.isSetCreds()) { this.creds = new com.cinchapi.concourse.thrift.AccessToken(other.creds); @@ -700407,82 +703987,56 @@ public traceRecordsTimestr_args(traceRecordsTimestr_args other) { } @Override - public traceRecordsTimestr_args deepCopy() { - return new traceRecordsTimestr_args(this); + public exec_args deepCopy() { + return new exec_args(this); } @Override public void clear() { - this.records = null; - this.timestamp = null; + this.commands = null; this.creds = null; this.transaction = null; this.environment = null; } - public int getRecordsSize() { - return (this.records == null) ? 0 : this.records.size(); + public int getCommandsSize() { + return (this.commands == null) ? 0 : this.commands.size(); } @org.apache.thrift.annotation.Nullable - public java.util.Iterator getRecordsIterator() { - return (this.records == null) ? null : this.records.iterator(); + public java.util.Iterator getCommandsIterator() { + return (this.commands == null) ? null : this.commands.iterator(); } - public void addToRecords(long elem) { - if (this.records == null) { - this.records = new java.util.ArrayList(); + public void addToCommands(com.cinchapi.concourse.thrift.TCommand elem) { + if (this.commands == null) { + this.commands = new java.util.ArrayList(); } - this.records.add(elem); + this.commands.add(elem); } @org.apache.thrift.annotation.Nullable - public java.util.List getRecords() { - return this.records; + public java.util.List getCommands() { + return this.commands; } - public traceRecordsTimestr_args setRecords(@org.apache.thrift.annotation.Nullable java.util.List records) { - this.records = records; + public exec_args setCommands(@org.apache.thrift.annotation.Nullable java.util.List commands) { + this.commands = commands; return this; } - public void unsetRecords() { - this.records = null; + public void unsetCommands() { + this.commands = null; } - /** Returns true if field records is set (has been assigned a value) and false otherwise */ - public boolean isSetRecords() { - return this.records != null; + /** Returns true if field commands is set (has been assigned a value) and false otherwise */ + public boolean isSetCommands() { + return this.commands != null; } - public void setRecordsIsSet(boolean value) { + public void setCommandsIsSet(boolean value) { if (!value) { - this.records = null; - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.String getTimestamp() { - return this.timestamp; - } - - public traceRecordsTimestr_args setTimestamp(@org.apache.thrift.annotation.Nullable java.lang.String timestamp) { - this.timestamp = timestamp; - return this; - } - - public void unsetTimestamp() { - this.timestamp = null; - } - - /** Returns true if field timestamp is set (has been assigned a value) and false otherwise */ - public boolean isSetTimestamp() { - return this.timestamp != null; - } - - public void setTimestampIsSet(boolean value) { - if (!value) { - this.timestamp = null; + this.commands = null; } } @@ -700491,7 +704045,7 @@ public com.cinchapi.concourse.thrift.AccessToken getCreds() { return this.creds; } - public traceRecordsTimestr_args setCreds(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds) { + public exec_args setCreds(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds) { this.creds = creds; return this; } @@ -700516,7 +704070,7 @@ public com.cinchapi.concourse.thrift.TransactionToken getTransaction() { return this.transaction; } - public traceRecordsTimestr_args setTransaction(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction) { + public exec_args setTransaction(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction) { this.transaction = transaction; return this; } @@ -700541,7 +704095,7 @@ public java.lang.String getEnvironment() { return this.environment; } - public traceRecordsTimestr_args setEnvironment(@org.apache.thrift.annotation.Nullable java.lang.String environment) { + public exec_args setEnvironment(@org.apache.thrift.annotation.Nullable java.lang.String environment) { this.environment = environment; return this; } @@ -700564,19 +704118,11 @@ public void setEnvironmentIsSet(boolean value) { @Override public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { - case RECORDS: - if (value == null) { - unsetRecords(); - } else { - setRecords((java.util.List)value); - } - break; - - case TIMESTAMP: + case COMMANDS: if (value == null) { - unsetTimestamp(); + unsetCommands(); } else { - setTimestamp((java.lang.String)value); + setCommands((java.util.List)value); } break; @@ -700611,11 +704157,8 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable @Override public java.lang.Object getFieldValue(_Fields field) { switch (field) { - case RECORDS: - return getRecords(); - - case TIMESTAMP: - return getTimestamp(); + case COMMANDS: + return getCommands(); case CREDS: return getCreds(); @@ -700638,10 +704181,8 @@ public boolean isSet(_Fields field) { } switch (field) { - case RECORDS: - return isSetRecords(); - case TIMESTAMP: - return isSetTimestamp(); + case COMMANDS: + return isSetCommands(); case CREDS: return isSetCreds(); case TRANSACTION: @@ -700654,32 +704195,23 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that instanceof traceRecordsTimestr_args) - return this.equals((traceRecordsTimestr_args)that); + if (that instanceof exec_args) + return this.equals((exec_args)that); return false; } - public boolean equals(traceRecordsTimestr_args that) { + public boolean equals(exec_args that) { if (that == null) return false; if (this == that) return true; - boolean this_present_records = true && this.isSetRecords(); - boolean that_present_records = true && that.isSetRecords(); - if (this_present_records || that_present_records) { - if (!(this_present_records && that_present_records)) + boolean this_present_commands = true && this.isSetCommands(); + boolean that_present_commands = true && that.isSetCommands(); + if (this_present_commands || that_present_commands) { + if (!(this_present_commands && that_present_commands)) return false; - if (!this.records.equals(that.records)) - return false; - } - - boolean this_present_timestamp = true && this.isSetTimestamp(); - boolean that_present_timestamp = true && that.isSetTimestamp(); - if (this_present_timestamp || that_present_timestamp) { - if (!(this_present_timestamp && that_present_timestamp)) - return false; - if (!this.timestamp.equals(that.timestamp)) + if (!this.commands.equals(that.commands)) return false; } @@ -700717,13 +704249,9 @@ public boolean equals(traceRecordsTimestr_args that) { public int hashCode() { int hashCode = 1; - hashCode = hashCode * 8191 + ((isSetRecords()) ? 131071 : 524287); - if (isSetRecords()) - hashCode = hashCode * 8191 + records.hashCode(); - - hashCode = hashCode * 8191 + ((isSetTimestamp()) ? 131071 : 524287); - if (isSetTimestamp()) - hashCode = hashCode * 8191 + timestamp.hashCode(); + hashCode = hashCode * 8191 + ((isSetCommands()) ? 131071 : 524287); + if (isSetCommands()) + hashCode = hashCode * 8191 + commands.hashCode(); hashCode = hashCode * 8191 + ((isSetCreds()) ? 131071 : 524287); if (isSetCreds()) @@ -700741,29 +704269,19 @@ public int hashCode() { } @Override - public int compareTo(traceRecordsTimestr_args other) { + public int compareTo(exec_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; - lastComparison = java.lang.Boolean.compare(isSetRecords(), other.isSetRecords()); + lastComparison = java.lang.Boolean.compare(isSetCommands(), other.isSetCommands()); if (lastComparison != 0) { return lastComparison; } - if (isSetRecords()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.records, other.records); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.compare(isSetTimestamp(), other.isSetTimestamp()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTimestamp()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, other.timestamp); + if (isSetCommands()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.commands, other.commands); if (lastComparison != 0) { return lastComparison; } @@ -700819,22 +704337,14 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("traceRecordsTimestr_args("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("exec_args("); boolean first = true; - sb.append("records:"); - if (this.records == null) { + sb.append("commands:"); + if (this.commands == null) { sb.append("null"); } else { - sb.append(this.records); - } - first = false; - if (!first) sb.append(", "); - sb.append("timestamp:"); - if (this.timestamp == null) { - sb.append("null"); - } else { - sb.append(this.timestamp); + sb.append(this.commands); } first = false; if (!first) sb.append(", "); @@ -700892,17 +704402,17 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class traceRecordsTimestr_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class exec_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public traceRecordsTimestr_argsStandardScheme getScheme() { - return new traceRecordsTimestr_argsStandardScheme(); + public exec_argsStandardScheme getScheme() { + return new exec_argsStandardScheme(); } } - private static class traceRecordsTimestr_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class exec_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordsTimestr_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, exec_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -700912,33 +704422,26 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordsTimestr break; } switch (schemeField.id) { - case 1: // RECORDS + case 1: // COMMANDS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list7166 = iprot.readListBegin(); - struct.records = new java.util.ArrayList(_list7166.size); - long _elem7167; - for (int _i7168 = 0; _i7168 < _list7166.size; ++_i7168) + org.apache.thrift.protocol.TList _list7210 = iprot.readListBegin(); + struct.commands = new java.util.ArrayList(_list7210.size); + @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TCommand _elem7211; + for (int _i7212 = 0; _i7212 < _list7210.size; ++_i7212) { - _elem7167 = iprot.readI64(); - struct.records.add(_elem7167); + _elem7211 = new com.cinchapi.concourse.thrift.TCommand(); + _elem7211.read(iprot); + struct.commands.add(_elem7211); } iprot.readListEnd(); } - struct.setRecordsIsSet(true); + struct.setCommandsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 2: // TIMESTAMP - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.timestamp = iprot.readString(); - struct.setTimestampIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // CREDS + case 2: // CREDS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); struct.creds.read(iprot); @@ -700947,7 +704450,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordsTimestr org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 4: // TRANSACTION + case 3: // TRANSACTION if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.transaction = new com.cinchapi.concourse.thrift.TransactionToken(); struct.transaction.read(iprot); @@ -700956,7 +704459,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordsTimestr org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 5: // ENVIRONMENT + case 4: // ENVIRONMENT if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.environment = iprot.readString(); struct.setEnvironmentIsSet(true); @@ -700976,27 +704479,22 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordsTimestr } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecordsTimestr_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, exec_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); - if (struct.records != null) { - oprot.writeFieldBegin(RECORDS_FIELD_DESC); + if (struct.commands != null) { + oprot.writeFieldBegin(COMMANDS_FIELD_DESC); { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, struct.records.size())); - for (long _iter7169 : struct.records) + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.commands.size())); + for (com.cinchapi.concourse.thrift.TCommand _iter7213 : struct.commands) { - oprot.writeI64(_iter7169); + _iter7213.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } - if (struct.timestamp != null) { - oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC); - oprot.writeString(struct.timestamp); - oprot.writeFieldEnd(); - } if (struct.creds != null) { oprot.writeFieldBegin(CREDS_FIELD_DESC); struct.creds.write(oprot); @@ -701018,47 +704516,41 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecordsTimest } - private static class traceRecordsTimestr_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class exec_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public traceRecordsTimestr_argsTupleScheme getScheme() { - return new traceRecordsTimestr_argsTupleScheme(); + public exec_argsTupleScheme getScheme() { + return new exec_argsTupleScheme(); } } - private static class traceRecordsTimestr_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class exec_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordsTimestr_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, exec_args 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.isSetRecords()) { + if (struct.isSetCommands()) { optionals.set(0); } - if (struct.isSetTimestamp()) { - optionals.set(1); - } if (struct.isSetCreds()) { - optionals.set(2); + optionals.set(1); } if (struct.isSetTransaction()) { - optionals.set(3); + optionals.set(2); } if (struct.isSetEnvironment()) { - optionals.set(4); + optionals.set(3); } - oprot.writeBitSet(optionals, 5); - if (struct.isSetRecords()) { + oprot.writeBitSet(optionals, 4); + if (struct.isSetCommands()) { { - oprot.writeI32(struct.records.size()); - for (long _iter7170 : struct.records) + oprot.writeI32(struct.commands.size()); + for (com.cinchapi.concourse.thrift.TCommand _iter7214 : struct.commands) { - oprot.writeI64(_iter7170); + _iter7214.write(oprot); } } } - if (struct.isSetTimestamp()) { - oprot.writeString(struct.timestamp); - } if (struct.isSetCreds()) { struct.creds.write(oprot); } @@ -701071,37 +704563,34 @@ public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordsTimestr } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, traceRecordsTimestr_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, exec_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(5); + java.util.BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { { - org.apache.thrift.protocol.TList _list7171 = iprot.readListBegin(org.apache.thrift.protocol.TType.I64); - struct.records = new java.util.ArrayList(_list7171.size); - long _elem7172; - for (int _i7173 = 0; _i7173 < _list7171.size; ++_i7173) + org.apache.thrift.protocol.TList _list7215 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT); + struct.commands = new java.util.ArrayList(_list7215.size); + @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TCommand _elem7216; + for (int _i7217 = 0; _i7217 < _list7215.size; ++_i7217) { - _elem7172 = iprot.readI64(); - struct.records.add(_elem7172); + _elem7216 = new com.cinchapi.concourse.thrift.TCommand(); + _elem7216.read(iprot); + struct.commands.add(_elem7216); } } - struct.setRecordsIsSet(true); + struct.setCommandsIsSet(true); } if (incoming.get(1)) { - struct.timestamp = iprot.readString(); - struct.setTimestampIsSet(true); - } - if (incoming.get(2)) { struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); struct.creds.read(iprot); struct.setCredsIsSet(true); } - if (incoming.get(3)) { + if (incoming.get(2)) { struct.transaction = new com.cinchapi.concourse.thrift.TransactionToken(); struct.transaction.read(iprot); struct.setTransactionIsSet(true); } - if (incoming.get(4)) { + if (incoming.get(3)) { struct.environment = iprot.readString(); struct.setEnvironmentIsSet(true); } @@ -701113,28 +704602,34 @@ private static S scheme(org.apache. } } - public static class traceRecordsTimestr_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("traceRecordsTimestr_result"); + public static class exec_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("exec_result"); - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.MAP, (short)0); + 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.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField EX2_FIELD_DESC = new org.apache.thrift.protocol.TField("ex2", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField EX3_FIELD_DESC = new org.apache.thrift.protocol.TField("ex3", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final org.apache.thrift.protocol.TField EX4_FIELD_DESC = new org.apache.thrift.protocol.TField("ex4", org.apache.thrift.protocol.TType.STRUCT, (short)4); + private static final org.apache.thrift.protocol.TField EX5_FIELD_DESC = new org.apache.thrift.protocol.TField("ex5", org.apache.thrift.protocol.TType.STRUCT, (short)5); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new traceRecordsTimestr_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new traceRecordsTimestr_resultTupleSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new exec_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new exec_resultTupleSchemeFactory(); - public @org.apache.thrift.annotation.Nullable java.util.Map>> success; // required + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ComplexTObject success; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2; // required - public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3; // required + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.InvalidArgumentException ex3; // required + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex4; // required + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ParseException ex5; // 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"), EX((short)1, "ex"), EX2((short)2, "ex2"), - EX3((short)3, "ex3"); + EX3((short)3, "ex3"), + EX4((short)4, "ex4"), + EX5((short)5, "ex5"); private static final java.util.Map byName = new java.util.LinkedHashMap(); @@ -701158,6 +704653,10 @@ public static _Fields findByThriftId(int fieldId) { return EX2; case 3: // EX3 return EX3; + case 4: // EX4 + return EX4; + case 5: // EX5 + return EX5; default: return null; } @@ -701205,67 +704704,47 @@ public java.lang.String getFieldName() { 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.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64), - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), - new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)))))); + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.ComplexTObject.class))); tmpMap.put(_Fields.EX, new org.apache.thrift.meta_data.FieldMetaData("ex", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.SecurityException.class))); tmpMap.put(_Fields.EX2, new org.apache.thrift.meta_data.FieldMetaData("ex2", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.TransactionException.class))); tmpMap.put(_Fields.EX3, new org.apache.thrift.meta_data.FieldMetaData("ex3", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.InvalidArgumentException.class))); + tmpMap.put(_Fields.EX4, new org.apache.thrift.meta_data.FieldMetaData("ex4", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.PermissionException.class))); + tmpMap.put(_Fields.EX5, new org.apache.thrift.meta_data.FieldMetaData("ex5", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.ParseException.class))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(traceRecordsTimestr_result.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(exec_result.class, metaDataMap); } - public traceRecordsTimestr_result() { + public exec_result() { } - public traceRecordsTimestr_result( - java.util.Map>> success, + public exec_result( + com.cinchapi.concourse.thrift.ComplexTObject success, com.cinchapi.concourse.thrift.SecurityException ex, com.cinchapi.concourse.thrift.TransactionException ex2, - com.cinchapi.concourse.thrift.PermissionException ex3) + com.cinchapi.concourse.thrift.InvalidArgumentException ex3, + com.cinchapi.concourse.thrift.PermissionException ex4, + com.cinchapi.concourse.thrift.ParseException ex5) { this(); this.success = success; this.ex = ex; this.ex2 = ex2; this.ex3 = ex3; + this.ex4 = ex4; + this.ex5 = ex5; } /** * Performs a deep copy on other. */ - public traceRecordsTimestr_result(traceRecordsTimestr_result other) { + public exec_result(exec_result other) { if (other.isSetSuccess()) { - java.util.Map>> __this__success = new java.util.LinkedHashMap>>(other.success.size()); - for (java.util.Map.Entry>> other_element : other.success.entrySet()) { - - java.lang.Long other_element_key = other_element.getKey(); - java.util.Map> other_element_value = other_element.getValue(); - - java.lang.Long __this__success_copy_key = other_element_key; - - java.util.Map> __this__success_copy_value = new java.util.LinkedHashMap>(other_element_value.size()); - for (java.util.Map.Entry> other_element_value_element : other_element_value.entrySet()) { - - java.lang.String other_element_value_element_key = other_element_value_element.getKey(); - java.util.Set other_element_value_element_value = other_element_value_element.getValue(); - - java.lang.String __this__success_copy_value_copy_key = other_element_value_element_key; - - java.util.Set __this__success_copy_value_copy_value = new java.util.LinkedHashSet(other_element_value_element_value); - - __this__success_copy_value.put(__this__success_copy_value_copy_key, __this__success_copy_value_copy_value); - } - - __this__success.put(__this__success_copy_key, __this__success_copy_value); - } - this.success = __this__success; + this.success = new com.cinchapi.concourse.thrift.ComplexTObject(other.success); } if (other.isSetEx()) { this.ex = new com.cinchapi.concourse.thrift.SecurityException(other.ex); @@ -701274,13 +704753,19 @@ public traceRecordsTimestr_result(traceRecordsTimestr_result other) { this.ex2 = new com.cinchapi.concourse.thrift.TransactionException(other.ex2); } if (other.isSetEx3()) { - this.ex3 = new com.cinchapi.concourse.thrift.PermissionException(other.ex3); + this.ex3 = new com.cinchapi.concourse.thrift.InvalidArgumentException(other.ex3); + } + if (other.isSetEx4()) { + this.ex4 = new com.cinchapi.concourse.thrift.PermissionException(other.ex4); + } + if (other.isSetEx5()) { + this.ex5 = new com.cinchapi.concourse.thrift.ParseException(other.ex5); } } @Override - public traceRecordsTimestr_result deepCopy() { - return new traceRecordsTimestr_result(this); + public exec_result deepCopy() { + return new exec_result(this); } @Override @@ -701289,25 +704774,16 @@ public void clear() { this.ex = null; this.ex2 = null; this.ex3 = null; - } - - public int getSuccessSize() { - return (this.success == null) ? 0 : this.success.size(); - } - - public void putToSuccess(long key, java.util.Map> val) { - if (this.success == null) { - this.success = new java.util.LinkedHashMap>>(); - } - this.success.put(key, val); + this.ex4 = null; + this.ex5 = null; } @org.apache.thrift.annotation.Nullable - public java.util.Map>> getSuccess() { + public com.cinchapi.concourse.thrift.ComplexTObject getSuccess() { return this.success; } - public traceRecordsTimestr_result setSuccess(@org.apache.thrift.annotation.Nullable java.util.Map>> success) { + public exec_result setSuccess(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ComplexTObject success) { this.success = success; return this; } @@ -701332,7 +704808,7 @@ public com.cinchapi.concourse.thrift.SecurityException getEx() { return this.ex; } - public traceRecordsTimestr_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { + public exec_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { this.ex = ex; return this; } @@ -701357,7 +704833,7 @@ public com.cinchapi.concourse.thrift.TransactionException getEx2() { return this.ex2; } - public traceRecordsTimestr_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { + public exec_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { this.ex2 = ex2; return this; } @@ -701378,11 +704854,11 @@ public void setEx2IsSet(boolean value) { } @org.apache.thrift.annotation.Nullable - public com.cinchapi.concourse.thrift.PermissionException getEx3() { + public com.cinchapi.concourse.thrift.InvalidArgumentException getEx3() { return this.ex3; } - public traceRecordsTimestr_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3) { + public exec_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.InvalidArgumentException ex3) { this.ex3 = ex3; return this; } @@ -701402,6 +704878,56 @@ public void setEx3IsSet(boolean value) { } } + @org.apache.thrift.annotation.Nullable + public com.cinchapi.concourse.thrift.PermissionException getEx4() { + return this.ex4; + } + + public exec_result setEx4(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex4) { + this.ex4 = ex4; + return this; + } + + public void unsetEx4() { + this.ex4 = null; + } + + /** Returns true if field ex4 is set (has been assigned a value) and false otherwise */ + public boolean isSetEx4() { + return this.ex4 != null; + } + + public void setEx4IsSet(boolean value) { + if (!value) { + this.ex4 = null; + } + } + + @org.apache.thrift.annotation.Nullable + public com.cinchapi.concourse.thrift.ParseException getEx5() { + return this.ex5; + } + + public exec_result setEx5(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ParseException ex5) { + this.ex5 = ex5; + return this; + } + + public void unsetEx5() { + this.ex5 = null; + } + + /** Returns true if field ex5 is set (has been assigned a value) and false otherwise */ + public boolean isSetEx5() { + return this.ex5 != null; + } + + public void setEx5IsSet(boolean value) { + if (!value) { + this.ex5 = null; + } + } + @Override public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { @@ -701409,7 +704935,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetSuccess(); } else { - setSuccess((java.util.Map>>)value); + setSuccess((com.cinchapi.concourse.thrift.ComplexTObject)value); } break; @@ -701433,7 +704959,23 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetEx3(); } else { - setEx3((com.cinchapi.concourse.thrift.PermissionException)value); + setEx3((com.cinchapi.concourse.thrift.InvalidArgumentException)value); + } + break; + + case EX4: + if (value == null) { + unsetEx4(); + } else { + setEx4((com.cinchapi.concourse.thrift.PermissionException)value); + } + break; + + case EX5: + if (value == null) { + unsetEx5(); + } else { + setEx5((com.cinchapi.concourse.thrift.ParseException)value); } break; @@ -701456,6 +704998,12 @@ public java.lang.Object getFieldValue(_Fields field) { case EX3: return getEx3(); + case EX4: + return getEx4(); + + case EX5: + return getEx5(); + } throw new java.lang.IllegalStateException(); } @@ -701476,18 +705024,22 @@ public boolean isSet(_Fields field) { return isSetEx2(); case EX3: return isSetEx3(); + case EX4: + return isSetEx4(); + case EX5: + return isSetEx5(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { - if (that instanceof traceRecordsTimestr_result) - return this.equals((traceRecordsTimestr_result)that); + if (that instanceof exec_result) + return this.equals((exec_result)that); return false; } - public boolean equals(traceRecordsTimestr_result that) { + public boolean equals(exec_result that) { if (that == null) return false; if (this == that) @@ -701529,6 +705081,24 @@ public boolean equals(traceRecordsTimestr_result that) { return false; } + boolean this_present_ex4 = true && this.isSetEx4(); + boolean that_present_ex4 = true && that.isSetEx4(); + if (this_present_ex4 || that_present_ex4) { + if (!(this_present_ex4 && that_present_ex4)) + return false; + if (!this.ex4.equals(that.ex4)) + return false; + } + + boolean this_present_ex5 = true && this.isSetEx5(); + boolean that_present_ex5 = true && that.isSetEx5(); + if (this_present_ex5 || that_present_ex5) { + if (!(this_present_ex5 && that_present_ex5)) + return false; + if (!this.ex5.equals(that.ex5)) + return false; + } + return true; } @@ -701552,11 +705122,19 @@ public int hashCode() { if (isSetEx3()) hashCode = hashCode * 8191 + ex3.hashCode(); + hashCode = hashCode * 8191 + ((isSetEx4()) ? 131071 : 524287); + if (isSetEx4()) + hashCode = hashCode * 8191 + ex4.hashCode(); + + hashCode = hashCode * 8191 + ((isSetEx5()) ? 131071 : 524287); + if (isSetEx5()) + hashCode = hashCode * 8191 + ex5.hashCode(); + return hashCode; } @Override - public int compareTo(traceRecordsTimestr_result other) { + public int compareTo(exec_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -701603,6 +705181,26 @@ public int compareTo(traceRecordsTimestr_result other) { return lastComparison; } } + lastComparison = java.lang.Boolean.compare(isSetEx4(), other.isSetEx4()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEx4()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex4, other.ex4); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetEx5(), other.isSetEx5()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEx5()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex5, other.ex5); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -701623,7 +705221,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("traceRecordsTimestr_result("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("exec_result("); boolean first = true; sb.append("success:"); @@ -701657,6 +705255,22 @@ public java.lang.String toString() { sb.append(this.ex3); } first = false; + if (!first) sb.append(", "); + sb.append("ex4:"); + if (this.ex4 == null) { + sb.append("null"); + } else { + sb.append(this.ex4); + } + first = false; + if (!first) sb.append(", "); + sb.append("ex5:"); + if (this.ex5 == null) { + sb.append("null"); + } else { + sb.append(this.ex5); + } + first = false; sb.append(")"); return sb.toString(); } @@ -701664,6 +705278,9 @@ public java.lang.String 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 { @@ -701682,17 +705299,17 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class traceRecordsTimestr_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class exec_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public traceRecordsTimestr_resultStandardScheme getScheme() { - return new traceRecordsTimestr_resultStandardScheme(); + public exec_resultStandardScheme getScheme() { + return new exec_resultStandardScheme(); } } - private static class traceRecordsTimestr_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class exec_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordsTimestr_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, exec_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -701703,42 +705320,9 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordsTimestr } switch (schemeField.id) { case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map7174 = iprot.readMapBegin(); - struct.success = new java.util.LinkedHashMap>>(2*_map7174.size); - long _key7175; - @org.apache.thrift.annotation.Nullable java.util.Map> _val7176; - for (int _i7177 = 0; _i7177 < _map7174.size; ++_i7177) - { - _key7175 = iprot.readI64(); - { - org.apache.thrift.protocol.TMap _map7178 = iprot.readMapBegin(); - _val7176 = new java.util.LinkedHashMap>(2*_map7178.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key7179; - @org.apache.thrift.annotation.Nullable java.util.Set _val7180; - for (int _i7181 = 0; _i7181 < _map7178.size; ++_i7181) - { - _key7179 = iprot.readString(); - { - org.apache.thrift.protocol.TSet _set7182 = iprot.readSetBegin(); - _val7180 = new java.util.LinkedHashSet(2*_set7182.size); - long _elem7183; - for (int _i7184 = 0; _i7184 < _set7182.size; ++_i7184) - { - _elem7183 = iprot.readI64(); - _val7180.add(_elem7183); - } - iprot.readSetEnd(); - } - _val7176.put(_key7179, _val7180); - } - iprot.readMapEnd(); - } - struct.success.put(_key7175, _val7176); - } - iprot.readMapEnd(); - } + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.success = new com.cinchapi.concourse.thrift.ComplexTObject(); + struct.success.read(iprot); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); @@ -701764,13 +705348,31 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordsTimestr break; case 3: // EX3 if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.ex3 = new com.cinchapi.concourse.thrift.PermissionException(); + struct.ex3 = new com.cinchapi.concourse.thrift.InvalidArgumentException(); struct.ex3.read(iprot); struct.setEx3IsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 4: // EX4 + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ex4 = new com.cinchapi.concourse.thrift.PermissionException(); + struct.ex4.read(iprot); + struct.setEx4IsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // EX5 + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ex5 = new com.cinchapi.concourse.thrift.ParseException(); + struct.ex5.read(iprot); + struct.setEx5IsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -701783,36 +705385,13 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordsTimestr } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecordsTimestr_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, exec_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.MAP, struct.success.size())); - for (java.util.Map.Entry>> _iter7185 : struct.success.entrySet()) - { - oprot.writeI64(_iter7185.getKey()); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.SET, _iter7185.getValue().size())); - for (java.util.Map.Entry> _iter7186 : _iter7185.getValue().entrySet()) - { - oprot.writeString(_iter7186.getKey()); - { - oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I64, _iter7186.getValue().size())); - for (long _iter7187 : _iter7186.getValue()) - { - oprot.writeI64(_iter7187); - } - oprot.writeSetEnd(); - } - } - oprot.writeMapEnd(); - } - } - oprot.writeMapEnd(); - } + struct.success.write(oprot); oprot.writeFieldEnd(); } if (struct.ex != null) { @@ -701830,23 +705409,33 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecordsTimest struct.ex3.write(oprot); oprot.writeFieldEnd(); } + if (struct.ex4 != null) { + oprot.writeFieldBegin(EX4_FIELD_DESC); + struct.ex4.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ex5 != null) { + oprot.writeFieldBegin(EX5_FIELD_DESC); + struct.ex5.write(oprot); + oprot.writeFieldEnd(); + } oprot.writeFieldStop(); oprot.writeStructEnd(); } } - private static class traceRecordsTimestr_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class exec_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public traceRecordsTimestr_resultTupleScheme getScheme() { - return new traceRecordsTimestr_resultTupleScheme(); + public exec_resultTupleScheme getScheme() { + return new exec_resultTupleScheme(); } } - private static class traceRecordsTimestr_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class exec_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordsTimestr_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, exec_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()) { @@ -701861,29 +705450,15 @@ public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordsTimestr if (struct.isSetEx3()) { optionals.set(3); } - oprot.writeBitSet(optionals, 4); + if (struct.isSetEx4()) { + optionals.set(4); + } + if (struct.isSetEx5()) { + optionals.set(5); + } + oprot.writeBitSet(optionals, 6); if (struct.isSetSuccess()) { - { - oprot.writeI32(struct.success.size()); - for (java.util.Map.Entry>> _iter7188 : struct.success.entrySet()) - { - oprot.writeI64(_iter7188.getKey()); - { - oprot.writeI32(_iter7188.getValue().size()); - for (java.util.Map.Entry> _iter7189 : _iter7188.getValue().entrySet()) - { - oprot.writeString(_iter7189.getKey()); - { - oprot.writeI32(_iter7189.getValue().size()); - for (long _iter7190 : _iter7189.getValue()) - { - oprot.writeI64(_iter7190); - } - } - } - } - } - } + struct.success.write(oprot); } if (struct.isSetEx()) { struct.ex.write(oprot); @@ -701894,45 +705469,21 @@ public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordsTimestr if (struct.isSetEx3()) { struct.ex3.write(oprot); } + if (struct.isSetEx4()) { + struct.ex4.write(oprot); + } + if (struct.isSetEx5()) { + struct.ex5.write(oprot); + } } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, traceRecordsTimestr_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, exec_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(4); + java.util.BitSet incoming = iprot.readBitSet(6); if (incoming.get(0)) { - { - org.apache.thrift.protocol.TMap _map7191 = iprot.readMapBegin(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.MAP); - struct.success = new java.util.LinkedHashMap>>(2*_map7191.size); - long _key7192; - @org.apache.thrift.annotation.Nullable java.util.Map> _val7193; - for (int _i7194 = 0; _i7194 < _map7191.size; ++_i7194) - { - _key7192 = iprot.readI64(); - { - org.apache.thrift.protocol.TMap _map7195 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.SET); - _val7193 = new java.util.LinkedHashMap>(2*_map7195.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key7196; - @org.apache.thrift.annotation.Nullable java.util.Set _val7197; - for (int _i7198 = 0; _i7198 < _map7195.size; ++_i7198) - { - _key7196 = iprot.readString(); - { - org.apache.thrift.protocol.TSet _set7199 = iprot.readSetBegin(org.apache.thrift.protocol.TType.I64); - _val7197 = new java.util.LinkedHashSet(2*_set7199.size); - long _elem7200; - for (int _i7201 = 0; _i7201 < _set7199.size; ++_i7201) - { - _elem7200 = iprot.readI64(); - _val7197.add(_elem7200); - } - } - _val7193.put(_key7196, _val7197); - } - } - struct.success.put(_key7192, _val7193); - } - } + struct.success = new com.cinchapi.concourse.thrift.ComplexTObject(); + struct.success.read(iprot); struct.setSuccessIsSet(true); } if (incoming.get(1)) { @@ -701946,10 +705497,20 @@ public void read(org.apache.thrift.protocol.TProtocol prot, traceRecordsTimestr_ struct.setEx2IsSet(true); } if (incoming.get(3)) { - struct.ex3 = new com.cinchapi.concourse.thrift.PermissionException(); + struct.ex3 = new com.cinchapi.concourse.thrift.InvalidArgumentException(); struct.ex3.read(iprot); struct.setEx3IsSet(true); } + if (incoming.get(4)) { + struct.ex4 = new com.cinchapi.concourse.thrift.PermissionException(); + struct.ex4.read(iprot); + struct.setEx4IsSet(true); + } + if (incoming.get(5)) { + struct.ex5 = new com.cinchapi.concourse.thrift.ParseException(); + struct.ex5.read(iprot); + struct.setEx5IsSet(true); + } } } @@ -701958,25 +705519,25 @@ private static S scheme(org.apache. } } - public static class consolidateRecords_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("consolidateRecords_args"); + public static class submit_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("submit_args"); - private static final org.apache.thrift.protocol.TField RECORDS_FIELD_DESC = new org.apache.thrift.protocol.TField("records", org.apache.thrift.protocol.TType.LIST, (short)1); + private static final org.apache.thrift.protocol.TField COMMANDS_FIELD_DESC = new org.apache.thrift.protocol.TField("commands", org.apache.thrift.protocol.TType.LIST, (short)1); private static final org.apache.thrift.protocol.TField CREDS_FIELD_DESC = new org.apache.thrift.protocol.TField("creds", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField TRANSACTION_FIELD_DESC = new org.apache.thrift.protocol.TField("transaction", org.apache.thrift.protocol.TType.STRUCT, (short)3); private static final org.apache.thrift.protocol.TField ENVIRONMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("environment", org.apache.thrift.protocol.TType.STRING, (short)4); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new consolidateRecords_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new consolidateRecords_argsTupleSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new submit_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new submit_argsTupleSchemeFactory(); - public @org.apache.thrift.annotation.Nullable java.util.List records; // required + public @org.apache.thrift.annotation.Nullable java.util.List commands; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction; // required public @org.apache.thrift.annotation.Nullable java.lang.String environment; // 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 { - RECORDS((short)1, "records"), + COMMANDS((short)1, "commands"), CREDS((short)2, "creds"), TRANSACTION((short)3, "transaction"), ENVIRONMENT((short)4, "environment"); @@ -701995,8 +705556,8 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { - case 1: // RECORDS - return RECORDS; + case 1: // COMMANDS + return COMMANDS; case 2: // CREDS return CREDS; case 3: // TRANSACTION @@ -702049,9 +705610,9 @@ public java.lang.String getFieldName() { 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.RECORDS, new org.apache.thrift.meta_data.FieldMetaData("records", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.COMMANDS, new org.apache.thrift.meta_data.FieldMetaData("commands", 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.I64)))); + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.TCommand.class)))); tmpMap.put(_Fields.CREDS, new org.apache.thrift.meta_data.FieldMetaData("creds", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.AccessToken.class))); tmpMap.put(_Fields.TRANSACTION, new org.apache.thrift.meta_data.FieldMetaData("transaction", org.apache.thrift.TFieldRequirementType.DEFAULT, @@ -702059,20 +705620,20 @@ public java.lang.String getFieldName() { tmpMap.put(_Fields.ENVIRONMENT, new org.apache.thrift.meta_data.FieldMetaData("environment", 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(consolidateRecords_args.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(submit_args.class, metaDataMap); } - public consolidateRecords_args() { + public submit_args() { } - public consolidateRecords_args( - java.util.List records, + public submit_args( + java.util.List commands, com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment) { this(); - this.records = records; + this.commands = commands; this.creds = creds; this.transaction = transaction; this.environment = environment; @@ -702081,10 +705642,13 @@ public consolidateRecords_args( /** * Performs a deep copy on other. */ - public consolidateRecords_args(consolidateRecords_args other) { - if (other.isSetRecords()) { - java.util.List __this__records = new java.util.ArrayList(other.records); - this.records = __this__records; + public submit_args(submit_args other) { + if (other.isSetCommands()) { + java.util.List __this__commands = new java.util.ArrayList(other.commands.size()); + for (com.cinchapi.concourse.thrift.TCommand other_element : other.commands) { + __this__commands.add(new com.cinchapi.concourse.thrift.TCommand(other_element)); + } + this.commands = __this__commands; } if (other.isSetCreds()) { this.creds = new com.cinchapi.concourse.thrift.AccessToken(other.creds); @@ -702098,56 +705662,56 @@ public consolidateRecords_args(consolidateRecords_args other) { } @Override - public consolidateRecords_args deepCopy() { - return new consolidateRecords_args(this); + public submit_args deepCopy() { + return new submit_args(this); } @Override public void clear() { - this.records = null; + this.commands = null; this.creds = null; this.transaction = null; this.environment = null; } - public int getRecordsSize() { - return (this.records == null) ? 0 : this.records.size(); + public int getCommandsSize() { + return (this.commands == null) ? 0 : this.commands.size(); } @org.apache.thrift.annotation.Nullable - public java.util.Iterator getRecordsIterator() { - return (this.records == null) ? null : this.records.iterator(); + public java.util.Iterator getCommandsIterator() { + return (this.commands == null) ? null : this.commands.iterator(); } - public void addToRecords(long elem) { - if (this.records == null) { - this.records = new java.util.ArrayList(); + public void addToCommands(com.cinchapi.concourse.thrift.TCommand elem) { + if (this.commands == null) { + this.commands = new java.util.ArrayList(); } - this.records.add(elem); + this.commands.add(elem); } @org.apache.thrift.annotation.Nullable - public java.util.List getRecords() { - return this.records; + public java.util.List getCommands() { + return this.commands; } - public consolidateRecords_args setRecords(@org.apache.thrift.annotation.Nullable java.util.List records) { - this.records = records; + public submit_args setCommands(@org.apache.thrift.annotation.Nullable java.util.List commands) { + this.commands = commands; return this; } - public void unsetRecords() { - this.records = null; + public void unsetCommands() { + this.commands = null; } - /** Returns true if field records is set (has been assigned a value) and false otherwise */ - public boolean isSetRecords() { - return this.records != null; + /** Returns true if field commands is set (has been assigned a value) and false otherwise */ + public boolean isSetCommands() { + return this.commands != null; } - public void setRecordsIsSet(boolean value) { + public void setCommandsIsSet(boolean value) { if (!value) { - this.records = null; + this.commands = null; } } @@ -702156,7 +705720,7 @@ public com.cinchapi.concourse.thrift.AccessToken getCreds() { return this.creds; } - public consolidateRecords_args setCreds(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds) { + public submit_args setCreds(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds) { this.creds = creds; return this; } @@ -702181,7 +705745,7 @@ public com.cinchapi.concourse.thrift.TransactionToken getTransaction() { return this.transaction; } - public consolidateRecords_args setTransaction(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction) { + public submit_args setTransaction(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction) { this.transaction = transaction; return this; } @@ -702206,7 +705770,7 @@ public java.lang.String getEnvironment() { return this.environment; } - public consolidateRecords_args setEnvironment(@org.apache.thrift.annotation.Nullable java.lang.String environment) { + public submit_args setEnvironment(@org.apache.thrift.annotation.Nullable java.lang.String environment) { this.environment = environment; return this; } @@ -702229,11 +705793,11 @@ public void setEnvironmentIsSet(boolean value) { @Override public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { - case RECORDS: + case COMMANDS: if (value == null) { - unsetRecords(); + unsetCommands(); } else { - setRecords((java.util.List)value); + setCommands((java.util.List)value); } break; @@ -702268,8 +705832,8 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable @Override public java.lang.Object getFieldValue(_Fields field) { switch (field) { - case RECORDS: - return getRecords(); + case COMMANDS: + return getCommands(); case CREDS: return getCreds(); @@ -702292,8 +705856,8 @@ public boolean isSet(_Fields field) { } switch (field) { - case RECORDS: - return isSetRecords(); + case COMMANDS: + return isSetCommands(); case CREDS: return isSetCreds(); case TRANSACTION: @@ -702306,23 +705870,23 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that instanceof consolidateRecords_args) - return this.equals((consolidateRecords_args)that); + if (that instanceof submit_args) + return this.equals((submit_args)that); return false; } - public boolean equals(consolidateRecords_args that) { + public boolean equals(submit_args that) { if (that == null) return false; if (this == that) return true; - boolean this_present_records = true && this.isSetRecords(); - boolean that_present_records = true && that.isSetRecords(); - if (this_present_records || that_present_records) { - if (!(this_present_records && that_present_records)) + boolean this_present_commands = true && this.isSetCommands(); + boolean that_present_commands = true && that.isSetCommands(); + if (this_present_commands || that_present_commands) { + if (!(this_present_commands && that_present_commands)) return false; - if (!this.records.equals(that.records)) + if (!this.commands.equals(that.commands)) return false; } @@ -702360,9 +705924,9 @@ public boolean equals(consolidateRecords_args that) { public int hashCode() { int hashCode = 1; - hashCode = hashCode * 8191 + ((isSetRecords()) ? 131071 : 524287); - if (isSetRecords()) - hashCode = hashCode * 8191 + records.hashCode(); + hashCode = hashCode * 8191 + ((isSetCommands()) ? 131071 : 524287); + if (isSetCommands()) + hashCode = hashCode * 8191 + commands.hashCode(); hashCode = hashCode * 8191 + ((isSetCreds()) ? 131071 : 524287); if (isSetCreds()) @@ -702380,19 +705944,19 @@ public int hashCode() { } @Override - public int compareTo(consolidateRecords_args other) { + public int compareTo(submit_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; - lastComparison = java.lang.Boolean.compare(isSetRecords(), other.isSetRecords()); + lastComparison = java.lang.Boolean.compare(isSetCommands(), other.isSetCommands()); if (lastComparison != 0) { return lastComparison; } - if (isSetRecords()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.records, other.records); + if (isSetCommands()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.commands, other.commands); if (lastComparison != 0) { return lastComparison; } @@ -702448,14 +706012,14 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("consolidateRecords_args("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("submit_args("); boolean first = true; - sb.append("records:"); - if (this.records == null) { + sb.append("commands:"); + if (this.commands == null) { sb.append("null"); } else { - sb.append(this.records); + sb.append(this.commands); } first = false; if (!first) sb.append(", "); @@ -702513,17 +706077,17 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class consolidateRecords_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class submit_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public consolidateRecords_argsStandardScheme getScheme() { - return new consolidateRecords_argsStandardScheme(); + public submit_argsStandardScheme getScheme() { + return new submit_argsStandardScheme(); } } - private static class consolidateRecords_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class submit_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, consolidateRecords_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, submit_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -702533,20 +706097,21 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, consolidateRecords_ break; } switch (schemeField.id) { - case 1: // RECORDS + case 1: // COMMANDS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list7202 = iprot.readListBegin(); - struct.records = new java.util.ArrayList(_list7202.size); - long _elem7203; - for (int _i7204 = 0; _i7204 < _list7202.size; ++_i7204) + org.apache.thrift.protocol.TList _list7218 = iprot.readListBegin(); + struct.commands = new java.util.ArrayList(_list7218.size); + @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TCommand _elem7219; + for (int _i7220 = 0; _i7220 < _list7218.size; ++_i7220) { - _elem7203 = iprot.readI64(); - struct.records.add(_elem7203); + _elem7219 = new com.cinchapi.concourse.thrift.TCommand(); + _elem7219.read(iprot); + struct.commands.add(_elem7219); } iprot.readListEnd(); } - struct.setRecordsIsSet(true); + struct.setCommandsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -702589,17 +706154,17 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, consolidateRecords_ } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, consolidateRecords_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, submit_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); - if (struct.records != null) { - oprot.writeFieldBegin(RECORDS_FIELD_DESC); + if (struct.commands != null) { + oprot.writeFieldBegin(COMMANDS_FIELD_DESC); { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, struct.records.size())); - for (long _iter7205 : struct.records) + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.commands.size())); + for (com.cinchapi.concourse.thrift.TCommand _iter7221 : struct.commands) { - oprot.writeI64(_iter7205); + _iter7221.write(oprot); } oprot.writeListEnd(); } @@ -702626,20 +706191,20 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, consolidateRecords } - private static class consolidateRecords_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class submit_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public consolidateRecords_argsTupleScheme getScheme() { - return new consolidateRecords_argsTupleScheme(); + public submit_argsTupleScheme getScheme() { + return new submit_argsTupleScheme(); } } - private static class consolidateRecords_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class submit_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, consolidateRecords_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, submit_args 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.isSetRecords()) { + if (struct.isSetCommands()) { optionals.set(0); } if (struct.isSetCreds()) { @@ -702652,12 +706217,12 @@ public void write(org.apache.thrift.protocol.TProtocol prot, consolidateRecords_ optionals.set(3); } oprot.writeBitSet(optionals, 4); - if (struct.isSetRecords()) { + if (struct.isSetCommands()) { { - oprot.writeI32(struct.records.size()); - for (long _iter7206 : struct.records) + oprot.writeI32(struct.commands.size()); + for (com.cinchapi.concourse.thrift.TCommand _iter7222 : struct.commands) { - oprot.writeI64(_iter7206); + _iter7222.write(oprot); } } } @@ -702673,21 +706238,22 @@ public void write(org.apache.thrift.protocol.TProtocol prot, consolidateRecords_ } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, consolidateRecords_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, submit_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { { - org.apache.thrift.protocol.TList _list7207 = iprot.readListBegin(org.apache.thrift.protocol.TType.I64); - struct.records = new java.util.ArrayList(_list7207.size); - long _elem7208; - for (int _i7209 = 0; _i7209 < _list7207.size; ++_i7209) + org.apache.thrift.protocol.TList _list7223 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT); + struct.commands = new java.util.ArrayList(_list7223.size); + @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TCommand _elem7224; + for (int _i7225 = 0; _i7225 < _list7223.size; ++_i7225) { - _elem7208 = iprot.readI64(); - struct.records.add(_elem7208); + _elem7224 = new com.cinchapi.concourse.thrift.TCommand(); + _elem7224.read(iprot); + struct.commands.add(_elem7224); } } - struct.setRecordsIsSet(true); + struct.setCommandsIsSet(true); } if (incoming.get(1)) { struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); @@ -702711,28 +706277,34 @@ private static S scheme(org.apache. } } - public static class consolidateRecords_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("consolidateRecords_result"); + public static class submit_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("submit_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.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.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField EX2_FIELD_DESC = new org.apache.thrift.protocol.TField("ex2", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField EX3_FIELD_DESC = new org.apache.thrift.protocol.TField("ex3", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final org.apache.thrift.protocol.TField EX4_FIELD_DESC = new org.apache.thrift.protocol.TField("ex4", org.apache.thrift.protocol.TType.STRUCT, (short)4); + private static final org.apache.thrift.protocol.TField EX5_FIELD_DESC = new org.apache.thrift.protocol.TField("ex5", org.apache.thrift.protocol.TType.STRUCT, (short)5); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new consolidateRecords_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new consolidateRecords_resultTupleSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new submit_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new submit_resultTupleSchemeFactory(); - public boolean success; // required + public @org.apache.thrift.annotation.Nullable java.util.List success; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2; // required - public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3; // required + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.InvalidArgumentException ex3; // required + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex4; // required + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ParseException ex5; // 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"), EX((short)1, "ex"), EX2((short)2, "ex2"), - EX3((short)3, "ex3"); + EX3((short)3, "ex3"), + EX4((short)4, "ex4"), + EX5((short)5, "ex5"); private static final java.util.Map byName = new java.util.LinkedHashMap(); @@ -702756,6 +706328,10 @@ public static _Fields findByThriftId(int fieldId) { return EX2; case 3: // EX3 return EX3; + case 4: // EX4 + return EX4; + case 5: // EX5 + return EX5; default: return null; } @@ -702799,46 +706375,57 @@ public java.lang.String getFieldName() { } // 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))); + 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, com.cinchapi.concourse.thrift.ComplexTObject.class)))); tmpMap.put(_Fields.EX, new org.apache.thrift.meta_data.FieldMetaData("ex", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.SecurityException.class))); tmpMap.put(_Fields.EX2, new org.apache.thrift.meta_data.FieldMetaData("ex2", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.TransactionException.class))); tmpMap.put(_Fields.EX3, new org.apache.thrift.meta_data.FieldMetaData("ex3", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.InvalidArgumentException.class))); + tmpMap.put(_Fields.EX4, new org.apache.thrift.meta_data.FieldMetaData("ex4", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.PermissionException.class))); + tmpMap.put(_Fields.EX5, new org.apache.thrift.meta_data.FieldMetaData("ex5", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.ParseException.class))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(consolidateRecords_result.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(submit_result.class, metaDataMap); } - public consolidateRecords_result() { + public submit_result() { } - public consolidateRecords_result( - boolean success, + public submit_result( + java.util.List success, com.cinchapi.concourse.thrift.SecurityException ex, com.cinchapi.concourse.thrift.TransactionException ex2, - com.cinchapi.concourse.thrift.PermissionException ex3) + com.cinchapi.concourse.thrift.InvalidArgumentException ex3, + com.cinchapi.concourse.thrift.PermissionException ex4, + com.cinchapi.concourse.thrift.ParseException ex5) { this(); this.success = success; - setSuccessIsSet(true); this.ex = ex; this.ex2 = ex2; this.ex3 = ex3; + this.ex4 = ex4; + this.ex5 = ex5; } /** * Performs a deep copy on other. */ - public consolidateRecords_result(consolidateRecords_result other) { - __isset_bitfield = other.__isset_bitfield; - this.success = other.success; + public submit_result(submit_result other) { + if (other.isSetSuccess()) { + java.util.List __this__success = new java.util.ArrayList(other.success.size()); + for (com.cinchapi.concourse.thrift.ComplexTObject other_element : other.success) { + __this__success.add(new com.cinchapi.concourse.thrift.ComplexTObject(other_element)); + } + this.success = __this__success; + } if (other.isSetEx()) { this.ex = new com.cinchapi.concourse.thrift.SecurityException(other.ex); } @@ -702846,45 +706433,70 @@ public consolidateRecords_result(consolidateRecords_result other) { this.ex2 = new com.cinchapi.concourse.thrift.TransactionException(other.ex2); } if (other.isSetEx3()) { - this.ex3 = new com.cinchapi.concourse.thrift.PermissionException(other.ex3); + this.ex3 = new com.cinchapi.concourse.thrift.InvalidArgumentException(other.ex3); + } + if (other.isSetEx4()) { + this.ex4 = new com.cinchapi.concourse.thrift.PermissionException(other.ex4); + } + if (other.isSetEx5()) { + this.ex5 = new com.cinchapi.concourse.thrift.ParseException(other.ex5); } } @Override - public consolidateRecords_result deepCopy() { - return new consolidateRecords_result(this); + public submit_result deepCopy() { + return new submit_result(this); } @Override public void clear() { - setSuccessIsSet(false); - this.success = false; + this.success = null; this.ex = null; this.ex2 = null; this.ex3 = null; + this.ex4 = null; + this.ex5 = null; } - public boolean isSuccess() { + 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(com.cinchapi.concourse.thrift.ComplexTObject 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 consolidateRecords_result setSuccess(boolean success) { + public submit_result setSuccess(@org.apache.thrift.annotation.Nullable java.util.List success) { this.success = success; - setSuccessIsSet(true); return this; } public void unsetSuccess() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + this.success = null; } /** 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); + return this.success != null; } public void setSuccessIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + if (!value) { + this.success = null; + } } @org.apache.thrift.annotation.Nullable @@ -702892,7 +706504,7 @@ public com.cinchapi.concourse.thrift.SecurityException getEx() { return this.ex; } - public consolidateRecords_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { + public submit_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { this.ex = ex; return this; } @@ -702917,7 +706529,7 @@ public com.cinchapi.concourse.thrift.TransactionException getEx2() { return this.ex2; } - public consolidateRecords_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { + public submit_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { this.ex2 = ex2; return this; } @@ -702938,11 +706550,11 @@ public void setEx2IsSet(boolean value) { } @org.apache.thrift.annotation.Nullable - public com.cinchapi.concourse.thrift.PermissionException getEx3() { + public com.cinchapi.concourse.thrift.InvalidArgumentException getEx3() { return this.ex3; } - public consolidateRecords_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3) { + public submit_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.InvalidArgumentException ex3) { this.ex3 = ex3; return this; } @@ -702962,6 +706574,56 @@ public void setEx3IsSet(boolean value) { } } + @org.apache.thrift.annotation.Nullable + public com.cinchapi.concourse.thrift.PermissionException getEx4() { + return this.ex4; + } + + public submit_result setEx4(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex4) { + this.ex4 = ex4; + return this; + } + + public void unsetEx4() { + this.ex4 = null; + } + + /** Returns true if field ex4 is set (has been assigned a value) and false otherwise */ + public boolean isSetEx4() { + return this.ex4 != null; + } + + public void setEx4IsSet(boolean value) { + if (!value) { + this.ex4 = null; + } + } + + @org.apache.thrift.annotation.Nullable + public com.cinchapi.concourse.thrift.ParseException getEx5() { + return this.ex5; + } + + public submit_result setEx5(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ParseException ex5) { + this.ex5 = ex5; + return this; + } + + public void unsetEx5() { + this.ex5 = null; + } + + /** Returns true if field ex5 is set (has been assigned a value) and false otherwise */ + public boolean isSetEx5() { + return this.ex5 != null; + } + + public void setEx5IsSet(boolean value) { + if (!value) { + this.ex5 = null; + } + } + @Override public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { @@ -702969,7 +706631,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetSuccess(); } else { - setSuccess((java.lang.Boolean)value); + setSuccess((java.util.List)value); } break; @@ -702993,7 +706655,23 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetEx3(); } else { - setEx3((com.cinchapi.concourse.thrift.PermissionException)value); + setEx3((com.cinchapi.concourse.thrift.InvalidArgumentException)value); + } + break; + + case EX4: + if (value == null) { + unsetEx4(); + } else { + setEx4((com.cinchapi.concourse.thrift.PermissionException)value); + } + break; + + case EX5: + if (value == null) { + unsetEx5(); + } else { + setEx5((com.cinchapi.concourse.thrift.ParseException)value); } break; @@ -703005,7 +706683,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: - return isSuccess(); + return getSuccess(); case EX: return getEx(); @@ -703016,6 +706694,12 @@ public java.lang.Object getFieldValue(_Fields field) { case EX3: return getEx3(); + case EX4: + return getEx4(); + + case EX5: + return getEx5(); + } throw new java.lang.IllegalStateException(); } @@ -703036,29 +706720,33 @@ public boolean isSet(_Fields field) { return isSetEx2(); case EX3: return isSetEx3(); + case EX4: + return isSetEx4(); + case EX5: + return isSetEx5(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { - if (that instanceof consolidateRecords_result) - return this.equals((consolidateRecords_result)that); + if (that instanceof submit_result) + return this.equals((submit_result)that); return false; } - public boolean equals(consolidateRecords_result that) { + public boolean equals(submit_result that) { if (that == null) return false; if (this == that) return true; - boolean this_present_success = true; - boolean that_present_success = 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 != that.success) + if (!this.success.equals(that.success)) return false; } @@ -703089,6 +706777,24 @@ public boolean equals(consolidateRecords_result that) { return false; } + boolean this_present_ex4 = true && this.isSetEx4(); + boolean that_present_ex4 = true && that.isSetEx4(); + if (this_present_ex4 || that_present_ex4) { + if (!(this_present_ex4 && that_present_ex4)) + return false; + if (!this.ex4.equals(that.ex4)) + return false; + } + + boolean this_present_ex5 = true && this.isSetEx5(); + boolean that_present_ex5 = true && that.isSetEx5(); + if (this_present_ex5 || that_present_ex5) { + if (!(this_present_ex5 && that_present_ex5)) + return false; + if (!this.ex5.equals(that.ex5)) + return false; + } + return true; } @@ -703096,7 +706802,9 @@ public boolean equals(consolidateRecords_result that) { public int hashCode() { int hashCode = 1; - hashCode = hashCode * 8191 + ((success) ? 131071 : 524287); + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); hashCode = hashCode * 8191 + ((isSetEx()) ? 131071 : 524287); if (isSetEx()) @@ -703110,11 +706818,19 @@ public int hashCode() { if (isSetEx3()) hashCode = hashCode * 8191 + ex3.hashCode(); + hashCode = hashCode * 8191 + ((isSetEx4()) ? 131071 : 524287); + if (isSetEx4()) + hashCode = hashCode * 8191 + ex4.hashCode(); + + hashCode = hashCode * 8191 + ((isSetEx5()) ? 131071 : 524287); + if (isSetEx5()) + hashCode = hashCode * 8191 + ex5.hashCode(); + return hashCode; } @Override - public int compareTo(consolidateRecords_result other) { + public int compareTo(submit_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -703161,6 +706877,26 @@ public int compareTo(consolidateRecords_result other) { return lastComparison; } } + lastComparison = java.lang.Boolean.compare(isSetEx4(), other.isSetEx4()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEx4()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex4, other.ex4); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetEx5(), other.isSetEx5()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEx5()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex5, other.ex5); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -703181,11 +706917,15 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("consolidateRecords_result("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("submit_result("); boolean first = true; sb.append("success:"); - sb.append(this.success); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } first = false; if (!first) sb.append(", "); sb.append("ex:"); @@ -703211,6 +706951,22 @@ public java.lang.String toString() { sb.append(this.ex3); } first = false; + if (!first) sb.append(", "); + sb.append("ex4:"); + if (this.ex4 == null) { + sb.append("null"); + } else { + sb.append(this.ex4); + } + first = false; + if (!first) sb.append(", "); + sb.append("ex5:"); + if (this.ex5 == null) { + sb.append("null"); + } else { + sb.append(this.ex5); + } + first = false; sb.append(")"); return sb.toString(); } @@ -703230,25 +706986,23 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept 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 consolidateRecords_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class submit_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public consolidateRecords_resultStandardScheme getScheme() { - return new consolidateRecords_resultStandardScheme(); + public submit_resultStandardScheme getScheme() { + return new submit_resultStandardScheme(); } } - private static class consolidateRecords_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class submit_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, consolidateRecords_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, submit_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -703259,8 +707013,19 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, consolidateRecords_ } switch (schemeField.id) { case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.success = iprot.readBool(); + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list7226 = iprot.readListBegin(); + struct.success = new java.util.ArrayList(_list7226.size); + @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ComplexTObject _elem7227; + for (int _i7228 = 0; _i7228 < _list7226.size; ++_i7228) + { + _elem7227 = new com.cinchapi.concourse.thrift.ComplexTObject(); + _elem7227.read(iprot); + struct.success.add(_elem7227); + } + iprot.readListEnd(); + } struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); @@ -703286,13 +707051,31 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, consolidateRecords_ break; case 3: // EX3 if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.ex3 = new com.cinchapi.concourse.thrift.PermissionException(); + struct.ex3 = new com.cinchapi.concourse.thrift.InvalidArgumentException(); struct.ex3.read(iprot); struct.setEx3IsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 4: // EX4 + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ex4 = new com.cinchapi.concourse.thrift.PermissionException(); + struct.ex4.read(iprot); + struct.setEx4IsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // EX5 + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ex5 = new com.cinchapi.concourse.thrift.ParseException(); + struct.ex5.read(iprot); + struct.setEx5IsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -703305,13 +707088,20 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, consolidateRecords_ } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, consolidateRecords_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, submit_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); - if (struct.isSetSuccess()) { + if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeBool(struct.success); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); + for (com.cinchapi.concourse.thrift.ComplexTObject _iter7229 : struct.success) + { + _iter7229.write(oprot); + } + oprot.writeListEnd(); + } oprot.writeFieldEnd(); } if (struct.ex != null) { @@ -703329,23 +707119,33 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, consolidateRecords struct.ex3.write(oprot); oprot.writeFieldEnd(); } + if (struct.ex4 != null) { + oprot.writeFieldBegin(EX4_FIELD_DESC); + struct.ex4.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ex5 != null) { + oprot.writeFieldBegin(EX5_FIELD_DESC); + struct.ex5.write(oprot); + oprot.writeFieldEnd(); + } oprot.writeFieldStop(); oprot.writeStructEnd(); } } - private static class consolidateRecords_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class submit_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public consolidateRecords_resultTupleScheme getScheme() { - return new consolidateRecords_resultTupleScheme(); + public submit_resultTupleScheme getScheme() { + return new submit_resultTupleScheme(); } } - private static class consolidateRecords_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class submit_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, consolidateRecords_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, submit_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()) { @@ -703360,9 +707160,21 @@ public void write(org.apache.thrift.protocol.TProtocol prot, consolidateRecords_ if (struct.isSetEx3()) { optionals.set(3); } - oprot.writeBitSet(optionals, 4); + if (struct.isSetEx4()) { + optionals.set(4); + } + if (struct.isSetEx5()) { + optionals.set(5); + } + oprot.writeBitSet(optionals, 6); if (struct.isSetSuccess()) { - oprot.writeBool(struct.success); + { + oprot.writeI32(struct.success.size()); + for (com.cinchapi.concourse.thrift.ComplexTObject _iter7230 : struct.success) + { + _iter7230.write(oprot); + } + } } if (struct.isSetEx()) { struct.ex.write(oprot); @@ -703373,14 +707185,30 @@ public void write(org.apache.thrift.protocol.TProtocol prot, consolidateRecords_ if (struct.isSetEx3()) { struct.ex3.write(oprot); } + if (struct.isSetEx4()) { + struct.ex4.write(oprot); + } + if (struct.isSetEx5()) { + struct.ex5.write(oprot); + } } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, consolidateRecords_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, submit_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(4); + java.util.BitSet incoming = iprot.readBitSet(6); if (incoming.get(0)) { - struct.success = iprot.readBool(); + { + org.apache.thrift.protocol.TList _list7231 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT); + struct.success = new java.util.ArrayList(_list7231.size); + @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ComplexTObject _elem7232; + for (int _i7233 = 0; _i7233 < _list7231.size; ++_i7233) + { + _elem7232 = new com.cinchapi.concourse.thrift.ComplexTObject(); + _elem7232.read(iprot); + struct.success.add(_elem7232); + } + } struct.setSuccessIsSet(true); } if (incoming.get(1)) { @@ -703394,10 +707222,20 @@ public void read(org.apache.thrift.protocol.TProtocol prot, consolidateRecords_r struct.setEx2IsSet(true); } if (incoming.get(3)) { - struct.ex3 = new com.cinchapi.concourse.thrift.PermissionException(); + struct.ex3 = new com.cinchapi.concourse.thrift.InvalidArgumentException(); struct.ex3.read(iprot); struct.setEx3IsSet(true); } + if (incoming.get(4)) { + struct.ex4 = new com.cinchapi.concourse.thrift.PermissionException(); + struct.ex4.read(iprot); + struct.setEx4IsSet(true); + } + if (incoming.get(5)) { + struct.ex5 = new com.cinchapi.concourse.thrift.ParseException(); + struct.ex5.read(iprot); + struct.setEx5IsSet(true); + } } } @@ -703910,14 +707748,14 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, invokeManagement_ar case 3: // PARAMS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list7210 = iprot.readListBegin(); - struct.params = new java.util.ArrayList(_list7210.size); - @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ComplexTObject _elem7211; - for (int _i7212 = 0; _i7212 < _list7210.size; ++_i7212) + org.apache.thrift.protocol.TList _list7234 = iprot.readListBegin(); + struct.params = new java.util.ArrayList(_list7234.size); + @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ComplexTObject _elem7235; + for (int _i7236 = 0; _i7236 < _list7234.size; ++_i7236) { - _elem7211 = new com.cinchapi.concourse.thrift.ComplexTObject(); - _elem7211.read(iprot); - struct.params.add(_elem7211); + _elem7235 = new com.cinchapi.concourse.thrift.ComplexTObject(); + _elem7235.read(iprot); + struct.params.add(_elem7235); } iprot.readListEnd(); } @@ -703960,9 +707798,9 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, invokeManagement_a oprot.writeFieldBegin(PARAMS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.params.size())); - for (com.cinchapi.concourse.thrift.ComplexTObject _iter7213 : struct.params) + for (com.cinchapi.concourse.thrift.ComplexTObject _iter7237 : struct.params) { - _iter7213.write(oprot); + _iter7237.write(oprot); } oprot.writeListEnd(); } @@ -704008,9 +707846,9 @@ public void write(org.apache.thrift.protocol.TProtocol prot, invokeManagement_ar if (struct.isSetParams()) { { oprot.writeI32(struct.params.size()); - for (com.cinchapi.concourse.thrift.ComplexTObject _iter7214 : struct.params) + for (com.cinchapi.concourse.thrift.ComplexTObject _iter7238 : struct.params) { - _iter7214.write(oprot); + _iter7238.write(oprot); } } } @@ -704029,14 +707867,14 @@ public void read(org.apache.thrift.protocol.TProtocol prot, invokeManagement_arg } if (incoming.get(1)) { { - org.apache.thrift.protocol.TList _list7215 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT); - struct.params = new java.util.ArrayList(_list7215.size); - @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ComplexTObject _elem7216; - for (int _i7217 = 0; _i7217 < _list7215.size; ++_i7217) + org.apache.thrift.protocol.TList _list7239 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT); + struct.params = new java.util.ArrayList(_list7239.size); + @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ComplexTObject _elem7240; + for (int _i7241 = 0; _i7241 < _list7239.size; ++_i7241) { - _elem7216 = new com.cinchapi.concourse.thrift.ComplexTObject(); - _elem7216.read(iprot); - struct.params.add(_elem7216); + _elem7240 = new com.cinchapi.concourse.thrift.ComplexTObject(); + _elem7240.read(iprot); + struct.params.add(_elem7240); } } struct.setParamsIsSet(true); diff --git a/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/DefaultCommandGroupTest.java b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/DefaultCommandGroupTest.java new file mode 100644 index 000000000..8823d8031 --- /dev/null +++ b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/DefaultCommandGroupTest.java @@ -0,0 +1,240 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.lang.command; + +import java.util.List; + +import org.junit.Assert; +import org.junit.Test; + +/** + * Unit tests for {@link DefaultCommandGroup}. + * + * @author Jeff Nelson + */ +public class DefaultCommandGroupTest { + + /** + * Goal: Verify that calling + * {@code add(key, value, record)} on a {@link DefaultCommandGroup} produces + * a {@link Command} with the correct CCL. + *

    + * Start state: A freshly created + * {@link DefaultCommandGroup}. + *

    + * Workflow: + *

      + *
    • Create a {@link DefaultCommandGroup}.
    • + *
    • Call {@code add("name", "Alice", 1)}.
    • + *
    • Retrieve the commands list.
    • + *
    + *

    + * Expected: The commands list has exactly one entry whose + * CCL matches {@code "add name as \"Alice\" in 1"}. + */ + @Test + public void testAddKeyValueRecord() { + DefaultCommandGroup group = new DefaultCommandGroup(); + group.add("name", "Alice", 1); + List commands = group.commands(); + Assert.assertEquals(1, commands.size()); + Assert.assertEquals("add name as \"Alice\" in 1", + commands.get(0).ccl()); + } + + /** + * Goal: Verify that calling {@code add(key, value)} + * without a record produces the correct CCL. + *

    + * Start state: A freshly created + * {@link DefaultCommandGroup}. + *

    + * Workflow: + *

      + *
    • Create a {@link DefaultCommandGroup}.
    • + *
    • Call {@code add("name", "Bob")}.
    • + *
    • Retrieve the commands list.
    • + *
    + *

    + * Expected: The commands list has one entry whose CCL is + * {@code "add name as \"Bob\""}. + */ + @Test + public void testAddKeyValue() { + DefaultCommandGroup group = new DefaultCommandGroup(); + group.add("name", "Bob"); + List commands = group.commands(); + Assert.assertEquals(1, commands.size()); + Assert.assertEquals("add name as \"Bob\"", commands.get(0).ccl()); + } + + /** + * Goal: Verify that multiple operations accumulate in the + * command list in order. + *

    + * Start state: A freshly created + * {@link DefaultCommandGroup}. + *

    + * Workflow: + *

      + *
    • Call {@code add}, {@code remove}, and {@code set} on the group.
    • + *
    • Retrieve the commands list.
    • + *
    + *

    + * Expected: The list has three entries in the order they + * were added. + */ + @Test + public void testMultipleCommandsAccumulate() { + DefaultCommandGroup group = new DefaultCommandGroup(); + group.add("a", 1, 10); + group.remove("a", 1, 10); + group.set("b", 2, 10); + List commands = group.commands(); + Assert.assertEquals(3, commands.size()); + Assert.assertTrue(commands.get(0).ccl().startsWith("add")); + Assert.assertTrue(commands.get(1).ccl().startsWith("remove")); + Assert.assertTrue(commands.get(2).ccl().startsWith("set")); + } + + /** + * Goal: Verify that the commands list returned by + * {@code commands()} is unmodifiable. + *

    + * Start state: A {@link DefaultCommandGroup} with one + * command. + *

    + * Workflow: + *

      + *
    • Add a command to the group.
    • + *
    • Retrieve the commands list.
    • + *
    • Attempt to modify the returned list.
    • + *
    + *

    + * Expected: The modification attempt throws + * {@link UnsupportedOperationException}. + */ + @Test(expected = UnsupportedOperationException.class) + public void testCommandsListIsUnmodifiable() { + DefaultCommandGroup group = new DefaultCommandGroup(); + group.add("x", 1, 1); + group.commands().clear(); + } + + /** + * Goal: Verify that {@code ping()} produces a ping + * command. + *

    + * Start state: A freshly created + * {@link DefaultCommandGroup}. + *

    + * Workflow: + *

      + *
    • Call {@code ping()} on the group.
    • + *
    • Check the CCL of the produced command.
    • + *
    + *

    + * Expected: The command's CCL is {@code "ping"}. + */ + @Test + public void testPingCommand() { + DefaultCommandGroup group = new DefaultCommandGroup(); + group.ping(); + List commands = group.commands(); + Assert.assertEquals(1, commands.size()); + Assert.assertEquals("ping", commands.get(0).ccl()); + } + + /** + * Goal: Verify that {@code stage()} and {@code commit()} + * produce the correct commands. + *

    + * Start state: A freshly created + * {@link DefaultCommandGroup}. + *

    + * Workflow: + *

      + *
    • Call {@code stage()}, then {@code add(...)}, then + * {@code commit()}.
    • + *
    • Check that three commands are produced with the correct CCL.
    • + *
    + *

    + * Expected: The commands are {@code "stage"}, an add + * command, and {@code "commit"}, in that order. + */ + @Test + public void testStageAndCommitCommands() { + DefaultCommandGroup group = new DefaultCommandGroup(); + group.stage(); + group.add("key", "value", 1); + group.commit(); + List commands = group.commands(); + Assert.assertEquals(3, commands.size()); + Assert.assertEquals("stage", commands.get(0).ccl()); + Assert.assertTrue(commands.get(1).ccl().startsWith("add")); + Assert.assertEquals("commit", commands.get(2).ccl()); + } + + /** + * Goal: Verify that {@code select(long record)} produces + * the correct command. + *

    + * Start state: A freshly created + * {@link DefaultCommandGroup}. + *

    + * Workflow: + *

      + *
    • Call {@code select(42)} on the group.
    • + *
    • Check the CCL of the produced command.
    • + *
    + *

    + * Expected: The command's CCL is {@code "select from 42"}. + */ + @Test + public void testSelectRecord() { + DefaultCommandGroup group = new DefaultCommandGroup(); + group.select(42); + List commands = group.commands(); + Assert.assertEquals(1, commands.size()); + Assert.assertEquals("select 42", commands.get(0).ccl()); + } + + /** + * Goal: Verify that + * {@code select(String key, long record)} produces the correct command. + *

    + * Start state: A freshly created + * {@link DefaultCommandGroup}. + *

    + * Workflow: + *

      + *
    • Call {@code select("name", 1)} on the group.
    • + *
    • Check the CCL of the produced command.
    • + *
    + *

    + * Expected: The command's CCL is + * {@code "select name from 1"}. + */ + @Test + public void testSelectKeyRecord() { + DefaultCommandGroup group = new DefaultCommandGroup(); + group.select("name", 1); + List commands = group.commands(); + Assert.assertEquals(1, commands.size()); + Assert.assertEquals("select name from 1", commands.get(0).ccl()); + } + +} diff --git a/concourse-integration-tests/src/test/java/com/cinchapi/concourse/CommandExecutionTest.java b/concourse-integration-tests/src/test/java/com/cinchapi/concourse/CommandExecutionTest.java new file mode 100644 index 000000000..6f8fdc9f6 --- /dev/null +++ b/concourse-integration-tests/src/test/java/com/cinchapi/concourse/CommandExecutionTest.java @@ -0,0 +1,310 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse; + +import java.util.List; +import java.util.Set; + +import org.junit.Assert; +import org.junit.Test; + +import com.cinchapi.concourse.lang.command.Command; +import com.cinchapi.concourse.lang.command.CommandGroup; +import com.cinchapi.concourse.test.ConcourseIntegrationTest; +import com.cinchapi.concourse.test.Variables; + +/** + * Integration tests for the {@code exec}, {@code submit}, and {@code group} + * command execution APIs. + * + * @author Jeff Nelson + */ +public class CommandExecutionTest extends ConcourseIntegrationTest { + + /** + * Goal: Verify that {@code exec} with a single add command + * returns the created record id. + *

    + * Start state: An empty database. + *

    + * Workflow: + *

      + *
    • Build an add command for a key and value.
    • + *
    • Execute it with {@code exec}.
    • + *
    • Query the database to verify the data was written.
    • + *
    + *

    + * Expected: {@code exec} returns a non-null record id, and + * the value is stored at that record. + */ + @Test + public void testExecSingleAddCommand() { + String key = Variables.register("key", "name"); + String value = Variables.register("value", "Jeff"); + Command command = Command.add(key).as(value); + Object result = client.exec(command); + Assert.assertNotNull(result); + long record = ((Number) result).longValue(); + Assert.assertTrue(record > 0); + Assert.assertTrue(client.verify(key, value, record)); + } + + /** + * Goal: Verify that {@code exec} with multiple commands + * returns only the last result. + *

    + * Start state: An empty database. + *

    + * Workflow: + *

      + *
    • Build two add commands for distinct key-value-record triples.
    • + *
    • Execute both with {@code exec}.
    • + *
    • Verify the result corresponds to the last command.
    • + *
    + *

    + * Expected: {@code exec} returns the result of the second + * (last) command, and both writes are persisted. + */ + @Test + public void testExecMultipleCommandsReturnsLast() { + Command cmd1 = Command.add("name").as("Alice").in(1); + Command cmd2 = Command.add("name").as("Bob").in(2); + Object result = client.exec(cmd1, cmd2); + Assert.assertTrue((Boolean) result); + Assert.assertTrue(client.verify("name", "Alice", 1)); + Assert.assertTrue(client.verify("name", "Bob", 2)); + } + + /** + * Goal: Verify that {@code submit} returns a result for + * each command. + *

    + * Start state: An empty database. + *

    + * Workflow: + *

      + *
    • Build two add commands.
    • + *
    • Submit both with {@code submit}.
    • + *
    • Check the result list size and contents.
    • + *
    + *

    + * Expected: The result list has two entries, each being + * the boolean result of the respective add. + */ + @Test + public void testSubmitReturnsAllResults() { + Command cmd1 = Command.add("name").as("Alice").in(1); + Command cmd2 = Command.add("age").as(30).in(1); + List results = client.submit(cmd1, cmd2); + Assert.assertEquals(2, results.size()); + Assert.assertTrue((Boolean) results.get(0)); + Assert.assertTrue((Boolean) results.get(1)); + Assert.assertTrue(client.verify("name", "Alice", 1)); + Assert.assertTrue(client.verify("age", 30, 1)); + } + + /** + * Goal: Verify that {@code group()} collects commands and + * {@code submit(group)} executes them as a batch. + *

    + * Start state: An empty database. + *

    + * Workflow: + *

      + *
    • Create a {@link CommandGroup} via {@code client.group()}.
    • + *
    • Add several operations to the group.
    • + *
    • Submit the group.
    • + *
    • Verify all operations took effect.
    • + *
    + *

    + * Expected: All grouped operations are executed and + * visible in the database. + */ + @Test + public void testGroupSubmit() { + CommandGroup group = client.group(); + group.add("name", "Alice", 1); + group.add("age", 25, 1); + group.add("name", "Bob", 2); + List results = client.submit(group); + Assert.assertEquals(3, results.size()); + Assert.assertTrue(client.verify("name", "Alice", 1)); + Assert.assertTrue(client.verify("age", 25, 1)); + Assert.assertTrue(client.verify("name", "Bob", 2)); + } + + /** + * Goal: Verify that a batch can include STAGE and COMMIT + * to wrap operations in a transaction. + *

    + * Start state: An empty database with no active + * transaction. + *

    + * Workflow: + *

      + *
    • Build a command list: stage, add, add, commit.
    • + *
    • Submit the batch.
    • + *
    • Verify the adds are visible.
    • + *
    + *

    + * Expected: The batch starts and commits a transaction + * internally, and both adds are persisted. + */ + @Test + public void testSubmitWithStageAndCommit() { + Command stage = Command.stage(); + Command add1 = Command.add("x").as(1).in(100); + Command add2 = Command.add("y").as(2).in(100); + Command commit = Command.commit(); + List results = client.submit(stage, add1, add2, commit); + Assert.assertEquals(4, results.size()); + Assert.assertTrue(client.verify("x", 1, 100)); + Assert.assertTrue(client.verify("y", 2, 100)); + } + + /** + * Goal: Verify that exec within an existing staged + * transaction respects the transaction context. + *

    + * Start state: A staged transaction on the client. + *

    + * Workflow: + *

      + *
    • Stage a transaction on the client.
    • + *
    • Execute add commands via {@code exec}.
    • + *
    • Commit the transaction.
    • + *
    • Verify the data is persisted.
    • + *
    + *

    + * Expected: The exec operations participate in the + * client's transaction and are committed together. + */ + @Test + public void testExecWithinTransaction() { + client.stage(); + client.add("a", 1, 10); + client.exec(Command.add("b").as(2).in(10)); + client.commit(); + Assert.assertTrue(client.verify("a", 1, 10)); + Assert.assertTrue(client.verify("b", 2, 10)); + } + + /** + * Goal: Verify that a select command can be executed via + * {@code exec} and returns the expected data. + *

    + * Start state: A record with known key-value pairs. + *

    + * Workflow: + *

      + *
    • Add data to a record using the standard API.
    • + *
    • Execute a select command via {@code exec}.
    • + *
    • Verify the result contains the expected data.
    • + *
    + *

    + * Expected: The exec result matches the data returned by a + * direct {@code select} call. + */ + @Test + @SuppressWarnings("unchecked") + public void testExecSelectCommand() { + client.add("name", "Alice", 1); + client.add("age", 30, 1); + Command cmd = Command.select("name").from(1); + Object result = client.exec(cmd); + Assert.assertNotNull(result); + Set values = (Set) result; + Assert.assertTrue(values.contains("Alice")); + } + + /** + * Goal: Verify that a find command executed via + * {@code exec} returns matching records. + *

    + * Start state: Multiple records with searchable data. + *

    + * Workflow: + *

      + *
    • Add data to several records.
    • + *
    • Execute a find command with a CCL condition.
    • + *
    • Verify the result contains expected records.
    • + *
    + *

    + * Expected: The find returns a set containing only the + * matching record ids. + */ + @Test + @SuppressWarnings("unchecked") + public void testExecFindCommand() { + client.add("score", 100, 1); + client.add("score", 50, 2); + client.add("score", 75, 3); + Command cmd = Command.find("score > 60"); + Object result = client.exec(cmd); + Assert.assertNotNull(result); + Set records = (Set) result; + Assert.assertTrue(records.contains(1L)); + Assert.assertFalse(records.contains(2L)); + Assert.assertTrue(records.contains(3L)); + } + + /** + * Goal: Verify that a remove command removes the specified + * value when executed. + *

    + * Start state: A record with a known key-value pair. + *

    + * Workflow: + *

      + *
    • Add a key-value pair to a record.
    • + *
    • Execute a remove command for that pair.
    • + *
    • Verify the value is no longer present.
    • + *
    + *

    + * Expected: The remove succeeds and the value is no longer + * stored at that record. + */ + @Test + public void testExecRemoveCommand() { + client.add("color", "red", 5); + Assert.assertTrue(client.verify("color", "red", 5)); + Command cmd = Command.remove("color").as("red").from(5); + Object result = client.exec(cmd); + Assert.assertTrue((Boolean) result); + Assert.assertFalse(client.verify("color", "red", 5)); + } + + /** + * Goal: Verify that a ping command returns {@code true} + * when the server is running. + *

    + * Start state: A running server with an active client + * connection. + *

    + * Workflow: + *

      + *
    • Execute a ping command via {@code exec}.
    • + *
    + *

    + * Expected: The result is {@code true}. + */ + @Test + public void testExecPingCommand() { + Object result = client.exec(Command.ping()); + Assert.assertTrue((Boolean) result); + } + +} diff --git a/concourse-plugin-core/src/main/java/com/cinchapi/concourse/server/plugin/StatefulConcourseService.java b/concourse-plugin-core/src/main/java/com/cinchapi/concourse/server/plugin/StatefulConcourseService.java index 0dc123e45..395a8f939 100644 --- a/concourse-plugin-core/src/main/java/com/cinchapi/concourse/server/plugin/StatefulConcourseService.java +++ b/concourse-plugin-core/src/main/java/com/cinchapi/concourse/server/plugin/StatefulConcourseService.java @@ -3176,6 +3176,14 @@ public boolean consolidateRecords(List records) { throw new UnsupportedOperationException(); } + public ComplexTObject exec(List commands) { + throw new UnsupportedOperationException(); + } + + public List submit(List commands) { + throw new UnsupportedOperationException(); + } + public boolean ping() { throw new UnsupportedOperationException(); } diff --git a/concourse-server/src/main/java/com/cinchapi/concourse/server/ConcourseServer.java b/concourse-server/src/main/java/com/cinchapi/concourse/server/ConcourseServer.java index 73b7f920b..ff174bc7c 100644 --- a/concourse-server/src/main/java/com/cinchapi/concourse/server/ConcourseServer.java +++ b/concourse-server/src/main/java/com/cinchapi/concourse/server/ConcourseServer.java @@ -90,6 +90,7 @@ import com.cinchapi.concourse.server.management.ConcourseManagementService; import com.cinchapi.concourse.server.monitoring.Tracker; import com.cinchapi.concourse.server.ops.AtomicOperations; +import com.cinchapi.concourse.server.ops.CommandDispatcher; import com.cinchapi.concourse.server.ops.InsufficientAtomicityException; import com.cinchapi.concourse.server.ops.Operations; import com.cinchapi.concourse.server.ops.Stores; @@ -119,10 +120,12 @@ import com.cinchapi.concourse.thrift.ConcourseService; import com.cinchapi.concourse.thrift.Diff; import com.cinchapi.concourse.thrift.DuplicateEntryException; +import com.cinchapi.concourse.thrift.InvalidArgumentException; import com.cinchapi.concourse.thrift.ManagementException; import com.cinchapi.concourse.thrift.Operator; import com.cinchapi.concourse.thrift.ParseException; import com.cinchapi.concourse.thrift.SecurityException; +import com.cinchapi.concourse.thrift.TCommand; import com.cinchapi.concourse.thrift.TCriteria; import com.cinchapi.concourse.thrift.TObject; import com.cinchapi.concourse.thrift.TOrder; @@ -1608,6 +1611,18 @@ public Map>> diffRecordStartstrEndstr( environment); } + @Override + @TranslateClientExceptions + @VerifyAccessToken + public ComplexTObject exec(List commands, AccessToken creds, + TransactionToken transaction, String environment) + throws TException { + List results = submit(commands, creds, transaction, + environment); + return results.isEmpty() ? ComplexTObject.fromJavaObject(null) + : results.get(results.size() - 1); + } + @Override @TranslateClientExceptions @VerifyAccessToken @@ -6067,6 +6082,55 @@ public TransactionToken stage(AccessToken creds, String env) return token; } + @Override + @TranslateClientExceptions + @VerifyAccessToken + public List submit(List commands, + AccessToken creds, TransactionToken transaction, String environment) + throws TException { + TransactionToken active = transaction; + List results = Lists.newArrayList(); + try { + for (TCommand command : commands) { + Object result; + switch (command.getVerb()) { + case STAGE: + if(active != null) { + throw new InvalidArgumentException( + "Cannot start a nested transaction"); + } + else { + active = stage(creds, environment); + result = null; + } + break; + case COMMIT: + result = commit(creds, active, environment); + active = transaction; + break; + case ABORT: + abort(creds, active, environment); + result = null; + active = transaction; + break; + default: + result = CommandDispatcher.dispatch(command, this, creds, + active, environment); + } + results.add(ComplexTObject.fromJavaObject(result)); + } + } + catch (TException e) { + if(active != null && active != transaction) { + // If the batch started its own transaction (active != + // transaction), abort it so it doesn't leak on the server. + abort(creds, active, environment); + } + throw e; + } + return results; + } + /** * Start the server. * diff --git a/concourse-server/src/main/java/com/cinchapi/concourse/server/management/ConcourseManagementService.java b/concourse-server/src/main/java/com/cinchapi/concourse/server/management/ConcourseManagementService.java index eab0d9018..ae65cb727 100644 --- a/concourse-server/src/main/java/com/cinchapi/concourse/server/management/ConcourseManagementService.java +++ b/concourse-server/src/main/java/com/cinchapi/concourse/server/management/ConcourseManagementService.java @@ -15,7 +15,7 @@ */ package com.cinchapi.concourse.server.management; -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.20.0)", date = "2026-03-13") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.20.0)", date = "2026-03-15") @SuppressWarnings({ "unchecked", "rawtypes", "serial", "unused" }) public class ConcourseManagementService { diff --git a/concourse-server/src/main/java/com/cinchapi/concourse/server/ops/CommandDispatcher.java b/concourse-server/src/main/java/com/cinchapi/concourse/server/ops/CommandDispatcher.java new file mode 100644 index 000000000..dd98c9e92 --- /dev/null +++ b/concourse-server/src/main/java/com/cinchapi/concourse/server/ops/CommandDispatcher.java @@ -0,0 +1,822 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.server.ops; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.thrift.TException; + +import com.cinchapi.common.base.CheckedExceptions; +import com.cinchapi.common.reflect.Reflection; +import com.cinchapi.concourse.Link; +import com.cinchapi.concourse.server.ConcourseServer; +import com.cinchapi.concourse.thrift.AccessToken; +import com.cinchapi.concourse.thrift.TCommand; +import com.cinchapi.concourse.thrift.TCommandVerb; +import com.cinchapi.concourse.thrift.TransactionToken; +import com.cinchapi.concourse.util.Convert; + +/** + * Dispatch a {@link TCommand} to the appropriate server method based on the + * command's verb and which optional fields are set. + *

    + * The dispatcher resolves the target method name by examining the + * {@link TCommandVerb} and the combination of set fields on the + * {@link TCommand}, then invokes the corresponding method on the server object + * via reflection. This approach avoids maintaining hundreds of explicit + * dispatch cases for every method variant. + * + * @author Jeff Nelson + */ +public final class CommandDispatcher { + + /** + * Dispatch a {@link TCommand} to the appropriate method on {@code server} + * and return the result. + *

    + * The correct method is determined by examining the {@link TCommand + * TCommand's} verb and which optional fields are populated. State + * parameters ({@code creds}, {@code transaction}, {@code environment}) are + * appended automatically. + * + * @param command the {@link TCommand} to dispatch + * @param server the server object that implements the target method + * @param creds the {@link AccessToken} for authentication + * @param transaction the {@link TransactionToken}, or {@code null} if not + * in a transaction + * @param environment the target environment + * @return the result of the dispatched method invocation + * @throws TException if the underlying method throws a Thrift exception + */ + public static Object dispatch(TCommand command, Object server, + AccessToken creds, TransactionToken transaction, String environment) + throws TException { + TCommandVerb verb = command.getVerb(); + if(verb == TCommandVerb.LINK) { + return dispatchLink(command, server, creds, transaction, + environment); + } + else if(verb == TCommandVerb.UNLINK) { + return dispatchUnlink(command, server, creds, transaction, + environment); + } + else { + String methodName = resolveMethodName(command); + List args = resolveArguments(command); + args.add(creds); + args.add(transaction); + args.add(environment); + return invoke(server, methodName, args.toArray()); + } + } + + /** + * Append the order to {@code args} if it is set on the {@link TCommand}. + * + * @param args the argument list being built + * @param cmd the {@link TCommand} to inspect + */ + private static void addOrder(List args, TCommand cmd) { + if(cmd.isSetOrder()) { + args.add(cmd.getOrder()); + } + } + + /** + * Append the page to {@code args} if it is set on the {@link TCommand}. + * + * @param args the argument list being built + * @param cmd the {@link TCommand} to inspect + */ + private static void addPage(List args, TCommand cmd) { + if(cmd.isSetPage()) { + args.add(cmd.getPage()); + } + } + + /** + * Append the timestamp to {@code args} if it is set on the + * {@link TCommand}. + * + * @param args the argument list being built + * @param cmd the {@link TCommand} to inspect + */ + private static void addTimestamp(List args, TCommand cmd) { + if(cmd.isSetTimestamp()) { + args.add(cmd.getTimestamp()); + } + } + + /** + * Return the key/record suffix for {@code AUDIT} method names: + * {@code "KeyRecord"} if keys are set, or {@code "Record"} otherwise. + * + * @param cmd the {@link TCommand} to inspect + * @return the audit suffix + */ + private static String auditSuffix(TCommand cmd) { + if(cmd.isSetKeys()) { + return "KeyRecord"; + } + else { + return "Record"; + } + } + + /** + * Return the source suffix for {@code CALCULATE} {@link TCommandVerb + * verbs}, which may have no source when operating on the entire dataset. + * Return {@code "Criteria"}, {@code "Ccl"}, {@code "Record"}, + * {@code "Records"}, or empty accordingly. + * + * @param cmd the {@link TCommand} to inspect + * @return the calculate source suffix + */ + private static String calculateSourceSuffix(TCommand cmd) { + if(cmd.isSetCriteria()) { + return "Criteria"; + } + else if(cmd.isSetCondition()) { + return "Ccl"; + } + else if(hasSingleRecord(cmd)) { + return "Record"; + } + else if(hasMultipleRecords(cmd)) { + return "Records"; + } + else { + return ""; + } + } + + /** + * Return the key/record suffix for {@code DIFF} method names: + * {@code "KeyRecord"} if both keys and records are set, {@code "Key"} if + * only keys are set, or {@code "Record"} otherwise. + * + * @param cmd the {@link TCommand} to inspect + * @return the diff suffix + */ + private static String diffSuffix(TCommand cmd) { + if(cmd.isSetKeys() && cmd.isSetRecords()) { + return "KeyRecord"; + } + else if(cmd.isSetKeys()) { + return "Key"; + } + else { + return "Record"; + } + } + + /** + * Dispatch a LINK command by adding a {@link Link} value via the + * {@code addKeyValueRecord} method. + * + * @param cmd the {@link TCommand} + * @param server the server object + * @param creds the {@link AccessToken} + * @param transaction the {@link TransactionToken} + * @param environment the target environment + * @return the result of the add operation + * @throws TException if the method throws + */ + private static Object dispatchLink(TCommand cmd, Object server, + AccessToken creds, TransactionToken transaction, String environment) + throws TException { + String key = cmd.getKeys().get(0); + long source = cmd.getSourceRecord(); + List destinations = cmd.getRecords(); + if(destinations.size() == 1) { + return invoke(server, "addKeyValueRecord", key, + Convert.javaToThrift(Link.to(destinations.get(0))), source, + creds, transaction, environment); + } + else { + // NOTE: Link to multiple destinations requires individual add + // calls. Return the result of the last one. + Object result = null; + for (long destination : destinations) { + result = invoke(server, "addKeyValueRecord", key, + Convert.javaToThrift(Link.to(destination)), source, + creds, transaction, environment); + } + return result; + } + } + + /** + * Dispatch an UNLINK command by removing a {@link Link} value via the + * {@code removeKeyValueRecord} method. + * + * @param cmd the {@link TCommand} + * @param server the server object + * @param creds the {@link AccessToken} + * @param transaction the {@link TransactionToken} + * @param environment the target environment + * @return the result of the remove operation + * @throws TException if the method throws + */ + private static Object dispatchUnlink(TCommand cmd, Object server, + AccessToken creds, TransactionToken transaction, String environment) + throws TException { + String key = cmd.getKeys().get(0); + long source = cmd.getSourceRecord(); + long destination = cmd.getRecords().get(0); + return invoke(server, "removeKeyValueRecord", key, + Convert.javaToThrift(Link.to(destination)), source, creds, + transaction, environment); + } + + /** + * Return the single key from the {@link TCommand TCommand's} keys list. + * + * @param cmd the {@link TCommand} containing the key + * @return the first (and only) key + */ + private static String getSingleKey(TCommand cmd) { + return cmd.getKeys().get(0); + } + + /** + * Return the single record from the {@link TCommand TCommand's} records + * list. + * + * @param cmd the {@link TCommand} containing the record + * @return the first (and only) record + */ + private static long getSingleRecord(TCommand cmd) { + return cmd.getRecords().get(0); + } + + /** + * Return {@code true} if the {@link TCommand} has more than one key set. + * + * @param cmd the {@link TCommand} to inspect + * @return {@code true} if multiple keys are present + */ + private static boolean hasMultipleKeys(TCommand cmd) { + return cmd.isSetKeys() && cmd.getKeysSize() > 1; + } + + /** + * Return {@code true} if the {@link TCommand} has more than one record set. + * + * @param cmd the {@link TCommand} to inspect + * @return {@code true} if multiple records are present + */ + private static boolean hasMultipleRecords(TCommand cmd) { + return cmd.isSetRecords() && cmd.getRecordsSize() > 1; + } + + /** + * Return {@code true} if the {@link TCommand} has exactly one key set. + * + * @param cmd the {@link TCommand} to inspect + * @return {@code true} if a single key is present + */ + private static boolean hasSingleKey(TCommand cmd) { + return cmd.isSetKeys() && cmd.getKeysSize() == 1; + } + + /** + * Return {@code true} if the {@link TCommand} has exactly one record set. + * + * @param cmd the {@link TCommand} to inspect + * @return {@code true} if a single record is present + */ + private static boolean hasSingleRecord(TCommand cmd) { + return cmd.isSetRecords() && cmd.getRecordsSize() == 1; + } + + /** + * Invoke a method on the server by name, unwrapping any {@link TException} + * from the reflective call. + * + * @param server the target object + * @param methodName the method to invoke + * @param args the arguments + * @return the method result + * @throws TException if the method throws a Thrift exception + */ + private static Object invoke(Object server, String methodName, + Object... args) throws TException { + Method method = METHODS.get(methodName); + if(method == null) { + throw new UnsupportedOperationException( + "No method found: " + methodName); + } + try { + return method.invoke(server, args); + } + catch (InvocationTargetException e) { + Throwable cause = e.getCause(); + if(cause instanceof TException) { + throw (TException) cause; + } + else { + throw CheckedExceptions.throwAsRuntimeException(cause); + } + } + catch (IllegalAccessException e) { + throw CheckedExceptions.throwAsRuntimeException(e); + } + } + + /** + * Return the method name suffix for the key component of the + * {@link TCommand}: {@code "Key"} for a single key, {@code "Keys"} for + * multiple, or empty if no keys are set. + * + * @param cmd the {@link TCommand} to inspect + * @return the key suffix + */ + private static String keySuffix(TCommand cmd) { + if(hasSingleKey(cmd)) { + return "Key"; + } + else if(hasMultipleKeys(cmd)) { + return "Keys"; + } + else { + return ""; + } + } + + /** + * Return {@code "Order"} if the {@link TCommand} has an order set, or empty + * otherwise. + * + * @param cmd the {@link TCommand} to inspect + * @return the order suffix + */ + private static String orderSuffix(TCommand cmd) { + return cmd.isSetOrder() ? "Order" : ""; + } + + /** + * Return {@code "Page"} if the {@link TCommand} has a page set, or empty + * otherwise. + * + * @param cmd the {@link TCommand} to inspect + * @return the page suffix + */ + private static String pageSuffix(TCommand cmd) { + return cmd.isSetPage() ? "Page" : ""; + } + + /** + * Return the method name suffix for the record component of the + * {@link TCommand}: {@code "Record"} for a single record, {@code "Records"} + * for multiple, or empty if no records are set. + * + * @param cmd the {@link TCommand} to inspect + * @return the record suffix + */ + private static String recordSuffix(TCommand cmd) { + if(hasSingleRecord(cmd)) { + return "Record"; + } + else if(hasMultipleRecords(cmd)) { + return "Records"; + } + else { + return ""; + } + } + + /** + * Build the ordered argument list for a {@link TCommand}, excluding the + * trailing state parameters (creds, transaction, environment) which are + * appended by the caller. + * + * @param cmd the {@link TCommand} + * @return the argument list + */ + private static List resolveArguments(TCommand cmd) { + List args = new ArrayList<>(); + switch (cmd.getVerb()) { + case ADD: + case SET: + case REMOVE: + args.add(getSingleKey(cmd)); + args.add(cmd.getValue()); + if(hasSingleRecord(cmd)) { + args.add(getSingleRecord(cmd)); + } + else if(hasMultipleRecords(cmd)) { + args.add(cmd.getRecords()); + } + break; + case CLEAR: + if(hasSingleKey(cmd)) { + args.add(getSingleKey(cmd)); + } + else if(hasMultipleKeys(cmd)) { + args.add(cmd.getKeys()); + } + if(hasSingleRecord(cmd)) { + args.add(getSingleRecord(cmd)); + } + else if(hasMultipleRecords(cmd)) { + args.add(cmd.getRecords()); + } + break; + case INSERT: + args.add(cmd.getJson()); + if(hasSingleRecord(cmd)) { + args.add(getSingleRecord(cmd)); + } + else if(hasMultipleRecords(cmd)) { + args.add(cmd.getRecords()); + } + break; + case FIND: + if(cmd.isSetCriteria()) { + args.add(cmd.getCriteria()); + } + else if(cmd.isSetCondition()) { + args.add(cmd.getCondition()); + } + addTimestamp(args, cmd); + addOrder(args, cmd); + addPage(args, cmd); + break; + case FIND_OR_ADD: + args.add(getSingleKey(cmd)); + args.add(cmd.getValue()); + break; + case FIND_OR_INSERT: + if(cmd.isSetCriteria()) { + args.add(cmd.getCriteria()); + } + else { + args.add(cmd.getCondition()); + } + args.add(cmd.getJson()); + break; + case SELECT: + case GET: + if(hasSingleKey(cmd)) { + args.add(getSingleKey(cmd)); + } + else if(hasMultipleKeys(cmd)) { + args.add(cmd.getKeys()); + } + if(cmd.isSetCriteria()) { + args.add(cmd.getCriteria()); + } + else if(cmd.isSetCondition()) { + args.add(cmd.getCondition()); + } + else if(hasSingleRecord(cmd)) { + args.add(getSingleRecord(cmd)); + } + else if(hasMultipleRecords(cmd)) { + args.add(cmd.getRecords()); + } + addTimestamp(args, cmd); + addOrder(args, cmd); + addPage(args, cmd); + break; + case NAVIGATE: + if(hasSingleKey(cmd)) { + args.add(getSingleKey(cmd)); + } + else if(hasMultipleKeys(cmd)) { + args.add(cmd.getKeys()); + } + if(cmd.isSetCriteria()) { + args.add(cmd.getCriteria()); + } + else if(cmd.isSetCondition()) { + args.add(cmd.getCondition()); + } + else if(hasSingleRecord(cmd)) { + args.add(getSingleRecord(cmd)); + } + else if(hasMultipleRecords(cmd)) { + args.add(cmd.getRecords()); + } + addTimestamp(args, cmd); + break; + case BROWSE: + if(hasSingleKey(cmd)) { + args.add(getSingleKey(cmd)); + } + else if(hasMultipleKeys(cmd)) { + args.add(cmd.getKeys()); + } + addTimestamp(args, cmd); + break; + case DESCRIBE: + if(hasSingleRecord(cmd)) { + args.add(getSingleRecord(cmd)); + } + else if(hasMultipleRecords(cmd)) { + args.add(cmd.getRecords()); + } + addTimestamp(args, cmd); + break; + case SEARCH: + args.add(getSingleKey(cmd)); + args.add(cmd.getQuery()); + break; + case TRACE: + if(hasSingleRecord(cmd)) { + args.add(getSingleRecord(cmd)); + } + else if(hasMultipleRecords(cmd)) { + args.add(cmd.getRecords()); + } + addTimestamp(args, cmd); + break; + case HOLDS: + if(hasSingleRecord(cmd)) { + args.add(getSingleRecord(cmd)); + } + else if(hasMultipleRecords(cmd)) { + args.add(cmd.getRecords()); + } + break; + case JSONIFY: + args.add(cmd.getRecords()); + args.add(true); + addTimestamp(args, cmd); + break; + case CHRONICLE: + args.add(getSingleKey(cmd)); + args.add(getSingleRecord(cmd)); + if(cmd.isSetTimestamp()) { + args.add(cmd.getTimestamp()); + if(cmd.isSetEndTimestamp()) { + args.add(cmd.getEndTimestamp()); + } + } + break; + case DIFF: + if(cmd.isSetKeys() && cmd.isSetRecords()) { + args.add(getSingleKey(cmd)); + args.add(getSingleRecord(cmd)); + } + else if(cmd.isSetKeys()) { + args.add(getSingleKey(cmd)); + } + else { + args.add(getSingleRecord(cmd)); + } + args.add(cmd.getTimestamp()); + if(cmd.isSetEndTimestamp()) { + args.add(cmd.getEndTimestamp()); + } + break; + case AUDIT: + if(cmd.isSetKeys()) { + args.add(getSingleKey(cmd)); + args.add(getSingleRecord(cmd)); + } + else { + args.add(getSingleRecord(cmd)); + } + if(cmd.isSetTimestamp()) { + args.add(cmd.getTimestamp()); + if(cmd.isSetEndTimestamp()) { + args.add(cmd.getEndTimestamp()); + } + } + break; + case REVERT: + if(hasSingleKey(cmd)) { + args.add(getSingleKey(cmd)); + } + else if(hasMultipleKeys(cmd)) { + args.add(cmd.getKeys()); + } + if(hasSingleRecord(cmd)) { + args.add(getSingleRecord(cmd)); + } + else if(hasMultipleRecords(cmd)) { + args.add(cmd.getRecords()); + } + args.add(cmd.getTimestamp()); + break; + case RECONCILE: + args.add(getSingleKey(cmd)); + args.add(getSingleRecord(cmd)); + args.add(cmd.getValues()); + break; + case CONSOLIDATE: + args.add(cmd.getRecords()); + break; + case VERIFY: + args.add(getSingleKey(cmd)); + args.add(cmd.getValue()); + args.add(getSingleRecord(cmd)); + addTimestamp(args, cmd); + break; + case VERIFY_AND_SWAP: + args.add(getSingleKey(cmd)); + args.add(cmd.getValue()); + args.add(getSingleRecord(cmd)); + args.add(cmd.getReplacement()); + break; + case VERIFY_OR_SET: + args.add(getSingleKey(cmd)); + args.add(cmd.getValue()); + args.add(getSingleRecord(cmd)); + break; + case CALCULATE: + args.add(getSingleKey(cmd)); + if(cmd.isSetCriteria()) { + args.add(cmd.getCriteria()); + } + else if(cmd.isSetCondition()) { + args.add(cmd.getCondition()); + } + else if(hasSingleRecord(cmd)) { + args.add(getSingleRecord(cmd)); + } + else if(hasMultipleRecords(cmd)) { + args.add(cmd.getRecords()); + } + addTimestamp(args, cmd); + break; + case PING: + case INVENTORY: + break; + default: + throw new UnsupportedOperationException( + "Cannot resolve arguments for verb: " + cmd.getVerb()); + } + return args; + } + + /** + * Resolve the thrift service method name for a {@link TCommand} based on + * its verb and which optional fields are set. + * + * @param cmd the {@link TCommand} + * @return the method name + */ + private static String resolveMethodName(TCommand cmd) { + switch (cmd.getVerb()) { + case ADD: + return "addKeyValue" + recordSuffix(cmd); + case REMOVE: + return "removeKeyValue" + recordSuffix(cmd); + case SET: + return "setKeyValue" + recordSuffix(cmd); + case CLEAR: + return "clear" + keySuffix(cmd) + recordSuffix(cmd); + case INSERT: + return "insertJson" + recordSuffix(cmd); + case FIND: + return "find" + sourceSuffix(cmd) + timeSuffix(cmd) + + orderSuffix(cmd) + pageSuffix(cmd); + case FIND_OR_ADD: + return "findOrAddKeyValue"; + case FIND_OR_INSERT: + return "findOrInsert" + (cmd.isSetCriteria() ? "Criteria" : "Ccl") + + "Json"; + case SELECT: + return "select" + keySuffix(cmd) + sourceSuffix(cmd) + + timeSuffix(cmd) + orderSuffix(cmd) + pageSuffix(cmd); + case GET: + return "get" + keySuffix(cmd) + sourceSuffix(cmd) + timeSuffix(cmd) + + orderSuffix(cmd) + pageSuffix(cmd); + case NAVIGATE: + return "navigate" + keySuffix(cmd) + sourceSuffix(cmd) + + timeSuffix(cmd); + case BROWSE: + return "browse" + keySuffix(cmd) + timeSuffix(cmd); + case DESCRIBE: + return "describe" + recordSuffix(cmd) + timeSuffix(cmd); + case SEARCH: + return "search"; + case TRACE: + return "trace" + recordSuffix(cmd) + timeSuffix(cmd); + case HOLDS: + return "holds" + recordSuffix(cmd); + case JSONIFY: + return "jsonifyRecords" + timeSuffix(cmd); + case CHRONICLE: + return "chronicleKeyRecord" + startSuffix(cmd); + case DIFF: + return "diff" + diffSuffix(cmd) + startSuffix(cmd); + case AUDIT: + return "audit" + auditSuffix(cmd) + startSuffix(cmd); + case REVERT: + return "revert" + keySuffix(cmd) + recordSuffix(cmd) + "Time"; + case RECONCILE: + return "reconcileKeyRecordValues"; + case CONSOLIDATE: + return "consolidateRecords"; + case VERIFY: + return "verifyKeyValueRecord" + timeSuffix(cmd); + case VERIFY_AND_SWAP: + return "verifyAndSwap"; + case VERIFY_OR_SET: + return "verifyOrSet"; + case CALCULATE: + return cmd.getFunction() + "Key" + calculateSourceSuffix(cmd) + + timeSuffix(cmd); + case PING: + return "ping"; + case INVENTORY: + return "inventory"; + default: + throw new UnsupportedOperationException( + "Cannot dispatch verb: " + cmd.getVerb()); + } + } + + /** + * Return the source suffix for methods that accept a data source: + * {@code "Criteria"} if a {@code TCriteria} is set, {@code "Ccl"} if a CCL + * condition string is set, or the {@link #recordSuffix(TCommand) record + * suffix} otherwise. + * + * @param cmd the {@link TCommand} to inspect + * @return the source suffix + */ + private static String sourceSuffix(TCommand cmd) { + if(cmd.isSetCriteria()) { + return "Criteria"; + } + else if(cmd.isSetCondition()) { + return "Ccl"; + } + else { + return recordSuffix(cmd); + } + } + + /** + * Return the start/end suffix for range-based methods (chronicle, diff, + * audit): {@code "StartEnd"} if both timestamp and end timestamp are set, + * {@code "Start"} if only the timestamp is set, or empty if neither is set. + * + * @param cmd the {@link TCommand} to inspect + * @return the start suffix + */ + private static String startSuffix(TCommand cmd) { + if(cmd.isSetTimestamp() && cmd.isSetEndTimestamp()) { + return "StartEnd"; + } + else if(cmd.isSetTimestamp()) { + return "Start"; + } + else { + return ""; + } + } + + /** + * Return {@code "Time"} if the {@link TCommand} has a timestamp set, or + * empty otherwise. + * + * @param cmd the {@link TCommand} to inspect + * @return the time suffix + */ + private static String timeSuffix(TCommand cmd) { + return cmd.isSetTimestamp() ? "Time" : ""; + } + + /** + * Map of method name to {@link Method} for all instance {@link Method + * Methods} declared on {@link ConcourseServer} and its hierarchy. Built + * statically on class load. + */ + private static final Map METHODS; + + static { + Map methods = new HashMap<>(); + for (Method m : Reflection + .getAllDeclaredMethods(ConcourseServer.class)) { + methods.putIfAbsent(m.getName(), m); + } + METHODS = methods; + } + + private CommandDispatcher() {/* no-init */} + +} diff --git a/interface/concourse.thrift b/interface/concourse.thrift index 437562f13..c6bf1db9f 100644 --- a/interface/concourse.thrift +++ b/interface/concourse.thrift @@ -6547,6 +6547,34 @@ service ConcourseService { 3: exceptions.PermissionException ex3 ); + complex.ComplexTObject exec( + 1: list commands, + 2: shared.AccessToken creds, + 3: shared.TransactionToken transaction, + 4: string environment + ) + throws ( + 1: exceptions.SecurityException ex, + 2: exceptions.TransactionException ex2, + 3: exceptions.InvalidArgumentException ex3, + 4: exceptions.PermissionException ex4, + 5: exceptions.ParseException ex5 + ); + + list submit( + 1: list commands, + 2: shared.AccessToken creds, + 3: shared.TransactionToken transaction, + 4: string environment + ) + throws ( + 1: exceptions.SecurityException ex, + 2: exceptions.TransactionException ex2, + 3: exceptions.InvalidArgumentException ex3, + 4: exceptions.PermissionException ex4, + 5: exceptions.ParseException ex5 + ); + complex.ComplexTObject invokeManagement( 2: string method, 3: list params, diff --git a/utils/codegen/CommandGroupGenerator.groovy b/utils/codegen/CommandGroupGenerator.groovy new file mode 100644 index 000000000..f67f8643e --- /dev/null +++ b/utils/codegen/CommandGroupGenerator.groovy @@ -0,0 +1,387 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// This script parses the ConcourseService interface from thrift IDL files +// and generates a Java interface with Concourse-style method names (verbs +// derived from thrift method names), void returns, and state parameters +// removed. The generated CommandGroup interface is intended to be +// implemented by a class that collects Commands for batch submission. + +@Grapes([ + @Grab('com.facebook.swift:swift-idl-parser:0.14.2'), + @Grab('com.google.guava:guava:15.0') + ] +) +import java.io.File; +import java.io.IOException; +import java.io.Reader; +import java.nio.charset.StandardCharsets; +import java.util.List; +import java.util.ArrayList; +import java.util.Set; + +import com.facebook.swift.parser.ThriftIdlParser; +import com.facebook.swift.parser.model.BaseType; +import com.facebook.swift.parser.model.Definition; +import com.facebook.swift.parser.model.Document; +import com.facebook.swift.parser.model.IdentifierType; +import com.facebook.swift.parser.model.ListType; +import com.facebook.swift.parser.model.MapType; +import com.facebook.swift.parser.model.Service; +import com.facebook.swift.parser.model.SetType; +import com.facebook.swift.parser.model.ThriftField; +import com.facebook.swift.parser.model.ThriftMethod; +import com.facebook.swift.parser.model.ThriftType; +import com.facebook.swift.parser.model.VoidType; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import com.google.common.io.Files; +import com.google.common.io.InputSupplier; + +/** + * A script that parses the concourse.thrift IDL file and generates + * a Java interface with Concourse-style method names (overloaded + * verbs), void returns, and no client state parameters. The + * generated interface is intended to be implemented by a class + * that collects {@code Command} objects for batch submission. + */ +public class CommandGroupGenerator { + + /** + * Compound verbs that consist of multiple camelCase words. + * These must be checked before the single-word verb extraction. + */ + private static Set COMPOUND_VERBS = Sets.newHashSet( + "verifyAndSwap", "verifyOrSet", "findOrAdd", + "findOrInsert", "invokeManagement", "invokePlugin"); + + /** + * Methods that should be excluded from the generated + * interface because they are not user-facing operations or + * because they are the exec/submit mechanism itself. + */ + private static Set BANNED_METHODS = Sets.newHashSet( + "login", "logout", "invokeManagement", + "invokePlugin", "exec", "submit", + "getServerVersion", "getServerEnvironment"); + + /** + * Parameters that represent client state and should be + * stripped from the generated method signatures. + */ + private static Set BANNED_PARAMS = Sets.newHashSet( + "creds", "transaction", "environment", "token"); + + /** + * Run the program... + * @param args command line options + */ + public static void main(String... args) throws IOException { + String target = args[args.length - 1]; + List signatures = new ArrayList(); + for(int i = 0; i < args.length - 1; ++i) { + String source = args[i]; + InputSupplier input = Files.asCharSource( + new File(source), StandardCharsets.UTF_8); + Document document = + ThriftIdlParser.parseThriftIdl(input); + signatures.addAll(getMethodSignatures(document)); + } + String generated = """/** + * Autogenerated by Codegen Compiler + * + * DO NOT EDIT UNLESS YOU KNOW WHAT YOU ARE DOING + * + * @generated + */ +package com.cinchapi.concourse.lang.command; + +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.cinchapi.concourse.lang.Criteria; +import com.cinchapi.concourse.lang.sort.Order; +import com.cinchapi.concourse.lang.paginate.Page; +import com.cinchapi.concourse.thrift.Operator; + +/** + * An interface that mirrors the Concourse API with void-returning + * methods. Implementations collect the method invocations as + * {@link Command Commands} for batch submission via + * {@code Concourse#submit(CommandGroup)}. + */ +public interface CommandGroup { +""" + for(String signature : signatures) { + generated ="""${generated} + ${signature}; +""" + } + generated="""${generated} +} + """ + Files.write(generated, new File(target), + StandardCharsets.UTF_8); + } + + /** + * Extract the verb (Concourse-style method name) from a + * thrift method name. For example, "addKeyValue" becomes + * "add" and "verifyAndSwap" stays "verifyAndSwap". + * + * @param methodName the thrift method name + * @return the extracted verb + */ + private static String extractVerb(String methodName) { + for (String verb : COMPOUND_VERBS) { + if(methodName.startsWith(verb)) { + return verb; + } + } + // Take the first camelCase word + for (int i = 1; i < methodName.length(); i++) { + if(Character.isUpperCase(methodName.charAt(i))) { + return methodName.substring(0, i); + } + } + return methodName; + } + + /** + * A method that traverses the parsed {@link Document} and + * returns a list of Strings, each of which is a method + * signature for the generated interface. + * + * @param document the parsed {@link Document} + * @return a list of all the method signatures + */ + private static List getMethodSignatures( + Document document) { + List signatures = Lists.newArrayList(); + Set seen = Sets.newHashSet(); + for (Definition definition : + document.getDefinitions()) { + if(definition instanceof Service) { + Service service = (Service) definition; + for (ThriftMethod method : + service.getMethods()) { + String name = method.getName(); + if(!BANNED_METHODS.contains(name)) { + String verb = extractVerb(name); + StringBuilder sb = + new StringBuilder(); + for (ThriftField field : + method.getArguments()) { + if(!BANNED_PARAMS.contains( + field.getName())) { + String type = + thriftTypeToJavaType( + field.getType(), + true); + if(type.equals("TObject")) { + type = "Object"; + } + else if(type.contains( + "TObject") + && !type.contains( + "ComplexTObject")) { + type = type.replaceAll( + "TObject", + "Object"); + } + else if(type.equals( + "TCriteria")) { + type = "Criteria"; + } + else if(type.equals( + "TOrder")) { + type = "Order"; + } + else if(type.equals( + "TPage")) { + type = "Page"; + } + sb.append(type); + sb.append(" "); + sb.append(field.getName()); + sb.append(", "); + } + } + if(sb.length() > 1) { + sb.delete(sb.length() - 2, + sb.length()); + } + String params = sb.toString(); + String signature = + "void ${verb}(${params})"; + // Build a type-only key for + // dedup (Java overload + // resolution uses types, not + // param names) + String typeKey = verb + "("; + boolean first = true; + for (ThriftField field : + method.getArguments()) { + if(!BANNED_PARAMS.contains( + field.getName())) { + String type = + thriftTypeToJavaType( + field.getType(), + true); + if(type.equals("TObject")) { + type = "Object"; + } + else if(type.contains( + "TObject") + && !type.contains( + "ComplexTObject")) { + type = type.replaceAll( + "TObject", + "Object"); + } + else if(type.equals( + "TCriteria")) { + type = "Criteria"; + } + else if(type.equals( + "TOrder")) { + type = "Order"; + } + else if(type.equals( + "TPage")) { + type = "Page"; + } + if(!first) { + typeKey += ","; + } + // Use erased type for + // dedup to avoid + // List vs + // List clashes + String erased = type + .replaceAll( + "<.*>", + ""); + typeKey += erased; + first = false; + } + } + typeKey += ")"; + if(seen.add(typeKey)) { + signatures.add(signature); + } + } + } + break; + } + } + return signatures; + } + + /** + * Utility method to convert any {@link ThriftType} to the + * appropriate Java type that should be added to the method + * signature. + * + * @param type the methods declared {@link ThriftType} + * @param primitive a flag that signals whether an attempt + * should be made to use a primitive Java type + * @return the appropriate Java type for the method signature + */ + private static String thriftTypeToJavaType(ThriftType type, + boolean primitive) { + if(type instanceof VoidType) { + return "void"; + } + else if(type instanceof BaseType) { + BaseType base = (BaseType) type; + String name = base.getType().toString(); + String ret; + boolean primitiveSupport = true; + switch (name) { + case "I64": + ret = "Long"; + break; + case "I32": + ret = "Integer"; + break; + case "FLOAT": + ret = "Float"; + break; + case "DOUBLE": + ret = "Double"; + break; + case "STRING": + ret = "String"; + primitiveSupport = false; + break; + case "BOOL": + ret = "Boolean"; + break; + case "BINARY": + ret = "ByteBuffer"; + primitiveSupport = false; + break; + default: + ret = name; + break; + } + return primitive & primitiveSupport + ? ret.toLowerCase() : ret; + } + else if(type instanceof MapType) { + MapType map = (MapType) type; + StringBuilder sb = new StringBuilder(); + sb.append("Map<"); + sb.append(thriftTypeToJavaType( + map.getKeyType(), false)); + sb.append(","); + sb.append(thriftTypeToJavaType( + map.getValueType(), false)); + sb.append(">"); + return sb.toString(); + } + else if(type instanceof SetType) { + SetType set = (SetType) type; + StringBuilder sb = new StringBuilder(); + sb.append("Set<"); + sb.append(thriftTypeToJavaType( + set.getElementType(), false)); + sb.append(">"); + return sb.toString(); + } + else if(type instanceof ListType) { + ListType list = (ListType) type; + StringBuilder sb = new StringBuilder(); + sb.append("List<"); + sb.append(thriftTypeToJavaType( + list.getElementType(), false)); + sb.append(">"); + return sb.toString(); + } + else if(type instanceof IdentifierType) { + IdentifierType identifier = + (IdentifierType) type; + String[] parts = + identifier.getName().split("\\."); + return parts[parts.length - 1]; + } + else { + return type.toString(); + } + } +} diff --git a/utils/codegen/StatefulConcourseServiceGenerator.groovy b/utils/codegen/StatefulConcourseServiceGenerator.groovy index 545ac0f1d..b3ea97cb7 100644 --- a/utils/codegen/StatefulConcourseServiceGenerator.groovy +++ b/utils/codegen/StatefulConcourseServiceGenerator.groovy @@ -238,7 +238,8 @@ abstract class StatefulConcourseService { ++pos; } if(sb.length() > 1) { - sb.setLength(sb.length() - 2); + sb.delete(sb.length() - 2, + sb.length()); } String params = sb.toString(); String signature = "${ret} ${name}(${params})"; diff --git a/utils/compile-thrift-java.sh b/utils/compile-thrift-java.sh index 885415027..2dde0a0c2 100755 --- a/utils/compile-thrift-java.sh +++ b/utils/compile-thrift-java.sh @@ -60,6 +60,18 @@ groovy $GENERATOR $THRIFT_IDLS $SOURCE_DESTINATION echo "Finished generating $SOURCE_DESTINATION" +# Generate the CommandGroup interface +cd $HOME +COMMAND_GROUP_DESTINATION=$HOME/../concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/CommandGroup.java +COMMAND_GROUP_GENERATOR=$HOME/codegen/CommandGroupGenerator.groovy +COMMAND_GROUP_IDLS="" +for module in "${MODULES[@]}"; do + COMMAND_GROUP_IDLS="$COMMAND_GROUP_IDLS $HOME/../interface/$module" +done +groovy $COMMAND_GROUP_GENERATOR $COMMAND_GROUP_IDLS $COMMAND_GROUP_DESTINATION + +echo "Finished generating $COMMAND_GROUP_DESTINATION" + # Generate the ConcourseManagementService class cd $HOME THRIFT_IDL=$HOME/../interface/management/management.thrift From e96f607b04240b2d38c959fbb79dd4a9b88f73e3 Mon Sep 17 00:00:00 2001 From: Jeff Nelson Date: Sun, 15 Mar 2026 18:20:02 -0400 Subject: [PATCH 09/13] just get this to a place where it can be reviewed --- .../server/ManagedConcourseServer.java | 130 + .../com/cinchapi/concourse/Concourse.java | 41 +- .../concourse/ConcourseThriftDriver.java | 323 +- .../concourse/ForwardingConcourse.java | 19 +- .../com/cinchapi/concourse/NoOpConcourse.java | 17 +- .../com/cinchapi/concourse/lang/Criteria.java | 6 + .../concourse/lang/command/Command.java | 749 +- .../lang/command/CommandBuilder.java | 687 ++ .../concourse/lang/command/CommandGroup.java | 8 +- .../lang/command/DefaultCommandGroup.java | 954 +- .../concourse/lang/command/ParsedCommand.java | 406 + .../concourse/thrift/ConcourseService.java | 9898 ++++++++++++----- .../lang/command/CommandCompilationTest.java | 210 +- .../command/CommandSerializationTest.java | 146 +- .../lang/command/InspectionCommandTest.java | 42 +- .../lang/command/LinkCommandTest.java | 29 +- .../lang/command/QueryCommandTest.java | 55 +- .../lang/command/TemporalCommandTest.java | 69 +- .../lang/command/WriteCommandTest.java | 46 +- .../concourse/CommandExecutionTest.java | 38 +- .../plugin/StatefulConcourseService.java | 8 + .../concourse/server/ConcourseServer.java | 35 +- .../server/ops/CommandDispatcher.java | 22 +- .../server/ops/CommandTreeConverter.java | 813 ++ .../server/ops/CommandDispatcherTest.java | 453 + .../concourse/shell/ConcourseShell.java | 341 +- interface/concourse.thrift | 28 + 27 files changed, 10942 insertions(+), 4631 deletions(-) create mode 100644 concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/CommandBuilder.java create mode 100644 concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/ParsedCommand.java create mode 100644 concourse-server/src/main/java/com/cinchapi/concourse/server/ops/CommandTreeConverter.java create mode 100644 concourse-server/src/test/java/com/cinchapi/concourse/server/ops/CommandDispatcherTest.java diff --git a/concourse-automation/src/main/java/com/cinchapi/concourse/automation/server/ManagedConcourseServer.java b/concourse-automation/src/main/java/com/cinchapi/concourse/automation/server/ManagedConcourseServer.java index 41c23d1a6..971929161 100644 --- a/concourse-automation/src/main/java/com/cinchapi/concourse/automation/server/ManagedConcourseServer.java +++ b/concourse-automation/src/main/java/com/cinchapi/concourse/automation/server/ManagedConcourseServer.java @@ -36,6 +36,7 @@ import java.nio.file.Paths; import java.nio.file.StandardCopyOption; import java.text.MessageFormat; +import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; @@ -73,6 +74,9 @@ import com.cinchapi.concourse.config.ConcourseClientConfiguration; import com.cinchapi.concourse.config.ConcourseServerConfiguration; import com.cinchapi.concourse.lang.Criteria; +import com.cinchapi.concourse.lang.command.Command; +import com.cinchapi.concourse.lang.command.CommandGroup; +import com.cinchapi.concourse.lang.command.DefaultCommandGroup; import com.cinchapi.concourse.lang.paginate.Page; import com.cinchapi.concourse.lang.sort.Order; import com.cinchapi.concourse.lang.sort.OrderComponent; @@ -1291,6 +1295,22 @@ public Map>> diff(String key, start); } + @Override + public Object exec(Command command) { + return invoke("exec", Command.class).with(command); + } + + @Override + public Object exec(Command command, Command... more) { + return invoke("exec", Command.class, Command[].class).with(command, + more); + } + + @Override + public Object exec(List commands) { + return invoke("exec", List.class).with(commands); + } + @Override public void exit() { invoke("exit").with(); @@ -2140,6 +2160,11 @@ public String getServerVersion() { return invoke("getServerVersion").with(); } + @Override + public CommandGroup prepare() { + return new DefaultCommandGroup(); + } + @Override public Set insert(String json) { return invoke("insert", String.class).with(json); @@ -3030,6 +3055,42 @@ public void stage() { invoke("stage").with(); } + @Override + public List submit(Command command) { + return invoke("submit", Command.class).with(command); + } + + @Override + public List submit(Command command, Command... more) { + return invoke("submit", Command.class, Command[].class) + .with(command, more); + } + + @Override + public List submit(List commands) { + return invoke("submit", List.class).with(commands); + } + + @Override + public List submit(CommandGroup group) { + return invoke("submit", List.class).with(group.commands()); + } + + @Override + public Object exec(String ccl) { + return invoke("exec", String.class).with(ccl); + } + + @Override + public List submit(String ccl) { + return invoke("submit", String.class).with(ccl); + } + + @Override + public boolean inTransaction() { + return invoke("inTransaction").with(); + } + @Override public Timestamp time() { return invoke("time").with(); @@ -3107,6 +3168,31 @@ protected Concourse copyConnection() { return new Client(clazz, invoke("copyConnection").with(), loader); } + /** + * Convert a {@link Command} into an equivalent object compatible with + * the remote server's classloader. + *

    + * The conversion uses the {@link Command Command's} CCL string + * representation, which is safe to pass across classloader boundaries + * because {@link String} is loaded by the bootstrap classloader. + *

    + * + * @param command the {@link Command} to convert + * @return a remote {@link Command} object + */ + private Object convertCommand(Command command) { + try { + String ccl = command.ccl(); + Class remoteCommandClass = loader + .loadClass(packageBase + "lang.command.Command"); + return remoteCommandClass.getMethod("parse", String.class) + .invoke(null, ccl); + } + catch (Exception e) { + throw CheckedExceptions.wrapAsRuntimeException(e); + } + } + /** * Return an invocation wrapper for the named {@code method} with the * specified {@code parameterTypes}. @@ -3141,6 +3227,16 @@ else if(parameterTypes[i] == Order.class) { parameterTypes[i] = loader .loadClass(packageBase + "lang.sort.Order"); } + else if(parameterTypes[i] == Command.class) { + parameterTypes[i] = loader.loadClass( + packageBase + "lang.command.Command"); + } + else if(parameterTypes[i] == Command[].class) { + parameterTypes[i] = java.lang.reflect.Array.newInstance( + loader.loadClass( + packageBase + "lang.command.Command"), + 0).getClass(); + } else { continue; } @@ -3295,6 +3391,33 @@ else if(args[i] instanceof Page) { .getMethod("of", int.class, int.class) .invoke(null, offset, limit); } + else if(args[i] instanceof Command) { + args[i] = convertCommand((Command) args[i]); + } + else if(args[i] instanceof Command[]) { + Command[] cmds = (Command[]) args[i]; + Class rc = loader.loadClass( + packageBase + "lang.command.Command"); + Object remoteArray = java.lang.reflect.Array + .newInstance(rc, cmds.length); + for (int j = 0; j < cmds.length; j++) { + java.lang.reflect.Array.set(remoteArray, j, + convertCommand(cmds[j])); + } + args[i] = remoteArray; + } + else if(args[i] instanceof List) { + List list = (List) args[i]; + if(!list.isEmpty() + && list.get(0) instanceof Command) { + List converted = new ArrayList<>(); + for (Object item : list) { + converted.add( + convertCommand((Command) item)); + } + args[i] = converted; + } + } else { continue; } @@ -3330,6 +3453,13 @@ else if(object instanceof Set) { } object = transformed; } + else if(object instanceof List) { + List transformed = Lists.newArrayList(); + for (Object item : (List) object) { + transformed.add(transformServerObject(item)); + } + object = transformed; + } else if(object instanceof Map) { Map transformed = new LinkedHashMap<>(); for (Entry entry : ((Map) object) diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/Concourse.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/Concourse.java index 6b1e5fbaa..083b2d3b8 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/Concourse.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/Concourse.java @@ -7529,7 +7529,7 @@ public final boolean stage(Runnable task) throws TransactionException { public abstract List submit(List commands); /** - * Submit all the {@link Command Commands} that have been collected by the + * Submit all the {@link Command Commands} that have been prepared in the * {@code group} and return a {@link List} of results corresponding to each * {@link Command}. *

    @@ -7555,7 +7555,44 @@ public final boolean stage(Runnable task) throws TransactionException { * * @return a new {@link CommandGroup} */ - public abstract CommandGroup group(); + public abstract CommandGroup prepare(); + + /** + * Execute CCL text containing one or more commands and return the result of + * the last command. + *

    + * The {@code ccl} text is validated and compiled on the server. Multiple + * commands may be separated by semicolons or newlines. If any command + * fails, execution stops and the exception is propagated immediately. + *

    + * + * @param ccl the CCL text to execute + * @return the result of the last command + */ + public abstract Object exec(String ccl); + + /** + * Submit CCL text containing one or more commands and return a {@link List} + * of results corresponding to each command. + *

    + * The {@code ccl} text is validated and compiled on the server. Commands + * are executed sequentially in a single round trip. If any command fails, + * execution stops and the exception is propagated. + *

    + * + * @param ccl the CCL text to submit + * @return a {@link List} of results, one per command + */ + public abstract List submit(String ccl); + + /** + * Return {@code true} if this client is currently within a transaction + * (i.e., {@link #stage()} has been called without a corresponding + * {@link #commit()} or {@link #abort()}). + * + * @return {@code true} if a transaction is active + */ + public abstract boolean inTransaction(); /** * Return a {@link Timestamp} that represents the current instant according diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/ConcourseThriftDriver.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/ConcourseThriftDriver.java index 709b41cb6..c689168fb 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/ConcourseThriftDriver.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/ConcourseThriftDriver.java @@ -19,6 +19,7 @@ import java.nio.ByteBuffer; import java.util.Arrays; import java.util.Collection; +import java.util.EnumSet; import java.util.List; import java.util.Map; import java.util.Map.Entry; @@ -64,6 +65,7 @@ import com.cinchapi.concourse.thrift.Operator; import com.cinchapi.concourse.thrift.SecurityException; import com.cinchapi.concourse.thrift.TCommand; +import com.cinchapi.concourse.thrift.TCommandVerb; import com.cinchapi.concourse.thrift.TObject; import com.cinchapi.concourse.thrift.TransactionToken; import com.cinchapi.concourse.util.Collections; @@ -76,6 +78,7 @@ import com.cinchapi.concourse.util.Version; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Throwables; +import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; import com.google.common.collect.Sets; @@ -233,6 +236,38 @@ static boolean isLegacyServerVersion(@Nullable String version) { */ private boolean serverSupportsMultiplexing = true; + /** + * A flag that controls whether exec/submit results are wrapped in + * pretty-printing collection types. + */ + private boolean usePrettyCollections = false; + + /** + * {@link TCommandVerb TCommandVerbs} whose results are never {@link Map + * Maps} and therefore never need pretty-printing. + */ + // @formatter:off + private static final EnumSet NON_MAP_VERBS = + EnumSet.of( + TCommandVerb.ADD, TCommandVerb.SET, + TCommandVerb.REMOVE, TCommandVerb.CLEAR, + TCommandVerb.INSERT, TCommandVerb.LINK, + TCommandVerb.UNLINK, TCommandVerb.REVERT, + TCommandVerb.RECONCILE, + TCommandVerb.CONSOLIDATE, + TCommandVerb.VERIFY, + TCommandVerb.VERIFY_AND_SWAP, + TCommandVerb.VERIFY_OR_SET, + TCommandVerb.HOLDS, TCommandVerb.PING, + TCommandVerb.STAGE, TCommandVerb.COMMIT, + TCommandVerb.ABORT, TCommandVerb.FIND, + TCommandVerb.SEARCH, TCommandVerb.INVENTORY, + TCommandVerb.CALCULATE, TCommandVerb.JSONIFY, + TCommandVerb.FIND_OR_ADD, + TCommandVerb.FIND_OR_INSERT + ); + // @formatter:on + /** * Create a new Client connection to the environment of the Concourse Server * described in the client configuration (e.g., @@ -2389,24 +2424,22 @@ public String jsonify(Collection records, Timestamp timestamp, @Override public String jsonify(long record) { - return jsonify(java.util.Collections.singletonList(record), true); + return jsonify(ImmutableList.of(record), true); } @Override public String jsonify(long record, boolean includeId) { - return jsonify(java.util.Collections.singletonList(record), includeId); + return jsonify(ImmutableList.of(record), includeId); } @Override public String jsonify(long record, Timestamp timestamp) { - return jsonify(java.util.Collections.singletonList(record), timestamp, - true); + return jsonify(ImmutableList.of(record), timestamp, true); } @Override public String jsonify(long record, Timestamp timestamp, boolean includeId) { - return jsonify(java.util.Collections.singletonList(record), timestamp, - includeId); + return jsonify(ImmutableList.of(record), timestamp, includeId); } @Override @@ -4069,13 +4102,13 @@ public void stage() throws TransactionException { @Override public Object exec(Command command) { - return exec(Lists.newArrayList(command)); + return exec(ImmutableList.of(command)); } @Override public Object exec(Command command, Command... more) { - List commands = Lists.newArrayList(command); - java.util.Collections.addAll(commands, more); + List commands = ImmutableList. builder().add(command) + .add(more).build(); return exec(commands); } @@ -4084,8 +4117,13 @@ public Object exec(List commands) { return execute(() -> { List tcommands = commands.stream().map(Command::toThrift) .collect(Collectors.toList()); - return core.exec(tcommands, creds, transaction, environment) - .getJavaObject(); + TCommandVerb verb = usePrettyCollections && !tcommands.isEmpty() + ? tcommands.get(tcommands.size() - 1).getVerb() + : null; + return prettify( + core.exec(tcommands, creds, transaction, environment) + .getJavaObject(), + verb); }); } @@ -4096,8 +4134,8 @@ public List submit(Command command) { @Override public List submit(Command command, Command... more) { - List commands = Lists.newArrayList(command); - java.util.Collections.addAll(commands, more); + List commands = ImmutableList. builder().add(command) + .add(more).build(); return submit(commands); } @@ -4106,9 +4144,17 @@ public List submit(List commands) { return execute(() -> { List tcommands = commands.stream().map(Command::toThrift) .collect(Collectors.toList()); - return core.submit(tcommands, creds, transaction, environment) - .stream().map(ComplexTObject::getJavaObject) - .collect(Collectors.toList()); + List results = core.submit(tcommands, creds, + transaction, environment); + List prettified = Lists + .newArrayListWithCapacity(results.size()); + for (int i = 0; i < results.size(); ++i) { + TCommandVerb verb = usePrettyCollections && i < tcommands.size() + ? tcommands.get(i).getVerb() + : null; + prettified.add(prettify(results.get(i).getJavaObject(), verb)); + } + return prettified; }); } @@ -4118,10 +4164,39 @@ public List submit(CommandGroup group) { } @Override - public CommandGroup group() { + public CommandGroup prepare() { return new DefaultCommandGroup(); } + @Override + public Object exec(String ccl) { + return execute(() -> { + return prettify(core.execCcl(ccl, creds, transaction, environment) + .getJavaObject(), extractLastVerb(ccl)); + }); + } + + @Override + public List submit(String ccl) { + return execute(() -> { + List verbs = extractVerbs(ccl); + List results = core.submitCcl(ccl, creds, + transaction, environment); + List prettified = Lists + .newArrayListWithCapacity(results.size()); + for (int i = 0; i < results.size(); ++i) { + TCommandVerb verb = i < verbs.size() ? verbs.get(i) : null; + prettified.add(prettify(results.get(i).getJavaObject(), verb)); + } + return prettified; + }); + } + + @Override + public boolean inTransaction() { + return transaction != null; + } + @Override public Timestamp time() { return execute(() -> Timestamp @@ -4691,4 +4766,218 @@ private boolean isConnectedToLegacyServer() { return legacy; } + /** + * Return the {@link TCommandVerb} for a single CCL segment. + * + * @param segment the CCL segment + * @return the {@link TCommandVerb}, or {@code null} if the verb cannot be + * determined + */ + @Nullable + private TCommandVerb extractVerb(String segment) { + if(segment.isEmpty()) { + return null; + } + int space = segment.indexOf(' '); + String token = space > 0 ? segment.substring(0, space) : segment; + try { + return TCommandVerb.valueOf(token.toUpperCase()); + } + catch (IllegalArgumentException e) { + return null; + } + } + + /** + * Return the {@link TCommandVerb} for the last command in a CCL string. + * + * @param ccl the CCL string + * @return the {@link TCommandVerb}, or {@code null} if the verb cannot be + * determined + */ + @Nullable + private TCommandVerb extractLastVerb(String ccl) { + if(usePrettyCollections) { + int last = ccl.lastIndexOf(';'); + String segment = last >= 0 ? ccl.substring(last + 1).trim() + : ccl.trim(); + return extractVerb(segment); + } + else { + return null; + } + } + + /** + * Return a {@link TCommandVerb} for each command in a CCL string, in order. + * Entries are {@code null} when the verb cannot be determined. + * + * @param ccl the CCL string + * @return a {@link List} of {@link TCommandVerb TCommandVerbs} + */ + private List extractVerbs(String ccl) { + if(usePrettyCollections) { + String[] segments = ccl.split(";"); + List verbs = Lists + .newArrayListWithCapacity(segments.length); + for (String segment : segments) { + String trimmed = segment.trim(); + if(!trimmed.isEmpty()) { + verbs.add(extractVerb(trimmed)); + } + } + return verbs; + } + else { + return ImmutableList.of(); + } + } + + /** + * Wrap a raw result from command execution in the appropriate + * pretty-printing container so that its {@link Object#toString()} output + * matches the formatting conventions of the corresponding individual driver + * method. + * + * @param value the result to wrap + * @param verb the {@link TCommandVerb} that produced the result, or + * {@code null} if unknown + * @return the pretty-printed result, or {@code value} unchanged if it is + * not a {@link Map} + */ + @SuppressWarnings({ "unchecked", "rawtypes" }) + private Object prettify(Object value, @Nullable TCommandVerb verb) { + if(usePrettyCollections) { + if(verb != null && NON_MAP_VERBS.contains(verb)) { + return value; + } + if(!(value instanceof Map)) { + return value; + } + Map map = (Map) value; + if(map.isEmpty()) { + return value; + } + Entry first = map.entrySet().iterator().next(); + Object firstKey = first.getKey(); + Object firstVal = first.getValue(); + if(verb != null) { + switch (verb) { + case SELECT: + case NAVIGATE: + if(firstKey instanceof Long && firstVal instanceof Map) { + return DataTable.multiValued((Map) value); + } + else { + return DataRow.multiValued((Map) value); + } + case GET: + if(firstKey instanceof Long && firstVal instanceof Map) { + return DataTable.singleValued((Map) value); + } + else { + return DataRow.singleValued((Map) value); + } + case BROWSE: + if(firstKey instanceof TObject) { + return DataProjection.of((Map) value); + } + else if(firstVal instanceof Map) { + return DataIndex.of((Map) value); + } + break; + case AUDIT: + case CHRONICLE: + return PrettyLinkedHashMap.of((Map) value, "DateTime", + "Revision"); + case DIFF: + if(isDiffResult(map)) { + return PrettyLinkedHashMap.of((Map) value, "Operation", + "Value"); + } + else if(firstVal instanceof Map) { + if(firstKey instanceof TObject) { + return PrettyLinkedTableMap.of((Map) value, + "Value"); + } + else { + return PrettyLinkedTableMap.of((Map) value, "Key"); + } + } + break; + case TRACE: + if(firstKey instanceof Long && firstVal instanceof Map) { + return PrettyLinkedTableMap.of((Map) value, "Record"); + } + else { + return PrettyLinkedHashMap.of((Map) value, "Key", + "Sources"); + } + case DESCRIBE: + return PrettyLinkedHashMap.of((Map) value, "Record", + "Keys"); + default: + break; + } + } + // Generic type-based fallback for null/unknown verbs + if(firstVal instanceof Map) { + if(firstKey instanceof Long) { + return PrettyLinkedTableMap.of((Map) value, "Record"); + } + else if(firstKey instanceof TObject) { + return PrettyLinkedTableMap.of((Map) value, "Value"); + } + else { + return PrettyLinkedTableMap.of((Map) value, "Key"); + } + } + else if(firstKey instanceof Long && firstVal instanceof List) { + return PrettyLinkedHashMap.of((Map) value, "DateTime", + "Revision"); + } + else if(firstKey instanceof Long && firstVal instanceof Boolean) { + return PrettyLinkedHashMap.of((Map) value, "Record", + "Successful"); + } + else if(isDiffResult(map)) { + return PrettyLinkedHashMap.of((Map) value, "Operation", + "Value"); + } + else if(firstKey instanceof TObject) { + String valHeader = firstVal instanceof Set ? "Records" + : "Record"; + return PrettyLinkedHashMap.of((Map) value, "Value", valHeader); + } + else { + String valHeader = firstVal instanceof Set ? "Values" : "Value"; + if(firstKey instanceof Long) { + return PrettyLinkedHashMap.of((Map) value, "Record", + valHeader); + } + else { + return PrettyLinkedHashMap.of((Map) value, "Key", + valHeader); + } + } + } + else { + return value; + } + } + + /** + * Return {@code true} if {@code map} appears to be a diff result — + * all keys are {@link String} representations of + * {@link com.cinchapi.concourse.thrift.Diff} enum constants + * ({@code "ADDED"} and/or {@code "REMOVED"}). + * + * @param map the {@link Map} to inspect + * @return {@code true} if the map looks like a diff result + */ + private boolean isDiffResult(Map map) { + return map.keySet().stream() + .allMatch(k -> "ADDED".equals(k) || "REMOVED".equals(k)); + } + } diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/ForwardingConcourse.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/ForwardingConcourse.java index f363e06a9..5d08a5a68 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/ForwardingConcourse.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/ForwardingConcourse.java @@ -1748,8 +1748,23 @@ public List submit(CommandGroup group) { } @Override - public CommandGroup group() { - return concourse.group(); + public CommandGroup prepare() { + return concourse.prepare(); + } + + @Override + public Object exec(String ccl) { + return concourse.exec(ccl); + } + + @Override + public List submit(String ccl) { + return concourse.submit(ccl); + } + + @Override + public boolean inTransaction() { + return concourse.inTransaction(); } @Override diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/NoOpConcourse.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/NoOpConcourse.java index 483edb558..279b94989 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/NoOpConcourse.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/NoOpConcourse.java @@ -1734,10 +1734,25 @@ public List submit(CommandGroup group) { } @Override - public CommandGroup group() { + public CommandGroup prepare() { throw new UnsupportedOperationException(); } + @Override + public Object exec(String ccl) { + throw new UnsupportedOperationException(); + } + + @Override + public List submit(String ccl) { + throw new UnsupportedOperationException(); + } + + @Override + public boolean inTransaction() { + return false; + } + @Override protected Concourse copyConnection() { throw new UnsupportedOperationException(); diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/Criteria.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/Criteria.java index 731d43a7c..dc037a737 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/Criteria.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/Criteria.java @@ -15,11 +15,14 @@ */ package com.cinchapi.concourse.lang; +import static com.google.common.base.Preconditions.checkArgument; + import java.util.List; import com.cinchapi.ccl.SyntaxException; import com.cinchapi.ccl.grammar.Symbol; import com.cinchapi.ccl.syntax.AbstractSyntaxTree; +import com.cinchapi.ccl.syntax.ConditionTree; import com.cinchapi.common.base.CheckedExceptions; import com.cinchapi.concourse.ParseException; import com.cinchapi.concourse.Timestamp; @@ -53,6 +56,9 @@ public interface Criteria extends Symbol { public static Criteria parse(String ccl) { try { AbstractSyntaxTree ast = ConcourseCompiler.get().parse(ccl); + checkArgument(ast instanceof ConditionTree, + "The provided CCL is not a valid Condition or Criteria statement: %s", + ccl); BuiltCriteria criteria = new BuiltCriteria(); criteria.symbols = Lists .newArrayList(ConcourseCompiler.get().tokenize(ast)); diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/Command.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/Command.java index 221e3ff6f..7a34065f0 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/Command.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/Command.java @@ -15,31 +15,46 @@ */ package com.cinchapi.concourse.lang.command; -import com.cinchapi.concourse.lang.Criteria; +import java.util.List; + +import com.cinchapi.ccl.SyntaxException; +import com.cinchapi.ccl.syntax.AbstractSyntaxTree; +import com.cinchapi.ccl.syntax.CommandTree; +import com.cinchapi.common.base.CheckedExceptions; +import com.cinchapi.concourse.ParseException; +import com.cinchapi.concourse.lang.ConcourseCompiler; import com.cinchapi.concourse.thrift.TCommand; +import com.google.common.base.Preconditions; /** * A {@link Command} encapsulates a complete CCL (Concourse Command Language) * statement that can be rendered as a CCL string or serialized as a * {@link TCommand} for wire transport. *

    - * {@link Command Commands} are constructed using the fluent static factory - * methods on this interface. Each factory returns a state object whose methods - * guide the caller through the valid parameter sequence for that command. - * Terminal states implement {@link Command}, so the result can be used directly - * without an explicit {@code build()} call. + * {@link Command Commands} are constructed using the fluent builder methods + * available from the {@link CommandBuilder} returned by {@link #to()}, + * {@link #is()}, or {@link #go()}. All three entry points are interchangeable + * aliases — choose whichever reads most naturally for the command being + * constructed: {@link #to()} for actions, {@link #is()} for checks, and + * {@link #go()} as an imperative. Each builder method returns a state object + * whose methods guide the caller through the valid parameter sequence for that + * command. Terminal states implement {@link Command}, so the result can be used + * directly without an explicit {@code build()} call. *

    *

    Usage

    * *
    + * // Write
    + * Command cmd = Command.to().add("name").as("jeff").in(1);
    + *
      * // Query
    - * Command cmd = Command.find(criteria).order(order).page(page);
    + * Command cmd = Command.to().find(criteria).order(order);
      *
    - * // Write
    - * Command cmd = Command.add("name").as("jeff").in(1);
    + * // Check
    + * Command cmd = Command.is().holds(1);
      *
    - * // Simple
    - * Command cmd = Command.ping();
    + * // Imperative
    + * Command cmd = Command.go().ping();
      *
      * // Render
      * String ccl = cmd.ccl();
    @@ -66,6 +81,47 @@ public default TCommand toThrift() {
             return CommandSerializer.toThrift(this);
         }
     
    +    /**
    +     * Parse a CCL command string into a {@link Command}.
    +     * 

    + * The provided {@code ccl} string is compiled using the + * {@link ConcourseCompiler} and must represent a valid command statement + * (e.g., {@code "find age > 30 order by name"} or + * {@code "add name as jeff in 1"}). + *

    + * + * @param ccl the CCL command string to parse + * @return an equivalent {@link Command} + * @throws ParseException if the CCL string is not a valid command + */ + public static Command parse(String ccl) { + try { + List trees = ConcourseCompiler.get() + .compile(ccl); + Preconditions.checkArgument( + !trees.isEmpty() && trees.get(0) instanceof CommandTree, + "The provided CCL is not a valid " + + "Command statement: %s", + ccl); + CommandTree tree = (CommandTree) trees.get(0); + return new ParsedCommand(ccl, tree); + } + catch (Exception e) { + if(e instanceof SyntaxException + || e instanceof IllegalStateException + || e instanceof IllegalArgumentException + || e.getCause() != null && e + .getCause() instanceof com.cinchapi.ccl.generated.ParseException) { + throw new ParseException( + new com.cinchapi.concourse.thrift.ParseException( + e.getMessage())); + } + else { + throw CheckedExceptions.throwAsRuntimeException(e); + } + } + } + /** * Reconstruct a {@link Command} from a {@link TCommand} received over the * wire. @@ -78,662 +134,45 @@ public static Command fromThrift(TCommand tc) { } /** - * Start building a {@code find} {@link Command} using the provided - * {@link Criteria}. - * - * @param criteria the {@link Criteria} to find - * @return the next builder state - */ - public static FindCommand.ConditionState find(Criteria criteria) { - return new FindCommand.ConditionState(criteria, null); - } - - /** - * Start building a {@code find} {@link Command} using a raw CCL condition - * string. - * - * @param ccl the CCL condition - * @return the next builder state - */ - public static FindCommand.ConditionState find(String ccl) { - return new FindCommand.ConditionState(null, ccl); - } - - /** - * Start building a {@code select} {@link Command} for the specified - * {@code key}. - * - * @param key the key to select - * @return the next builder state - */ - public static SelectCommand.KeyState select(String key) { - return new SelectCommand.KeyState(key); - } - - /** - * Start building a {@code select} {@link Command} for the specified - * {@code keys}. - * - * @param key the first key to select - * @param moreKeys additional keys - * @return the next builder state - */ - public static SelectCommand.KeyState select(String key, - String... moreKeys) { - return new SelectCommand.KeyState(key, moreKeys); - } - - /** - * Return a {@code select} {@link Command} for all keys from the specified - * {@code record}. - * - * @param record the record to select from - * @return the next builder state - */ - public static SelectCommand.SourceState select(long record) { - return select(record, new long[0]); - } - - /** - * Return a {@code select} {@link Command} for all keys from the specified - * {@code records}. - * - * @param record the first record - * @param moreRecords additional records - * @return the next builder state - */ - public static SelectCommand.SourceState select(long record, - long... moreRecords) { - return new SelectCommand.SourceState(null, - CclRenderer.collectRecords(record, moreRecords), null, null); - } - - /** - * Start building a {@code select} {@link Command} for all keys. - * - * @return the next builder state - */ - public static SelectCommand.AllKeysState selectAll() { - return new SelectCommand.AllKeysState(); - } - - /** - * Start building a {@code get} {@link Command} for the specified - * {@code key}. - * - * @param key the key to get - * @return the next builder state - */ - public static GetCommand.KeyState get(String key) { - return new GetCommand.KeyState(key); - } - - /** - * Start building a {@code get} {@link Command} for the specified - * {@code keys}. - * - * @param key the first key to get - * @param moreKeys additional keys - * @return the next builder state - */ - public static GetCommand.KeyState get(String key, String... moreKeys) { - return new GetCommand.KeyState(key, moreKeys); - } - - /** - * Return a {@code get} {@link Command} for all keys from the specified - * {@code record}. - * - * @param record the record to get from - * @return the next builder state - */ - public static GetCommand.SourceState get(long record) { - return get(record, new long[0]); - } - - /** - * Return a {@code get} {@link Command} for all keys from the specified - * {@code records}. - * - * @param record the first record - * @param moreRecords additional records - * @return the next builder state - */ - public static GetCommand.SourceState get(long record, long... moreRecords) { - return new GetCommand.SourceState(null, - CclRenderer.collectRecords(record, moreRecords), null, null); - } - - /** - * Start building a {@code get} {@link Command} for all keys. - * - * @return the next builder state - */ - public static GetCommand.AllKeysState getAll() { - return new GetCommand.AllKeysState(); - } - - /** - * Start building a {@code navigate} {@link Command} for the specified - * navigation {@code key}. - * - * @param key the key to navigate - * @return the next builder state - */ - public static NavigateCommand.KeyState navigate(String key) { - return new NavigateCommand.KeyState(key); - } - - /** - * Start building a {@code navigate} {@link Command} for the specified - * navigation {@code keys}. - * - * @param key the first key to navigate - * @param moreKeys additional keys - * @return the next builder state - */ - public static NavigateCommand.KeyState navigate(String key, - String... moreKeys) { - return new NavigateCommand.KeyState(key, moreKeys); - } - - /** - * Start building an {@code add} {@link Command} for the specified - * {@code key}. - * - * @param key the key to add - * @return the next builder state - */ - public static AddCommand.KeyState add(String key) { - return new AddCommand.KeyState(key); - } - - /** - * Start building a {@code set} {@link Command} for the specified - * {@code key}. - * - * @param key the key to set - * @return the next builder state - */ - public static SetCommand.KeyState set(String key) { - return new SetCommand.KeyState(key); - } - - /** - * Start building a {@code remove} {@link Command} for the specified - * {@code key}. - * - * @param key the key to remove - * @return the next builder state - */ - public static RemoveCommand.KeyState remove(String key) { - return new RemoveCommand.KeyState(key); - } - - /** - * Start building a {@code clear} {@link Command} for the specified - * {@code key}. - * - * @param key the key to clear - * @return the next builder state - */ - public static ClearCommand.KeyState clear(String key) { - return new ClearCommand.KeyState(key); - } - - /** - * Start building a {@code clear} {@link Command} for the specified - * {@code keys}. - * - * @param key the first key to clear - * @param moreKeys additional keys - * @return the next builder state - */ - public static ClearCommand.KeyState clear(String key, String... moreKeys) { - return new ClearCommand.KeyState(key, moreKeys); - } - - /** - * Return a {@code clear} {@link Command} for the specified {@code record}. - * - * @param record the record to clear - * @return the {@link Command} - */ - public static ClearCommand.RecordState clear(long record) { - return new ClearCommand.RecordState(null, record); - } - - /** - * Return a {@code clear} {@link Command} for the specified {@code records}. - * - * @param record the first record to clear - * @param moreRecords additional records - * @return the {@link Command} - */ - public static ClearCommand.RecordState clear(long record, - long... moreRecords) { - return new ClearCommand.RecordState(null, record, moreRecords); - } - - /** - * Start building an {@code insert} {@link Command} with the provided JSON - * data. - * - * @param json the JSON string to insert - * @return the next builder state - */ - public static InsertCommand.JsonState insert(String json) { - return new InsertCommand.JsonState(json); - } - - /** - * Start building a {@code link} {@link Command} for the specified - * {@code key}. - * - * @param key the link key - * @return the next builder state - */ - public static LinkCommand.KeyState link(String key) { - return new LinkCommand.KeyState(key); - } - - /** - * Start building an {@code unlink} {@link Command} for the specified - * {@code key}. - * - * @param key the link key - * @return the next builder state - */ - public static UnlinkCommand.KeyState unlink(String key) { - return new UnlinkCommand.KeyState(key); - } - - /** - * Start building a {@code verify} {@link Command} for the specified - * {@code key}. - * - * @param key the key to verify - * @return the next builder state - */ - public static VerifyCommand.KeyState verify(String key) { - return new VerifyCommand.KeyState(key); - } - - /** - * Start building a {@code verifyAndSwap} {@link Command} for the specified - * {@code key}. - * - * @param key the key to verify and swap - * @return the next builder state - */ - public static VerifyAndSwapCommand.KeyState verifyAndSwap(String key) { - return new VerifyAndSwapCommand.KeyState(key); - } - - /** - * Start building a {@code verifyOrSet} {@link Command} for the specified - * {@code key}. - * - * @param key the key to verify or set - * @return the next builder state - */ - public static VerifyOrSetCommand.KeyState verifyOrSet(String key) { - return new VerifyOrSetCommand.KeyState(key); - } - - /** - * Start building a {@code findOrAdd} {@link Command} for the specified - * {@code key}. - * - * @param key the key to find or add - * @return the next builder state - */ - public static FindOrAddCommand.KeyState findOrAdd(String key) { - return new FindOrAddCommand.KeyState(key); - } - - /** - * Start building a {@code findOrInsert} {@link Command} using the provided - * {@link Criteria}. + * Return a {@link CommandBuilder} for constructing {@link Command + * Commands}. + *

    + * This entry point reads naturally for action commands: + * {@code Command.to().add("name").as("jeff").in(1)}. + *

    * - * @param criteria the {@link Criteria} to search - * @return the next builder state + * @return a {@link CommandBuilder} */ - public static FindOrInsertCommand.ConditionState findOrInsert( - Criteria criteria) { - return new FindOrInsertCommand.ConditionState(criteria, null); + public static CommandBuilder to() { + return new CommandBuilder(); } /** - * Start building a {@code findOrInsert} {@link Command} using a raw CCL - * condition string. + * Return a {@link CommandBuilder} for constructing {@link Command + * Commands}. + *

    + * This entry point reads naturally for query and check commands: + * {@code Command.is().holds(1)}. + *

    * - * @param ccl the CCL condition - * @return the next builder state + * @return a {@link CommandBuilder} */ - public static FindOrInsertCommand.ConditionState findOrInsert(String ccl) { - return new FindOrInsertCommand.ConditionState(null, ccl); + public static CommandBuilder is() { + return new CommandBuilder(); } /** - * Start building a {@code search} {@link Command} for the specified - * {@code key}. + * Return a {@link CommandBuilder} for constructing {@link Command + * Commands}. + *

    + * This entry point reads naturally as an imperative: + * {@code Command.go().add("name").as("jeff").in(1)}. + *

    * - * @param key the key to search - * @return the next builder state - */ - public static SearchCommand.KeyState search(String key) { - return new SearchCommand.KeyState(key); - } - - /** - * Start building a {@code browse} {@link Command} for the specified - * {@code key}. - * - * @param key the key to browse - * @return the next builder state - */ - public static BrowseCommand.State browse(String key) { - return new BrowseCommand.State(key); - } - - /** - * Start building a {@code browse} {@link Command} for the specified - * {@code keys}. - * - * @param key the first key to browse - * @param moreKeys additional keys - * @return the next builder state - */ - public static BrowseCommand.State browse(String key, String... moreKeys) { - return new BrowseCommand.State(key, moreKeys); - } - - /** - * Start building a {@code describe} {@link Command} for the specified - * {@code record}. - * - * @param record the record to describe - * @return the next builder state - */ - public static DescribeCommand.State describe(long record) { - return new DescribeCommand.State(record); - } - - /** - * Start building a {@code describe} {@link Command} for the specified - * {@code records}. - * - * @param record the first record to describe - * @param moreRecords additional records - * @return the next builder state - */ - public static DescribeCommand.State describe(long record, - long... moreRecords) { - return new DescribeCommand.State(record, moreRecords); - } - - /** - * Start building a {@code describe} {@link Command} that describes all - * records, optionally at a historical - * {@link com.cinchapi.concourse.Timestamp Timestamp}. - * - * @return the next builder state - */ - public static DescribeCommand.AllState describeAll() { - return new DescribeCommand.AllState(); - } - - /** - * Start building a {@code trace} {@link Command} for the specified - * {@code record}. - * - * @param record the record to trace - * @return the next builder state - */ - public static TraceCommand.State trace(long record) { - return new TraceCommand.State(record); - } - - /** - * Start building a {@code trace} {@link Command} for the specified - * {@code records}. - * - * @param record the first record to trace - * @param moreRecords additional records - * @return the next builder state - */ - public static TraceCommand.State trace(long record, long... moreRecords) { - return new TraceCommand.State(record, moreRecords); - } - - /** - * Start building a {@code holds} {@link Command} for the specified - * {@code record}. - * - * @param record the record to check - * @return the next builder state - */ - public static HoldsCommand.State holds(long record) { - return new HoldsCommand.State(record); - } - - /** - * Start building a {@code holds} {@link Command} for the specified - * {@code records}. - * - * @param record the first record to check - * @param moreRecords additional records - * @return the next builder state - */ - public static HoldsCommand.State holds(long record, long... moreRecords) { - return new HoldsCommand.State(record, moreRecords); - } - - /** - * Start building a {@code jsonify} {@link Command} for the specified - * {@code record}. - * - * @param record the record to jsonify - * @return the next builder state - */ - public static JsonifyCommand.State jsonify(long record) { - return new JsonifyCommand.State(record); - } - - /** - * Start building a {@code jsonify} {@link Command} for the specified - * {@code records}. - * - * @param record the first record to jsonify - * @param moreRecords additional records - * @return the next builder state - */ - public static JsonifyCommand.State jsonify(long record, - long... moreRecords) { - return new JsonifyCommand.State(record, moreRecords); - } - - /** - * Start building a {@code chronicle} {@link Command} for the specified - * {@code key}. - * - * @param key the key to chronicle - * @return the next builder state - */ - public static ChronicleCommand.KeyState chronicle(String key) { - return new ChronicleCommand.KeyState(key); - } - - /** - * Start building a {@code diff} {@link Command} for the specified - * {@code record}. - * - * @param record the record to diff - * @return the next builder state - */ - public static DiffCommand.RecordState diff(long record) { - return new DiffCommand.RecordState(record); - } - - /** - * Start building a {@code diff} {@link Command} for the specified - * {@code key}. - * - * @param key the key to diff - * @return the next builder state - */ - public static DiffCommand.KeyState diff(String key) { - return new DiffCommand.KeyState(key); - } - - /** - * Start building an {@code audit} {@link Command} for the specified - * {@code record}. - * - * @param record the record to audit - * @return the next builder state - */ - public static AuditCommand.RecordState audit(long record) { - return new AuditCommand.RecordState(record); - } - - /** - * Start building an {@code audit} {@link Command} for the specified - * {@code key}. - * - * @param key the key to audit - * @return the next builder state - */ - public static AuditCommand.KeyState audit(String key) { - return new AuditCommand.KeyState(key); - } - - /** - * Start building a {@code revert} {@link Command} for the specified - * {@code key}. - * - * @param key the key to revert - * @return the next builder state - */ - public static RevertCommand.KeyState revert(String key) { - return new RevertCommand.KeyState(key); - } - - /** - * Start building a {@code revert} {@link Command} for the specified - * {@code keys}. - * - * @param key the first key to revert - * @param moreKeys additional keys - * @return the next builder state - */ - public static RevertCommand.KeyState revert(String key, - String... moreKeys) { - return new RevertCommand.KeyState(key, moreKeys); - } - - /** - * Start building a {@code reconcile} {@link Command} for the specified - * {@code key}. - * - * @param key the key to reconcile - * @return the next builder state - */ - public static ReconcileCommand.KeyState reconcile(String key) { - return new ReconcileCommand.KeyState(key); - } - - /** - * Return a {@code consolidate} {@link Command} that merges the specified - * records into the {@code first}. - * - * @param first the target record - * @param second the first record to merge - * @param remaining additional records to merge - * @return the {@link Command} - */ - public static ConsolidateCommand.State consolidate(long first, long second, - long... remaining) { - return new ConsolidateCommand.State(first, second, remaining); - } - - /** - * Start building a {@code calculate} {@link Command} with the specified - * aggregation {@code function} and {@code key}. - * - * @param function the calculation function (e.g., sum, avg) - * @param key the key to calculate - * @return the next builder state - */ - public static CalculateCommand.State calculate(String function, - String key) { - return new CalculateCommand.State(function, key); - } - - /** - * Return a {@code stage} {@link Command}. - * - * @return the {@link Command} - */ - public static Command stage() { - return new BuiltCommand("stage"); - } - - /** - * Return a {@code commit} {@link Command}. - * - * @return the {@link Command} - */ - public static Command commit() { - return new BuiltCommand("commit"); - } - - /** - * Return an {@code abort} {@link Command}. - * - * @return the {@link Command} - */ - public static Command abort() { - return new BuiltCommand("abort"); - } - - /** - * Return a {@code ping} {@link Command}. - * - * @return the {@link Command} - */ - public static Command ping() { - return new BuiltCommand("ping"); - } - - /** - * Return an {@code inventory} {@link Command}. - * - * @return the {@link Command} - */ - public static Command inventory() { - return new BuiltCommand("inventory"); - } - - /** - * Return a {@code time} {@link Command}. - * - * @return the {@link Command} - */ - public static Command time() { - return new BuiltCommand("time"); - } - - /** - * Return a {@code time} {@link Command} that resolves the given - * {@code phrase} to a timestamp. - * - * @param phrase the natural language time phrase - * @return the {@link Command} + * @return a {@link CommandBuilder} */ - public static Command time(String phrase) { - return new BuiltCommand("time " + phrase); + public static CommandBuilder go() { + return new CommandBuilder(); } } diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/CommandBuilder.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/CommandBuilder.java new file mode 100644 index 000000000..7b847fae2 --- /dev/null +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/CommandBuilder.java @@ -0,0 +1,687 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.lang.command; + +import com.cinchapi.concourse.lang.Criteria; + +/** + * A {@link CommandBuilder} provides the fluent factory methods for constructing + * {@link Command Commands}. Obtain an instance via {@link Command#to()}, + * {@link Command#is()}, or {@link Command#go()}. + *

    + * Each method returns a state object whose methods guide the caller through the + * valid parameter sequence for that command. Terminal states implement + * {@link Command}, so the result can be used directly without an explicit + * {@code build()} call. + *

    + * + * @author Jeff Nelson + */ +public final class CommandBuilder { + + CommandBuilder() {/* no-init */} + + /** + * Start building a {@code find} {@link Command} using the provided + * {@link Criteria}. + * + * @param criteria the {@link Criteria} to find + * @return the next builder state + */ + public FindCommand.ConditionState find(Criteria criteria) { + return new FindCommand.ConditionState(criteria, null); + } + + /** + * Start building a {@code find} {@link Command} using a raw CCL condition + * string. + * + * @param ccl the CCL condition + * @return the next builder state + */ + public FindCommand.ConditionState find(String ccl) { + return new FindCommand.ConditionState(null, ccl); + } + + /** + * Start building a {@code select} {@link Command} for the specified + * {@code key}. + * + * @param key the key to select + * @return the next builder state + */ + public SelectCommand.KeyState select(String key) { + return new SelectCommand.KeyState(key); + } + + /** + * Start building a {@code select} {@link Command} for the specified + * {@code keys}. + * + * @param key the first key to select + * @param moreKeys additional keys + * @return the next builder state + */ + public SelectCommand.KeyState select(String key, String... moreKeys) { + return new SelectCommand.KeyState(key, moreKeys); + } + + /** + * Return a {@code select} {@link Command} for all keys from the specified + * {@code record}. + * + * @param record the record to select from + * @return the next builder state + */ + public SelectCommand.SourceState select(long record) { + return select(record, new long[0]); + } + + /** + * Return a {@code select} {@link Command} for all keys from the specified + * {@code records}. + * + * @param record the first record + * @param moreRecords additional records + * @return the next builder state + */ + public SelectCommand.SourceState select(long record, long... moreRecords) { + return new SelectCommand.SourceState(null, + CclRenderer.collectRecords(record, moreRecords), null, null); + } + + /** + * Start building a {@code select} {@link Command} for all keys. + * + * @return the next builder state + */ + public SelectCommand.AllKeysState selectAll() { + return new SelectCommand.AllKeysState(); + } + + /** + * Start building a {@code get} {@link Command} for the specified + * {@code key}. + * + * @param key the key to get + * @return the next builder state + */ + public GetCommand.KeyState get(String key) { + return new GetCommand.KeyState(key); + } + + /** + * Start building a {@code get} {@link Command} for the specified + * {@code keys}. + * + * @param key the first key to get + * @param moreKeys additional keys + * @return the next builder state + */ + public GetCommand.KeyState get(String key, String... moreKeys) { + return new GetCommand.KeyState(key, moreKeys); + } + + /** + * Return a {@code get} {@link Command} for all keys from the specified + * {@code record}. + * + * @param record the record to get from + * @return the next builder state + */ + public GetCommand.SourceState get(long record) { + return get(record, new long[0]); + } + + /** + * Return a {@code get} {@link Command} for all keys from the specified + * {@code records}. + * + * @param record the first record + * @param moreRecords additional records + * @return the next builder state + */ + public GetCommand.SourceState get(long record, long... moreRecords) { + return new GetCommand.SourceState(null, + CclRenderer.collectRecords(record, moreRecords), null, null); + } + + /** + * Start building a {@code get} {@link Command} for all keys. + * + * @return the next builder state + */ + public GetCommand.AllKeysState getAll() { + return new GetCommand.AllKeysState(); + } + + /** + * Start building a {@code navigate} {@link Command} for the specified + * navigation {@code key}. + * + * @param key the key to navigate + * @return the next builder state + */ + public NavigateCommand.KeyState navigate(String key) { + return new NavigateCommand.KeyState(key); + } + + /** + * Start building a {@code navigate} {@link Command} for the specified + * navigation {@code keys}. + * + * @param key the first key to navigate + * @param moreKeys additional keys + * @return the next builder state + */ + public NavigateCommand.KeyState navigate(String key, String... moreKeys) { + return new NavigateCommand.KeyState(key, moreKeys); + } + + /** + * Start building an {@code add} {@link Command} for the specified + * {@code key}. + * + * @param key the key to add + * @return the next builder state + */ + public AddCommand.KeyState add(String key) { + return new AddCommand.KeyState(key); + } + + /** + * Start building a {@code set} {@link Command} for the specified + * {@code key}. + * + * @param key the key to set + * @return the next builder state + */ + public SetCommand.KeyState set(String key) { + return new SetCommand.KeyState(key); + } + + /** + * Start building a {@code remove} {@link Command} for the specified + * {@code key}. + * + * @param key the key to remove + * @return the next builder state + */ + public RemoveCommand.KeyState remove(String key) { + return new RemoveCommand.KeyState(key); + } + + /** + * Start building a {@code clear} {@link Command} for the specified + * {@code key}. + * + * @param key the key to clear + * @return the next builder state + */ + public ClearCommand.KeyState clear(String key) { + return new ClearCommand.KeyState(key); + } + + /** + * Start building a {@code clear} {@link Command} for the specified + * {@code keys}. + * + * @param key the first key to clear + * @param moreKeys additional keys + * @return the next builder state + */ + public ClearCommand.KeyState clear(String key, String... moreKeys) { + return new ClearCommand.KeyState(key, moreKeys); + } + + /** + * Return a {@code clear} {@link Command} for the specified {@code record}. + * + * @param record the record to clear + * @return the {@link Command} + */ + public ClearCommand.RecordState clear(long record) { + return new ClearCommand.RecordState(null, record); + } + + /** + * Return a {@code clear} {@link Command} for the specified {@code records}. + * + * @param record the first record to clear + * @param moreRecords additional records + * @return the {@link Command} + */ + public ClearCommand.RecordState clear(long record, long... moreRecords) { + return new ClearCommand.RecordState(null, record, moreRecords); + } + + /** + * Start building an {@code insert} {@link Command} with the provided JSON + * data. + * + * @param json the JSON string to insert + * @return the next builder state + */ + public InsertCommand.JsonState insert(String json) { + return new InsertCommand.JsonState(json); + } + + /** + * Start building a {@code link} {@link Command} for the specified + * {@code key}. + * + * @param key the link key + * @return the next builder state + */ + public LinkCommand.KeyState link(String key) { + return new LinkCommand.KeyState(key); + } + + /** + * Start building an {@code unlink} {@link Command} for the specified + * {@code key}. + * + * @param key the link key + * @return the next builder state + */ + public UnlinkCommand.KeyState unlink(String key) { + return new UnlinkCommand.KeyState(key); + } + + /** + * Start building a {@code verify} {@link Command} for the specified + * {@code key}. + * + * @param key the key to verify + * @return the next builder state + */ + public VerifyCommand.KeyState verify(String key) { + return new VerifyCommand.KeyState(key); + } + + /** + * Start building a {@code verifyAndSwap} {@link Command} for the specified + * {@code key}. + * + * @param key the key to verify and swap + * @return the next builder state + */ + public VerifyAndSwapCommand.KeyState verifyAndSwap(String key) { + return new VerifyAndSwapCommand.KeyState(key); + } + + /** + * Start building a {@code verifyOrSet} {@link Command} for the specified + * {@code key}. + * + * @param key the key to verify or set + * @return the next builder state + */ + public VerifyOrSetCommand.KeyState verifyOrSet(String key) { + return new VerifyOrSetCommand.KeyState(key); + } + + /** + * Start building a {@code findOrAdd} {@link Command} for the specified + * {@code key}. + * + * @param key the key to find or add + * @return the next builder state + */ + public FindOrAddCommand.KeyState findOrAdd(String key) { + return new FindOrAddCommand.KeyState(key); + } + + /** + * Start building a {@code findOrInsert} {@link Command} using the provided + * {@link Criteria}. + * + * @param criteria the {@link Criteria} to search + * @return the next builder state + */ + public FindOrInsertCommand.ConditionState findOrInsert(Criteria criteria) { + return new FindOrInsertCommand.ConditionState(criteria, null); + } + + /** + * Start building a {@code findOrInsert} {@link Command} using a raw CCL + * condition string. + * + * @param ccl the CCL condition + * @return the next builder state + */ + public FindOrInsertCommand.ConditionState findOrInsert(String ccl) { + return new FindOrInsertCommand.ConditionState(null, ccl); + } + + /** + * Start building a {@code search} {@link Command} for the specified + * {@code key}. + * + * @param key the key to search + * @return the next builder state + */ + public SearchCommand.KeyState search(String key) { + return new SearchCommand.KeyState(key); + } + + /** + * Start building a {@code browse} {@link Command} for the specified + * {@code key}. + * + * @param key the key to browse + * @return the next builder state + */ + public BrowseCommand.State browse(String key) { + return new BrowseCommand.State(key); + } + + /** + * Start building a {@code browse} {@link Command} for the specified + * {@code keys}. + * + * @param key the first key to browse + * @param moreKeys additional keys + * @return the next builder state + */ + public BrowseCommand.State browse(String key, String... moreKeys) { + return new BrowseCommand.State(key, moreKeys); + } + + /** + * Start building a {@code describe} {@link Command} for the specified + * {@code record}. + * + * @param record the record to describe + * @return the next builder state + */ + public DescribeCommand.State describe(long record) { + return new DescribeCommand.State(record); + } + + /** + * Start building a {@code describe} {@link Command} for the specified + * {@code records}. + * + * @param record the first record to describe + * @param moreRecords additional records + * @return the next builder state + */ + public DescribeCommand.State describe(long record, long... moreRecords) { + return new DescribeCommand.State(record, moreRecords); + } + + /** + * Start building a {@code describe} {@link Command} that describes all + * records, optionally at a historical + * {@link com.cinchapi.concourse.Timestamp Timestamp}. + * + * @return the next builder state + */ + public DescribeCommand.AllState describeAll() { + return new DescribeCommand.AllState(); + } + + /** + * Start building a {@code trace} {@link Command} for the specified + * {@code record}. + * + * @param record the record to trace + * @return the next builder state + */ + public TraceCommand.State trace(long record) { + return new TraceCommand.State(record); + } + + /** + * Start building a {@code trace} {@link Command} for the specified + * {@code records}. + * + * @param record the first record to trace + * @param moreRecords additional records + * @return the next builder state + */ + public TraceCommand.State trace(long record, long... moreRecords) { + return new TraceCommand.State(record, moreRecords); + } + + /** + * Start building a {@code holds} {@link Command} for the specified + * {@code record}. + * + * @param record the record to check + * @return the next builder state + */ + public HoldsCommand.State holds(long record) { + return new HoldsCommand.State(record); + } + + /** + * Start building a {@code holds} {@link Command} for the specified + * {@code records}. + * + * @param record the first record to check + * @param moreRecords additional records + * @return the next builder state + */ + public HoldsCommand.State holds(long record, long... moreRecords) { + return new HoldsCommand.State(record, moreRecords); + } + + /** + * Start building a {@code jsonify} {@link Command} for the specified + * {@code record}. + * + * @param record the record to jsonify + * @return the next builder state + */ + public JsonifyCommand.State jsonify(long record) { + return new JsonifyCommand.State(record); + } + + /** + * Start building a {@code jsonify} {@link Command} for the specified + * {@code records}. + * + * @param record the first record to jsonify + * @param moreRecords additional records + * @return the next builder state + */ + public JsonifyCommand.State jsonify(long record, long... moreRecords) { + return new JsonifyCommand.State(record, moreRecords); + } + + /** + * Start building a {@code chronicle} {@link Command} for the specified + * {@code key}. + * + * @param key the key to chronicle + * @return the next builder state + */ + public ChronicleCommand.KeyState chronicle(String key) { + return new ChronicleCommand.KeyState(key); + } + + /** + * Start building a {@code diff} {@link Command} for the specified + * {@code record}. + * + * @param record the record to diff + * @return the next builder state + */ + public DiffCommand.RecordState diff(long record) { + return new DiffCommand.RecordState(record); + } + + /** + * Start building a {@code diff} {@link Command} for the specified + * {@code key}. + * + * @param key the key to diff + * @return the next builder state + */ + public DiffCommand.KeyState diff(String key) { + return new DiffCommand.KeyState(key); + } + + /** + * Start building an {@code audit} {@link Command} for the specified + * {@code record}. + * + * @param record the record to audit + * @return the next builder state + */ + public AuditCommand.RecordState audit(long record) { + return new AuditCommand.RecordState(record); + } + + /** + * Start building an {@code audit} {@link Command} for the specified + * {@code key}. + * + * @param key the key to audit + * @return the next builder state + */ + public AuditCommand.KeyState audit(String key) { + return new AuditCommand.KeyState(key); + } + + /** + * Start building a {@code revert} {@link Command} for the specified + * {@code key}. + * + * @param key the key to revert + * @return the next builder state + */ + public RevertCommand.KeyState revert(String key) { + return new RevertCommand.KeyState(key); + } + + /** + * Start building a {@code revert} {@link Command} for the specified + * {@code keys}. + * + * @param key the first key to revert + * @param moreKeys additional keys + * @return the next builder state + */ + public RevertCommand.KeyState revert(String key, String... moreKeys) { + return new RevertCommand.KeyState(key, moreKeys); + } + + /** + * Start building a {@code reconcile} {@link Command} for the specified + * {@code key}. + * + * @param key the key to reconcile + * @return the next builder state + */ + public ReconcileCommand.KeyState reconcile(String key) { + return new ReconcileCommand.KeyState(key); + } + + /** + * Return a {@code consolidate} {@link Command} that merges the specified + * records into the {@code first}. + * + * @param first the target record + * @param second the first record to merge + * @param remaining additional records to merge + * @return the {@link Command} + */ + public ConsolidateCommand.State consolidate(long first, long second, + long... remaining) { + return new ConsolidateCommand.State(first, second, remaining); + } + + /** + * Start building a {@code calculate} {@link Command} with the specified + * aggregation {@code function} and {@code key}. + * + * @param function the calculation function (e.g., sum, avg) + * @param key the key to calculate + * @return the next builder state + */ + public CalculateCommand.State calculate(String function, String key) { + return new CalculateCommand.State(function, key); + } + + /** + * Return a {@code stage} {@link Command}. + * + * @return the {@link Command} + */ + public Command stage() { + return new BuiltCommand("stage"); + } + + /** + * Return a {@code commit} {@link Command}. + * + * @return the {@link Command} + */ + public Command commit() { + return new BuiltCommand("commit"); + } + + /** + * Return an {@code abort} {@link Command}. + * + * @return the {@link Command} + */ + public Command abort() { + return new BuiltCommand("abort"); + } + + /** + * Return a {@code ping} {@link Command}. + * + * @return the {@link Command} + */ + public Command ping() { + return new BuiltCommand("ping"); + } + + /** + * Return an {@code inventory} {@link Command}. + * + * @return the {@link Command} + */ + public Command inventory() { + return new BuiltCommand("inventory"); + } + + /** + * Return a {@code time} {@link Command}. + * + * @return the {@link Command} + */ + public Command time() { + return new BuiltCommand("time"); + } + + /** + * Return a {@code time} {@link Command} that resolves the given + * {@code phrase} to a timestamp. + * + * @param phrase the natural language time phrase + * @return the {@link Command} + */ + public Command time(String phrase) { + return new BuiltCommand("time " + phrase); + } + +} diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/CommandGroup.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/CommandGroup.java index 120f594b0..434c19ca9 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/CommandGroup.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/CommandGroup.java @@ -31,9 +31,9 @@ public interface CommandGroup { /** - * Return the collected {@link Command Commands}. + * Return the accumulated {@link Command Commands}. * - * @return the {@link Command Commands} + * @return an unmodifiable list of {@link Command Commands} */ List commands(); @@ -746,6 +746,10 @@ void verifyAndSwap(String key, Object expected, long record, void consolidate(List records); + void exec(String ccl); + + void submit(String ccl); + void ping(); void sum(String key, long record); diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/DefaultCommandGroup.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/DefaultCommandGroup.java index 34504709e..45de3c309 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/DefaultCommandGroup.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/DefaultCommandGroup.java @@ -44,11 +44,7 @@ public class DefaultCommandGroup implements CommandGroup { */ private final List commands = Lists.newArrayList(); - /** - * Return an unmodifiable view of the collected {@link Command Commands}. - * - * @return the {@link Command Commands} - */ + @Override public List commands() { return Collections.unmodifiableList(commands); } @@ -99,181 +95,185 @@ private static String[] restKeys(List keys) { @Override public void abort() { - commands.add(Command.abort()); + commands.add(Command.to().abort()); } @Override public void add(String key, Object value) { - commands.add(Command.add(key).as(value)); + commands.add(Command.to().add(key).as(value)); } @Override public void add(String key, Object value, long record) { - commands.add(Command.add(key).as(value).in(record)); + commands.add(Command.to().add(key).as(value).in(record)); } @Override public void add(String key, Object value, List records) { for (long record : records) { - commands.add(Command.add(key).as(value).in(record)); + commands.add(Command.to().add(key).as(value).in(record)); } } @Override public void audit(long record) { - commands.add(Command.audit(record)); + commands.add(Command.to().audit(record)); } @Override public void audit(long record, long start) { - commands.add(Command.audit(record).at(Timestamp.fromMicros(start))); + commands.add( + Command.to().audit(record).at(Timestamp.fromMicros(start))); } @Override public void audit(long record, String start) { - commands.add(Command.audit(record).at(Timestamp.fromString(start))); + commands.add( + Command.to().audit(record).at(Timestamp.fromString(start))); } @Override public void audit(long record, long start, long tend) { - commands.add(Command.audit(record).at(Timestamp.fromMicros(start)) + commands.add(Command.to().audit(record).at(Timestamp.fromMicros(start)) .at(Timestamp.fromMicros(tend))); } @Override public void audit(long record, String start, String tend) { - commands.add(Command.audit(record).at(Timestamp.fromString(start)) + commands.add(Command.to().audit(record).at(Timestamp.fromString(start)) .at(Timestamp.fromString(tend))); } @Override public void audit(String key, long record) { - commands.add(Command.audit(key).in(record)); + commands.add(Command.to().audit(key).in(record)); } @Override public void audit(String key, long record, long start) { - commands.add( - Command.audit(key).in(record).at(Timestamp.fromMicros(start))); + commands.add(Command.to().audit(key).in(record) + .at(Timestamp.fromMicros(start))); } @Override public void audit(String key, long record, String start) { - commands.add( - Command.audit(key).in(record).at(Timestamp.fromString(start))); + commands.add(Command.to().audit(key).in(record) + .at(Timestamp.fromString(start))); } @Override public void audit(String key, long record, long start, long tend) { - commands.add( - Command.audit(key).in(record).at(Timestamp.fromMicros(start)) - .at(Timestamp.fromMicros(tend))); + commands.add(Command.to().audit(key).in(record) + .at(Timestamp.fromMicros(start)) + .at(Timestamp.fromMicros(tend))); } @Override public void audit(String key, long record, String start, String tend) { - commands.add( - Command.audit(key).in(record).at(Timestamp.fromString(start)) - .at(Timestamp.fromString(tend))); + commands.add(Command.to().audit(key).in(record) + .at(Timestamp.fromString(start)) + .at(Timestamp.fromString(tend))); } @Override public void browse(String key) { - commands.add(Command.browse(key)); + commands.add(Command.to().browse(key)); } @Override public void browse(List keys) { for (String key : keys) { - commands.add(Command.browse(key)); + commands.add(Command.to().browse(key)); } } @Override public void browse(String key, long timestamp) { - commands.add(Command.browse(key).at(Timestamp.fromMicros(timestamp))); + commands.add( + Command.to().browse(key).at(Timestamp.fromMicros(timestamp))); } @Override public void browse(String key, String timestamp) { - commands.add(Command.browse(key).at(Timestamp.fromString(timestamp))); + commands.add( + Command.to().browse(key).at(Timestamp.fromString(timestamp))); } @Override public void browse(List keys, long timestamp) { for (String key : keys) { - commands.add( - Command.browse(key).at(Timestamp.fromMicros(timestamp))); + commands.add(Command.to().browse(key) + .at(Timestamp.fromMicros(timestamp))); } } @Override public void browse(List keys, String timestamp) { for (String key : keys) { - commands.add( - Command.browse(key).at(Timestamp.fromString(timestamp))); + commands.add(Command.to().browse(key) + .at(Timestamp.fromString(timestamp))); } } @Override public void chronicle(String key, long record) { - commands.add(Command.chronicle(key).in(record)); + commands.add(Command.to().chronicle(key).in(record)); } @Override public void chronicle(String key, long record, long start) { - commands.add(Command.chronicle(key).in(record) + commands.add(Command.to().chronicle(key).in(record) .at(Timestamp.fromMicros(start))); } @Override public void chronicle(String key, long record, String start) { - commands.add(Command.chronicle(key).in(record) + commands.add(Command.to().chronicle(key).in(record) .at(Timestamp.fromString(start))); } @Override public void chronicle(String key, long record, long start, long tend) { - commands.add(Command.chronicle(key).in(record) + commands.add(Command.to().chronicle(key).in(record) .at(Timestamp.fromMicros(start)) .at(Timestamp.fromMicros(tend))); } @Override public void chronicle(String key, long record, String start, String tend) { - commands.add(Command.chronicle(key).in(record) + commands.add(Command.to().chronicle(key).in(record) .at(Timestamp.fromString(start)) .at(Timestamp.fromString(tend))); } @Override public void clear(long record) { - commands.add(Command.clear(record)); + commands.add(Command.to().clear(record)); } @Override public void clear(List records) { for (long record : records) { - commands.add(Command.clear(record)); + commands.add(Command.to().clear(record)); } } @Override public void clear(String key, long record) { - commands.add(Command.clear(key).from(record)); + commands.add(Command.to().clear(key).from(record)); } @Override public void clear(List keys, long record) { for (String key : keys) { - commands.add(Command.clear(key).from(record)); + commands.add(Command.to().clear(key).from(record)); } } @Override public void clear(String key, List records) { for (long record : records) { - commands.add(Command.clear(key).from(record)); + commands.add(Command.to().clear(key).from(record)); } } @@ -281,54 +281,56 @@ public void clear(String key, List records) { public void clear(List keys, List records) { for (String key : keys) { for (long record : records) { - commands.add(Command.clear(key).from(record)); + commands.add(Command.to().clear(key).from(record)); } } } @Override public void commit() { - commands.add(Command.commit()); + commands.add(Command.to().commit()); } @Override public void describe() { - commands.add(Command.describeAll()); + commands.add(Command.to().describeAll()); } @Override public void describe(long timestamp) { - commands.add(Command.describeAll().at(Timestamp.fromMicros(timestamp))); + commands.add( + Command.to().describeAll().at(Timestamp.fromMicros(timestamp))); } @Override public void describe(String timestamp) { - commands.add(Command.describeAll().at(Timestamp.fromString(timestamp))); + commands.add( + Command.to().describeAll().at(Timestamp.fromString(timestamp))); } @Override public void describe(long record, long timestamp) { - commands.add( - Command.describe(record).at(Timestamp.fromMicros(timestamp))); + commands.add(Command.to().describe(record) + .at(Timestamp.fromMicros(timestamp))); } @Override public void describe(long record, String timestamp) { - commands.add( - Command.describe(record).at(Timestamp.fromString(timestamp))); + commands.add(Command.to().describe(record) + .at(Timestamp.fromString(timestamp))); } @Override public void describe(List records) { for (long record : records) { - commands.add(Command.describe(record)); + commands.add(Command.to().describe(record)); } } @Override public void describe(List records, long timestamp) { for (long record : records) { - commands.add(Command.describe(record) + commands.add(Command.to().describe(record) .at(Timestamp.fromMicros(timestamp))); } } @@ -336,112 +338,112 @@ public void describe(List records, long timestamp) { @Override public void describe(List records, String timestamp) { for (long record : records) { - commands.add(Command.describe(record) + commands.add(Command.to().describe(record) .at(Timestamp.fromString(timestamp))); } } @Override public void diff(long record, long start) { - commands.add(Command.diff(record).at(Timestamp.fromMicros(start))); + commands.add(Command.to().diff(record).at(Timestamp.fromMicros(start))); } @Override public void diff(long record, String start) { - commands.add(Command.diff(record).at(Timestamp.fromString(start))); + commands.add(Command.to().diff(record).at(Timestamp.fromString(start))); } @Override public void diff(long record, long start, long tend) { - commands.add(Command.diff(record).at(Timestamp.fromMicros(start)) + commands.add(Command.to().diff(record).at(Timestamp.fromMicros(start)) .at(Timestamp.fromMicros(tend))); } @Override public void diff(long record, String start, String tend) { - commands.add(Command.diff(record).at(Timestamp.fromString(start)) + commands.add(Command.to().diff(record).at(Timestamp.fromString(start)) .at(Timestamp.fromString(tend))); } @Override public void diff(String key, long record, long start) { - commands.add( - Command.diff(key).in(record).at(Timestamp.fromMicros(start))); + commands.add(Command.to().diff(key).in(record) + .at(Timestamp.fromMicros(start))); } @Override public void diff(String key, long record, String start) { - commands.add( - Command.diff(key).in(record).at(Timestamp.fromString(start))); + commands.add(Command.to().diff(key).in(record) + .at(Timestamp.fromString(start))); } @Override public void diff(String key, long record, long start, long tend) { - commands.add( - Command.diff(key).in(record).at(Timestamp.fromMicros(start)) - .at(Timestamp.fromMicros(tend))); + commands.add(Command.to().diff(key).in(record) + .at(Timestamp.fromMicros(start)) + .at(Timestamp.fromMicros(tend))); } @Override public void diff(String key, long record, String start, String tend) { - commands.add( - Command.diff(key).in(record).at(Timestamp.fromString(start)) - .at(Timestamp.fromString(tend))); + commands.add(Command.to().diff(key).in(record) + .at(Timestamp.fromString(start)) + .at(Timestamp.fromString(tend))); } @Override public void diff(String key, long start) { - commands.add(Command.diff(key).at(Timestamp.fromMicros(start))); + commands.add(Command.to().diff(key).at(Timestamp.fromMicros(start))); } @Override public void diff(String key, String start) { - commands.add(Command.diff(key).at(Timestamp.fromString(start))); + commands.add(Command.to().diff(key).at(Timestamp.fromString(start))); } @Override public void diff(String key, String start, String tend) { - commands.add(Command.diff(key).at(Timestamp.fromString(start)) + commands.add(Command.to().diff(key).at(Timestamp.fromString(start)) .at(Timestamp.fromString(tend))); } @Override public void stage() { - commands.add(Command.stage()); + commands.add(Command.to().stage()); } @Override public void insert(String json) { - commands.add(Command.insert(json)); + commands.add(Command.to().insert(json)); } @Override public void insert(String json, long record) { - commands.add(Command.insert(json).in(record)); + commands.add(Command.to().insert(json).in(record)); } @Override public void insert(String json, List records) { for (long record : records) { - commands.add(Command.insert(json).in(record)); + commands.add(Command.to().insert(json).in(record)); } } @Override public void remove(String key, Object value, long record) { - commands.add(Command.remove(key).as(value).from(record)); + commands.add(Command.to().remove(key).as(value).from(record)); } @Override public void remove(String key, Object value, List records) { for (long record : records) { - commands.add(Command.remove(key).as(value).from(record)); + commands.add(Command.to().remove(key).as(value).from(record)); } } @Override public void set(String key, Object value, long record) { - commands.add(Command.set(key).as(value).in(record)); + commands.add(Command.to().set(key).as(value).in(record)); } @Override @@ -453,7 +455,7 @@ public void set(String key, Object value) { @Override public void set(String key, Object value, List records) { for (long record : records) { - commands.add(Command.set(key).as(value).in(record)); + commands.add(Command.to().set(key).as(value).in(record)); } } @@ -464,76 +466,77 @@ public void reconcile(String key, long record, Set values) { Object first = array[0]; Object[] rest = new Object[array.length - 1]; System.arraycopy(array, 1, rest, 0, rest.length); - commands.add(Command.reconcile(key).in(record).with(first, rest)); + commands.add( + Command.to().reconcile(key).in(record).with(first, rest)); } } @Override public void inventory() { - commands.add(Command.inventory()); + commands.add(Command.to().inventory()); } // -- select methods -- @Override public void select(long record) { - commands.add(Command.select(record)); + commands.add(Command.to().select(record)); } @Override public void select(List records) { - commands.add(Command.selectAll().from(firstRecord(records), + commands.add(Command.to().selectAll().from(firstRecord(records), restRecords(records))); } @Override public void select(List records, Page page) { - commands.add(Command.selectAll() + commands.add(Command.to().selectAll() .from(firstRecord(records), restRecords(records)).page(page)); } @Override public void select(List records, Order order) { - commands.add(Command.selectAll() + commands.add(Command.to().selectAll() .from(firstRecord(records), restRecords(records)).order(order)); } @Override public void select(List records, Order order, Page page) { - commands.add(Command.selectAll() + commands.add(Command.to().selectAll() .from(firstRecord(records), restRecords(records)).order(order) .page(page)); } @Override public void select(long record, long timestamp) { - commands.add( - Command.select(record).at(Timestamp.fromMicros(timestamp))); + commands.add(Command.to().select(record) + .at(Timestamp.fromMicros(timestamp))); } @Override public void select(long record, String timestamp) { - commands.add( - Command.select(record).at(Timestamp.fromString(timestamp))); + commands.add(Command.to().select(record) + .at(Timestamp.fromString(timestamp))); } @Override public void select(List records, long timestamp) { - commands.add(Command.selectAll() + commands.add(Command.to().selectAll() .from(firstRecord(records), restRecords(records)) .at(Timestamp.fromMicros(timestamp))); } @Override public void select(List records, long timestamp, Page page) { - commands.add(Command.selectAll() + commands.add(Command.to().selectAll() .from(firstRecord(records), restRecords(records)) .at(Timestamp.fromMicros(timestamp)).page(page)); } @Override public void select(List records, long timestamp, Order order) { - commands.add(Command.selectAll() + commands.add(Command.to().selectAll() .from(firstRecord(records), restRecords(records)) .at(Timestamp.fromMicros(timestamp)).order(order)); } @@ -541,28 +544,28 @@ public void select(List records, long timestamp, Order order) { @Override public void select(List records, long timestamp, Order order, Page page) { - commands.add(Command.selectAll() + commands.add(Command.to().selectAll() .from(firstRecord(records), restRecords(records)) .at(Timestamp.fromMicros(timestamp)).order(order).page(page)); } @Override public void select(List records, String timestamp) { - commands.add(Command.selectAll() + commands.add(Command.to().selectAll() .from(firstRecord(records), restRecords(records)) .at(Timestamp.fromString(timestamp))); } @Override public void select(List records, String timestamp, Page page) { - commands.add(Command.selectAll() + commands.add(Command.to().selectAll() .from(firstRecord(records), restRecords(records)) .at(Timestamp.fromString(timestamp)).page(page)); } @Override public void select(List records, String timestamp, Order order) { - commands.add(Command.selectAll() + commands.add(Command.to().selectAll() .from(firstRecord(records), restRecords(records)) .at(Timestamp.fromString(timestamp)).order(order)); } @@ -570,94 +573,94 @@ public void select(List records, String timestamp, Order order) { @Override public void select(List records, String timestamp, Order order, Page page) { - commands.add(Command.selectAll() + commands.add(Command.to().selectAll() .from(firstRecord(records), restRecords(records)) .at(Timestamp.fromString(timestamp)).order(order).page(page)); } @Override public void select(String key, long record) { - commands.add(Command.select(key).from(record)); + commands.add(Command.to().select(key).from(record)); } @Override public void select(String key, long record, long timestamp) { - commands.add(Command.select(key).from(record) + commands.add(Command.to().select(key).from(record) .at(Timestamp.fromMicros(timestamp))); } @Override public void select(String key, long record, String timestamp) { - commands.add(Command.select(key).from(record) + commands.add(Command.to().select(key).from(record) .at(Timestamp.fromString(timestamp))); } @Override public void select(List keys, long record, long timestamp) { - commands.add(Command.select(firstKey(keys), restKeys(keys)).from(record) - .at(Timestamp.fromMicros(timestamp))); + commands.add(Command.to().select(firstKey(keys), restKeys(keys)) + .from(record).at(Timestamp.fromMicros(timestamp))); } @Override public void select(List keys, long record, String timestamp) { - commands.add(Command.select(firstKey(keys), restKeys(keys)).from(record) - .at(Timestamp.fromString(timestamp))); + commands.add(Command.to().select(firstKey(keys), restKeys(keys)) + .from(record).at(Timestamp.fromString(timestamp))); } @Override public void select(List keys, List records) { - commands.add(Command.select(firstKey(keys), restKeys(keys)) + commands.add(Command.to().select(firstKey(keys), restKeys(keys)) .from(firstRecord(records), restRecords(records))); } @Override public void select(List keys, List records, Page page) { - commands.add(Command.select(firstKey(keys), restKeys(keys)) + commands.add(Command.to().select(firstKey(keys), restKeys(keys)) .from(firstRecord(records), restRecords(records)).page(page)); } @Override public void select(List keys, List records, Order order) { - commands.add(Command.select(firstKey(keys), restKeys(keys)) + commands.add(Command.to().select(firstKey(keys), restKeys(keys)) .from(firstRecord(records), restRecords(records)).order(order)); } @Override public void select(List keys, List records, Order order, Page page) { - commands.add(Command.select(firstKey(keys), restKeys(keys)) + commands.add(Command.to().select(firstKey(keys), restKeys(keys)) .from(firstRecord(records), restRecords(records)).order(order) .page(page)); } @Override public void select(String key, List records) { - commands.add(Command.select(key).from(firstRecord(records), + commands.add(Command.to().select(key).from(firstRecord(records), restRecords(records))); } @Override public void select(String key, List records, Page page) { - commands.add(Command.select(key) + commands.add(Command.to().select(key) .from(firstRecord(records), restRecords(records)).page(page)); } @Override public void select(String key, List records, Order order) { - commands.add(Command.select(key) + commands.add(Command.to().select(key) .from(firstRecord(records), restRecords(records)).order(order)); } @Override public void select(String key, List records, Order order, Page page) { - commands.add(Command.select(key) + commands.add(Command.to().select(key) .from(firstRecord(records), restRecords(records)).order(order) .page(page)); } @Override public void select(String key, List records, long timestamp) { - commands.add(Command.select(key) + commands.add(Command.to().select(key) .from(firstRecord(records), restRecords(records)) .at(Timestamp.fromMicros(timestamp))); } @@ -665,7 +668,7 @@ public void select(String key, List records, long timestamp) { @Override public void select(String key, List records, long timestamp, Page page) { - commands.add(Command.select(key) + commands.add(Command.to().select(key) .from(firstRecord(records), restRecords(records)) .at(Timestamp.fromMicros(timestamp)).page(page)); } @@ -673,7 +676,7 @@ public void select(String key, List records, long timestamp, @Override public void select(String key, List records, long timestamp, Order order) { - commands.add(Command.select(key) + commands.add(Command.to().select(key) .from(firstRecord(records), restRecords(records)) .at(Timestamp.fromMicros(timestamp)).order(order)); } @@ -681,14 +684,14 @@ public void select(String key, List records, long timestamp, @Override public void select(String key, List records, long timestamp, Order order, Page page) { - commands.add(Command.select(key) + commands.add(Command.to().select(key) .from(firstRecord(records), restRecords(records)) .at(Timestamp.fromMicros(timestamp)).order(order).page(page)); } @Override public void select(String key, List records, String timestamp) { - commands.add(Command.select(key) + commands.add(Command.to().select(key) .from(firstRecord(records), restRecords(records)) .at(Timestamp.fromString(timestamp))); } @@ -696,7 +699,7 @@ public void select(String key, List records, String timestamp) { @Override public void select(String key, List records, String timestamp, Page page) { - commands.add(Command.select(key) + commands.add(Command.to().select(key) .from(firstRecord(records), restRecords(records)) .at(Timestamp.fromString(timestamp)).page(page)); } @@ -704,7 +707,7 @@ public void select(String key, List records, String timestamp, @Override public void select(String key, List records, String timestamp, Order order) { - commands.add(Command.select(key) + commands.add(Command.to().select(key) .from(firstRecord(records), restRecords(records)) .at(Timestamp.fromString(timestamp)).order(order)); } @@ -712,14 +715,14 @@ public void select(String key, List records, String timestamp, @Override public void select(String key, List records, String timestamp, Order order, Page page) { - commands.add(Command.select(key) + commands.add(Command.to().select(key) .from(firstRecord(records), restRecords(records)) .at(Timestamp.fromString(timestamp)).order(order).page(page)); } @Override public void select(List keys, List records, long timestamp) { - commands.add(Command.select(firstKey(keys), restKeys(keys)) + commands.add(Command.to().select(firstKey(keys), restKeys(keys)) .from(firstRecord(records), restRecords(records)) .at(Timestamp.fromMicros(timestamp))); } @@ -727,7 +730,7 @@ public void select(List keys, List records, long timestamp) { @Override public void select(List keys, List records, long timestamp, Page page) { - commands.add(Command.select(firstKey(keys), restKeys(keys)) + commands.add(Command.to().select(firstKey(keys), restKeys(keys)) .from(firstRecord(records), restRecords(records)) .at(Timestamp.fromMicros(timestamp)).page(page)); } @@ -735,7 +738,7 @@ public void select(List keys, List records, long timestamp, @Override public void select(List keys, List records, long timestamp, Order order) { - commands.add(Command.select(firstKey(keys), restKeys(keys)) + commands.add(Command.to().select(firstKey(keys), restKeys(keys)) .from(firstRecord(records), restRecords(records)) .at(Timestamp.fromMicros(timestamp)).order(order)); } @@ -743,7 +746,7 @@ public void select(List keys, List records, long timestamp, @Override public void select(List keys, List records, long timestamp, Order order, Page page) { - commands.add(Command.select(firstKey(keys), restKeys(keys)) + commands.add(Command.to().select(firstKey(keys), restKeys(keys)) .from(firstRecord(records), restRecords(records)) .at(Timestamp.fromMicros(timestamp)).order(order).page(page)); } @@ -751,7 +754,7 @@ public void select(List keys, List records, long timestamp, @Override public void select(List keys, List records, String timestamp) { - commands.add(Command.select(firstKey(keys), restKeys(keys)) + commands.add(Command.to().select(firstKey(keys), restKeys(keys)) .from(firstRecord(records), restRecords(records)) .at(Timestamp.fromString(timestamp))); } @@ -759,7 +762,7 @@ public void select(List keys, List records, @Override public void select(List keys, List records, String timestamp, Page page) { - commands.add(Command.select(firstKey(keys), restKeys(keys)) + commands.add(Command.to().select(firstKey(keys), restKeys(keys)) .from(firstRecord(records), restRecords(records)) .at(Timestamp.fromString(timestamp)).page(page)); } @@ -767,7 +770,7 @@ public void select(List keys, List records, String timestamp, @Override public void select(List keys, List records, String timestamp, Order order) { - commands.add(Command.select(firstKey(keys), restKeys(keys)) + commands.add(Command.to().select(firstKey(keys), restKeys(keys)) .from(firstRecord(records), restRecords(records)) .at(Timestamp.fromString(timestamp)).order(order)); } @@ -775,505 +778,509 @@ public void select(List keys, List records, String timestamp, @Override public void select(List keys, List records, String timestamp, Order order, Page page) { - commands.add(Command.select(firstKey(keys), restKeys(keys)) + commands.add(Command.to().select(firstKey(keys), restKeys(keys)) .from(firstRecord(records), restRecords(records)) .at(Timestamp.fromString(timestamp)).order(order).page(page)); } @Override public void select(Criteria criteria) { - commands.add(Command.selectAll().where(criteria)); + commands.add(Command.to().selectAll().where(criteria)); } @Override public void select(Criteria criteria, Page page) { - commands.add(Command.selectAll().where(criteria).page(page)); + commands.add(Command.to().selectAll().where(criteria).page(page)); } @Override public void select(Criteria criteria, Order order) { - commands.add(Command.selectAll().where(criteria).order(order)); + commands.add(Command.to().selectAll().where(criteria).order(order)); } @Override public void select(Criteria criteria, Order order, Page page) { - commands.add( - Command.selectAll().where(criteria).order(order).page(page)); + commands.add(Command.to().selectAll().where(criteria).order(order) + .page(page)); } @Override public void select(String ccl) { - commands.add(Command.selectAll().where(ccl)); + commands.add(Command.to().selectAll().where(ccl)); } @Override public void select(String ccl, Page page) { - commands.add(Command.selectAll().where(ccl).page(page)); + commands.add(Command.to().selectAll().where(ccl).page(page)); } @Override public void select(String ccl, Order order) { - commands.add(Command.selectAll().where(ccl).order(order)); + commands.add(Command.to().selectAll().where(ccl).order(order)); } @Override public void select(String ccl, Order order, Page page) { - commands.add(Command.selectAll().where(ccl).order(order).page(page)); + commands.add( + Command.to().selectAll().where(ccl).order(order).page(page)); } @Override public void select(Criteria criteria, long timestamp) { - commands.add(Command.selectAll().where(criteria) + commands.add(Command.to().selectAll().where(criteria) .at(Timestamp.fromMicros(timestamp))); } @Override public void select(Criteria criteria, long timestamp, Page page) { - commands.add(Command.selectAll().where(criteria) + commands.add(Command.to().selectAll().where(criteria) .at(Timestamp.fromMicros(timestamp)).page(page)); } @Override public void select(Criteria criteria, long timestamp, Order order) { - commands.add(Command.selectAll().where(criteria) + commands.add(Command.to().selectAll().where(criteria) .at(Timestamp.fromMicros(timestamp)).order(order)); } @Override public void select(Criteria criteria, long timestamp, Order order, Page page) { - commands.add(Command.selectAll().where(criteria) + commands.add(Command.to().selectAll().where(criteria) .at(Timestamp.fromMicros(timestamp)).order(order).page(page)); } @Override public void select(Criteria criteria, String timestamp) { - commands.add(Command.selectAll().where(criteria) + commands.add(Command.to().selectAll().where(criteria) .at(Timestamp.fromString(timestamp))); } @Override public void select(Criteria criteria, String timestamp, Page page) { - commands.add(Command.selectAll().where(criteria) + commands.add(Command.to().selectAll().where(criteria) .at(Timestamp.fromString(timestamp)).page(page)); } @Override public void select(Criteria criteria, String timestamp, Order order) { - commands.add(Command.selectAll().where(criteria) + commands.add(Command.to().selectAll().where(criteria) .at(Timestamp.fromString(timestamp)).order(order)); } @Override public void select(Criteria criteria, String timestamp, Order order, Page page) { - commands.add(Command.selectAll().where(criteria) + commands.add(Command.to().selectAll().where(criteria) .at(Timestamp.fromString(timestamp)).order(order).page(page)); } @Override public void select(String ccl, long timestamp, Page page) { - commands.add(Command.selectAll().where(ccl) + commands.add(Command.to().selectAll().where(ccl) .at(Timestamp.fromMicros(timestamp)).page(page)); } @Override public void select(String ccl, long timestamp, Order order) { - commands.add(Command.selectAll().where(ccl) + commands.add(Command.to().selectAll().where(ccl) .at(Timestamp.fromMicros(timestamp)).order(order)); } @Override public void select(String ccl, long timestamp, Order order, Page page) { - commands.add(Command.selectAll().where(ccl) + commands.add(Command.to().selectAll().where(ccl) .at(Timestamp.fromMicros(timestamp)).order(order).page(page)); } @Override public void select(String ccl, String timestamp) { - commands.add(Command.selectAll().where(ccl) + commands.add(Command.to().selectAll().where(ccl) .at(Timestamp.fromString(timestamp))); } @Override public void select(String ccl, String timestamp, Page page) { - commands.add(Command.selectAll().where(ccl) + commands.add(Command.to().selectAll().where(ccl) .at(Timestamp.fromString(timestamp)).page(page)); } @Override public void select(String ccl, String timestamp, Order order) { - commands.add(Command.selectAll().where(ccl) + commands.add(Command.to().selectAll().where(ccl) .at(Timestamp.fromString(timestamp)).order(order)); } @Override public void select(String ccl, String timestamp, Order order, Page page) { - commands.add(Command.selectAll().where(ccl) + commands.add(Command.to().selectAll().where(ccl) .at(Timestamp.fromString(timestamp)).order(order).page(page)); } @Override public void select(String key, Criteria criteria) { - commands.add(Command.select(key).where(criteria)); + commands.add(Command.to().select(key).where(criteria)); } @Override public void select(String key, Criteria criteria, Page page) { - commands.add(Command.select(key).where(criteria).page(page)); + commands.add(Command.to().select(key).where(criteria).page(page)); } @Override public void select(String key, Criteria criteria, Order order) { - commands.add(Command.select(key).where(criteria).order(order)); + commands.add(Command.to().select(key).where(criteria).order(order)); } @Override public void select(String key, Criteria criteria, Order order, Page page) { - commands.add( - Command.select(key).where(criteria).order(order).page(page)); + commands.add(Command.to().select(key).where(criteria).order(order) + .page(page)); } @Override public void select(String key, Criteria criteria, long timestamp) { - commands.add(Command.select(key).where(criteria) + commands.add(Command.to().select(key).where(criteria) .at(Timestamp.fromMicros(timestamp))); } @Override public void select(String key, Criteria criteria, long timestamp, Page page) { - commands.add(Command.select(key).where(criteria) + commands.add(Command.to().select(key).where(criteria) .at(Timestamp.fromMicros(timestamp)).page(page)); } @Override public void select(String key, Criteria criteria, long timestamp, Order order) { - commands.add(Command.select(key).where(criteria) + commands.add(Command.to().select(key).where(criteria) .at(Timestamp.fromMicros(timestamp)).order(order)); } @Override public void select(String key, Criteria criteria, long timestamp, Order order, Page page) { - commands.add(Command.select(key).where(criteria) + commands.add(Command.to().select(key).where(criteria) .at(Timestamp.fromMicros(timestamp)).order(order).page(page)); } @Override public void select(String key, Criteria criteria, String timestamp) { - commands.add(Command.select(key).where(criteria) + commands.add(Command.to().select(key).where(criteria) .at(Timestamp.fromString(timestamp))); } @Override public void select(String key, Criteria criteria, String timestamp, Page page) { - commands.add(Command.select(key).where(criteria) + commands.add(Command.to().select(key).where(criteria) .at(Timestamp.fromString(timestamp)).page(page)); } @Override public void select(String key, Criteria criteria, String timestamp, Order order) { - commands.add(Command.select(key).where(criteria) + commands.add(Command.to().select(key).where(criteria) .at(Timestamp.fromString(timestamp)).order(order)); } @Override public void select(String key, Criteria criteria, String timestamp, Order order, Page page) { - commands.add(Command.select(key).where(criteria) + commands.add(Command.to().select(key).where(criteria) .at(Timestamp.fromString(timestamp)).order(order).page(page)); } @Override public void select(String key, String ccl, long timestamp) { - commands.add(Command.select(key).where(ccl) + commands.add(Command.to().select(key).where(ccl) .at(Timestamp.fromMicros(timestamp))); } @Override public void select(String key, String ccl, long timestamp, Page page) { - commands.add(Command.select(key).where(ccl) + commands.add(Command.to().select(key).where(ccl) .at(Timestamp.fromMicros(timestamp)).page(page)); } @Override public void select(String key, String ccl, long timestamp, Order order) { - commands.add(Command.select(key).where(ccl) + commands.add(Command.to().select(key).where(ccl) .at(Timestamp.fromMicros(timestamp)).order(order)); } @Override public void select(String key, String ccl, long timestamp, Order order, Page page) { - commands.add(Command.select(key).where(ccl) + commands.add(Command.to().select(key).where(ccl) .at(Timestamp.fromMicros(timestamp)).order(order).page(page)); } @Override public void select(String key, String ccl, String timestamp) { - commands.add(Command.select(key).where(ccl) + commands.add(Command.to().select(key).where(ccl) .at(Timestamp.fromString(timestamp))); } @Override public void select(String key, String ccl, String timestamp, Page page) { - commands.add(Command.select(key).where(ccl) + commands.add(Command.to().select(key).where(ccl) .at(Timestamp.fromString(timestamp)).page(page)); } @Override public void select(String key, String ccl, String timestamp, Order order) { - commands.add(Command.select(key).where(ccl) + commands.add(Command.to().select(key).where(ccl) .at(Timestamp.fromString(timestamp)).order(order)); } @Override public void select(String key, String ccl, String timestamp, Order order, Page page) { - commands.add(Command.select(key).where(ccl) + commands.add(Command.to().select(key).where(ccl) .at(Timestamp.fromString(timestamp)).order(order).page(page)); } @Override public void select(List keys, Criteria criteria) { - commands.add( - Command.select(firstKey(keys), restKeys(keys)).where(criteria)); + commands.add(Command.to().select(firstKey(keys), restKeys(keys)) + .where(criteria)); } @Override public void select(List keys, Criteria criteria, Page page) { - commands.add(Command.select(firstKey(keys), restKeys(keys)) + commands.add(Command.to().select(firstKey(keys), restKeys(keys)) .where(criteria).page(page)); } @Override public void select(List keys, Criteria criteria, Order order) { - commands.add(Command.select(firstKey(keys), restKeys(keys)) + commands.add(Command.to().select(firstKey(keys), restKeys(keys)) .where(criteria).order(order)); } @Override public void select(List keys, Criteria criteria, Order order, Page page) { - commands.add(Command.select(firstKey(keys), restKeys(keys)) + commands.add(Command.to().select(firstKey(keys), restKeys(keys)) .where(criteria).order(order).page(page)); } @Override public void select(List keys, Criteria criteria, long timestamp) { - commands.add(Command.select(firstKey(keys), restKeys(keys)) + commands.add(Command.to().select(firstKey(keys), restKeys(keys)) .where(criteria).at(Timestamp.fromMicros(timestamp))); } @Override public void select(List keys, Criteria criteria, long timestamp, Page page) { - commands.add( - Command.select(firstKey(keys), restKeys(keys)).where(criteria) - .at(Timestamp.fromMicros(timestamp)).page(page)); + commands.add(Command.to().select(firstKey(keys), restKeys(keys)) + .where(criteria).at(Timestamp.fromMicros(timestamp)) + .page(page)); } @Override public void select(List keys, Criteria criteria, long timestamp, Order order) { - commands.add( - Command.select(firstKey(keys), restKeys(keys)).where(criteria) - .at(Timestamp.fromMicros(timestamp)).order(order)); + commands.add(Command.to().select(firstKey(keys), restKeys(keys)) + .where(criteria).at(Timestamp.fromMicros(timestamp)) + .order(order)); } @Override public void select(List keys, Criteria criteria, long timestamp, Order order, Page page) { - commands.add(Command.select(firstKey(keys), restKeys(keys)) + commands.add(Command.to().select(firstKey(keys), restKeys(keys)) .where(criteria).at(Timestamp.fromMicros(timestamp)) .order(order).page(page)); } @Override public void select(List keys, Criteria criteria, String timestamp) { - commands.add(Command.select(firstKey(keys), restKeys(keys)) + commands.add(Command.to().select(firstKey(keys), restKeys(keys)) .where(criteria).at(Timestamp.fromString(timestamp))); } @Override public void select(List keys, Criteria criteria, String timestamp, Page page) { - commands.add( - Command.select(firstKey(keys), restKeys(keys)).where(criteria) - .at(Timestamp.fromString(timestamp)).page(page)); + commands.add(Command.to().select(firstKey(keys), restKeys(keys)) + .where(criteria).at(Timestamp.fromString(timestamp)) + .page(page)); } @Override public void select(List keys, Criteria criteria, String timestamp, Order order) { - commands.add( - Command.select(firstKey(keys), restKeys(keys)).where(criteria) - .at(Timestamp.fromString(timestamp)).order(order)); + commands.add(Command.to().select(firstKey(keys), restKeys(keys)) + .where(criteria).at(Timestamp.fromString(timestamp)) + .order(order)); } @Override public void select(List keys, Criteria criteria, String timestamp, Order order, Page page) { - commands.add(Command.select(firstKey(keys), restKeys(keys)) + commands.add(Command.to().select(firstKey(keys), restKeys(keys)) .where(criteria).at(Timestamp.fromString(timestamp)) .order(order).page(page)); } @Override public void select(List keys, String ccl, long timestamp) { - commands.add(Command.select(firstKey(keys), restKeys(keys)).where(ccl) - .at(Timestamp.fromMicros(timestamp))); + commands.add(Command.to().select(firstKey(keys), restKeys(keys)) + .where(ccl).at(Timestamp.fromMicros(timestamp))); } @Override public void select(List keys, String ccl, long timestamp, Page page) { - commands.add(Command.select(firstKey(keys), restKeys(keys)).where(ccl) - .at(Timestamp.fromMicros(timestamp)).page(page)); + commands.add(Command.to().select(firstKey(keys), restKeys(keys)) + .where(ccl).at(Timestamp.fromMicros(timestamp)).page(page)); } @Override public void select(List keys, String ccl, long timestamp, Order order) { - commands.add(Command.select(firstKey(keys), restKeys(keys)).where(ccl) - .at(Timestamp.fromMicros(timestamp)).order(order)); + commands.add(Command.to().select(firstKey(keys), restKeys(keys)) + .where(ccl).at(Timestamp.fromMicros(timestamp)).order(order)); } @Override public void select(List keys, String ccl, long timestamp, Order order, Page page) { - commands.add(Command.select(firstKey(keys), restKeys(keys)).where(ccl) - .at(Timestamp.fromMicros(timestamp)).order(order).page(page)); + commands.add(Command.to().select(firstKey(keys), restKeys(keys)) + .where(ccl).at(Timestamp.fromMicros(timestamp)).order(order) + .page(page)); } @Override public void select(List keys, String ccl, String timestamp) { - commands.add(Command.select(firstKey(keys), restKeys(keys)).where(ccl) - .at(Timestamp.fromString(timestamp))); + commands.add(Command.to().select(firstKey(keys), restKeys(keys)) + .where(ccl).at(Timestamp.fromString(timestamp))); } @Override public void select(List keys, String ccl, String timestamp, Page page) { - commands.add(Command.select(firstKey(keys), restKeys(keys)).where(ccl) - .at(Timestamp.fromString(timestamp)).page(page)); + commands.add(Command.to().select(firstKey(keys), restKeys(keys)) + .where(ccl).at(Timestamp.fromString(timestamp)).page(page)); } @Override public void select(List keys, String ccl, String timestamp, Order order) { - commands.add(Command.select(firstKey(keys), restKeys(keys)).where(ccl) - .at(Timestamp.fromString(timestamp)).order(order)); + commands.add(Command.to().select(firstKey(keys), restKeys(keys)) + .where(ccl).at(Timestamp.fromString(timestamp)).order(order)); } @Override public void select(List keys, String ccl, String timestamp, Order order, Page page) { - commands.add(Command.select(firstKey(keys), restKeys(keys)).where(ccl) - .at(Timestamp.fromString(timestamp)).order(order).page(page)); + commands.add(Command.to().select(firstKey(keys), restKeys(keys)) + .where(ccl).at(Timestamp.fromString(timestamp)).order(order) + .page(page)); } // -- get methods -- @Override public void get(String key, long record) { - commands.add(Command.get(key).from(record)); + commands.add(Command.to().get(key).from(record)); } @Override public void get(String key, long record, long timestamp) { - commands.add(Command.get(key).from(record) + commands.add(Command.to().get(key).from(record) .at(Timestamp.fromMicros(timestamp))); } @Override public void get(String key, long record, String timestamp) { - commands.add(Command.get(key).from(record) + commands.add(Command.to().get(key).from(record) .at(Timestamp.fromString(timestamp))); } @Override public void get(List keys, long record) { - commands.add(Command.get(firstKey(keys), restKeys(keys)).from(record)); + commands.add( + Command.to().get(firstKey(keys), restKeys(keys)).from(record)); } @Override public void get(List keys, long record, long timestamp) { - commands.add(Command.get(firstKey(keys), restKeys(keys)).from(record) - .at(Timestamp.fromMicros(timestamp))); + commands.add(Command.to().get(firstKey(keys), restKeys(keys)) + .from(record).at(Timestamp.fromMicros(timestamp))); } @Override public void get(List keys, long record, String timestamp) { - commands.add(Command.get(firstKey(keys), restKeys(keys)).from(record) - .at(Timestamp.fromString(timestamp))); + commands.add(Command.to().get(firstKey(keys), restKeys(keys)) + .from(record).at(Timestamp.fromString(timestamp))); } @Override public void get(List keys, List records) { - commands.add(Command.get(firstKey(keys), restKeys(keys)) + commands.add(Command.to().get(firstKey(keys), restKeys(keys)) .from(firstRecord(records), restRecords(records))); } @Override public void get(List keys, List records, Page page) { - commands.add(Command.get(firstKey(keys), restKeys(keys)) + commands.add(Command.to().get(firstKey(keys), restKeys(keys)) .from(firstRecord(records), restRecords(records)).page(page)); } @Override public void get(List keys, List records, Order order) { - commands.add(Command.get(firstKey(keys), restKeys(keys)) + commands.add(Command.to().get(firstKey(keys), restKeys(keys)) .from(firstRecord(records), restRecords(records)).order(order)); } @Override public void get(List keys, List records, Order order, Page page) { - commands.add(Command.get(firstKey(keys), restKeys(keys)) + commands.add(Command.to().get(firstKey(keys), restKeys(keys)) .from(firstRecord(records), restRecords(records)).order(order) .page(page)); } @Override public void get(String key, List records) { - commands.add(Command.get(key).from(firstRecord(records), + commands.add(Command.to().get(key).from(firstRecord(records), restRecords(records))); } @Override public void get(String key, List records, Page page) { - commands.add(Command.get(key) + commands.add(Command.to().get(key) .from(firstRecord(records), restRecords(records)).page(page)); } @Override public void get(String key, List records, Order order) { - commands.add(Command.get(key) + commands.add(Command.to().get(key) .from(firstRecord(records), restRecords(records)).order(order)); } @Override public void get(String key, List records, Order order, Page page) { - commands.add(Command.get(key) + commands.add(Command.to().get(key) .from(firstRecord(records), restRecords(records)).order(order) .page(page)); } @Override public void get(String key, List records, long timestamp) { - commands.add(Command.get(key) + commands.add(Command.to().get(key) .from(firstRecord(records), restRecords(records)) .at(Timestamp.fromMicros(timestamp))); } @Override public void get(String key, List records, long timestamp, Page page) { - commands.add(Command.get(key) + commands.add(Command.to().get(key) .from(firstRecord(records), restRecords(records)) .at(Timestamp.fromMicros(timestamp)).page(page)); } @@ -1281,7 +1288,7 @@ public void get(String key, List records, long timestamp, Page page) { @Override public void get(String key, List records, long timestamp, Order order) { - commands.add(Command.get(key) + commands.add(Command.to().get(key) .from(firstRecord(records), restRecords(records)) .at(Timestamp.fromMicros(timestamp)).order(order)); } @@ -1289,14 +1296,14 @@ public void get(String key, List records, long timestamp, @Override public void get(String key, List records, long timestamp, Order order, Page page) { - commands.add(Command.get(key) + commands.add(Command.to().get(key) .from(firstRecord(records), restRecords(records)) .at(Timestamp.fromMicros(timestamp)).order(order).page(page)); } @Override public void get(String key, List records, String timestamp) { - commands.add(Command.get(key) + commands.add(Command.to().get(key) .from(firstRecord(records), restRecords(records)) .at(Timestamp.fromString(timestamp))); } @@ -1304,7 +1311,7 @@ public void get(String key, List records, String timestamp) { @Override public void get(String key, List records, String timestamp, Page page) { - commands.add(Command.get(key) + commands.add(Command.to().get(key) .from(firstRecord(records), restRecords(records)) .at(Timestamp.fromString(timestamp)).page(page)); } @@ -1312,7 +1319,7 @@ public void get(String key, List records, String timestamp, @Override public void get(String key, List records, String timestamp, Order order) { - commands.add(Command.get(key) + commands.add(Command.to().get(key) .from(firstRecord(records), restRecords(records)) .at(Timestamp.fromString(timestamp)).order(order)); } @@ -1320,14 +1327,14 @@ public void get(String key, List records, String timestamp, @Override public void get(String key, List records, String timestamp, Order order, Page page) { - commands.add(Command.get(key) + commands.add(Command.to().get(key) .from(firstRecord(records), restRecords(records)) .at(Timestamp.fromString(timestamp)).order(order).page(page)); } @Override public void get(List keys, List records, long timestamp) { - commands.add(Command.get(firstKey(keys), restKeys(keys)) + commands.add(Command.to().get(firstKey(keys), restKeys(keys)) .from(firstRecord(records), restRecords(records)) .at(Timestamp.fromMicros(timestamp))); } @@ -1335,7 +1342,7 @@ public void get(List keys, List records, long timestamp) { @Override public void get(List keys, List records, long timestamp, Page page) { - commands.add(Command.get(firstKey(keys), restKeys(keys)) + commands.add(Command.to().get(firstKey(keys), restKeys(keys)) .from(firstRecord(records), restRecords(records)) .at(Timestamp.fromMicros(timestamp)).page(page)); } @@ -1343,7 +1350,7 @@ public void get(List keys, List records, long timestamp, @Override public void get(List keys, List records, long timestamp, Order order) { - commands.add(Command.get(firstKey(keys), restKeys(keys)) + commands.add(Command.to().get(firstKey(keys), restKeys(keys)) .from(firstRecord(records), restRecords(records)) .at(Timestamp.fromMicros(timestamp)).order(order)); } @@ -1351,14 +1358,14 @@ public void get(List keys, List records, long timestamp, @Override public void get(List keys, List records, long timestamp, Order order, Page page) { - commands.add(Command.get(firstKey(keys), restKeys(keys)) + commands.add(Command.to().get(firstKey(keys), restKeys(keys)) .from(firstRecord(records), restRecords(records)) .at(Timestamp.fromMicros(timestamp)).order(order).page(page)); } @Override public void get(List keys, List records, String timestamp) { - commands.add(Command.get(firstKey(keys), restKeys(keys)) + commands.add(Command.to().get(firstKey(keys), restKeys(keys)) .from(firstRecord(records), restRecords(records)) .at(Timestamp.fromString(timestamp))); } @@ -1366,7 +1373,7 @@ public void get(List keys, List records, String timestamp) { @Override public void get(List keys, List records, String timestamp, Page page) { - commands.add(Command.get(firstKey(keys), restKeys(keys)) + commands.add(Command.to().get(firstKey(keys), restKeys(keys)) .from(firstRecord(records), restRecords(records)) .at(Timestamp.fromString(timestamp)).page(page)); } @@ -1374,7 +1381,7 @@ public void get(List keys, List records, String timestamp, @Override public void get(List keys, List records, String timestamp, Order order) { - commands.add(Command.get(firstKey(keys), restKeys(keys)) + commands.add(Command.to().get(firstKey(keys), restKeys(keys)) .from(firstRecord(records), restRecords(records)) .at(Timestamp.fromString(timestamp)).order(order)); } @@ -1382,417 +1389,426 @@ public void get(List keys, List records, String timestamp, @Override public void get(List keys, List records, String timestamp, Order order, Page page) { - commands.add(Command.get(firstKey(keys), restKeys(keys)) + commands.add(Command.to().get(firstKey(keys), restKeys(keys)) .from(firstRecord(records), restRecords(records)) .at(Timestamp.fromString(timestamp)).order(order).page(page)); } @Override public void get(String key, Criteria criteria) { - commands.add(Command.get(key).where(criteria)); + commands.add(Command.to().get(key).where(criteria)); } @Override public void get(String key, Criteria criteria, Page page) { - commands.add(Command.get(key).where(criteria).page(page)); + commands.add(Command.to().get(key).where(criteria).page(page)); } @Override public void get(String key, Criteria criteria, Order order) { - commands.add(Command.get(key).where(criteria).order(order)); + commands.add(Command.to().get(key).where(criteria).order(order)); } @Override public void get(String key, Criteria criteria, Order order, Page page) { - commands.add(Command.get(key).where(criteria).order(order).page(page)); + commands.add( + Command.to().get(key).where(criteria).order(order).page(page)); } @Override public void get(Criteria criteria) { - commands.add(Command.getAll().where(criteria)); + commands.add(Command.to().getAll().where(criteria)); } @Override public void get(Criteria criteria, Page page) { - commands.add(Command.getAll().where(criteria).page(page)); + commands.add(Command.to().getAll().where(criteria).page(page)); } @Override public void get(Criteria criteria, Order order) { - commands.add(Command.getAll().where(criteria).order(order)); + commands.add(Command.to().getAll().where(criteria).order(order)); } @Override public void get(Criteria criteria, Order order, Page page) { - commands.add(Command.getAll().where(criteria).order(order).page(page)); + commands.add( + Command.to().getAll().where(criteria).order(order).page(page)); } @Override public void get(String ccl) { - commands.add(Command.getAll().where(ccl)); + commands.add(Command.to().getAll().where(ccl)); } @Override public void get(String ccl, Page page) { - commands.add(Command.getAll().where(ccl).page(page)); + commands.add(Command.to().getAll().where(ccl).page(page)); } @Override public void get(String ccl, Order order) { - commands.add(Command.getAll().where(ccl).order(order)); + commands.add(Command.to().getAll().where(ccl).order(order)); } @Override public void get(String ccl, Order order, Page page) { - commands.add(Command.getAll().where(ccl).order(order).page(page)); + commands.add(Command.to().getAll().where(ccl).order(order).page(page)); } @Override public void get(Criteria criteria, long timestamp) { - commands.add(Command.getAll().where(criteria) + commands.add(Command.to().getAll().where(criteria) .at(Timestamp.fromMicros(timestamp))); } @Override public void get(Criteria criteria, long timestamp, Page page) { - commands.add(Command.getAll().where(criteria) + commands.add(Command.to().getAll().where(criteria) .at(Timestamp.fromMicros(timestamp)).page(page)); } @Override public void get(Criteria criteria, long timestamp, Order order) { - commands.add(Command.getAll().where(criteria) + commands.add(Command.to().getAll().where(criteria) .at(Timestamp.fromMicros(timestamp)).order(order)); } @Override public void get(Criteria criteria, long timestamp, Order order, Page page) { - commands.add(Command.getAll().where(criteria) + commands.add(Command.to().getAll().where(criteria) .at(Timestamp.fromMicros(timestamp)).order(order).page(page)); } @Override public void get(Criteria criteria, String timestamp) { - commands.add(Command.getAll().where(criteria) + commands.add(Command.to().getAll().where(criteria) .at(Timestamp.fromString(timestamp))); } @Override public void get(Criteria criteria, String timestamp, Page page) { - commands.add(Command.getAll().where(criteria) + commands.add(Command.to().getAll().where(criteria) .at(Timestamp.fromString(timestamp)).page(page)); } @Override public void get(Criteria criteria, String timestamp, Order order) { - commands.add(Command.getAll().where(criteria) + commands.add(Command.to().getAll().where(criteria) .at(Timestamp.fromString(timestamp)).order(order)); } @Override public void get(Criteria criteria, String timestamp, Order order, Page page) { - commands.add(Command.getAll().where(criteria) + commands.add(Command.to().getAll().where(criteria) .at(Timestamp.fromString(timestamp)).order(order).page(page)); } @Override public void get(String ccl, long timestamp, Page page) { - commands.add(Command.getAll().where(ccl) + commands.add(Command.to().getAll().where(ccl) .at(Timestamp.fromMicros(timestamp)).page(page)); } @Override public void get(String ccl, long timestamp, Order order) { - commands.add(Command.getAll().where(ccl) + commands.add(Command.to().getAll().where(ccl) .at(Timestamp.fromMicros(timestamp)).order(order)); } @Override public void get(String ccl, long timestamp, Order order, Page page) { - commands.add(Command.getAll().where(ccl) + commands.add(Command.to().getAll().where(ccl) .at(Timestamp.fromMicros(timestamp)).order(order).page(page)); } @Override public void get(String ccl, String timestamp) { - commands.add(Command.getAll().where(ccl) + commands.add(Command.to().getAll().where(ccl) .at(Timestamp.fromString(timestamp))); } @Override public void get(String ccl, String timestamp, Page page) { - commands.add(Command.getAll().where(ccl) + commands.add(Command.to().getAll().where(ccl) .at(Timestamp.fromString(timestamp)).page(page)); } @Override public void get(String ccl, String timestamp, Order order) { - commands.add(Command.getAll().where(ccl) + commands.add(Command.to().getAll().where(ccl) .at(Timestamp.fromString(timestamp)).order(order)); } @Override public void get(String ccl, String timestamp, Order order, Page page) { - commands.add(Command.getAll().where(ccl) + commands.add(Command.to().getAll().where(ccl) .at(Timestamp.fromString(timestamp)).order(order).page(page)); } @Override public void get(String key, Criteria criteria, long timestamp) { - commands.add(Command.get(key).where(criteria) + commands.add(Command.to().get(key).where(criteria) .at(Timestamp.fromMicros(timestamp))); } @Override public void get(String key, Criteria criteria, long timestamp, Page page) { - commands.add(Command.get(key).where(criteria) + commands.add(Command.to().get(key).where(criteria) .at(Timestamp.fromMicros(timestamp)).page(page)); } @Override public void get(String key, Criteria criteria, long timestamp, Order order) { - commands.add(Command.get(key).where(criteria) + commands.add(Command.to().get(key).where(criteria) .at(Timestamp.fromMicros(timestamp)).order(order)); } @Override public void get(String key, Criteria criteria, long timestamp, Order order, Page page) { - commands.add(Command.get(key).where(criteria) + commands.add(Command.to().get(key).where(criteria) .at(Timestamp.fromMicros(timestamp)).order(order).page(page)); } @Override public void get(String key, Criteria criteria, String timestamp) { - commands.add(Command.get(key).where(criteria) + commands.add(Command.to().get(key).where(criteria) .at(Timestamp.fromString(timestamp))); } @Override public void get(String key, Criteria criteria, String timestamp, Page page) { - commands.add(Command.get(key).where(criteria) + commands.add(Command.to().get(key).where(criteria) .at(Timestamp.fromString(timestamp)).page(page)); } @Override public void get(String key, Criteria criteria, String timestamp, Order order) { - commands.add(Command.get(key).where(criteria) + commands.add(Command.to().get(key).where(criteria) .at(Timestamp.fromString(timestamp)).order(order)); } @Override public void get(String key, Criteria criteria, String timestamp, Order order, Page page) { - commands.add(Command.get(key).where(criteria) + commands.add(Command.to().get(key).where(criteria) .at(Timestamp.fromString(timestamp)).order(order).page(page)); } @Override public void get(String key, String ccl, long timestamp) { - commands.add(Command.get(key).where(ccl) + commands.add(Command.to().get(key).where(ccl) .at(Timestamp.fromMicros(timestamp))); } @Override public void get(String key, String ccl, long timestamp, Page page) { - commands.add(Command.get(key).where(ccl) + commands.add(Command.to().get(key).where(ccl) .at(Timestamp.fromMicros(timestamp)).page(page)); } @Override public void get(String key, String ccl, long timestamp, Order order) { - commands.add(Command.get(key).where(ccl) + commands.add(Command.to().get(key).where(ccl) .at(Timestamp.fromMicros(timestamp)).order(order)); } @Override public void get(String key, String ccl, long timestamp, Order order, Page page) { - commands.add(Command.get(key).where(ccl) + commands.add(Command.to().get(key).where(ccl) .at(Timestamp.fromMicros(timestamp)).order(order).page(page)); } @Override public void get(String key, String ccl, String timestamp) { - commands.add(Command.get(key).where(ccl) + commands.add(Command.to().get(key).where(ccl) .at(Timestamp.fromString(timestamp))); } @Override public void get(String key, String ccl, String timestamp, Page page) { - commands.add(Command.get(key).where(ccl) + commands.add(Command.to().get(key).where(ccl) .at(Timestamp.fromString(timestamp)).page(page)); } @Override public void get(String key, String ccl, String timestamp, Order order) { - commands.add(Command.get(key).where(ccl) + commands.add(Command.to().get(key).where(ccl) .at(Timestamp.fromString(timestamp)).order(order)); } @Override public void get(String key, String ccl, String timestamp, Order order, Page page) { - commands.add(Command.get(key).where(ccl) + commands.add(Command.to().get(key).where(ccl) .at(Timestamp.fromString(timestamp)).order(order).page(page)); } @Override public void get(List keys, Criteria criteria) { - commands.add( - Command.get(firstKey(keys), restKeys(keys)).where(criteria)); + commands.add(Command.to().get(firstKey(keys), restKeys(keys)) + .where(criteria)); } @Override public void get(List keys, Criteria criteria, Page page) { - commands.add(Command.get(firstKey(keys), restKeys(keys)).where(criteria) - .page(page)); + commands.add(Command.to().get(firstKey(keys), restKeys(keys)) + .where(criteria).page(page)); } @Override public void get(List keys, Criteria criteria, Order order) { - commands.add(Command.get(firstKey(keys), restKeys(keys)).where(criteria) - .order(order)); + commands.add(Command.to().get(firstKey(keys), restKeys(keys)) + .where(criteria).order(order)); } @Override public void get(List keys, Criteria criteria, Order order, Page page) { - commands.add(Command.get(firstKey(keys), restKeys(keys)).where(criteria) - .order(order).page(page)); + commands.add(Command.to().get(firstKey(keys), restKeys(keys)) + .where(criteria).order(order).page(page)); } @Override public void get(List keys, String ccl) { - commands.add(Command.get(firstKey(keys), restKeys(keys)).where(ccl)); + commands.add( + Command.to().get(firstKey(keys), restKeys(keys)).where(ccl)); } @Override public void get(List keys, String ccl, Page page) { - commands.add(Command.get(firstKey(keys), restKeys(keys)).where(ccl) + commands.add(Command.to().get(firstKey(keys), restKeys(keys)).where(ccl) .page(page)); } @Override public void get(List keys, String ccl, Order order) { - commands.add(Command.get(firstKey(keys), restKeys(keys)).where(ccl) + commands.add(Command.to().get(firstKey(keys), restKeys(keys)).where(ccl) .order(order)); } @Override public void get(List keys, String ccl, Order order, Page page) { - commands.add(Command.get(firstKey(keys), restKeys(keys)).where(ccl) + commands.add(Command.to().get(firstKey(keys), restKeys(keys)).where(ccl) .order(order).page(page)); } @Override public void get(List keys, Criteria criteria, long timestamp) { - commands.add(Command.get(firstKey(keys), restKeys(keys)).where(criteria) - .at(Timestamp.fromMicros(timestamp))); + commands.add(Command.to().get(firstKey(keys), restKeys(keys)) + .where(criteria).at(Timestamp.fromMicros(timestamp))); } @Override public void get(List keys, Criteria criteria, long timestamp, Page page) { - commands.add(Command.get(firstKey(keys), restKeys(keys)).where(criteria) - .at(Timestamp.fromMicros(timestamp)).page(page)); + commands.add( + Command.to().get(firstKey(keys), restKeys(keys)).where(criteria) + .at(Timestamp.fromMicros(timestamp)).page(page)); } @Override public void get(List keys, Criteria criteria, long timestamp, Order order) { - commands.add(Command.get(firstKey(keys), restKeys(keys)).where(criteria) - .at(Timestamp.fromMicros(timestamp)).order(order)); + commands.add( + Command.to().get(firstKey(keys), restKeys(keys)).where(criteria) + .at(Timestamp.fromMicros(timestamp)).order(order)); } @Override public void get(List keys, Criteria criteria, long timestamp, Order order, Page page) { - commands.add(Command.get(firstKey(keys), restKeys(keys)).where(criteria) - .at(Timestamp.fromMicros(timestamp)).order(order).page(page)); + commands.add(Command.to().get(firstKey(keys), restKeys(keys)) + .where(criteria).at(Timestamp.fromMicros(timestamp)) + .order(order).page(page)); } @Override public void get(List keys, Criteria criteria, String timestamp) { - commands.add(Command.get(firstKey(keys), restKeys(keys)).where(criteria) - .at(Timestamp.fromString(timestamp))); + commands.add(Command.to().get(firstKey(keys), restKeys(keys)) + .where(criteria).at(Timestamp.fromString(timestamp))); } @Override public void get(List keys, Criteria criteria, String timestamp, Page page) { - commands.add(Command.get(firstKey(keys), restKeys(keys)).where(criteria) - .at(Timestamp.fromString(timestamp)).page(page)); + commands.add( + Command.to().get(firstKey(keys), restKeys(keys)).where(criteria) + .at(Timestamp.fromString(timestamp)).page(page)); } @Override public void get(List keys, Criteria criteria, String timestamp, Order order) { - commands.add(Command.get(firstKey(keys), restKeys(keys)).where(criteria) - .at(Timestamp.fromString(timestamp)).order(order)); + commands.add( + Command.to().get(firstKey(keys), restKeys(keys)).where(criteria) + .at(Timestamp.fromString(timestamp)).order(order)); } @Override public void get(List keys, Criteria criteria, String timestamp, Order order, Page page) { - commands.add(Command.get(firstKey(keys), restKeys(keys)).where(criteria) - .at(Timestamp.fromString(timestamp)).order(order).page(page)); + commands.add(Command.to().get(firstKey(keys), restKeys(keys)) + .where(criteria).at(Timestamp.fromString(timestamp)) + .order(order).page(page)); } @Override public void get(List keys, String ccl, long timestamp) { - commands.add(Command.get(firstKey(keys), restKeys(keys)).where(ccl) + commands.add(Command.to().get(firstKey(keys), restKeys(keys)).where(ccl) .at(Timestamp.fromMicros(timestamp))); } @Override public void get(List keys, String ccl, long timestamp, Page page) { - commands.add(Command.get(firstKey(keys), restKeys(keys)).where(ccl) + commands.add(Command.to().get(firstKey(keys), restKeys(keys)).where(ccl) .at(Timestamp.fromMicros(timestamp)).page(page)); } @Override public void get(List keys, String ccl, long timestamp, Order order) { - commands.add(Command.get(firstKey(keys), restKeys(keys)).where(ccl) + commands.add(Command.to().get(firstKey(keys), restKeys(keys)).where(ccl) .at(Timestamp.fromMicros(timestamp)).order(order)); } @Override public void get(List keys, String ccl, long timestamp, Order order, Page page) { - commands.add(Command.get(firstKey(keys), restKeys(keys)).where(ccl) + commands.add(Command.to().get(firstKey(keys), restKeys(keys)).where(ccl) .at(Timestamp.fromMicros(timestamp)).order(order).page(page)); } @Override public void get(List keys, String ccl, String timestamp) { - commands.add(Command.get(firstKey(keys), restKeys(keys)).where(ccl) + commands.add(Command.to().get(firstKey(keys), restKeys(keys)).where(ccl) .at(Timestamp.fromString(timestamp))); } @Override public void get(List keys, String ccl, String timestamp, Page page) { - commands.add(Command.get(firstKey(keys), restKeys(keys)).where(ccl) + commands.add(Command.to().get(firstKey(keys), restKeys(keys)).where(ccl) .at(Timestamp.fromString(timestamp)).page(page)); } @Override public void get(List keys, String ccl, String timestamp, Order order) { - commands.add(Command.get(firstKey(keys), restKeys(keys)).where(ccl) + commands.add(Command.to().get(firstKey(keys), restKeys(keys)).where(ccl) .at(Timestamp.fromString(timestamp)).order(order)); } @Override public void get(List keys, String ccl, String timestamp, Order order, Page page) { - commands.add(Command.get(firstKey(keys), restKeys(keys)).where(ccl) + commands.add(Command.to().get(firstKey(keys), restKeys(keys)).where(ccl) .at(Timestamp.fromString(timestamp)).order(order).page(page)); } @@ -1800,19 +1816,19 @@ public void get(List keys, String ccl, String timestamp, @Override public void verify(String key, Object value, long record) { - commands.add(Command.verify(key).as(value).in(record)); + commands.add(Command.to().verify(key).as(value).in(record)); } @Override public void verify(String key, Object value, long record, long timestamp) { - commands.add(Command.verify(key).as(value).in(record) + commands.add(Command.to().verify(key).as(value).in(record) .at(Timestamp.fromMicros(timestamp))); } @Override public void verify(String key, Object value, long record, String timestamp) { - commands.add(Command.verify(key).as(value).in(record) + commands.add(Command.to().verify(key).as(value).in(record) .at(Timestamp.fromString(timestamp))); } @@ -1823,10 +1839,10 @@ public void jsonify(List records, boolean identifier) { long first = firstRecord(records); long[] rest = restRecords(records); if(identifier) { - commands.add(Command.jsonify(first, rest).identifier()); + commands.add(Command.to().jsonify(first, rest).identifier()); } else { - commands.add(Command.jsonify(first, rest)); + commands.add(Command.to().jsonify(first, rest)); } } @@ -1836,11 +1852,11 @@ public void jsonify(List records, long timestamp, long first = firstRecord(records); long[] rest = restRecords(records); if(identifier) { - commands.add(Command.jsonify(first, rest) + commands.add(Command.to().jsonify(first, rest) .at(Timestamp.fromMicros(timestamp)).identifier()); } else { - commands.add(Command.jsonify(first, rest) + commands.add(Command.to().jsonify(first, rest) .at(Timestamp.fromMicros(timestamp))); } } @@ -1851,11 +1867,11 @@ public void jsonify(List records, String timestamp, long first = firstRecord(records); long[] rest = restRecords(records); if(identifier) { - commands.add(Command.jsonify(first, rest) + commands.add(Command.to().jsonify(first, rest) .at(Timestamp.fromString(timestamp)).identifier()); } else { - commands.add(Command.jsonify(first, rest) + commands.add(Command.to().jsonify(first, rest) .at(Timestamp.fromString(timestamp))); } } @@ -1864,42 +1880,42 @@ public void jsonify(List records, String timestamp, @Override public void find(Criteria criteria) { - commands.add(Command.find(criteria)); + commands.add(Command.to().find(criteria)); } @Override public void find(Criteria criteria, Page page) { - commands.add(Command.find(criteria).page(page)); + commands.add(Command.to().find(criteria).page(page)); } @Override public void find(Criteria criteria, Order order) { - commands.add(Command.find(criteria).order(order)); + commands.add(Command.to().find(criteria).order(order)); } @Override public void find(Criteria criteria, Order order, Page page) { - commands.add(Command.find(criteria).order(order).page(page)); + commands.add(Command.to().find(criteria).order(order).page(page)); } @Override public void find(String ccl) { - commands.add(Command.find(ccl)); + commands.add(Command.to().find(ccl)); } @Override public void find(String ccl, Page page) { - commands.add(Command.find(ccl).page(page)); + commands.add(Command.to().find(ccl).page(page)); } @Override public void find(String ccl, Order order) { - commands.add(Command.find(ccl).order(order)); + commands.add(Command.to().find(ccl).order(order)); } @Override public void find(String ccl, Order order, Page page) { - commands.add(Command.find(ccl).order(order).page(page)); + commands.add(Command.to().find(ccl).order(order).page(page)); } @Override @@ -2072,7 +2088,7 @@ public void find(String key, String operator, List values, @Override public void search(String key, String query) { - commands.add(Command.search(key).forQuery(query)); + commands.add(Command.to().search(key).forQuery(query)); } // -- revert methods -- @@ -2081,7 +2097,7 @@ public void search(String key, String query) { public void revert(List keys, List records, long timestamp) { for (String key : keys) { for (long record : records) { - commands.add(Command.revert(key).in(record) + commands.add(Command.to().revert(key).in(record) .to(Timestamp.fromMicros(timestamp))); } } @@ -2092,7 +2108,7 @@ public void revert(List keys, List records, String timestamp) { for (String key : keys) { for (long record : records) { - commands.add(Command.revert(key).in(record) + commands.add(Command.to().revert(key).in(record) .to(Timestamp.fromString(timestamp))); } } @@ -2101,7 +2117,7 @@ public void revert(List keys, List records, @Override public void revert(List keys, long record, long timestamp) { for (String key : keys) { - commands.add(Command.revert(key).in(record) + commands.add(Command.to().revert(key).in(record) .to(Timestamp.fromMicros(timestamp))); } } @@ -2109,7 +2125,7 @@ public void revert(List keys, long record, long timestamp) { @Override public void revert(List keys, long record, String timestamp) { for (String key : keys) { - commands.add(Command.revert(key).in(record) + commands.add(Command.to().revert(key).in(record) .to(Timestamp.fromString(timestamp))); } } @@ -2117,7 +2133,7 @@ public void revert(List keys, long record, String timestamp) { @Override public void revert(String key, List records, long timestamp) { for (long record : records) { - commands.add(Command.revert(key).in(record) + commands.add(Command.to().revert(key).in(record) .to(Timestamp.fromMicros(timestamp))); } } @@ -2125,20 +2141,20 @@ public void revert(String key, List records, long timestamp) { @Override public void revert(String key, List records, String timestamp) { for (long record : records) { - commands.add(Command.revert(key).in(record) + commands.add(Command.to().revert(key).in(record) .to(Timestamp.fromString(timestamp))); } } @Override public void revert(String key, long record, long timestamp) { - commands.add(Command.revert(key).in(record) + commands.add(Command.to().revert(key).in(record) .to(Timestamp.fromMicros(timestamp))); } @Override public void revert(String key, long record, String timestamp) { - commands.add(Command.revert(key).in(record) + commands.add(Command.to().revert(key).in(record) .to(Timestamp.fromString(timestamp))); } @@ -2147,13 +2163,13 @@ public void revert(String key, long record, String timestamp) { @Override public void holds(List records) { for (long record : records) { - commands.add(Command.holds(record)); + commands.add(Command.to().holds(record)); } } @Override public void holds(long record) { - commands.add(Command.holds(record)); + commands.add(Command.to().holds(record)); } // -- verifyAndSwap -- @@ -2161,7 +2177,7 @@ public void holds(long record) { @Override public void verifyAndSwap(String key, Object expected, long record, Object replacement) { - commands.add(Command.verifyAndSwap(key).as(expected).in(record) + commands.add(Command.to().verifyAndSwap(key).as(expected).in(record) .with(replacement)); } @@ -2169,77 +2185,79 @@ public void verifyAndSwap(String key, Object expected, long record, @Override public void verifyOrSet(String key, Object value, long record) { - commands.add(Command.verifyOrSet(key).as(value).in(record)); + commands.add(Command.to().verifyOrSet(key).as(value).in(record)); } // -- findOrAdd -- @Override public void findOrAdd(String key, Object value) { - commands.add(Command.findOrAdd(key).as(value)); + commands.add(Command.to().findOrAdd(key).as(value)); } // -- findOrInsert methods -- @Override public void findOrInsert(Criteria criteria, String json) { - commands.add(Command.findOrInsert(criteria).json(json)); + commands.add(Command.to().findOrInsert(criteria).json(json)); } @Override public void findOrInsert(String ccl, String json) { - commands.add(Command.findOrInsert(ccl).json(json)); + commands.add(Command.to().findOrInsert(ccl).json(json)); } // -- time methods -- @Override public void time() { - commands.add(Command.time()); + commands.add(Command.to().time()); } @Override public void time(String phrase) { - commands.add(Command.time(phrase)); + commands.add(Command.to().time(phrase)); } // -- trace methods -- @Override public void trace(long record) { - commands.add(Command.trace(record)); + commands.add(Command.to().trace(record)); } @Override public void trace(long record, long timestamp) { - commands.add(Command.trace(record).at(Timestamp.fromMicros(timestamp))); + commands.add( + Command.to().trace(record).at(Timestamp.fromMicros(timestamp))); } @Override public void trace(long record, String timestamp) { - commands.add(Command.trace(record).at(Timestamp.fromString(timestamp))); + commands.add( + Command.to().trace(record).at(Timestamp.fromString(timestamp))); } @Override public void trace(List records) { for (long record : records) { - commands.add(Command.trace(record)); + commands.add(Command.to().trace(record)); } } @Override public void trace(List records, long timestamp) { for (long record : records) { - commands.add( - Command.trace(record).at(Timestamp.fromMicros(timestamp))); + commands.add(Command.to().trace(record) + .at(Timestamp.fromMicros(timestamp))); } } @Override public void trace(List records, String timestamp) { for (long record : records) { - commands.add( - Command.trace(record).at(Timestamp.fromString(timestamp))); + commands.add(Command.to().trace(record) + .at(Timestamp.fromString(timestamp))); } } @@ -2254,7 +2272,7 @@ public void consolidate(List records) { for (int i = 2; i < records.size(); ++i) { remaining[i - 2] = records.get(i); } - commands.add(Command.consolidate(first, second, remaining)); + commands.add(Command.to().consolidate(first, second, remaining)); } } @@ -2262,391 +2280,391 @@ public void consolidate(List records) { @Override public void ping() { - commands.add(Command.ping()); + commands.add(Command.to().ping()); } // -- calculate methods -- @Override public void sum(String key, long record) { - commands.add(Command.calculate("sum", key).in(record)); + commands.add(Command.to().calculate("sum", key).in(record)); } @Override public void sum(String key, long record, long timestamp) { - commands.add(Command.calculate("sum", key).in(record) + commands.add(Command.to().calculate("sum", key).in(record) .at(Timestamp.fromMicros(timestamp))); } @Override public void sum(String key, long record, String timestamp) { - commands.add(Command.calculate("sum", key).in(record) + commands.add(Command.to().calculate("sum", key).in(record) .at(Timestamp.fromString(timestamp))); } @Override public void sum(String key, List records) { - commands.add(Command.calculate("sum", key).in(firstRecord(records), + commands.add(Command.to().calculate("sum", key).in(firstRecord(records), restRecords(records))); } @Override public void sum(String key, List records, long timestamp) { - commands.add(Command.calculate("sum", key) + commands.add(Command.to().calculate("sum", key) .in(firstRecord(records), restRecords(records)) .at(Timestamp.fromMicros(timestamp))); } @Override public void sum(String key, List records, String timestamp) { - commands.add(Command.calculate("sum", key) + commands.add(Command.to().calculate("sum", key) .in(firstRecord(records), restRecords(records)) .at(Timestamp.fromString(timestamp))); } @Override public void sum(String key) { - commands.add(Command.calculate("sum", key)); + commands.add(Command.to().calculate("sum", key)); } @Override public void sum(String key, String timestamp) { - commands.add(Command.calculate("sum", key) + commands.add(Command.to().calculate("sum", key) .at(Timestamp.fromString(timestamp))); } @Override public void sum(String key, Criteria criteria) { - commands.add(Command.calculate("sum", key).where(criteria)); + commands.add(Command.to().calculate("sum", key).where(criteria)); } @Override public void sum(String key, Criteria criteria, long timestamp) { - commands.add(Command.calculate("sum", key).where(criteria) + commands.add(Command.to().calculate("sum", key).where(criteria) .at(Timestamp.fromMicros(timestamp))); } @Override public void sum(String key, Criteria criteria, String timestamp) { - commands.add(Command.calculate("sum", key).where(criteria) + commands.add(Command.to().calculate("sum", key).where(criteria) .at(Timestamp.fromString(timestamp))); } @Override public void sum(String key, String ccl, long timestamp) { - commands.add(Command.calculate("sum", key).where(ccl) + commands.add(Command.to().calculate("sum", key).where(ccl) .at(Timestamp.fromMicros(timestamp))); } @Override public void sum(String key, String ccl, String timestamp) { - commands.add(Command.calculate("sum", key).where(ccl) + commands.add(Command.to().calculate("sum", key).where(ccl) .at(Timestamp.fromString(timestamp))); } @Override public void average(String key, long record) { - commands.add(Command.calculate("average", key).in(record)); + commands.add(Command.to().calculate("average", key).in(record)); } @Override public void average(String key, long record, long timestamp) { - commands.add(Command.calculate("average", key).in(record) + commands.add(Command.to().calculate("average", key).in(record) .at(Timestamp.fromMicros(timestamp))); } @Override public void average(String key, long record, String timestamp) { - commands.add(Command.calculate("average", key).in(record) + commands.add(Command.to().calculate("average", key).in(record) .at(Timestamp.fromString(timestamp))); } @Override public void average(String key, List records) { - commands.add(Command.calculate("average", key).in(firstRecord(records), - restRecords(records))); + commands.add(Command.to().calculate("average", key) + .in(firstRecord(records), restRecords(records))); } @Override public void average(String key, List records, long timestamp) { - commands.add(Command.calculate("average", key) + commands.add(Command.to().calculate("average", key) .in(firstRecord(records), restRecords(records)) .at(Timestamp.fromMicros(timestamp))); } @Override public void average(String key, List records, String timestamp) { - commands.add(Command.calculate("average", key) + commands.add(Command.to().calculate("average", key) .in(firstRecord(records), restRecords(records)) .at(Timestamp.fromString(timestamp))); } @Override public void average(String key) { - commands.add(Command.calculate("average", key)); + commands.add(Command.to().calculate("average", key)); } @Override public void average(String key, String timestamp) { - commands.add(Command.calculate("average", key) + commands.add(Command.to().calculate("average", key) .at(Timestamp.fromString(timestamp))); } @Override public void average(String key, Criteria criteria) { - commands.add(Command.calculate("average", key).where(criteria)); + commands.add(Command.to().calculate("average", key).where(criteria)); } @Override public void average(String key, Criteria criteria, long timestamp) { - commands.add(Command.calculate("average", key).where(criteria) + commands.add(Command.to().calculate("average", key).where(criteria) .at(Timestamp.fromMicros(timestamp))); } @Override public void average(String key, Criteria criteria, String timestamp) { - commands.add(Command.calculate("average", key).where(criteria) + commands.add(Command.to().calculate("average", key).where(criteria) .at(Timestamp.fromString(timestamp))); } @Override public void average(String key, String ccl, long timestamp) { - commands.add(Command.calculate("average", key).where(ccl) + commands.add(Command.to().calculate("average", key).where(ccl) .at(Timestamp.fromMicros(timestamp))); } @Override public void average(String key, String ccl, String timestamp) { - commands.add(Command.calculate("average", key).where(ccl) + commands.add(Command.to().calculate("average", key).where(ccl) .at(Timestamp.fromString(timestamp))); } @Override public void count(String key, long record) { - commands.add(Command.calculate("count", key).in(record)); + commands.add(Command.to().calculate("count", key).in(record)); } @Override public void count(String key, long record, long timestamp) { - commands.add(Command.calculate("count", key).in(record) + commands.add(Command.to().calculate("count", key).in(record) .at(Timestamp.fromMicros(timestamp))); } @Override public void count(String key, long record, String timestamp) { - commands.add(Command.calculate("count", key).in(record) + commands.add(Command.to().calculate("count", key).in(record) .at(Timestamp.fromString(timestamp))); } @Override public void count(String key, List records) { - commands.add(Command.calculate("count", key).in(firstRecord(records), - restRecords(records))); + commands.add(Command.to().calculate("count", key) + .in(firstRecord(records), restRecords(records))); } @Override public void count(String key, List records, long timestamp) { - commands.add(Command.calculate("count", key) + commands.add(Command.to().calculate("count", key) .in(firstRecord(records), restRecords(records)) .at(Timestamp.fromMicros(timestamp))); } @Override public void count(String key, List records, String timestamp) { - commands.add(Command.calculate("count", key) + commands.add(Command.to().calculate("count", key) .in(firstRecord(records), restRecords(records)) .at(Timestamp.fromString(timestamp))); } @Override public void count(String key) { - commands.add(Command.calculate("count", key)); + commands.add(Command.to().calculate("count", key)); } @Override public void count(String key, String timestamp) { - commands.add(Command.calculate("count", key) + commands.add(Command.to().calculate("count", key) .at(Timestamp.fromString(timestamp))); } @Override public void count(String key, Criteria criteria) { - commands.add(Command.calculate("count", key).where(criteria)); + commands.add(Command.to().calculate("count", key).where(criteria)); } @Override public void count(String key, Criteria criteria, long timestamp) { - commands.add(Command.calculate("count", key).where(criteria) + commands.add(Command.to().calculate("count", key).where(criteria) .at(Timestamp.fromMicros(timestamp))); } @Override public void count(String key, Criteria criteria, String timestamp) { - commands.add(Command.calculate("count", key).where(criteria) + commands.add(Command.to().calculate("count", key).where(criteria) .at(Timestamp.fromString(timestamp))); } @Override public void count(String key, String ccl, long timestamp) { - commands.add(Command.calculate("count", key).where(ccl) + commands.add(Command.to().calculate("count", key).where(ccl) .at(Timestamp.fromMicros(timestamp))); } @Override public void count(String key, String ccl, String timestamp) { - commands.add(Command.calculate("count", key).where(ccl) + commands.add(Command.to().calculate("count", key).where(ccl) .at(Timestamp.fromString(timestamp))); } @Override public void max(String key, long record) { - commands.add(Command.calculate("max", key).in(record)); + commands.add(Command.to().calculate("max", key).in(record)); } @Override public void max(String key, long record, long timestamp) { - commands.add(Command.calculate("max", key).in(record) + commands.add(Command.to().calculate("max", key).in(record) .at(Timestamp.fromMicros(timestamp))); } @Override public void max(String key, long record, String timestamp) { - commands.add(Command.calculate("max", key).in(record) + commands.add(Command.to().calculate("max", key).in(record) .at(Timestamp.fromString(timestamp))); } @Override public void max(String key, List records) { - commands.add(Command.calculate("max", key).in(firstRecord(records), + commands.add(Command.to().calculate("max", key).in(firstRecord(records), restRecords(records))); } @Override public void max(String key, List records, long timestamp) { - commands.add(Command.calculate("max", key) + commands.add(Command.to().calculate("max", key) .in(firstRecord(records), restRecords(records)) .at(Timestamp.fromMicros(timestamp))); } @Override public void max(String key, List records, String timestamp) { - commands.add(Command.calculate("max", key) + commands.add(Command.to().calculate("max", key) .in(firstRecord(records), restRecords(records)) .at(Timestamp.fromString(timestamp))); } @Override public void max(String key, Criteria criteria) { - commands.add(Command.calculate("max", key).where(criteria)); + commands.add(Command.to().calculate("max", key).where(criteria)); } @Override public void max(String key, Criteria criteria, long timestamp) { - commands.add(Command.calculate("max", key).where(criteria) + commands.add(Command.to().calculate("max", key).where(criteria) .at(Timestamp.fromMicros(timestamp))); } @Override public void max(String key, Criteria criteria, String timestamp) { - commands.add(Command.calculate("max", key).where(criteria) + commands.add(Command.to().calculate("max", key).where(criteria) .at(Timestamp.fromString(timestamp))); } @Override public void max(String key, String ccl) { - commands.add(Command.calculate("max", key).where(ccl)); + commands.add(Command.to().calculate("max", key).where(ccl)); } @Override public void max(String key, String ccl, long timestamp) { - commands.add(Command.calculate("max", key).where(ccl) + commands.add(Command.to().calculate("max", key).where(ccl) .at(Timestamp.fromMicros(timestamp))); } @Override public void max(String key, String ccl, String timestamp) { - commands.add(Command.calculate("max", key).where(ccl) + commands.add(Command.to().calculate("max", key).where(ccl) .at(Timestamp.fromString(timestamp))); } @Override public void max(String key) { - commands.add(Command.calculate("max", key)); + commands.add(Command.to().calculate("max", key)); } @Override public void min(String key, long record) { - commands.add(Command.calculate("min", key).in(record)); + commands.add(Command.to().calculate("min", key).in(record)); } @Override public void min(String key, long record, long timestamp) { - commands.add(Command.calculate("min", key).in(record) + commands.add(Command.to().calculate("min", key).in(record) .at(Timestamp.fromMicros(timestamp))); } @Override public void min(String key, long record, String timestamp) { - commands.add(Command.calculate("min", key).in(record) + commands.add(Command.to().calculate("min", key).in(record) .at(Timestamp.fromString(timestamp))); } @Override public void min(String key) { - commands.add(Command.calculate("min", key)); + commands.add(Command.to().calculate("min", key)); } @Override public void min(String key, List records, long timestamp) { - commands.add(Command.calculate("min", key) + commands.add(Command.to().calculate("min", key) .in(firstRecord(records), restRecords(records)) .at(Timestamp.fromMicros(timestamp))); } @Override public void min(String key, List records, String timestamp) { - commands.add(Command.calculate("min", key) + commands.add(Command.to().calculate("min", key) .in(firstRecord(records), restRecords(records)) .at(Timestamp.fromString(timestamp))); } @Override public void min(String key, Criteria criteria) { - commands.add(Command.calculate("min", key).where(criteria)); + commands.add(Command.to().calculate("min", key).where(criteria)); } @Override public void min(String key, Criteria criteria, long timestamp) { - commands.add(Command.calculate("min", key).where(criteria) + commands.add(Command.to().calculate("min", key).where(criteria) .at(Timestamp.fromMicros(timestamp))); } @Override public void min(String key, Criteria criteria, String timestamp) { - commands.add(Command.calculate("min", key).where(criteria) + commands.add(Command.to().calculate("min", key).where(criteria) .at(Timestamp.fromString(timestamp))); } @Override public void min(String key, String ccl) { - commands.add(Command.calculate("min", key).where(ccl)); + commands.add(Command.to().calculate("min", key).where(ccl)); } @Override public void min(String key, String ccl, long timestamp) { - commands.add(Command.calculate("min", key).where(ccl) + commands.add(Command.to().calculate("min", key).where(ccl) .at(Timestamp.fromMicros(timestamp))); } @Override public void min(String key, String ccl, String timestamp) { - commands.add(Command.calculate("min", key).where(ccl) + commands.add(Command.to().calculate("min", key).where(ccl) .at(Timestamp.fromString(timestamp))); } @Override public void min(String key, List records) { - commands.add(Command.calculate("min", key).in(firstRecord(records), + commands.add(Command.to().calculate("min", key).in(firstRecord(records), restRecords(records))); } @@ -2654,61 +2672,61 @@ public void min(String key, List records) { @Override public void navigate(String key, long record) { - commands.add(Command.navigate(key).from(record)); + commands.add(Command.to().navigate(key).from(record)); } @Override public void navigate(String key, long record, long timestamp) { - commands.add(Command.navigate(key).from(record) + commands.add(Command.to().navigate(key).from(record) .at(Timestamp.fromMicros(timestamp))); } @Override public void navigate(String key, long record, String timestamp) { - commands.add(Command.navigate(key).from(record) + commands.add(Command.to().navigate(key).from(record) .at(Timestamp.fromString(timestamp))); } @Override public void navigate(List keys, long record) { - commands.add( - Command.navigate(firstKey(keys), restKeys(keys)).from(record)); + commands.add(Command.to().navigate(firstKey(keys), restKeys(keys)) + .from(record)); } @Override public void navigate(List keys, long record, long timestamp) { - commands.add(Command.navigate(firstKey(keys), restKeys(keys)) + commands.add(Command.to().navigate(firstKey(keys), restKeys(keys)) .from(record).at(Timestamp.fromMicros(timestamp))); } @Override public void navigate(List keys, long record, String timestamp) { - commands.add(Command.navigate(firstKey(keys), restKeys(keys)) + commands.add(Command.to().navigate(firstKey(keys), restKeys(keys)) .from(record).at(Timestamp.fromString(timestamp))); } @Override public void navigate(List keys, List records) { - commands.add(Command.navigate(firstKey(keys), restKeys(keys)) + commands.add(Command.to().navigate(firstKey(keys), restKeys(keys)) .from(firstRecord(records), restRecords(records))); } @Override public void navigate(String key, List records) { - commands.add(Command.navigate(key).from(firstRecord(records), + commands.add(Command.to().navigate(key).from(firstRecord(records), restRecords(records))); } @Override public void navigate(String key, List records, long timestamp) { - commands.add(Command.navigate(key) + commands.add(Command.to().navigate(key) .from(firstRecord(records), restRecords(records)) .at(Timestamp.fromMicros(timestamp))); } @Override public void navigate(String key, List records, String timestamp) { - commands.add(Command.navigate(key) + commands.add(Command.to().navigate(key) .from(firstRecord(records), restRecords(records)) .at(Timestamp.fromString(timestamp))); } @@ -2716,7 +2734,7 @@ public void navigate(String key, List records, String timestamp) { @Override public void navigate(List keys, List records, long timestamp) { - commands.add(Command.navigate(firstKey(keys), restKeys(keys)) + commands.add(Command.to().navigate(firstKey(keys), restKeys(keys)) .from(firstRecord(records), restRecords(records)) .at(Timestamp.fromMicros(timestamp))); } @@ -2724,80 +2742,90 @@ public void navigate(List keys, List records, @Override public void navigate(List keys, List records, String timestamp) { - commands.add(Command.navigate(firstKey(keys), restKeys(keys)) + commands.add(Command.to().navigate(firstKey(keys), restKeys(keys)) .from(firstRecord(records), restRecords(records)) .at(Timestamp.fromString(timestamp))); } @Override public void navigate(String key, String ccl) { - commands.add(Command.navigate(key).where(ccl)); + commands.add(Command.to().navigate(key).where(ccl)); } @Override public void navigate(String key, String ccl, long timestamp) { - commands.add(Command.navigate(key).where(ccl) + commands.add(Command.to().navigate(key).where(ccl) .at(Timestamp.fromMicros(timestamp))); } @Override public void navigate(String key, String ccl, String timestamp) { - commands.add(Command.navigate(key).where(ccl) + commands.add(Command.to().navigate(key).where(ccl) .at(Timestamp.fromString(timestamp))); } @Override public void navigate(List keys, String ccl) { - commands.add( - Command.navigate(firstKey(keys), restKeys(keys)).where(ccl)); + commands.add(Command.to().navigate(firstKey(keys), restKeys(keys)) + .where(ccl)); } @Override public void navigate(List keys, String ccl, long timestamp) { - commands.add(Command.navigate(firstKey(keys), restKeys(keys)).where(ccl) - .at(Timestamp.fromMicros(timestamp))); + commands.add(Command.to().navigate(firstKey(keys), restKeys(keys)) + .where(ccl).at(Timestamp.fromMicros(timestamp))); } @Override public void navigate(List keys, String ccl, String timestamp) { - commands.add(Command.navigate(firstKey(keys), restKeys(keys)).where(ccl) - .at(Timestamp.fromString(timestamp))); + commands.add(Command.to().navigate(firstKey(keys), restKeys(keys)) + .where(ccl).at(Timestamp.fromString(timestamp))); } @Override public void navigate(String key, Criteria criteria) { - commands.add(Command.navigate(key).where(criteria)); + commands.add(Command.to().navigate(key).where(criteria)); } @Override public void navigate(String key, Criteria criteria, long timestamp) { - commands.add(Command.navigate(key).where(criteria) + commands.add(Command.to().navigate(key).where(criteria) .at(Timestamp.fromMicros(timestamp))); } @Override public void navigate(String key, Criteria criteria, String timestamp) { - commands.add(Command.navigate(key).where(criteria) + commands.add(Command.to().navigate(key).where(criteria) .at(Timestamp.fromString(timestamp))); } @Override public void navigate(List keys, Criteria criteria) { - commands.add(Command.navigate(firstKey(keys), restKeys(keys)) + commands.add(Command.to().navigate(firstKey(keys), restKeys(keys)) .where(criteria)); } @Override public void navigate(List keys, Criteria criteria, long timestamp) { - commands.add(Command.navigate(firstKey(keys), restKeys(keys)) + commands.add(Command.to().navigate(firstKey(keys), restKeys(keys)) .where(criteria).at(Timestamp.fromMicros(timestamp))); } @Override public void navigate(List keys, Criteria criteria, String timestamp) { - commands.add(Command.navigate(firstKey(keys), restKeys(keys)) + commands.add(Command.to().navigate(firstKey(keys), restKeys(keys)) .where(criteria).at(Timestamp.fromString(timestamp))); } + @Override + public void exec(String ccl) { + commands.add(Command.parse(ccl)); + } + + @Override + public void submit(String ccl) { + commands.add(Command.parse(ccl)); + } + } diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/ParsedCommand.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/ParsedCommand.java new file mode 100644 index 000000000..32efe40aa --- /dev/null +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/ParsedCommand.java @@ -0,0 +1,406 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.lang.command; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.StreamSupport; + +import com.cinchapi.ccl.grammar.KeyTokenSymbol; +import com.cinchapi.ccl.grammar.Symbol; +import com.cinchapi.ccl.grammar.TimestampSymbol; +import com.cinchapi.ccl.grammar.command.AddSymbol; +import com.cinchapi.ccl.grammar.command.AuditSymbol; +import com.cinchapi.ccl.grammar.command.BrowseSymbol; +import com.cinchapi.ccl.grammar.command.CalculateSymbol; +import com.cinchapi.ccl.grammar.command.ChronicleSymbol; +import com.cinchapi.ccl.grammar.command.ClearSymbol; +import com.cinchapi.ccl.grammar.command.CommandSymbol; +import com.cinchapi.ccl.grammar.command.ConsolidateSymbol; +import com.cinchapi.ccl.grammar.command.DescribeSymbol; +import com.cinchapi.ccl.grammar.command.DiffSymbol; +import com.cinchapi.ccl.grammar.command.FindOrAddSymbol; +import com.cinchapi.ccl.grammar.command.FindOrInsertSymbol; +import com.cinchapi.ccl.grammar.command.FindSymbol; +import com.cinchapi.ccl.grammar.command.GetSymbol; +import com.cinchapi.ccl.grammar.command.HoldsSymbol; +import com.cinchapi.ccl.grammar.command.InsertSymbol; +import com.cinchapi.ccl.grammar.command.JsonifySymbol; +import com.cinchapi.ccl.grammar.command.LinkSymbol; +import com.cinchapi.ccl.grammar.command.NavigateSymbol; +import com.cinchapi.ccl.grammar.command.ReconcileSymbol; +import com.cinchapi.ccl.grammar.command.RemoveSymbol; +import com.cinchapi.ccl.grammar.command.RevertSymbol; +import com.cinchapi.ccl.grammar.command.SearchSymbol; +import com.cinchapi.ccl.grammar.command.SelectSymbol; +import com.cinchapi.ccl.grammar.command.SetSymbol; +import com.cinchapi.ccl.grammar.command.TraceSymbol; +import com.cinchapi.ccl.grammar.command.UnlinkSymbol; +import com.cinchapi.ccl.grammar.command.VerifyAndSwapSymbol; +import com.cinchapi.ccl.grammar.command.VerifyOrSetSymbol; +import com.cinchapi.ccl.grammar.command.VerifySymbol; +import com.cinchapi.ccl.syntax.CommandTree; +import com.cinchapi.concourse.lang.ConcourseCompiler; +import com.cinchapi.concourse.lang.paginate.Page; +import com.cinchapi.concourse.lang.sort.Order; +import com.cinchapi.concourse.thrift.JavaThriftBridge; +import com.cinchapi.concourse.thrift.TCommand; +import com.cinchapi.concourse.thrift.TCommandVerb; +import com.cinchapi.concourse.util.Convert; + +/** + * A {@link Command} created by parsing a CCL string via + * {@link Command#parse(String)}. + *

    + * Unlike the builder-pattern {@link Command Commands} constructed via the + * fluent API, a {@link ParsedCommand} stores the raw CCL string and the parsed + * {@link CommandTree}. It overrides {@link #toThrift()} to build a + * {@link TCommand} directly from the parsed tree, avoiding the need to + * reconstruct intermediate builder states. + *

    + * + * @author Jeff Nelson + */ +final class ParsedCommand implements Command { + + /** + * The original CCL string. + */ + private final String ccl; + + /** + * The parsed {@link CommandTree}. + */ + private final CommandTree tree; + + /** + * Construct a new instance. + * + * @param ccl the original CCL string + * @param tree the parsed {@link CommandTree} + */ + ParsedCommand(String ccl, CommandTree tree) { + this.ccl = ccl; + this.tree = tree; + } + + @Override + public String ccl() { + return ccl; + } + + @Override + public TCommand toThrift() { + CommandSymbol symbol = (CommandSymbol) tree.root(); + TCommand tc = new TCommand(TCommandVerb.valueOf(symbol.type())); + populateFromSymbol(tc, symbol); + populateFromTree(tc); + return tc; + } + + @Override + public String toString() { + return ccl(); + } + + /** + * Populate a {@link TCommand} with data extracted from the + * {@link CommandSymbol}. + * + * @param tc the {@link TCommand} to populate + * @param symbol the {@link CommandSymbol} carrying parsed data + */ + private void populateFromSymbol(TCommand tc, CommandSymbol symbol) { + if(symbol instanceof FindSymbol) { + setTimestamp(tc, ((FindSymbol) symbol).timestamp()); + } + else if(symbol instanceof SelectSymbol) { + SelectSymbol ss = (SelectSymbol) symbol; + setKeyTokens(tc, ss.keys()); + setRecordsFromSymbol(tc, ss.record(), ss.records()); + setTimestamp(tc, ss.timestamp()); + } + else if(symbol instanceof GetSymbol) { + GetSymbol gs = (GetSymbol) symbol; + setKeyTokens(tc, gs.keys()); + setRecordsFromSymbol(tc, gs.record(), gs.records()); + setTimestamp(tc, gs.timestamp()); + } + else if(symbol instanceof NavigateSymbol) { + NavigateSymbol ns = (NavigateSymbol) symbol; + setKeyTokens(tc, ns.keys()); + setRecordsFromSymbol(tc, ns.record(), ns.records()); + setTimestamp(tc, ns.timestamp()); + } + else if(symbol instanceof AddSymbol) { + AddSymbol as = (AddSymbol) symbol; + tc.setKeys(Collections.singletonList(as.key().toString())); + tc.setValue(Convert.javaToThrift(as.value().value())); + setRecordsFromSymbol(tc, as.record(), as.records()); + } + else if(symbol instanceof SetSymbol) { + SetSymbol ss = (SetSymbol) symbol; + tc.setKeys(Collections.singletonList(ss.key().toString())); + tc.setValue(Convert.javaToThrift(ss.value().value())); + setRecordsFromSymbol(tc, ss.record(), ss.records()); + } + else if(symbol instanceof RemoveSymbol) { + RemoveSymbol rs = (RemoveSymbol) symbol; + tc.setKeys(Collections.singletonList(rs.key().toString())); + tc.setValue(Convert.javaToThrift(rs.value().value())); + setRecordsFromSymbol(tc, null, + rs.isMultiRecord() ? rs.records() : null); + if(!rs.isMultiRecord()) { + tc.setRecords(Collections.singletonList(rs.record())); + } + } + else if(symbol instanceof ClearSymbol) { + ClearSymbol cs = (ClearSymbol) symbol; + if(cs.keys() != null) { + setKeyTokens(tc, cs.keys()); + } + else if(cs.key() != null) { + tc.setKeys(Collections.singletonList(cs.key().toString())); + } + setRecordsFromSymbol(tc, null, cs.records()); + if(cs.records() == null) { + tc.setRecords(Collections.singletonList(cs.record())); + } + } + else if(symbol instanceof InsertSymbol) { + InsertSymbol is = (InsertSymbol) symbol; + tc.setJson(is.json()); + setRecordsFromSymbol(tc, is.record(), is.records()); + } + else if(symbol instanceof LinkSymbol) { + LinkSymbol ls = (LinkSymbol) symbol; + tc.setKeys(Collections.singletonList(ls.key().toString())); + tc.setSourceRecord(ls.source()); + tc.setRecords(new ArrayList<>(ls.destinations())); + } + else if(symbol instanceof UnlinkSymbol) { + UnlinkSymbol us = (UnlinkSymbol) symbol; + tc.setKeys(Collections.singletonList(us.key().toString())); + tc.setSourceRecord(us.source()); + tc.setRecords(Collections.singletonList(us.destination())); + } + else if(symbol instanceof VerifySymbol) { + VerifySymbol vs = (VerifySymbol) symbol; + tc.setKeys(Collections.singletonList(vs.key().toString())); + tc.setValue(Convert.javaToThrift(vs.value().value())); + tc.setRecords(Collections.singletonList(vs.record())); + setTimestamp(tc, vs.timestamp()); + } + else if(symbol instanceof VerifyAndSwapSymbol) { + VerifyAndSwapSymbol vas = (VerifyAndSwapSymbol) symbol; + tc.setKeys(Collections.singletonList(vas.key().toString())); + tc.setValue(Convert.javaToThrift(vas.expected().value())); + tc.setReplacement(Convert.javaToThrift(vas.replacement().value())); + tc.setRecords(Collections.singletonList(vas.record())); + } + else if(symbol instanceof VerifyOrSetSymbol) { + VerifyOrSetSymbol vos = (VerifyOrSetSymbol) symbol; + tc.setKeys(Collections.singletonList(vos.key().toString())); + tc.setValue(Convert.javaToThrift(vos.value().value())); + tc.setRecords(Collections.singletonList(vos.record())); + } + else if(symbol instanceof FindOrAddSymbol) { + FindOrAddSymbol foa = (FindOrAddSymbol) symbol; + tc.setKeys(Collections.singletonList(foa.key().toString())); + tc.setValue(Convert.javaToThrift(foa.value().value())); + } + else if(symbol instanceof FindOrInsertSymbol) { + FindOrInsertSymbol foi = (FindOrInsertSymbol) symbol; + tc.setJson(foi.json()); + setTimestamp(tc, foi.timestamp()); + } + else if(symbol instanceof SearchSymbol) { + SearchSymbol ss = (SearchSymbol) symbol; + tc.setKeys(Collections.singletonList(ss.key().toString())); + tc.setQuery(ss.query()); + } + else if(symbol instanceof BrowseSymbol) { + BrowseSymbol bs = (BrowseSymbol) symbol; + setKeyTokens(tc, bs.keys()); + setTimestamp(tc, bs.timestamp()); + } + else if(symbol instanceof DescribeSymbol) { + DescribeSymbol ds = (DescribeSymbol) symbol; + setRecordsFromSymbol(tc, ds.record(), ds.records()); + setTimestamp(tc, ds.timestamp()); + } + else if(symbol instanceof TraceSymbol) { + TraceSymbol ts = (TraceSymbol) symbol; + setRecordsFromSymbol(tc, ts.record(), ts.records()); + setTimestamp(tc, ts.timestamp()); + } + else if(symbol instanceof HoldsSymbol) { + HoldsSymbol hs = (HoldsSymbol) symbol; + setRecordsFromSymbol(tc, hs.record(), hs.records()); + } + else if(symbol instanceof JsonifySymbol) { + JsonifySymbol js = (JsonifySymbol) symbol; + setRecordsFromSymbol(tc, js.record(), js.records()); + setTimestamp(tc, js.timestamp()); + } + else if(symbol instanceof ChronicleSymbol) { + ChronicleSymbol cs = (ChronicleSymbol) symbol; + tc.setKeys(Collections.singletonList(cs.key().toString())); + tc.setRecords(Collections.singletonList(cs.record())); + setTimestamp(tc, cs.start()); + if(cs.end() != null && cs.end() != TimestampSymbol.PRESENT) { + tc.setEndTimestamp(cs.end().timestamp()); + } + } + else if(symbol instanceof DiffSymbol) { + DiffSymbol ds = (DiffSymbol) symbol; + if(ds.key() != null) { + tc.setKeys(Collections.singletonList(ds.key().toString())); + } + if(ds.record() != null) { + tc.setRecords(Collections.singletonList(ds.record())); + } + setTimestamp(tc, ds.start()); + if(ds.end() != null && ds.end() != TimestampSymbol.PRESENT) { + tc.setEndTimestamp(ds.end().timestamp()); + } + } + else if(symbol instanceof AuditSymbol) { + AuditSymbol as = (AuditSymbol) symbol; + if(as.key() != null) { + tc.setKeys(Collections.singletonList(as.key().toString())); + } + tc.setRecords(Collections.singletonList(as.record())); + setTimestamp(tc, as.start()); + if(as.end() != null && as.end() != TimestampSymbol.PRESENT) { + tc.setEndTimestamp(as.end().timestamp()); + } + } + else if(symbol instanceof RevertSymbol) { + RevertSymbol rs = (RevertSymbol) symbol; + if(rs.keys() != null) { + setKeyTokens(tc, rs.keys()); + } + else if(rs.key() != null) { + tc.setKeys(Collections.singletonList(rs.key().toString())); + } + setRecordsFromSymbol(tc, null, rs.records()); + if(rs.records() == null) { + tc.setRecords(Collections.singletonList(rs.record())); + } + setTimestamp(tc, rs.timestamp()); + } + else if(symbol instanceof ReconcileSymbol) { + ReconcileSymbol rs = (ReconcileSymbol) symbol; + tc.setKeys(Collections.singletonList(rs.key().toString())); + tc.setRecords(Collections.singletonList(rs.record())); + tc.setValues(rs.values().stream() + .map(v -> Convert.javaToThrift(v.value())) + .collect(Collectors.toList())); + } + else if(symbol instanceof ConsolidateSymbol) { + ConsolidateSymbol cs = (ConsolidateSymbol) symbol; + List records = new ArrayList<>(); + records.add(cs.first()); + records.addAll(cs.remaining()); + tc.setRecords(records); + } + else if(symbol instanceof CalculateSymbol) { + CalculateSymbol cs = (CalculateSymbol) symbol; + tc.setFunction(cs.function()); + tc.setKeys(Collections.singletonList(cs.key().toString())); + if(cs.records() != null) { + tc.setRecords(new ArrayList<>(cs.records())); + } + setTimestamp(tc, cs.timestamp()); + } + // NOTE: Nullary commands (PingSymbol, StageSymbol, + // CommitSymbol, AbortSymbol, InventorySymbol) need no + // additional fields beyond the verb that is already set. + } + + /** + * Populate a {@link TCommand} with condition, order, and page data from the + * {@link CommandTree}. + * + * @param tc the {@link TCommand} to populate + */ + private void populateFromTree(TCommand tc) { + if(tree.conditionTree() != null) { + String condition = StreamSupport + .stream(ConcourseCompiler.get() + .tokenize(tree.conditionTree()).spliterator(), + false) + .map(Symbol::toString).collect(Collectors.joining(" ")); + tc.setCondition(condition); + } + if(tree.orderTree() != null) { + tc.setOrder(JavaThriftBridge.convert(Order.from(tree.orderTree()))); + } + if(tree.pageTree() != null) { + tc.setPage(JavaThriftBridge.convert(Page.from(tree.pageTree()))); + } + } + + /** + * Set a timestamp on the {@link TCommand} if the given + * {@link TimestampSymbol} represents a historical timestamp. + * + * @param tc the {@link TCommand} to modify + * @param ts the {@link TimestampSymbol}, or {@code null} + */ + private static void setTimestamp(TCommand tc, TimestampSymbol ts) { + if(ts != null && ts != TimestampSymbol.PRESENT && ts.timestamp() != 0) { + tc.setTimestamp(ts.timestamp()); + } + } + + /** + * Set key tokens on the {@link TCommand} from a collection of + * {@link KeyTokenSymbol KeyTokenSymbols}. + * + * @param tc the {@link TCommand} to modify + * @param keys the key symbols, or {@code null} + */ + private static void setKeyTokens(TCommand tc, + java.util.Collection> keys) { + if(keys != null && !keys.isEmpty()) { + tc.setKeys(keys.stream().map(KeyTokenSymbol::toString) + .collect(Collectors.toList())); + } + } + + /** + * Set records on the {@link TCommand} from a single record or a collection + * of records extracted from a {@link CommandSymbol}. + * + * @param tc the {@link TCommand} to modify + * @param record the single record, or {@code null} + * @param records the collection of records, or {@code null} + */ + private static void setRecordsFromSymbol(TCommand tc, Long record, + java.util.Collection records) { + if(records != null) { + tc.setRecords(new ArrayList<>(records)); + } + else if(record != null) { + tc.setRecords(Collections.singletonList(record)); + } + } + +} diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/thrift/ConcourseService.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/thrift/ConcourseService.java index 07edf4bf0..b203742d8 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/thrift/ConcourseService.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/thrift/ConcourseService.java @@ -2289,6 +2289,10 @@ public interface Iface { public java.util.List submit(java.util.List commands, com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment) throws com.cinchapi.concourse.thrift.SecurityException, com.cinchapi.concourse.thrift.TransactionException, com.cinchapi.concourse.thrift.InvalidArgumentException, com.cinchapi.concourse.thrift.PermissionException, com.cinchapi.concourse.thrift.ParseException, org.apache.thrift.TException; + public com.cinchapi.concourse.thrift.ComplexTObject execCcl(java.lang.String ccl, com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment) throws com.cinchapi.concourse.thrift.SecurityException, com.cinchapi.concourse.thrift.TransactionException, com.cinchapi.concourse.thrift.InvalidArgumentException, com.cinchapi.concourse.thrift.PermissionException, com.cinchapi.concourse.thrift.ParseException, org.apache.thrift.TException; + + public java.util.List submitCcl(java.lang.String ccl, com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment) throws com.cinchapi.concourse.thrift.SecurityException, com.cinchapi.concourse.thrift.TransactionException, com.cinchapi.concourse.thrift.InvalidArgumentException, com.cinchapi.concourse.thrift.PermissionException, com.cinchapi.concourse.thrift.ParseException, org.apache.thrift.TException; + public com.cinchapi.concourse.thrift.ComplexTObject invokeManagement(java.lang.String method, java.util.List params, com.cinchapi.concourse.thrift.AccessToken creds) throws com.cinchapi.concourse.thrift.SecurityException, com.cinchapi.concourse.thrift.ManagementException, org.apache.thrift.TException; public boolean ping(com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment) throws com.cinchapi.concourse.thrift.SecurityException, com.cinchapi.concourse.thrift.PermissionException, org.apache.thrift.TException; @@ -3003,6 +3007,10 @@ public interface AsyncIface { public void submit(java.util.List commands, com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws org.apache.thrift.TException; + public void execCcl(java.lang.String ccl, com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void submitCcl(java.lang.String ccl, com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws org.apache.thrift.TException; + public void invokeManagement(java.lang.String method, java.util.List params, com.cinchapi.concourse.thrift.AccessToken creds, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void ping(com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; @@ -16945,6 +16953,90 @@ public java.util.List recv_submit( throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "submit failed: unknown result"); } + @Override + public com.cinchapi.concourse.thrift.ComplexTObject execCcl(java.lang.String ccl, com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment) throws com.cinchapi.concourse.thrift.SecurityException, com.cinchapi.concourse.thrift.TransactionException, com.cinchapi.concourse.thrift.InvalidArgumentException, com.cinchapi.concourse.thrift.PermissionException, com.cinchapi.concourse.thrift.ParseException, org.apache.thrift.TException + { + send_execCcl(ccl, creds, transaction, environment); + return recv_execCcl(); + } + + public void send_execCcl(java.lang.String ccl, com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment) throws org.apache.thrift.TException + { + execCcl_args args = new execCcl_args(); + args.setCcl(ccl); + args.setCreds(creds); + args.setTransaction(transaction); + args.setEnvironment(environment); + sendBase("execCcl", args); + } + + public com.cinchapi.concourse.thrift.ComplexTObject recv_execCcl() throws com.cinchapi.concourse.thrift.SecurityException, com.cinchapi.concourse.thrift.TransactionException, com.cinchapi.concourse.thrift.InvalidArgumentException, com.cinchapi.concourse.thrift.PermissionException, com.cinchapi.concourse.thrift.ParseException, org.apache.thrift.TException + { + execCcl_result result = new execCcl_result(); + receiveBase(result, "execCcl"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.ex != null) { + throw result.ex; + } + if (result.ex2 != null) { + throw result.ex2; + } + if (result.ex3 != null) { + throw result.ex3; + } + if (result.ex4 != null) { + throw result.ex4; + } + if (result.ex5 != null) { + throw result.ex5; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "execCcl failed: unknown result"); + } + + @Override + public java.util.List submitCcl(java.lang.String ccl, com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment) throws com.cinchapi.concourse.thrift.SecurityException, com.cinchapi.concourse.thrift.TransactionException, com.cinchapi.concourse.thrift.InvalidArgumentException, com.cinchapi.concourse.thrift.PermissionException, com.cinchapi.concourse.thrift.ParseException, org.apache.thrift.TException + { + send_submitCcl(ccl, creds, transaction, environment); + return recv_submitCcl(); + } + + public void send_submitCcl(java.lang.String ccl, com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment) throws org.apache.thrift.TException + { + submitCcl_args args = new submitCcl_args(); + args.setCcl(ccl); + args.setCreds(creds); + args.setTransaction(transaction); + args.setEnvironment(environment); + sendBase("submitCcl", args); + } + + public java.util.List recv_submitCcl() throws com.cinchapi.concourse.thrift.SecurityException, com.cinchapi.concourse.thrift.TransactionException, com.cinchapi.concourse.thrift.InvalidArgumentException, com.cinchapi.concourse.thrift.PermissionException, com.cinchapi.concourse.thrift.ParseException, org.apache.thrift.TException + { + submitCcl_result result = new submitCcl_result(); + receiveBase(result, "submitCcl"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.ex != null) { + throw result.ex; + } + if (result.ex2 != null) { + throw result.ex2; + } + if (result.ex3 != null) { + throw result.ex3; + } + if (result.ex4 != null) { + throw result.ex4; + } + if (result.ex5 != null) { + throw result.ex5; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "submitCcl failed: unknown result"); + } + @Override public com.cinchapi.concourse.thrift.ComplexTObject invokeManagement(java.lang.String method, java.util.List params, com.cinchapi.concourse.thrift.AccessToken creds) throws com.cinchapi.concourse.thrift.SecurityException, com.cinchapi.concourse.thrift.ManagementException, org.apache.thrift.TException { @@ -34713,6 +34805,94 @@ public java.util.List getResult() } } + @Override + public void execCcl(java.lang.String ccl, com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + execCcl_call method_call = new execCcl_call(ccl, creds, transaction, environment, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class execCcl_call extends org.apache.thrift.async.TAsyncMethodCall { + private java.lang.String ccl; + private com.cinchapi.concourse.thrift.AccessToken creds; + private com.cinchapi.concourse.thrift.TransactionToken transaction; + private java.lang.String environment; + public execCcl_call(java.lang.String ccl, com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment, 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.ccl = ccl; + this.creds = creds; + this.transaction = transaction; + this.environment = environment; + } + + @Override + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("execCcl", org.apache.thrift.protocol.TMessageType.CALL, 0)); + execCcl_args args = new execCcl_args(); + args.setCcl(ccl); + args.setCreds(creds); + args.setTransaction(transaction); + args.setEnvironment(environment); + args.write(prot); + prot.writeMessageEnd(); + } + + @Override + public com.cinchapi.concourse.thrift.ComplexTObject getResult() throws com.cinchapi.concourse.thrift.SecurityException, com.cinchapi.concourse.thrift.TransactionException, com.cinchapi.concourse.thrift.InvalidArgumentException, com.cinchapi.concourse.thrift.PermissionException, com.cinchapi.concourse.thrift.ParseException, 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_execCcl(); + } + } + + @Override + public void submitCcl(java.lang.String ccl, com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws org.apache.thrift.TException { + checkReady(); + submitCcl_call method_call = new submitCcl_call(ccl, creds, transaction, environment, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class submitCcl_call extends org.apache.thrift.async.TAsyncMethodCall> { + private java.lang.String ccl; + private com.cinchapi.concourse.thrift.AccessToken creds; + private com.cinchapi.concourse.thrift.TransactionToken transaction; + private java.lang.String environment; + public submitCcl_call(java.lang.String ccl, com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment, 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.ccl = ccl; + this.creds = creds; + this.transaction = transaction; + this.environment = environment; + } + + @Override + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("submitCcl", org.apache.thrift.protocol.TMessageType.CALL, 0)); + submitCcl_args args = new submitCcl_args(); + args.setCcl(ccl); + args.setCreds(creds); + args.setTransaction(transaction); + args.setEnvironment(environment); + args.write(prot); + prot.writeMessageEnd(); + } + + @Override + public java.util.List getResult() throws com.cinchapi.concourse.thrift.SecurityException, com.cinchapi.concourse.thrift.TransactionException, com.cinchapi.concourse.thrift.InvalidArgumentException, com.cinchapi.concourse.thrift.PermissionException, com.cinchapi.concourse.thrift.ParseException, 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_submitCcl(); + } + } + @Override public void invokeManagement(java.lang.String method, java.util.List params, com.cinchapi.concourse.thrift.AccessToken creds, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); @@ -35161,6 +35341,8 @@ protected Processor(I iface, java.util.Map extends org.apache.thrift.ProcessFunction { + public execCcl() { + super("execCcl"); + } + + @Override + public execCcl_args getEmptyArgsInstance() { + return new execCcl_args(); + } + + @Override + protected boolean isOneway() { + return false; + } + + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + @Override + public execCcl_result getResult(I iface, execCcl_args args) throws org.apache.thrift.TException { + execCcl_result result = new execCcl_result(); + try { + result.success = iface.execCcl(args.ccl, args.creds, args.transaction, args.environment); + } catch (com.cinchapi.concourse.thrift.SecurityException ex) { + result.ex = ex; + } catch (com.cinchapi.concourse.thrift.TransactionException ex2) { + result.ex2 = ex2; + } catch (com.cinchapi.concourse.thrift.InvalidArgumentException ex3) { + result.ex3 = ex3; + } catch (com.cinchapi.concourse.thrift.PermissionException ex4) { + result.ex4 = ex4; + } catch (com.cinchapi.concourse.thrift.ParseException ex5) { + result.ex5 = ex5; + } + return result; + } + } + + public static class submitCcl extends org.apache.thrift.ProcessFunction { + public submitCcl() { + super("submitCcl"); + } + + @Override + public submitCcl_args getEmptyArgsInstance() { + return new submitCcl_args(); + } + + @Override + protected boolean isOneway() { + return false; + } + + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + @Override + public submitCcl_result getResult(I iface, submitCcl_args args) throws org.apache.thrift.TException { + submitCcl_result result = new submitCcl_result(); + try { + result.success = iface.submitCcl(args.ccl, args.creds, args.transaction, args.environment); + } catch (com.cinchapi.concourse.thrift.SecurityException ex) { + result.ex = ex; + } catch (com.cinchapi.concourse.thrift.TransactionException ex2) { + result.ex2 = ex2; + } catch (com.cinchapi.concourse.thrift.InvalidArgumentException ex3) { + result.ex3 = ex3; + } catch (com.cinchapi.concourse.thrift.PermissionException ex4) { + result.ex4 = ex4; + } catch (com.cinchapi.concourse.thrift.ParseException ex5) { + result.ex5 = ex5; + } + return result; + } + } + public static class invokeManagement extends org.apache.thrift.ProcessFunction { public invokeManagement() { super("invokeManagement"); @@ -48696,6 +48958,8 @@ protected AsyncProcessor(I iface, java.util.Map extends org.apache.thrift.AsyncProcessFunction { - public invokeManagement() { - super("invokeManagement"); + public static class execCcl extends org.apache.thrift.AsyncProcessFunction { + public execCcl() { + super("execCcl"); } @Override - public invokeManagement_args getEmptyArgsInstance() { - return new invokeManagement_args(); + public execCcl_args getEmptyArgsInstance() { + return new execCcl_args(); } @Override @@ -77341,7 +77605,7 @@ public org.apache.thrift.async.AsyncMethodCallback() { @Override public void onComplete(com.cinchapi.concourse.thrift.ComplexTObject o) { - invokeManagement_result result = new invokeManagement_result(); + execCcl_result result = new execCcl_result(); result.success = o; try { fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); @@ -77357,15 +77621,27 @@ public void onComplete(com.cinchapi.concourse.thrift.ComplexTObject o) { public void onError(java.lang.Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TSerializable msg; - invokeManagement_result result = new invokeManagement_result(); + execCcl_result result = new execCcl_result(); if (e instanceof com.cinchapi.concourse.thrift.SecurityException) { result.ex = (com.cinchapi.concourse.thrift.SecurityException) e; result.setExIsSet(true); msg = result; - } else if (e instanceof com.cinchapi.concourse.thrift.ManagementException) { - result.ex2 = (com.cinchapi.concourse.thrift.ManagementException) e; + } else if (e instanceof com.cinchapi.concourse.thrift.TransactionException) { + result.ex2 = (com.cinchapi.concourse.thrift.TransactionException) e; result.setEx2IsSet(true); msg = result; + } else if (e instanceof com.cinchapi.concourse.thrift.InvalidArgumentException) { + result.ex3 = (com.cinchapi.concourse.thrift.InvalidArgumentException) e; + result.setEx3IsSet(true); + msg = result; + } else if (e instanceof com.cinchapi.concourse.thrift.PermissionException) { + result.ex4 = (com.cinchapi.concourse.thrift.PermissionException) e; + result.setEx4IsSet(true); + msg = result; + } else if (e instanceof com.cinchapi.concourse.thrift.ParseException) { + result.ex5 = (com.cinchapi.concourse.thrift.ParseException) e; + result.setEx5IsSet(true); + msg = result; } else if (e instanceof org.apache.thrift.transport.TTransportException) { _LOGGER.error("TTransportException inside handler", e); fb.close(); @@ -77395,30 +77671,29 @@ protected boolean isOneway() { } @Override - public void start(I iface, invokeManagement_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - iface.invokeManagement(args.method, args.params, args.creds,resultHandler); + public void start(I iface, execCcl_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + iface.execCcl(args.ccl, args.creds, args.transaction, args.environment,resultHandler); } } - public static class ping extends org.apache.thrift.AsyncProcessFunction { - public ping() { - super("ping"); + public static class submitCcl extends org.apache.thrift.AsyncProcessFunction> { + public submitCcl() { + super("submitCcl"); } @Override - public ping_args getEmptyArgsInstance() { - return new ping_args(); + public submitCcl_args getEmptyArgsInstance() { + return new submitCcl_args(); } @Override - public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + 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() { + return new org.apache.thrift.async.AsyncMethodCallback>() { @Override - public void onComplete(java.lang.Boolean o) { - ping_result result = new ping_result(); + public void onComplete(java.util.List o) { + submitCcl_result result = new submitCcl_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) { @@ -77433,13 +77708,176 @@ public void onComplete(java.lang.Boolean o) { public void onError(java.lang.Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TSerializable msg; - ping_result result = new ping_result(); + submitCcl_result result = new submitCcl_result(); if (e instanceof com.cinchapi.concourse.thrift.SecurityException) { result.ex = (com.cinchapi.concourse.thrift.SecurityException) e; result.setExIsSet(true); msg = result; - } else if (e instanceof com.cinchapi.concourse.thrift.PermissionException) { - result.ex2 = (com.cinchapi.concourse.thrift.PermissionException) e; + } else if (e instanceof com.cinchapi.concourse.thrift.TransactionException) { + result.ex2 = (com.cinchapi.concourse.thrift.TransactionException) e; + result.setEx2IsSet(true); + msg = result; + } else if (e instanceof com.cinchapi.concourse.thrift.InvalidArgumentException) { + result.ex3 = (com.cinchapi.concourse.thrift.InvalidArgumentException) e; + result.setEx3IsSet(true); + msg = result; + } else if (e instanceof com.cinchapi.concourse.thrift.PermissionException) { + result.ex4 = (com.cinchapi.concourse.thrift.PermissionException) e; + result.setEx4IsSet(true); + msg = result; + } else if (e instanceof com.cinchapi.concourse.thrift.ParseException) { + result.ex5 = (com.cinchapi.concourse.thrift.ParseException) e; + result.setEx5IsSet(true); + msg = result; + } else 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, submitCcl_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws org.apache.thrift.TException { + iface.submitCcl(args.ccl, args.creds, args.transaction, args.environment,resultHandler); + } + } + + public static class invokeManagement extends org.apache.thrift.AsyncProcessFunction { + public invokeManagement() { + super("invokeManagement"); + } + + @Override + public invokeManagement_args getEmptyArgsInstance() { + return new invokeManagement_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(com.cinchapi.concourse.thrift.ComplexTObject o) { + invokeManagement_result result = new invokeManagement_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; + invokeManagement_result result = new invokeManagement_result(); + if (e instanceof com.cinchapi.concourse.thrift.SecurityException) { + result.ex = (com.cinchapi.concourse.thrift.SecurityException) e; + result.setExIsSet(true); + msg = result; + } else if (e instanceof com.cinchapi.concourse.thrift.ManagementException) { + result.ex2 = (com.cinchapi.concourse.thrift.ManagementException) e; + result.setEx2IsSet(true); + msg = result; + } else 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, invokeManagement_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + iface.invokeManagement(args.method, args.params, args.creds,resultHandler); + } + } + + public static class ping extends org.apache.thrift.AsyncProcessFunction { + public ping() { + super("ping"); + } + + @Override + public ping_args getEmptyArgsInstance() { + return new ping_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) { + ping_result result = new ping_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; + ping_result result = new ping_result(); + if (e instanceof com.cinchapi.concourse.thrift.SecurityException) { + result.ex = (com.cinchapi.concourse.thrift.SecurityException) e; + result.setExIsSet(true); + msg = result; + } else if (e instanceof com.cinchapi.concourse.thrift.PermissionException) { + result.ex2 = (com.cinchapi.concourse.thrift.PermissionException) e; result.setEx2IsSet(true); msg = result; } else if (e instanceof org.apache.thrift.transport.TTransportException) { @@ -686986,7 +687424,2450 @@ public com.cinchapi.concourse.thrift.TransactionException getEx2() { return this.ex2; } - public findOrInsertCclJson_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { + public findOrInsertCclJson_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { + this.ex2 = ex2; + return this; + } + + public void unsetEx2() { + this.ex2 = null; + } + + /** Returns true if field ex2 is set (has been assigned a value) and false otherwise */ + public boolean isSetEx2() { + return this.ex2 != null; + } + + public void setEx2IsSet(boolean value) { + if (!value) { + this.ex2 = null; + } + } + + @org.apache.thrift.annotation.Nullable + public com.cinchapi.concourse.thrift.ParseException getEx3() { + return this.ex3; + } + + public findOrInsertCclJson_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ParseException ex3) { + this.ex3 = ex3; + return this; + } + + public void unsetEx3() { + this.ex3 = null; + } + + /** Returns true if field ex3 is set (has been assigned a value) and false otherwise */ + public boolean isSetEx3() { + return this.ex3 != null; + } + + public void setEx3IsSet(boolean value) { + if (!value) { + this.ex3 = null; + } + } + + @org.apache.thrift.annotation.Nullable + public com.cinchapi.concourse.thrift.DuplicateEntryException getEx4() { + return this.ex4; + } + + public findOrInsertCclJson_result setEx4(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.DuplicateEntryException ex4) { + this.ex4 = ex4; + return this; + } + + public void unsetEx4() { + this.ex4 = null; + } + + /** Returns true if field ex4 is set (has been assigned a value) and false otherwise */ + public boolean isSetEx4() { + return this.ex4 != null; + } + + public void setEx4IsSet(boolean value) { + if (!value) { + this.ex4 = null; + } + } + + @org.apache.thrift.annotation.Nullable + public com.cinchapi.concourse.thrift.PermissionException getEx5() { + return this.ex5; + } + + public findOrInsertCclJson_result setEx5(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex5) { + this.ex5 = ex5; + return this; + } + + public void unsetEx5() { + this.ex5 = null; + } + + /** Returns true if field ex5 is set (has been assigned a value) and false otherwise */ + public boolean isSetEx5() { + return this.ex5 != null; + } + + public void setEx5IsSet(boolean value) { + if (!value) { + this.ex5 = 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.lang.Long)value); + } + break; + + case EX: + if (value == null) { + unsetEx(); + } else { + setEx((com.cinchapi.concourse.thrift.SecurityException)value); + } + break; + + case EX2: + if (value == null) { + unsetEx2(); + } else { + setEx2((com.cinchapi.concourse.thrift.TransactionException)value); + } + break; + + case EX3: + if (value == null) { + unsetEx3(); + } else { + setEx3((com.cinchapi.concourse.thrift.ParseException)value); + } + break; + + case EX4: + if (value == null) { + unsetEx4(); + } else { + setEx4((com.cinchapi.concourse.thrift.DuplicateEntryException)value); + } + break; + + case EX5: + if (value == null) { + unsetEx5(); + } else { + setEx5((com.cinchapi.concourse.thrift.PermissionException)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case EX: + return getEx(); + + case EX2: + return getEx2(); + + case EX3: + return getEx3(); + + case EX4: + return getEx4(); + + case EX5: + return getEx5(); + + } + 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(); + case EX: + return isSetEx(); + case EX2: + return isSetEx2(); + case EX3: + return isSetEx3(); + case EX4: + return isSetEx4(); + case EX5: + return isSetEx5(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that instanceof findOrInsertCclJson_result) + return this.equals((findOrInsertCclJson_result)that); + return false; + } + + public boolean equals(findOrInsertCclJson_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; + } + + boolean this_present_ex = true && this.isSetEx(); + boolean that_present_ex = true && that.isSetEx(); + if (this_present_ex || that_present_ex) { + if (!(this_present_ex && that_present_ex)) + return false; + if (!this.ex.equals(that.ex)) + return false; + } + + boolean this_present_ex2 = true && this.isSetEx2(); + boolean that_present_ex2 = true && that.isSetEx2(); + if (this_present_ex2 || that_present_ex2) { + if (!(this_present_ex2 && that_present_ex2)) + return false; + if (!this.ex2.equals(that.ex2)) + return false; + } + + boolean this_present_ex3 = true && this.isSetEx3(); + boolean that_present_ex3 = true && that.isSetEx3(); + if (this_present_ex3 || that_present_ex3) { + if (!(this_present_ex3 && that_present_ex3)) + return false; + if (!this.ex3.equals(that.ex3)) + return false; + } + + boolean this_present_ex4 = true && this.isSetEx4(); + boolean that_present_ex4 = true && that.isSetEx4(); + if (this_present_ex4 || that_present_ex4) { + if (!(this_present_ex4 && that_present_ex4)) + return false; + if (!this.ex4.equals(that.ex4)) + return false; + } + + boolean this_present_ex5 = true && this.isSetEx5(); + boolean that_present_ex5 = true && that.isSetEx5(); + if (this_present_ex5 || that_present_ex5) { + if (!(this_present_ex5 && that_present_ex5)) + return false; + if (!this.ex5.equals(that.ex5)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(success); + + hashCode = hashCode * 8191 + ((isSetEx()) ? 131071 : 524287); + if (isSetEx()) + hashCode = hashCode * 8191 + ex.hashCode(); + + hashCode = hashCode * 8191 + ((isSetEx2()) ? 131071 : 524287); + if (isSetEx2()) + hashCode = hashCode * 8191 + ex2.hashCode(); + + hashCode = hashCode * 8191 + ((isSetEx3()) ? 131071 : 524287); + if (isSetEx3()) + hashCode = hashCode * 8191 + ex3.hashCode(); + + hashCode = hashCode * 8191 + ((isSetEx4()) ? 131071 : 524287); + if (isSetEx4()) + hashCode = hashCode * 8191 + ex4.hashCode(); + + hashCode = hashCode * 8191 + ((isSetEx5()) ? 131071 : 524287); + if (isSetEx5()) + hashCode = hashCode * 8191 + ex5.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(findOrInsertCclJson_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; + } + } + lastComparison = java.lang.Boolean.compare(isSetEx(), other.isSetEx()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEx()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex, other.ex); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetEx2(), other.isSetEx2()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEx2()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex2, other.ex2); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetEx3(), other.isSetEx3()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEx3()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex3, other.ex3); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetEx4(), other.isSetEx4()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEx4()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex4, other.ex4); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetEx5(), other.isSetEx5()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEx5()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex5, other.ex5); + 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("findOrInsertCclJson_result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + first = false; + if (!first) sb.append(", "); + sb.append("ex:"); + if (this.ex == null) { + sb.append("null"); + } else { + sb.append(this.ex); + } + first = false; + if (!first) sb.append(", "); + sb.append("ex2:"); + if (this.ex2 == null) { + sb.append("null"); + } else { + sb.append(this.ex2); + } + first = false; + if (!first) sb.append(", "); + sb.append("ex3:"); + if (this.ex3 == null) { + sb.append("null"); + } else { + sb.append(this.ex3); + } + first = false; + if (!first) sb.append(", "); + sb.append("ex4:"); + if (this.ex4 == null) { + sb.append("null"); + } else { + sb.append(this.ex4); + } + first = false; + if (!first) sb.append(", "); + sb.append("ex5:"); + if (this.ex5 == null) { + sb.append("null"); + } else { + sb.append(this.ex5); + } + 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 findOrInsertCclJson_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public findOrInsertCclJson_resultStandardScheme getScheme() { + return new findOrInsertCclJson_resultStandardScheme(); + } + } + + private static class findOrInsertCclJson_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, findOrInsertCclJson_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; + case 1: // EX + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ex = new com.cinchapi.concourse.thrift.SecurityException(); + struct.ex.read(iprot); + struct.setExIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // EX2 + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ex2 = new com.cinchapi.concourse.thrift.TransactionException(); + struct.ex2.read(iprot); + struct.setEx2IsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // EX3 + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ex3 = new com.cinchapi.concourse.thrift.ParseException(); + struct.ex3.read(iprot); + struct.setEx3IsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // EX4 + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ex4 = new com.cinchapi.concourse.thrift.DuplicateEntryException(); + struct.ex4.read(iprot); + struct.setEx4IsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // EX5 + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ex5 = new com.cinchapi.concourse.thrift.PermissionException(); + struct.ex5.read(iprot); + struct.setEx5IsSet(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, findOrInsertCclJson_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(); + } + if (struct.ex != null) { + oprot.writeFieldBegin(EX_FIELD_DESC); + struct.ex.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ex2 != null) { + oprot.writeFieldBegin(EX2_FIELD_DESC); + struct.ex2.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ex3 != null) { + oprot.writeFieldBegin(EX3_FIELD_DESC); + struct.ex3.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ex4 != null) { + oprot.writeFieldBegin(EX4_FIELD_DESC); + struct.ex4.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ex5 != null) { + oprot.writeFieldBegin(EX5_FIELD_DESC); + struct.ex5.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class findOrInsertCclJson_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public findOrInsertCclJson_resultTupleScheme getScheme() { + return new findOrInsertCclJson_resultTupleScheme(); + } + } + + private static class findOrInsertCclJson_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, findOrInsertCclJson_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); + } + if (struct.isSetEx()) { + optionals.set(1); + } + if (struct.isSetEx2()) { + optionals.set(2); + } + if (struct.isSetEx3()) { + optionals.set(3); + } + if (struct.isSetEx4()) { + optionals.set(4); + } + if (struct.isSetEx5()) { + optionals.set(5); + } + oprot.writeBitSet(optionals, 6); + if (struct.isSetSuccess()) { + oprot.writeI64(struct.success); + } + if (struct.isSetEx()) { + struct.ex.write(oprot); + } + if (struct.isSetEx2()) { + struct.ex2.write(oprot); + } + if (struct.isSetEx3()) { + struct.ex3.write(oprot); + } + if (struct.isSetEx4()) { + struct.ex4.write(oprot); + } + if (struct.isSetEx5()) { + struct.ex5.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, findOrInsertCclJson_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(6); + if (incoming.get(0)) { + struct.success = iprot.readI64(); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.ex = new com.cinchapi.concourse.thrift.SecurityException(); + struct.ex.read(iprot); + struct.setExIsSet(true); + } + if (incoming.get(2)) { + struct.ex2 = new com.cinchapi.concourse.thrift.TransactionException(); + struct.ex2.read(iprot); + struct.setEx2IsSet(true); + } + if (incoming.get(3)) { + struct.ex3 = new com.cinchapi.concourse.thrift.ParseException(); + struct.ex3.read(iprot); + struct.setEx3IsSet(true); + } + if (incoming.get(4)) { + struct.ex4 = new com.cinchapi.concourse.thrift.DuplicateEntryException(); + struct.ex4.read(iprot); + struct.setEx4IsSet(true); + } + if (incoming.get(5)) { + struct.ex5 = new com.cinchapi.concourse.thrift.PermissionException(); + struct.ex5.read(iprot); + struct.setEx5IsSet(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(); + } + } + + public static class getServerEnvironment_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("getServerEnvironment_args"); + + private static final org.apache.thrift.protocol.TField CREDS_FIELD_DESC = new org.apache.thrift.protocol.TField("creds", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final org.apache.thrift.protocol.TField ENVIRONMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("environment", org.apache.thrift.protocol.TType.STRING, (short)3); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getServerEnvironment_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getServerEnvironment_argsTupleSchemeFactory(); + + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds; // required + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken token; // required + public @org.apache.thrift.annotation.Nullable java.lang.String environment; // 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 { + CREDS((short)1, "creds"), + TOKEN((short)2, "token"), + ENVIRONMENT((short)3, "environment"); + + private static final java.util.Map byName = new java.util.LinkedHashMap(); + + 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: // CREDS + return CREDS; + case 2: // TOKEN + return TOKEN; + case 3: // ENVIRONMENT + return ENVIRONMENT; + 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.CREDS, new org.apache.thrift.meta_data.FieldMetaData("creds", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.AccessToken.class))); + tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.TransactionToken.class))); + tmpMap.put(_Fields.ENVIRONMENT, new org.apache.thrift.meta_data.FieldMetaData("environment", 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(getServerEnvironment_args.class, metaDataMap); + } + + public getServerEnvironment_args() { + } + + public getServerEnvironment_args( + com.cinchapi.concourse.thrift.AccessToken creds, + com.cinchapi.concourse.thrift.TransactionToken token, + java.lang.String environment) + { + this(); + this.creds = creds; + this.token = token; + this.environment = environment; + } + + /** + * Performs a deep copy on other. + */ + public getServerEnvironment_args(getServerEnvironment_args other) { + if (other.isSetCreds()) { + this.creds = new com.cinchapi.concourse.thrift.AccessToken(other.creds); + } + if (other.isSetToken()) { + this.token = new com.cinchapi.concourse.thrift.TransactionToken(other.token); + } + if (other.isSetEnvironment()) { + this.environment = other.environment; + } + } + + @Override + public getServerEnvironment_args deepCopy() { + return new getServerEnvironment_args(this); + } + + @Override + public void clear() { + this.creds = null; + this.token = null; + this.environment = null; + } + + @org.apache.thrift.annotation.Nullable + public com.cinchapi.concourse.thrift.AccessToken getCreds() { + return this.creds; + } + + public getServerEnvironment_args setCreds(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds) { + this.creds = creds; + return this; + } + + public void unsetCreds() { + this.creds = null; + } + + /** Returns true if field creds is set (has been assigned a value) and false otherwise */ + public boolean isSetCreds() { + return this.creds != null; + } + + public void setCredsIsSet(boolean value) { + if (!value) { + this.creds = null; + } + } + + @org.apache.thrift.annotation.Nullable + public com.cinchapi.concourse.thrift.TransactionToken getToken() { + return this.token; + } + + public getServerEnvironment_args setToken(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken token) { + this.token = token; + return this; + } + + public void unsetToken() { + this.token = null; + } + + /** Returns true if field token is set (has been assigned a value) and false otherwise */ + public boolean isSetToken() { + return this.token != null; + } + + public void setTokenIsSet(boolean value) { + if (!value) { + this.token = null; + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getEnvironment() { + return this.environment; + } + + public getServerEnvironment_args setEnvironment(@org.apache.thrift.annotation.Nullable java.lang.String environment) { + this.environment = environment; + return this; + } + + public void unsetEnvironment() { + this.environment = null; + } + + /** Returns true if field environment is set (has been assigned a value) and false otherwise */ + public boolean isSetEnvironment() { + return this.environment != null; + } + + public void setEnvironmentIsSet(boolean value) { + if (!value) { + this.environment = null; + } + } + + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case CREDS: + if (value == null) { + unsetCreds(); + } else { + setCreds((com.cinchapi.concourse.thrift.AccessToken)value); + } + break; + + case TOKEN: + if (value == null) { + unsetToken(); + } else { + setToken((com.cinchapi.concourse.thrift.TransactionToken)value); + } + break; + + case ENVIRONMENT: + if (value == null) { + unsetEnvironment(); + } else { + setEnvironment((java.lang.String)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case CREDS: + return getCreds(); + + case TOKEN: + return getToken(); + + case ENVIRONMENT: + return getEnvironment(); + + } + 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 CREDS: + return isSetCreds(); + case TOKEN: + return isSetToken(); + case ENVIRONMENT: + return isSetEnvironment(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that instanceof getServerEnvironment_args) + return this.equals((getServerEnvironment_args)that); + return false; + } + + public boolean equals(getServerEnvironment_args that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_creds = true && this.isSetCreds(); + boolean that_present_creds = true && that.isSetCreds(); + if (this_present_creds || that_present_creds) { + if (!(this_present_creds && that_present_creds)) + return false; + if (!this.creds.equals(that.creds)) + return false; + } + + boolean this_present_token = true && this.isSetToken(); + boolean that_present_token = true && that.isSetToken(); + if (this_present_token || that_present_token) { + if (!(this_present_token && that_present_token)) + return false; + if (!this.token.equals(that.token)) + return false; + } + + boolean this_present_environment = true && this.isSetEnvironment(); + boolean that_present_environment = true && that.isSetEnvironment(); + if (this_present_environment || that_present_environment) { + if (!(this_present_environment && that_present_environment)) + return false; + if (!this.environment.equals(that.environment)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetCreds()) ? 131071 : 524287); + if (isSetCreds()) + hashCode = hashCode * 8191 + creds.hashCode(); + + hashCode = hashCode * 8191 + ((isSetToken()) ? 131071 : 524287); + if (isSetToken()) + hashCode = hashCode * 8191 + token.hashCode(); + + hashCode = hashCode * 8191 + ((isSetEnvironment()) ? 131071 : 524287); + if (isSetEnvironment()) + hashCode = hashCode * 8191 + environment.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(getServerEnvironment_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.compare(isSetCreds(), other.isSetCreds()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetCreds()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.creds, other.creds); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetToken(), other.isSetToken()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetToken()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetEnvironment(), other.isSetEnvironment()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEnvironment()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.environment, other.environment); + 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("getServerEnvironment_args("); + boolean first = true; + + sb.append("creds:"); + if (this.creds == null) { + sb.append("null"); + } else { + sb.append(this.creds); + } + first = false; + if (!first) sb.append(", "); + sb.append("token:"); + if (this.token == null) { + sb.append("null"); + } else { + sb.append(this.token); + } + first = false; + if (!first) sb.append(", "); + sb.append("environment:"); + if (this.environment == null) { + sb.append("null"); + } else { + sb.append(this.environment); + } + 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 (creds != null) { + creds.validate(); + } + if (token != null) { + token.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 getServerEnvironment_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public getServerEnvironment_argsStandardScheme getScheme() { + return new getServerEnvironment_argsStandardScheme(); + } + } + + private static class getServerEnvironment_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, getServerEnvironment_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: // CREDS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); + struct.creds.read(iprot); + struct.setCredsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // TOKEN + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.token = new com.cinchapi.concourse.thrift.TransactionToken(); + struct.token.read(iprot); + struct.setTokenIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // ENVIRONMENT + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.environment = iprot.readString(); + struct.setEnvironmentIsSet(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, getServerEnvironment_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.creds != null) { + oprot.writeFieldBegin(CREDS_FIELD_DESC); + struct.creds.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.token != null) { + oprot.writeFieldBegin(TOKEN_FIELD_DESC); + struct.token.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.environment != null) { + oprot.writeFieldBegin(ENVIRONMENT_FIELD_DESC); + oprot.writeString(struct.environment); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getServerEnvironment_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public getServerEnvironment_argsTupleScheme getScheme() { + return new getServerEnvironment_argsTupleScheme(); + } + } + + private static class getServerEnvironment_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getServerEnvironment_args 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.isSetCreds()) { + optionals.set(0); + } + if (struct.isSetToken()) { + optionals.set(1); + } + if (struct.isSetEnvironment()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetCreds()) { + struct.creds.write(oprot); + } + if (struct.isSetToken()) { + struct.token.write(oprot); + } + if (struct.isSetEnvironment()) { + oprot.writeString(struct.environment); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getServerEnvironment_args 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)) { + struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); + struct.creds.read(iprot); + struct.setCredsIsSet(true); + } + if (incoming.get(1)) { + struct.token = new com.cinchapi.concourse.thrift.TransactionToken(); + struct.token.read(iprot); + struct.setTokenIsSet(true); + } + if (incoming.get(2)) { + struct.environment = iprot.readString(); + struct.setEnvironmentIsSet(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(); + } + } + + public static class getServerEnvironment_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("getServerEnvironment_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0); + private static final org.apache.thrift.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final org.apache.thrift.protocol.TField EX2_FIELD_DESC = new org.apache.thrift.protocol.TField("ex2", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final org.apache.thrift.protocol.TField EX3_FIELD_DESC = new org.apache.thrift.protocol.TField("ex3", org.apache.thrift.protocol.TType.STRUCT, (short)3); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getServerEnvironment_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getServerEnvironment_resultTupleSchemeFactory(); + + public @org.apache.thrift.annotation.Nullable java.lang.String success; // required + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex; // required + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2; // required + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3; // 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"), + EX((short)1, "ex"), + EX2((short)2, "ex2"), + EX3((short)3, "ex3"); + + private static final java.util.Map byName = new java.util.LinkedHashMap(); + + 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; + case 1: // EX + return EX; + case 2: // EX2 + return EX2; + case 3: // EX3 + return EX3; + 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.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.EX, new org.apache.thrift.meta_data.FieldMetaData("ex", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.SecurityException.class))); + tmpMap.put(_Fields.EX2, new org.apache.thrift.meta_data.FieldMetaData("ex2", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.TransactionException.class))); + tmpMap.put(_Fields.EX3, new org.apache.thrift.meta_data.FieldMetaData("ex3", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.PermissionException.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getServerEnvironment_result.class, metaDataMap); + } + + public getServerEnvironment_result() { + } + + public getServerEnvironment_result( + java.lang.String success, + com.cinchapi.concourse.thrift.SecurityException ex, + com.cinchapi.concourse.thrift.TransactionException ex2, + com.cinchapi.concourse.thrift.PermissionException ex3) + { + this(); + this.success = success; + this.ex = ex; + this.ex2 = ex2; + this.ex3 = ex3; + } + + /** + * Performs a deep copy on other. + */ + public getServerEnvironment_result(getServerEnvironment_result other) { + if (other.isSetSuccess()) { + this.success = other.success; + } + if (other.isSetEx()) { + this.ex = new com.cinchapi.concourse.thrift.SecurityException(other.ex); + } + if (other.isSetEx2()) { + this.ex2 = new com.cinchapi.concourse.thrift.TransactionException(other.ex2); + } + if (other.isSetEx3()) { + this.ex3 = new com.cinchapi.concourse.thrift.PermissionException(other.ex3); + } + } + + @Override + public getServerEnvironment_result deepCopy() { + return new getServerEnvironment_result(this); + } + + @Override + public void clear() { + this.success = null; + this.ex = null; + this.ex2 = null; + this.ex3 = null; + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getSuccess() { + return this.success; + } + + public getServerEnvironment_result setSuccess(@org.apache.thrift.annotation.Nullable java.lang.String 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; + } + } + + @org.apache.thrift.annotation.Nullable + public com.cinchapi.concourse.thrift.SecurityException getEx() { + return this.ex; + } + + public getServerEnvironment_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { + this.ex = ex; + return this; + } + + public void unsetEx() { + this.ex = null; + } + + /** Returns true if field ex is set (has been assigned a value) and false otherwise */ + public boolean isSetEx() { + return this.ex != null; + } + + public void setExIsSet(boolean value) { + if (!value) { + this.ex = null; + } + } + + @org.apache.thrift.annotation.Nullable + public com.cinchapi.concourse.thrift.TransactionException getEx2() { + return this.ex2; + } + + public getServerEnvironment_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { + this.ex2 = ex2; + return this; + } + + public void unsetEx2() { + this.ex2 = null; + } + + /** Returns true if field ex2 is set (has been assigned a value) and false otherwise */ + public boolean isSetEx2() { + return this.ex2 != null; + } + + public void setEx2IsSet(boolean value) { + if (!value) { + this.ex2 = null; + } + } + + @org.apache.thrift.annotation.Nullable + public com.cinchapi.concourse.thrift.PermissionException getEx3() { + return this.ex3; + } + + public getServerEnvironment_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3) { + this.ex3 = ex3; + return this; + } + + public void unsetEx3() { + this.ex3 = null; + } + + /** Returns true if field ex3 is set (has been assigned a value) and false otherwise */ + public boolean isSetEx3() { + return this.ex3 != null; + } + + public void setEx3IsSet(boolean value) { + if (!value) { + this.ex3 = 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.lang.String)value); + } + break; + + case EX: + if (value == null) { + unsetEx(); + } else { + setEx((com.cinchapi.concourse.thrift.SecurityException)value); + } + break; + + case EX2: + if (value == null) { + unsetEx2(); + } else { + setEx2((com.cinchapi.concourse.thrift.TransactionException)value); + } + break; + + case EX3: + if (value == null) { + unsetEx3(); + } else { + setEx3((com.cinchapi.concourse.thrift.PermissionException)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case EX: + return getEx(); + + case EX2: + return getEx2(); + + case EX3: + return getEx3(); + + } + 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(); + case EX: + return isSetEx(); + case EX2: + return isSetEx2(); + case EX3: + return isSetEx3(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that instanceof getServerEnvironment_result) + return this.equals((getServerEnvironment_result)that); + return false; + } + + public boolean equals(getServerEnvironment_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; + } + + boolean this_present_ex = true && this.isSetEx(); + boolean that_present_ex = true && that.isSetEx(); + if (this_present_ex || that_present_ex) { + if (!(this_present_ex && that_present_ex)) + return false; + if (!this.ex.equals(that.ex)) + return false; + } + + boolean this_present_ex2 = true && this.isSetEx2(); + boolean that_present_ex2 = true && that.isSetEx2(); + if (this_present_ex2 || that_present_ex2) { + if (!(this_present_ex2 && that_present_ex2)) + return false; + if (!this.ex2.equals(that.ex2)) + return false; + } + + boolean this_present_ex3 = true && this.isSetEx3(); + boolean that_present_ex3 = true && that.isSetEx3(); + if (this_present_ex3 || that_present_ex3) { + if (!(this_present_ex3 && that_present_ex3)) + return false; + if (!this.ex3.equals(that.ex3)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); + + hashCode = hashCode * 8191 + ((isSetEx()) ? 131071 : 524287); + if (isSetEx()) + hashCode = hashCode * 8191 + ex.hashCode(); + + hashCode = hashCode * 8191 + ((isSetEx2()) ? 131071 : 524287); + if (isSetEx2()) + hashCode = hashCode * 8191 + ex2.hashCode(); + + hashCode = hashCode * 8191 + ((isSetEx3()) ? 131071 : 524287); + if (isSetEx3()) + hashCode = hashCode * 8191 + ex3.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(getServerEnvironment_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; + } + } + lastComparison = java.lang.Boolean.compare(isSetEx(), other.isSetEx()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEx()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex, other.ex); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetEx2(), other.isSetEx2()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEx2()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex2, other.ex2); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetEx3(), other.isSetEx3()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEx3()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex3, other.ex3); + 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("getServerEnvironment_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("ex:"); + if (this.ex == null) { + sb.append("null"); + } else { + sb.append(this.ex); + } + first = false; + if (!first) sb.append(", "); + sb.append("ex2:"); + if (this.ex2 == null) { + sb.append("null"); + } else { + sb.append(this.ex2); + } + first = false; + if (!first) sb.append(", "); + sb.append("ex3:"); + if (this.ex3 == null) { + sb.append("null"); + } else { + sb.append(this.ex3); + } + 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 getServerEnvironment_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public getServerEnvironment_resultStandardScheme getScheme() { + return new getServerEnvironment_resultStandardScheme(); + } + } + + private static class getServerEnvironment_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, getServerEnvironment_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.STRING) { + struct.success = iprot.readString(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // EX + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ex = new com.cinchapi.concourse.thrift.SecurityException(); + struct.ex.read(iprot); + struct.setExIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // EX2 + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ex2 = new com.cinchapi.concourse.thrift.TransactionException(); + struct.ex2.read(iprot); + struct.setEx2IsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // EX3 + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ex3 = new com.cinchapi.concourse.thrift.PermissionException(); + struct.ex3.read(iprot); + struct.setEx3IsSet(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, getServerEnvironment_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeString(struct.success); + oprot.writeFieldEnd(); + } + if (struct.ex != null) { + oprot.writeFieldBegin(EX_FIELD_DESC); + struct.ex.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ex2 != null) { + oprot.writeFieldBegin(EX2_FIELD_DESC); + struct.ex2.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ex3 != null) { + oprot.writeFieldBegin(EX3_FIELD_DESC); + struct.ex3.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getServerEnvironment_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public getServerEnvironment_resultTupleScheme getScheme() { + return new getServerEnvironment_resultTupleScheme(); + } + } + + private static class getServerEnvironment_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getServerEnvironment_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); + } + if (struct.isSetEx()) { + optionals.set(1); + } + if (struct.isSetEx2()) { + optionals.set(2); + } + if (struct.isSetEx3()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.isSetSuccess()) { + oprot.writeString(struct.success); + } + if (struct.isSetEx()) { + struct.ex.write(oprot); + } + if (struct.isSetEx2()) { + struct.ex2.write(oprot); + } + if (struct.isSetEx3()) { + struct.ex3.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getServerEnvironment_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(4); + if (incoming.get(0)) { + struct.success = iprot.readString(); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.ex = new com.cinchapi.concourse.thrift.SecurityException(); + struct.ex.read(iprot); + struct.setExIsSet(true); + } + if (incoming.get(2)) { + struct.ex2 = new com.cinchapi.concourse.thrift.TransactionException(); + struct.ex2.read(iprot); + struct.setEx2IsSet(true); + } + if (incoming.get(3)) { + struct.ex3 = new com.cinchapi.concourse.thrift.PermissionException(); + struct.ex3.read(iprot); + struct.setEx3IsSet(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(); + } + } + + public static class getServerVersion_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("getServerVersion_args"); + + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getServerVersion_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getServerVersion_argsTupleSchemeFactory(); + + + /** 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.LinkedHashMap(); + + 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(getServerVersion_args.class, metaDataMap); + } + + public getServerVersion_args() { + } + + /** + * Performs a deep copy on other. + */ + public getServerVersion_args(getServerVersion_args other) { + } + + @Override + public getServerVersion_args deepCopy() { + return new getServerVersion_args(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 getServerVersion_args) + return this.equals((getServerVersion_args)that); + return false; + } + + public boolean equals(getServerVersion_args 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(getServerVersion_args 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); + } + + @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("getServerVersion_args("); + 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 getServerVersion_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public getServerVersion_argsStandardScheme getScheme() { + return new getServerVersion_argsStandardScheme(); + } + } + + private static class getServerVersion_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, getServerVersion_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) { + 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, getServerVersion_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getServerVersion_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public getServerVersion_argsTupleScheme getScheme() { + return new getServerVersion_argsTupleScheme(); + } + } + + private static class getServerVersion_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getServerVersion_args 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, getServerVersion_args 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(); + } + } + + public static class getServerVersion_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("getServerVersion_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0); + private static final org.apache.thrift.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final org.apache.thrift.protocol.TField EX2_FIELD_DESC = new org.apache.thrift.protocol.TField("ex2", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final org.apache.thrift.protocol.TField EX3_FIELD_DESC = new org.apache.thrift.protocol.TField("ex3", org.apache.thrift.protocol.TType.STRUCT, (short)3); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getServerVersion_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getServerVersion_resultTupleSchemeFactory(); + + public @org.apache.thrift.annotation.Nullable java.lang.String success; // required + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex; // required + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2; // required + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3; // 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"), + EX((short)1, "ex"), + EX2((short)2, "ex2"), + EX3((short)3, "ex3"); + + private static final java.util.Map byName = new java.util.LinkedHashMap(); + + 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; + case 1: // EX + return EX; + case 2: // EX2 + return EX2; + case 3: // EX3 + return EX3; + 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.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.EX, new org.apache.thrift.meta_data.FieldMetaData("ex", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.SecurityException.class))); + tmpMap.put(_Fields.EX2, new org.apache.thrift.meta_data.FieldMetaData("ex2", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.TransactionException.class))); + tmpMap.put(_Fields.EX3, new org.apache.thrift.meta_data.FieldMetaData("ex3", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.PermissionException.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getServerVersion_result.class, metaDataMap); + } + + public getServerVersion_result() { + } + + public getServerVersion_result( + java.lang.String success, + com.cinchapi.concourse.thrift.SecurityException ex, + com.cinchapi.concourse.thrift.TransactionException ex2, + com.cinchapi.concourse.thrift.PermissionException ex3) + { + this(); + this.success = success; + this.ex = ex; + this.ex2 = ex2; + this.ex3 = ex3; + } + + /** + * Performs a deep copy on other. + */ + public getServerVersion_result(getServerVersion_result other) { + if (other.isSetSuccess()) { + this.success = other.success; + } + if (other.isSetEx()) { + this.ex = new com.cinchapi.concourse.thrift.SecurityException(other.ex); + } + if (other.isSetEx2()) { + this.ex2 = new com.cinchapi.concourse.thrift.TransactionException(other.ex2); + } + if (other.isSetEx3()) { + this.ex3 = new com.cinchapi.concourse.thrift.PermissionException(other.ex3); + } + } + + @Override + public getServerVersion_result deepCopy() { + return new getServerVersion_result(this); + } + + @Override + public void clear() { + this.success = null; + this.ex = null; + this.ex2 = null; + this.ex3 = null; + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getSuccess() { + return this.success; + } + + public getServerVersion_result setSuccess(@org.apache.thrift.annotation.Nullable java.lang.String 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; + } + } + + @org.apache.thrift.annotation.Nullable + public com.cinchapi.concourse.thrift.SecurityException getEx() { + return this.ex; + } + + public getServerVersion_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { + this.ex = ex; + return this; + } + + public void unsetEx() { + this.ex = null; + } + + /** Returns true if field ex is set (has been assigned a value) and false otherwise */ + public boolean isSetEx() { + return this.ex != null; + } + + public void setExIsSet(boolean value) { + if (!value) { + this.ex = null; + } + } + + @org.apache.thrift.annotation.Nullable + public com.cinchapi.concourse.thrift.TransactionException getEx2() { + return this.ex2; + } + + public getServerVersion_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { this.ex2 = ex2; return this; } @@ -687007,11 +689888,11 @@ public void setEx2IsSet(boolean value) { } @org.apache.thrift.annotation.Nullable - public com.cinchapi.concourse.thrift.ParseException getEx3() { + public com.cinchapi.concourse.thrift.PermissionException getEx3() { return this.ex3; } - public findOrInsertCclJson_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ParseException ex3) { + public getServerVersion_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3) { this.ex3 = ex3; return this; } @@ -687031,56 +689912,6 @@ public void setEx3IsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable - public com.cinchapi.concourse.thrift.DuplicateEntryException getEx4() { - return this.ex4; - } - - public findOrInsertCclJson_result setEx4(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.DuplicateEntryException ex4) { - this.ex4 = ex4; - return this; - } - - public void unsetEx4() { - this.ex4 = null; - } - - /** Returns true if field ex4 is set (has been assigned a value) and false otherwise */ - public boolean isSetEx4() { - return this.ex4 != null; - } - - public void setEx4IsSet(boolean value) { - if (!value) { - this.ex4 = null; - } - } - - @org.apache.thrift.annotation.Nullable - public com.cinchapi.concourse.thrift.PermissionException getEx5() { - return this.ex5; - } - - public findOrInsertCclJson_result setEx5(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex5) { - this.ex5 = ex5; - return this; - } - - public void unsetEx5() { - this.ex5 = null; - } - - /** Returns true if field ex5 is set (has been assigned a value) and false otherwise */ - public boolean isSetEx5() { - return this.ex5 != null; - } - - public void setEx5IsSet(boolean value) { - if (!value) { - this.ex5 = null; - } - } - @Override public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { @@ -687088,7 +689919,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetSuccess(); } else { - setSuccess((java.lang.Long)value); + setSuccess((java.lang.String)value); } break; @@ -687112,23 +689943,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetEx3(); } else { - setEx3((com.cinchapi.concourse.thrift.ParseException)value); - } - break; - - case EX4: - if (value == null) { - unsetEx4(); - } else { - setEx4((com.cinchapi.concourse.thrift.DuplicateEntryException)value); - } - break; - - case EX5: - if (value == null) { - unsetEx5(); - } else { - setEx5((com.cinchapi.concourse.thrift.PermissionException)value); + setEx3((com.cinchapi.concourse.thrift.PermissionException)value); } break; @@ -687151,12 +689966,6 @@ public java.lang.Object getFieldValue(_Fields field) { case EX3: return getEx3(); - case EX4: - return getEx4(); - - case EX5: - return getEx5(); - } throw new java.lang.IllegalStateException(); } @@ -687177,33 +689986,29 @@ public boolean isSet(_Fields field) { return isSetEx2(); case EX3: return isSetEx3(); - case EX4: - return isSetEx4(); - case EX5: - return isSetEx5(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { - if (that instanceof findOrInsertCclJson_result) - return this.equals((findOrInsertCclJson_result)that); + if (that instanceof getServerVersion_result) + return this.equals((getServerVersion_result)that); return false; } - public boolean equals(findOrInsertCclJson_result that) { + public boolean equals(getServerVersion_result that) { if (that == null) return false; if (this == that) return true; - boolean this_present_success = true; - boolean that_present_success = 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 != that.success) + if (!this.success.equals(that.success)) return false; } @@ -687234,24 +690039,6 @@ public boolean equals(findOrInsertCclJson_result that) { return false; } - boolean this_present_ex4 = true && this.isSetEx4(); - boolean that_present_ex4 = true && that.isSetEx4(); - if (this_present_ex4 || that_present_ex4) { - if (!(this_present_ex4 && that_present_ex4)) - return false; - if (!this.ex4.equals(that.ex4)) - return false; - } - - boolean this_present_ex5 = true && this.isSetEx5(); - boolean that_present_ex5 = true && that.isSetEx5(); - if (this_present_ex5 || that_present_ex5) { - if (!(this_present_ex5 && that_present_ex5)) - return false; - if (!this.ex5.equals(that.ex5)) - return false; - } - return true; } @@ -687259,7 +690046,9 @@ public boolean equals(findOrInsertCclJson_result that) { public int hashCode() { int hashCode = 1; - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(success); + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); hashCode = hashCode * 8191 + ((isSetEx()) ? 131071 : 524287); if (isSetEx()) @@ -687273,19 +690062,11 @@ public int hashCode() { if (isSetEx3()) hashCode = hashCode * 8191 + ex3.hashCode(); - hashCode = hashCode * 8191 + ((isSetEx4()) ? 131071 : 524287); - if (isSetEx4()) - hashCode = hashCode * 8191 + ex4.hashCode(); - - hashCode = hashCode * 8191 + ((isSetEx5()) ? 131071 : 524287); - if (isSetEx5()) - hashCode = hashCode * 8191 + ex5.hashCode(); - return hashCode; } @Override - public int compareTo(findOrInsertCclJson_result other) { + public int compareTo(getServerVersion_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -687332,26 +690113,6 @@ public int compareTo(findOrInsertCclJson_result other) { return lastComparison; } } - lastComparison = java.lang.Boolean.compare(isSetEx4(), other.isSetEx4()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetEx4()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex4, other.ex4); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.compare(isSetEx5(), other.isSetEx5()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetEx5()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex5, other.ex5); - if (lastComparison != 0) { - return lastComparison; - } - } return 0; } @@ -687372,11 +690133,15 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("findOrInsertCclJson_result("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("getServerVersion_result("); boolean first = true; sb.append("success:"); - sb.append(this.success); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } first = false; if (!first) sb.append(", "); sb.append("ex:"); @@ -687402,22 +690167,6 @@ public java.lang.String toString() { sb.append(this.ex3); } first = false; - if (!first) sb.append(", "); - sb.append("ex4:"); - if (this.ex4 == null) { - sb.append("null"); - } else { - sb.append(this.ex4); - } - first = false; - if (!first) sb.append(", "); - sb.append("ex5:"); - if (this.ex5 == null) { - sb.append("null"); - } else { - sb.append(this.ex5); - } - first = false; sb.append(")"); return sb.toString(); } @@ -687437,25 +690186,23 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept 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 findOrInsertCclJson_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class getServerVersion_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public findOrInsertCclJson_resultStandardScheme getScheme() { - return new findOrInsertCclJson_resultStandardScheme(); + public getServerVersion_resultStandardScheme getScheme() { + return new getServerVersion_resultStandardScheme(); } } - private static class findOrInsertCclJson_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class getServerVersion_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, findOrInsertCclJson_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, getServerVersion_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -687466,8 +690213,8 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, findOrInsertCclJson } switch (schemeField.id) { case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.success = iprot.readI64(); + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.success = iprot.readString(); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); @@ -687493,31 +690240,13 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, findOrInsertCclJson break; case 3: // EX3 if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.ex3 = new com.cinchapi.concourse.thrift.ParseException(); + struct.ex3 = new com.cinchapi.concourse.thrift.PermissionException(); struct.ex3.read(iprot); struct.setEx3IsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 4: // EX4 - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.ex4 = new com.cinchapi.concourse.thrift.DuplicateEntryException(); - struct.ex4.read(iprot); - struct.setEx4IsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // EX5 - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.ex5 = new com.cinchapi.concourse.thrift.PermissionException(); - struct.ex5.read(iprot); - struct.setEx5IsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -687530,13 +690259,13 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, findOrInsertCclJson } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, findOrInsertCclJson_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, getServerVersion_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); - if (struct.isSetSuccess()) { + if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeI64(struct.success); + oprot.writeString(struct.success); oprot.writeFieldEnd(); } if (struct.ex != null) { @@ -687554,33 +690283,23 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, findOrInsertCclJso struct.ex3.write(oprot); oprot.writeFieldEnd(); } - if (struct.ex4 != null) { - oprot.writeFieldBegin(EX4_FIELD_DESC); - struct.ex4.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.ex5 != null) { - oprot.writeFieldBegin(EX5_FIELD_DESC); - struct.ex5.write(oprot); - oprot.writeFieldEnd(); - } oprot.writeFieldStop(); oprot.writeStructEnd(); } } - private static class findOrInsertCclJson_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class getServerVersion_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public findOrInsertCclJson_resultTupleScheme getScheme() { - return new findOrInsertCclJson_resultTupleScheme(); + public getServerVersion_resultTupleScheme getScheme() { + return new getServerVersion_resultTupleScheme(); } } - private static class findOrInsertCclJson_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class getServerVersion_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, findOrInsertCclJson_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, getServerVersion_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()) { @@ -687595,15 +690314,9 @@ public void write(org.apache.thrift.protocol.TProtocol prot, findOrInsertCclJson if (struct.isSetEx3()) { optionals.set(3); } - if (struct.isSetEx4()) { - optionals.set(4); - } - if (struct.isSetEx5()) { - optionals.set(5); - } - oprot.writeBitSet(optionals, 6); + oprot.writeBitSet(optionals, 4); if (struct.isSetSuccess()) { - oprot.writeI64(struct.success); + oprot.writeString(struct.success); } if (struct.isSetEx()) { struct.ex.write(oprot); @@ -687614,20 +690327,14 @@ public void write(org.apache.thrift.protocol.TProtocol prot, findOrInsertCclJson if (struct.isSetEx3()) { struct.ex3.write(oprot); } - if (struct.isSetEx4()) { - struct.ex4.write(oprot); - } - if (struct.isSetEx5()) { - struct.ex5.write(oprot); - } } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, findOrInsertCclJson_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, getServerVersion_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(6); + java.util.BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { - struct.success = iprot.readI64(); + struct.success = iprot.readString(); struct.setSuccessIsSet(true); } if (incoming.get(1)) { @@ -687641,20 +690348,10 @@ public void read(org.apache.thrift.protocol.TProtocol prot, findOrInsertCclJson_ struct.setEx2IsSet(true); } if (incoming.get(3)) { - struct.ex3 = new com.cinchapi.concourse.thrift.ParseException(); + struct.ex3 = new com.cinchapi.concourse.thrift.PermissionException(); struct.ex3.read(iprot); struct.setEx3IsSet(true); } - if (incoming.get(4)) { - struct.ex4 = new com.cinchapi.concourse.thrift.DuplicateEntryException(); - struct.ex4.read(iprot); - struct.setEx4IsSet(true); - } - if (incoming.get(5)) { - struct.ex5 = new com.cinchapi.concourse.thrift.PermissionException(); - struct.ex5.read(iprot); - struct.setEx5IsSet(true); - } } } @@ -687663,15 +690360,15 @@ private static S scheme(org.apache. } } - public static class getServerEnvironment_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("getServerEnvironment_args"); + public static class time_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("time_args"); private static final org.apache.thrift.protocol.TField CREDS_FIELD_DESC = new org.apache.thrift.protocol.TField("creds", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField ENVIRONMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("environment", org.apache.thrift.protocol.TType.STRING, (short)3); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getServerEnvironment_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getServerEnvironment_argsTupleSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new time_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new time_argsTupleSchemeFactory(); public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken token; // required @@ -687756,13 +690453,13 @@ public java.lang.String getFieldName() { tmpMap.put(_Fields.ENVIRONMENT, new org.apache.thrift.meta_data.FieldMetaData("environment", 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(getServerEnvironment_args.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(time_args.class, metaDataMap); } - public getServerEnvironment_args() { + public time_args() { } - public getServerEnvironment_args( + public time_args( com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken token, java.lang.String environment) @@ -687776,7 +690473,7 @@ public getServerEnvironment_args( /** * Performs a deep copy on other. */ - public getServerEnvironment_args(getServerEnvironment_args other) { + public time_args(time_args other) { if (other.isSetCreds()) { this.creds = new com.cinchapi.concourse.thrift.AccessToken(other.creds); } @@ -687789,8 +690486,8 @@ public getServerEnvironment_args(getServerEnvironment_args other) { } @Override - public getServerEnvironment_args deepCopy() { - return new getServerEnvironment_args(this); + public time_args deepCopy() { + return new time_args(this); } @Override @@ -687805,7 +690502,7 @@ public com.cinchapi.concourse.thrift.AccessToken getCreds() { return this.creds; } - public getServerEnvironment_args setCreds(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds) { + public time_args setCreds(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds) { this.creds = creds; return this; } @@ -687830,7 +690527,7 @@ public com.cinchapi.concourse.thrift.TransactionToken getToken() { return this.token; } - public getServerEnvironment_args setToken(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken token) { + public time_args setToken(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken token) { this.token = token; return this; } @@ -687855,7 +690552,7 @@ public java.lang.String getEnvironment() { return this.environment; } - public getServerEnvironment_args setEnvironment(@org.apache.thrift.annotation.Nullable java.lang.String environment) { + public time_args setEnvironment(@org.apache.thrift.annotation.Nullable java.lang.String environment) { this.environment = environment; return this; } @@ -687942,12 +690639,12 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that instanceof getServerEnvironment_args) - return this.equals((getServerEnvironment_args)that); + if (that instanceof time_args) + return this.equals((time_args)that); return false; } - public boolean equals(getServerEnvironment_args that) { + public boolean equals(time_args that) { if (that == null) return false; if (this == that) @@ -688003,7 +690700,7 @@ public int hashCode() { } @Override - public int compareTo(getServerEnvironment_args other) { + public int compareTo(time_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -688061,7 +690758,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("getServerEnvironment_args("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("time_args("); boolean first = true; sb.append("creds:"); @@ -688118,17 +690815,17 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class getServerEnvironment_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class time_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public getServerEnvironment_argsStandardScheme getScheme() { - return new getServerEnvironment_argsStandardScheme(); + public time_argsStandardScheme getScheme() { + return new time_argsStandardScheme(); } } - private static class getServerEnvironment_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class time_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, getServerEnvironment_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, time_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -688176,7 +690873,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, getServerEnvironmen } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, getServerEnvironment_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, time_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); @@ -688201,17 +690898,17 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, getServerEnvironme } - private static class getServerEnvironment_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class time_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public getServerEnvironment_argsTupleScheme getScheme() { - return new getServerEnvironment_argsTupleScheme(); + public time_argsTupleScheme getScheme() { + return new time_argsTupleScheme(); } } - private static class getServerEnvironment_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class time_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, getServerEnvironment_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, time_args 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.isSetCreds()) { @@ -688236,7 +690933,7 @@ public void write(org.apache.thrift.protocol.TProtocol prot, getServerEnvironmen } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, getServerEnvironment_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, time_args 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)) { @@ -688261,18 +690958,18 @@ private static S scheme(org.apache. } } - public static class getServerEnvironment_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("getServerEnvironment_result"); + public static class time_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("time_result"); - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0); + 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.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField EX2_FIELD_DESC = new org.apache.thrift.protocol.TField("ex2", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField EX3_FIELD_DESC = new org.apache.thrift.protocol.TField("ex3", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getServerEnvironment_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getServerEnvironment_resultTupleSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new time_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new time_resultTupleSchemeFactory(); - public @org.apache.thrift.annotation.Nullable java.lang.String success; // required + public long success; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3; // required @@ -688349,11 +691046,13 @@ public java.lang.String getFieldName() { } // 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.STRING))); + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.EX, new org.apache.thrift.meta_data.FieldMetaData("ex", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.SecurityException.class))); tmpMap.put(_Fields.EX2, new org.apache.thrift.meta_data.FieldMetaData("ex2", org.apache.thrift.TFieldRequirementType.DEFAULT, @@ -688361,20 +691060,21 @@ public java.lang.String getFieldName() { tmpMap.put(_Fields.EX3, new org.apache.thrift.meta_data.FieldMetaData("ex3", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.PermissionException.class))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getServerEnvironment_result.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(time_result.class, metaDataMap); } - public getServerEnvironment_result() { + public time_result() { } - public getServerEnvironment_result( - java.lang.String success, + public time_result( + long success, com.cinchapi.concourse.thrift.SecurityException ex, com.cinchapi.concourse.thrift.TransactionException ex2, com.cinchapi.concourse.thrift.PermissionException ex3) { this(); this.success = success; + setSuccessIsSet(true); this.ex = ex; this.ex2 = ex2; this.ex3 = ex3; @@ -688383,10 +691083,9 @@ public getServerEnvironment_result( /** * Performs a deep copy on other. */ - public getServerEnvironment_result(getServerEnvironment_result other) { - if (other.isSetSuccess()) { - this.success = other.success; - } + public time_result(time_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; if (other.isSetEx()) { this.ex = new com.cinchapi.concourse.thrift.SecurityException(other.ex); } @@ -688399,41 +691098,40 @@ public getServerEnvironment_result(getServerEnvironment_result other) { } @Override - public getServerEnvironment_result deepCopy() { - return new getServerEnvironment_result(this); + public time_result deepCopy() { + return new time_result(this); } @Override public void clear() { - this.success = null; + setSuccessIsSet(false); + this.success = 0; this.ex = null; this.ex2 = null; this.ex3 = null; } - @org.apache.thrift.annotation.Nullable - public java.lang.String getSuccess() { + public long getSuccess() { return this.success; } - public getServerEnvironment_result setSuccess(@org.apache.thrift.annotation.Nullable java.lang.String success) { + public time_result setSuccess(long success) { this.success = success; + setSuccessIsSet(true); return this; } public void unsetSuccess() { - this.success = null; + __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 this.success != null; + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } @org.apache.thrift.annotation.Nullable @@ -688441,7 +691139,7 @@ public com.cinchapi.concourse.thrift.SecurityException getEx() { return this.ex; } - public getServerEnvironment_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { + public time_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { this.ex = ex; return this; } @@ -688466,7 +691164,7 @@ public com.cinchapi.concourse.thrift.TransactionException getEx2() { return this.ex2; } - public getServerEnvironment_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { + public time_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { this.ex2 = ex2; return this; } @@ -688491,7 +691189,7 @@ public com.cinchapi.concourse.thrift.PermissionException getEx3() { return this.ex3; } - public getServerEnvironment_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3) { + public time_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3) { this.ex3 = ex3; return this; } @@ -688518,7 +691216,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetSuccess(); } else { - setSuccess((java.lang.String)value); + setSuccess((java.lang.Long)value); } break; @@ -688591,23 +691289,23 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that instanceof getServerEnvironment_result) - return this.equals((getServerEnvironment_result)that); + if (that instanceof time_result) + return this.equals((time_result)that); return false; } - public boolean equals(getServerEnvironment_result that) { + public boolean equals(time_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(); + 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.equals(that.success)) + if (this.success != that.success) return false; } @@ -688645,9 +691343,7 @@ public boolean equals(getServerEnvironment_result that) { public int hashCode() { int hashCode = 1; - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(success); hashCode = hashCode * 8191 + ((isSetEx()) ? 131071 : 524287); if (isSetEx()) @@ -688665,7 +691361,7 @@ public int hashCode() { } @Override - public int compareTo(getServerEnvironment_result other) { + public int compareTo(time_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -688732,15 +691428,11 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("getServerEnvironment_result("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("time_result("); boolean first = true; sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } + sb.append(this.success); first = false; if (!first) sb.append(", "); sb.append("ex:"); @@ -688785,23 +691477,25 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept 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 getServerEnvironment_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class time_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public getServerEnvironment_resultStandardScheme getScheme() { - return new getServerEnvironment_resultStandardScheme(); + public time_resultStandardScheme getScheme() { + return new time_resultStandardScheme(); } } - private static class getServerEnvironment_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class time_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, getServerEnvironment_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, time_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -688812,8 +691506,8 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, getServerEnvironmen } switch (schemeField.id) { case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.success = iprot.readString(); + 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); @@ -688858,13 +691552,13 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, getServerEnvironmen } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, getServerEnvironment_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, time_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { + if (struct.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeString(struct.success); + oprot.writeI64(struct.success); oprot.writeFieldEnd(); } if (struct.ex != null) { @@ -688888,17 +691582,17 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, getServerEnvironme } - private static class getServerEnvironment_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class time_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public getServerEnvironment_resultTupleScheme getScheme() { - return new getServerEnvironment_resultTupleScheme(); + public time_resultTupleScheme getScheme() { + return new time_resultTupleScheme(); } } - private static class getServerEnvironment_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class time_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, getServerEnvironment_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, time_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()) { @@ -688915,7 +691609,7 @@ public void write(org.apache.thrift.protocol.TProtocol prot, getServerEnvironmen } oprot.writeBitSet(optionals, 4); if (struct.isSetSuccess()) { - oprot.writeString(struct.success); + oprot.writeI64(struct.success); } if (struct.isSetEx()) { struct.ex.write(oprot); @@ -688929,11 +691623,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, getServerEnvironmen } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, getServerEnvironment_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, time_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(4); if (incoming.get(0)) { - struct.success = iprot.readString(); + struct.success = iprot.readI64(); struct.setSuccessIsSet(true); } if (incoming.get(1)) { @@ -688959,17 +691653,28 @@ private static S scheme(org.apache. } } - public static class getServerVersion_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("getServerVersion_args"); + public static class timePhrase_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("timePhrase_args"); + private static final org.apache.thrift.protocol.TField PHRASE_FIELD_DESC = new org.apache.thrift.protocol.TField("phrase", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField CREDS_FIELD_DESC = new org.apache.thrift.protocol.TField("creds", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final org.apache.thrift.protocol.TField ENVIRONMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("environment", org.apache.thrift.protocol.TType.STRING, (short)4); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getServerVersion_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getServerVersion_argsTupleSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new timePhrase_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new timePhrase_argsTupleSchemeFactory(); + public @org.apache.thrift.annotation.Nullable java.lang.String phrase; // required + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds; // required + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken token; // required + public @org.apache.thrift.annotation.Nullable java.lang.String environment; // 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 { -; + PHRASE((short)1, "phrase"), + CREDS((short)2, "creds"), + TOKEN((short)3, "token"), + ENVIRONMENT((short)4, "environment"); private static final java.util.Map byName = new java.util.LinkedHashMap(); @@ -688985,6 +691690,14 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { + case 1: // PHRASE + return PHRASE; + case 2: // CREDS + return CREDS; + case 3: // TOKEN + return TOKEN; + case 4: // ENVIRONMENT + return ENVIRONMENT; default: return null; } @@ -689026,34 +691739,205 @@ 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.PHRASE, new org.apache.thrift.meta_data.FieldMetaData("phrase", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.CREDS, new org.apache.thrift.meta_data.FieldMetaData("creds", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.AccessToken.class))); + tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.TransactionToken.class))); + tmpMap.put(_Fields.ENVIRONMENT, new org.apache.thrift.meta_data.FieldMetaData("environment", 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(getServerVersion_args.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(timePhrase_args.class, metaDataMap); } - public getServerVersion_args() { + public timePhrase_args() { + } + + public timePhrase_args( + java.lang.String phrase, + com.cinchapi.concourse.thrift.AccessToken creds, + com.cinchapi.concourse.thrift.TransactionToken token, + java.lang.String environment) + { + this(); + this.phrase = phrase; + this.creds = creds; + this.token = token; + this.environment = environment; } /** * Performs a deep copy on other. */ - public getServerVersion_args(getServerVersion_args other) { + public timePhrase_args(timePhrase_args other) { + if (other.isSetPhrase()) { + this.phrase = other.phrase; + } + if (other.isSetCreds()) { + this.creds = new com.cinchapi.concourse.thrift.AccessToken(other.creds); + } + if (other.isSetToken()) { + this.token = new com.cinchapi.concourse.thrift.TransactionToken(other.token); + } + if (other.isSetEnvironment()) { + this.environment = other.environment; + } } @Override - public getServerVersion_args deepCopy() { - return new getServerVersion_args(this); + public timePhrase_args deepCopy() { + return new timePhrase_args(this); } @Override public void clear() { + this.phrase = null; + this.creds = null; + this.token = null; + this.environment = null; + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getPhrase() { + return this.phrase; + } + + public timePhrase_args setPhrase(@org.apache.thrift.annotation.Nullable java.lang.String phrase) { + this.phrase = phrase; + return this; + } + + public void unsetPhrase() { + this.phrase = null; + } + + /** Returns true if field phrase is set (has been assigned a value) and false otherwise */ + public boolean isSetPhrase() { + return this.phrase != null; + } + + public void setPhraseIsSet(boolean value) { + if (!value) { + this.phrase = null; + } + } + + @org.apache.thrift.annotation.Nullable + public com.cinchapi.concourse.thrift.AccessToken getCreds() { + return this.creds; + } + + public timePhrase_args setCreds(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds) { + this.creds = creds; + return this; + } + + public void unsetCreds() { + this.creds = null; + } + + /** Returns true if field creds is set (has been assigned a value) and false otherwise */ + public boolean isSetCreds() { + return this.creds != null; + } + + public void setCredsIsSet(boolean value) { + if (!value) { + this.creds = null; + } + } + + @org.apache.thrift.annotation.Nullable + public com.cinchapi.concourse.thrift.TransactionToken getToken() { + return this.token; + } + + public timePhrase_args setToken(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken token) { + this.token = token; + return this; + } + + public void unsetToken() { + this.token = null; + } + + /** Returns true if field token is set (has been assigned a value) and false otherwise */ + public boolean isSetToken() { + return this.token != null; + } + + public void setTokenIsSet(boolean value) { + if (!value) { + this.token = null; + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getEnvironment() { + return this.environment; + } + + public timePhrase_args setEnvironment(@org.apache.thrift.annotation.Nullable java.lang.String environment) { + this.environment = environment; + return this; + } + + public void unsetEnvironment() { + this.environment = null; + } + + /** Returns true if field environment is set (has been assigned a value) and false otherwise */ + public boolean isSetEnvironment() { + return this.environment != null; + } + + public void setEnvironmentIsSet(boolean value) { + if (!value) { + this.environment = null; + } } @Override public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { + case PHRASE: + if (value == null) { + unsetPhrase(); + } else { + setPhrase((java.lang.String)value); + } + break; + + case CREDS: + if (value == null) { + unsetCreds(); + } else { + setCreds((com.cinchapi.concourse.thrift.AccessToken)value); + } + break; + + case TOKEN: + if (value == null) { + unsetToken(); + } else { + setToken((com.cinchapi.concourse.thrift.TransactionToken)value); + } + break; + + case ENVIRONMENT: + if (value == null) { + unsetEnvironment(); + } else { + setEnvironment((java.lang.String)value); + } + break; + } } @@ -689061,6 +691945,18 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable @Override public java.lang.Object getFieldValue(_Fields field) { switch (field) { + case PHRASE: + return getPhrase(); + + case CREDS: + return getCreds(); + + case TOKEN: + return getToken(); + + case ENVIRONMENT: + return getEnvironment(); + } throw new java.lang.IllegalStateException(); } @@ -689073,23 +691969,67 @@ public boolean isSet(_Fields field) { } switch (field) { + case PHRASE: + return isSetPhrase(); + case CREDS: + return isSetCreds(); + case TOKEN: + return isSetToken(); + case ENVIRONMENT: + return isSetEnvironment(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { - if (that instanceof getServerVersion_args) - return this.equals((getServerVersion_args)that); + if (that instanceof timePhrase_args) + return this.equals((timePhrase_args)that); return false; } - public boolean equals(getServerVersion_args that) { + public boolean equals(timePhrase_args that) { if (that == null) return false; if (this == that) return true; + boolean this_present_phrase = true && this.isSetPhrase(); + boolean that_present_phrase = true && that.isSetPhrase(); + if (this_present_phrase || that_present_phrase) { + if (!(this_present_phrase && that_present_phrase)) + return false; + if (!this.phrase.equals(that.phrase)) + return false; + } + + boolean this_present_creds = true && this.isSetCreds(); + boolean that_present_creds = true && that.isSetCreds(); + if (this_present_creds || that_present_creds) { + if (!(this_present_creds && that_present_creds)) + return false; + if (!this.creds.equals(that.creds)) + return false; + } + + boolean this_present_token = true && this.isSetToken(); + boolean that_present_token = true && that.isSetToken(); + if (this_present_token || that_present_token) { + if (!(this_present_token && that_present_token)) + return false; + if (!this.token.equals(that.token)) + return false; + } + + boolean this_present_environment = true && this.isSetEnvironment(); + boolean that_present_environment = true && that.isSetEnvironment(); + if (this_present_environment || that_present_environment) { + if (!(this_present_environment && that_present_environment)) + return false; + if (!this.environment.equals(that.environment)) + return false; + } + return true; } @@ -689097,17 +692037,73 @@ public boolean equals(getServerVersion_args that) { public int hashCode() { int hashCode = 1; + hashCode = hashCode * 8191 + ((isSetPhrase()) ? 131071 : 524287); + if (isSetPhrase()) + hashCode = hashCode * 8191 + phrase.hashCode(); + + hashCode = hashCode * 8191 + ((isSetCreds()) ? 131071 : 524287); + if (isSetCreds()) + hashCode = hashCode * 8191 + creds.hashCode(); + + hashCode = hashCode * 8191 + ((isSetToken()) ? 131071 : 524287); + if (isSetToken()) + hashCode = hashCode * 8191 + token.hashCode(); + + hashCode = hashCode * 8191 + ((isSetEnvironment()) ? 131071 : 524287); + if (isSetEnvironment()) + hashCode = hashCode * 8191 + environment.hashCode(); + return hashCode; } @Override - public int compareTo(getServerVersion_args other) { + public int compareTo(timePhrase_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; + lastComparison = java.lang.Boolean.compare(isSetPhrase(), other.isSetPhrase()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetPhrase()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.phrase, other.phrase); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetCreds(), other.isSetCreds()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetCreds()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.creds, other.creds); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetToken(), other.isSetToken()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetToken()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetEnvironment(), other.isSetEnvironment()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEnvironment()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.environment, other.environment); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -689129,9 +692125,40 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("getServerVersion_args("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("timePhrase_args("); boolean first = true; + sb.append("phrase:"); + if (this.phrase == null) { + sb.append("null"); + } else { + sb.append(this.phrase); + } + first = false; + if (!first) sb.append(", "); + sb.append("creds:"); + if (this.creds == null) { + sb.append("null"); + } else { + sb.append(this.creds); + } + first = false; + if (!first) sb.append(", "); + sb.append("token:"); + if (this.token == null) { + sb.append("null"); + } else { + sb.append(this.token); + } + first = false; + if (!first) sb.append(", "); + sb.append("environment:"); + if (this.environment == null) { + sb.append("null"); + } else { + sb.append(this.environment); + } + first = false; sb.append(")"); return sb.toString(); } @@ -689139,6 +692166,12 @@ public java.lang.String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity + if (creds != null) { + creds.validate(); + } + if (token != null) { + token.validate(); + } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -689157,17 +692190,17 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class getServerVersion_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class timePhrase_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public getServerVersion_argsStandardScheme getScheme() { - return new getServerVersion_argsStandardScheme(); + public timePhrase_argsStandardScheme getScheme() { + return new timePhrase_argsStandardScheme(); } } - private static class getServerVersion_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class timePhrase_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, getServerVersion_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, timePhrase_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -689177,6 +692210,40 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, getServerVersion_ar break; } switch (schemeField.id) { + case 1: // PHRASE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.phrase = iprot.readString(); + struct.setPhraseIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // CREDS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); + struct.creds.read(iprot); + struct.setCredsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // TOKEN + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.token = new com.cinchapi.concourse.thrift.TransactionToken(); + struct.token.read(iprot); + struct.setTokenIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // ENVIRONMENT + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.environment = iprot.readString(); + struct.setEnvironmentIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -689189,33 +692256,98 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, getServerVersion_ar } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, getServerVersion_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, timePhrase_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); + if (struct.phrase != null) { + oprot.writeFieldBegin(PHRASE_FIELD_DESC); + oprot.writeString(struct.phrase); + oprot.writeFieldEnd(); + } + if (struct.creds != null) { + oprot.writeFieldBegin(CREDS_FIELD_DESC); + struct.creds.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.token != null) { + oprot.writeFieldBegin(TOKEN_FIELD_DESC); + struct.token.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.environment != null) { + oprot.writeFieldBegin(ENVIRONMENT_FIELD_DESC); + oprot.writeString(struct.environment); + oprot.writeFieldEnd(); + } oprot.writeFieldStop(); oprot.writeStructEnd(); } } - private static class getServerVersion_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class timePhrase_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public getServerVersion_argsTupleScheme getScheme() { - return new getServerVersion_argsTupleScheme(); + public timePhrase_argsTupleScheme getScheme() { + return new timePhrase_argsTupleScheme(); } } - private static class getServerVersion_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class timePhrase_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, getServerVersion_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, timePhrase_args 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.isSetPhrase()) { + optionals.set(0); + } + if (struct.isSetCreds()) { + optionals.set(1); + } + if (struct.isSetToken()) { + optionals.set(2); + } + if (struct.isSetEnvironment()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.isSetPhrase()) { + oprot.writeString(struct.phrase); + } + if (struct.isSetCreds()) { + struct.creds.write(oprot); + } + if (struct.isSetToken()) { + struct.token.write(oprot); + } + if (struct.isSetEnvironment()) { + oprot.writeString(struct.environment); + } } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, getServerVersion_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, timePhrase_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(4); + if (incoming.get(0)) { + struct.phrase = iprot.readString(); + struct.setPhraseIsSet(true); + } + if (incoming.get(1)) { + struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); + struct.creds.read(iprot); + struct.setCredsIsSet(true); + } + if (incoming.get(2)) { + struct.token = new com.cinchapi.concourse.thrift.TransactionToken(); + struct.token.read(iprot); + struct.setTokenIsSet(true); + } + if (incoming.get(3)) { + struct.environment = iprot.readString(); + struct.setEnvironmentIsSet(true); + } } } @@ -689224,28 +692356,31 @@ private static S scheme(org.apache. } } - public static class getServerVersion_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("getServerVersion_result"); + public static class timePhrase_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("timePhrase_result"); - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0); + 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.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField EX2_FIELD_DESC = new org.apache.thrift.protocol.TField("ex2", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField EX3_FIELD_DESC = new org.apache.thrift.protocol.TField("ex3", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final org.apache.thrift.protocol.TField EX4_FIELD_DESC = new org.apache.thrift.protocol.TField("ex4", org.apache.thrift.protocol.TType.STRUCT, (short)4); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getServerVersion_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getServerVersion_resultTupleSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new timePhrase_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new timePhrase_resultTupleSchemeFactory(); - public @org.apache.thrift.annotation.Nullable java.lang.String success; // required + public long success; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2; // required - public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3; // required + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ParseException ex3; // required + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex4; // 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"), EX((short)1, "ex"), EX2((short)2, "ex2"), - EX3((short)3, "ex3"); + EX3((short)3, "ex3"), + EX4((short)4, "ex4"); private static final java.util.Map byName = new java.util.LinkedHashMap(); @@ -689269,6 +692404,8 @@ public static _Fields findByThriftId(int fieldId) { return EX2; case 3: // EX3 return EX3; + case 4: // EX4 + return EX4; default: return null; } @@ -689312,44 +692449,50 @@ public java.lang.String getFieldName() { } // 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.STRING))); + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.EX, new org.apache.thrift.meta_data.FieldMetaData("ex", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.SecurityException.class))); tmpMap.put(_Fields.EX2, new org.apache.thrift.meta_data.FieldMetaData("ex2", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.TransactionException.class))); tmpMap.put(_Fields.EX3, new org.apache.thrift.meta_data.FieldMetaData("ex3", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.ParseException.class))); + tmpMap.put(_Fields.EX4, new org.apache.thrift.meta_data.FieldMetaData("ex4", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.PermissionException.class))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getServerVersion_result.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(timePhrase_result.class, metaDataMap); } - public getServerVersion_result() { + public timePhrase_result() { } - public getServerVersion_result( - java.lang.String success, + public timePhrase_result( + long success, com.cinchapi.concourse.thrift.SecurityException ex, com.cinchapi.concourse.thrift.TransactionException ex2, - com.cinchapi.concourse.thrift.PermissionException ex3) + com.cinchapi.concourse.thrift.ParseException ex3, + com.cinchapi.concourse.thrift.PermissionException ex4) { this(); this.success = success; + setSuccessIsSet(true); this.ex = ex; this.ex2 = ex2; this.ex3 = ex3; + this.ex4 = ex4; } /** * Performs a deep copy on other. */ - public getServerVersion_result(getServerVersion_result other) { - if (other.isSetSuccess()) { - this.success = other.success; - } + public timePhrase_result(timePhrase_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; if (other.isSetEx()) { this.ex = new com.cinchapi.concourse.thrift.SecurityException(other.ex); } @@ -689357,46 +692500,49 @@ public getServerVersion_result(getServerVersion_result other) { this.ex2 = new com.cinchapi.concourse.thrift.TransactionException(other.ex2); } if (other.isSetEx3()) { - this.ex3 = new com.cinchapi.concourse.thrift.PermissionException(other.ex3); + this.ex3 = new com.cinchapi.concourse.thrift.ParseException(other.ex3); + } + if (other.isSetEx4()) { + this.ex4 = new com.cinchapi.concourse.thrift.PermissionException(other.ex4); } } @Override - public getServerVersion_result deepCopy() { - return new getServerVersion_result(this); + public timePhrase_result deepCopy() { + return new timePhrase_result(this); } @Override public void clear() { - this.success = null; + setSuccessIsSet(false); + this.success = 0; this.ex = null; this.ex2 = null; this.ex3 = null; + this.ex4 = null; } - @org.apache.thrift.annotation.Nullable - public java.lang.String getSuccess() { + public long getSuccess() { return this.success; } - public getServerVersion_result setSuccess(@org.apache.thrift.annotation.Nullable java.lang.String success) { + public timePhrase_result setSuccess(long success) { this.success = success; + setSuccessIsSet(true); return this; } public void unsetSuccess() { - this.success = null; + __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 this.success != null; + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } @org.apache.thrift.annotation.Nullable @@ -689404,7 +692550,7 @@ public com.cinchapi.concourse.thrift.SecurityException getEx() { return this.ex; } - public getServerVersion_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { + public timePhrase_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { this.ex = ex; return this; } @@ -689429,7 +692575,7 @@ public com.cinchapi.concourse.thrift.TransactionException getEx2() { return this.ex2; } - public getServerVersion_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { + public timePhrase_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { this.ex2 = ex2; return this; } @@ -689450,11 +692596,11 @@ public void setEx2IsSet(boolean value) { } @org.apache.thrift.annotation.Nullable - public com.cinchapi.concourse.thrift.PermissionException getEx3() { + public com.cinchapi.concourse.thrift.ParseException getEx3() { return this.ex3; } - public getServerVersion_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3) { + public timePhrase_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ParseException ex3) { this.ex3 = ex3; return this; } @@ -689474,6 +692620,31 @@ public void setEx3IsSet(boolean value) { } } + @org.apache.thrift.annotation.Nullable + public com.cinchapi.concourse.thrift.PermissionException getEx4() { + return this.ex4; + } + + public timePhrase_result setEx4(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex4) { + this.ex4 = ex4; + return this; + } + + public void unsetEx4() { + this.ex4 = null; + } + + /** Returns true if field ex4 is set (has been assigned a value) and false otherwise */ + public boolean isSetEx4() { + return this.ex4 != null; + } + + public void setEx4IsSet(boolean value) { + if (!value) { + this.ex4 = null; + } + } + @Override public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { @@ -689481,7 +692652,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetSuccess(); } else { - setSuccess((java.lang.String)value); + setSuccess((java.lang.Long)value); } break; @@ -689505,7 +692676,15 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetEx3(); } else { - setEx3((com.cinchapi.concourse.thrift.PermissionException)value); + setEx3((com.cinchapi.concourse.thrift.ParseException)value); + } + break; + + case EX4: + if (value == null) { + unsetEx4(); + } else { + setEx4((com.cinchapi.concourse.thrift.PermissionException)value); } break; @@ -689528,6 +692707,9 @@ public java.lang.Object getFieldValue(_Fields field) { case EX3: return getEx3(); + case EX4: + return getEx4(); + } throw new java.lang.IllegalStateException(); } @@ -689548,29 +692730,31 @@ public boolean isSet(_Fields field) { return isSetEx2(); case EX3: return isSetEx3(); + case EX4: + return isSetEx4(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { - if (that instanceof getServerVersion_result) - return this.equals((getServerVersion_result)that); + if (that instanceof timePhrase_result) + return this.equals((timePhrase_result)that); return false; } - public boolean equals(getServerVersion_result that) { + public boolean equals(timePhrase_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(); + 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.equals(that.success)) + if (this.success != that.success) return false; } @@ -689601,6 +692785,15 @@ public boolean equals(getServerVersion_result that) { return false; } + boolean this_present_ex4 = true && this.isSetEx4(); + boolean that_present_ex4 = true && that.isSetEx4(); + if (this_present_ex4 || that_present_ex4) { + if (!(this_present_ex4 && that_present_ex4)) + return false; + if (!this.ex4.equals(that.ex4)) + return false; + } + return true; } @@ -689608,9 +692801,7 @@ public boolean equals(getServerVersion_result that) { public int hashCode() { int hashCode = 1; - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(success); hashCode = hashCode * 8191 + ((isSetEx()) ? 131071 : 524287); if (isSetEx()) @@ -689624,11 +692815,15 @@ public int hashCode() { if (isSetEx3()) hashCode = hashCode * 8191 + ex3.hashCode(); + hashCode = hashCode * 8191 + ((isSetEx4()) ? 131071 : 524287); + if (isSetEx4()) + hashCode = hashCode * 8191 + ex4.hashCode(); + return hashCode; } @Override - public int compareTo(getServerVersion_result other) { + public int compareTo(timePhrase_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -689675,6 +692870,16 @@ public int compareTo(getServerVersion_result other) { return lastComparison; } } + lastComparison = java.lang.Boolean.compare(isSetEx4(), other.isSetEx4()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEx4()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex4, other.ex4); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -689695,15 +692900,11 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("getServerVersion_result("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("timePhrase_result("); boolean first = true; sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } + sb.append(this.success); first = false; if (!first) sb.append(", "); sb.append("ex:"); @@ -689729,6 +692930,14 @@ public java.lang.String toString() { sb.append(this.ex3); } first = false; + if (!first) sb.append(", "); + sb.append("ex4:"); + if (this.ex4 == null) { + sb.append("null"); + } else { + sb.append(this.ex4); + } + first = false; sb.append(")"); return sb.toString(); } @@ -689748,23 +692957,25 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept 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 getServerVersion_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class timePhrase_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public getServerVersion_resultStandardScheme getScheme() { - return new getServerVersion_resultStandardScheme(); + public timePhrase_resultStandardScheme getScheme() { + return new timePhrase_resultStandardScheme(); } } - private static class getServerVersion_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class timePhrase_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, getServerVersion_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, timePhrase_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -689775,8 +692986,8 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, getServerVersion_re } switch (schemeField.id) { case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.success = iprot.readString(); + 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); @@ -689802,13 +693013,22 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, getServerVersion_re break; case 3: // EX3 if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.ex3 = new com.cinchapi.concourse.thrift.PermissionException(); + struct.ex3 = new com.cinchapi.concourse.thrift.ParseException(); struct.ex3.read(iprot); struct.setEx3IsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 4: // EX4 + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ex4 = new com.cinchapi.concourse.thrift.PermissionException(); + struct.ex4.read(iprot); + struct.setEx4IsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -689821,13 +693041,13 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, getServerVersion_re } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, getServerVersion_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, timePhrase_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { + if (struct.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeString(struct.success); + oprot.writeI64(struct.success); oprot.writeFieldEnd(); } if (struct.ex != null) { @@ -689845,23 +693065,28 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, getServerVersion_r struct.ex3.write(oprot); oprot.writeFieldEnd(); } + if (struct.ex4 != null) { + oprot.writeFieldBegin(EX4_FIELD_DESC); + struct.ex4.write(oprot); + oprot.writeFieldEnd(); + } oprot.writeFieldStop(); oprot.writeStructEnd(); } } - private static class getServerVersion_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class timePhrase_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public getServerVersion_resultTupleScheme getScheme() { - return new getServerVersion_resultTupleScheme(); + public timePhrase_resultTupleScheme getScheme() { + return new timePhrase_resultTupleScheme(); } } - private static class getServerVersion_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class timePhrase_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, getServerVersion_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, timePhrase_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()) { @@ -689876,9 +693101,12 @@ public void write(org.apache.thrift.protocol.TProtocol prot, getServerVersion_re if (struct.isSetEx3()) { optionals.set(3); } - oprot.writeBitSet(optionals, 4); + if (struct.isSetEx4()) { + optionals.set(4); + } + oprot.writeBitSet(optionals, 5); if (struct.isSetSuccess()) { - oprot.writeString(struct.success); + oprot.writeI64(struct.success); } if (struct.isSetEx()) { struct.ex.write(oprot); @@ -689889,14 +693117,17 @@ public void write(org.apache.thrift.protocol.TProtocol prot, getServerVersion_re if (struct.isSetEx3()) { struct.ex3.write(oprot); } + if (struct.isSetEx4()) { + struct.ex4.write(oprot); + } } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, getServerVersion_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, timePhrase_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(4); + java.util.BitSet incoming = iprot.readBitSet(5); if (incoming.get(0)) { - struct.success = iprot.readString(); + struct.success = iprot.readI64(); struct.setSuccessIsSet(true); } if (incoming.get(1)) { @@ -689910,10 +693141,15 @@ public void read(org.apache.thrift.protocol.TProtocol prot, getServerVersion_res struct.setEx2IsSet(true); } if (incoming.get(3)) { - struct.ex3 = new com.cinchapi.concourse.thrift.PermissionException(); + struct.ex3 = new com.cinchapi.concourse.thrift.ParseException(); struct.ex3.read(iprot); struct.setEx3IsSet(true); } + if (incoming.get(4)) { + struct.ex4 = new com.cinchapi.concourse.thrift.PermissionException(); + struct.ex4.read(iprot); + struct.setEx4IsSet(true); + } } } @@ -689922,25 +693158,28 @@ private static S scheme(org.apache. } } - public static class time_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("time_args"); + public static class traceRecord_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("traceRecord_args"); - private static final org.apache.thrift.protocol.TField CREDS_FIELD_DESC = new org.apache.thrift.protocol.TField("creds", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRUCT, (short)2); - private static final org.apache.thrift.protocol.TField ENVIRONMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("environment", org.apache.thrift.protocol.TType.STRING, (short)3); + private static final org.apache.thrift.protocol.TField RECORD_FIELD_DESC = new org.apache.thrift.protocol.TField("record", org.apache.thrift.protocol.TType.I64, (short)1); + private static final org.apache.thrift.protocol.TField CREDS_FIELD_DESC = new org.apache.thrift.protocol.TField("creds", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final org.apache.thrift.protocol.TField TRANSACTION_FIELD_DESC = new org.apache.thrift.protocol.TField("transaction", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final org.apache.thrift.protocol.TField ENVIRONMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("environment", org.apache.thrift.protocol.TType.STRING, (short)4); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new time_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new time_argsTupleSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new traceRecord_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new traceRecord_argsTupleSchemeFactory(); + public long record; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds; // required - public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken token; // required + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction; // required public @org.apache.thrift.annotation.Nullable java.lang.String environment; // 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 { - CREDS((short)1, "creds"), - TOKEN((short)2, "token"), - ENVIRONMENT((short)3, "environment"); + RECORD((short)1, "record"), + CREDS((short)2, "creds"), + TRANSACTION((short)3, "transaction"), + ENVIRONMENT((short)4, "environment"); private static final java.util.Map byName = new java.util.LinkedHashMap(); @@ -689956,11 +693195,13 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { - case 1: // CREDS + case 1: // RECORD + return RECORD; + case 2: // CREDS return CREDS; - case 2: // TOKEN - return TOKEN; - case 3: // ENVIRONMENT + case 3: // TRANSACTION + return TRANSACTION; + case 4: // ENVIRONMENT return ENVIRONMENT; default: return null; @@ -690005,42 +693246,51 @@ public java.lang.String getFieldName() { } // isset id assignments + private static final int __RECORD_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.RECORD, new org.apache.thrift.meta_data.FieldMetaData("record", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.CREDS, new org.apache.thrift.meta_data.FieldMetaData("creds", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.AccessToken.class))); - tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.TRANSACTION, new org.apache.thrift.meta_data.FieldMetaData("transaction", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.TransactionToken.class))); tmpMap.put(_Fields.ENVIRONMENT, new org.apache.thrift.meta_data.FieldMetaData("environment", 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(time_args.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(traceRecord_args.class, metaDataMap); } - public time_args() { + public traceRecord_args() { } - public time_args( + public traceRecord_args( + long record, com.cinchapi.concourse.thrift.AccessToken creds, - com.cinchapi.concourse.thrift.TransactionToken token, + com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment) { this(); + this.record = record; + setRecordIsSet(true); this.creds = creds; - this.token = token; + this.transaction = transaction; this.environment = environment; } /** * Performs a deep copy on other. */ - public time_args(time_args other) { + public traceRecord_args(traceRecord_args other) { + __isset_bitfield = other.__isset_bitfield; + this.record = other.record; if (other.isSetCreds()) { this.creds = new com.cinchapi.concourse.thrift.AccessToken(other.creds); } - if (other.isSetToken()) { - this.token = new com.cinchapi.concourse.thrift.TransactionToken(other.token); + if (other.isSetTransaction()) { + this.transaction = new com.cinchapi.concourse.thrift.TransactionToken(other.transaction); } if (other.isSetEnvironment()) { this.environment = other.environment; @@ -690048,23 +693298,48 @@ public time_args(time_args other) { } @Override - public time_args deepCopy() { - return new time_args(this); + public traceRecord_args deepCopy() { + return new traceRecord_args(this); } @Override public void clear() { + setRecordIsSet(false); + this.record = 0; this.creds = null; - this.token = null; + this.transaction = null; this.environment = null; } + public long getRecord() { + return this.record; + } + + public traceRecord_args setRecord(long record) { + this.record = record; + setRecordIsSet(true); + return this; + } + + public void unsetRecord() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __RECORD_ISSET_ID); + } + + /** Returns true if field record is set (has been assigned a value) and false otherwise */ + public boolean isSetRecord() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __RECORD_ISSET_ID); + } + + public void setRecordIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __RECORD_ISSET_ID, value); + } + @org.apache.thrift.annotation.Nullable public com.cinchapi.concourse.thrift.AccessToken getCreds() { return this.creds; } - public time_args setCreds(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds) { + public traceRecord_args setCreds(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds) { this.creds = creds; return this; } @@ -690085,27 +693360,27 @@ public void setCredsIsSet(boolean value) { } @org.apache.thrift.annotation.Nullable - public com.cinchapi.concourse.thrift.TransactionToken getToken() { - return this.token; + public com.cinchapi.concourse.thrift.TransactionToken getTransaction() { + return this.transaction; } - public time_args setToken(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken token) { - this.token = token; + public traceRecord_args setTransaction(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction) { + this.transaction = transaction; return this; } - public void unsetToken() { - this.token = null; + public void unsetTransaction() { + this.transaction = null; } - /** Returns true if field token is set (has been assigned a value) and false otherwise */ - public boolean isSetToken() { - return this.token != null; + /** Returns true if field transaction is set (has been assigned a value) and false otherwise */ + public boolean isSetTransaction() { + return this.transaction != null; } - public void setTokenIsSet(boolean value) { + public void setTransactionIsSet(boolean value) { if (!value) { - this.token = null; + this.transaction = null; } } @@ -690114,7 +693389,7 @@ public java.lang.String getEnvironment() { return this.environment; } - public time_args setEnvironment(@org.apache.thrift.annotation.Nullable java.lang.String environment) { + public traceRecord_args setEnvironment(@org.apache.thrift.annotation.Nullable java.lang.String environment) { this.environment = environment; return this; } @@ -690137,6 +693412,14 @@ public void setEnvironmentIsSet(boolean value) { @Override public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { + case RECORD: + if (value == null) { + unsetRecord(); + } else { + setRecord((java.lang.Long)value); + } + break; + case CREDS: if (value == null) { unsetCreds(); @@ -690145,11 +693428,11 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } break; - case TOKEN: + case TRANSACTION: if (value == null) { - unsetToken(); + unsetTransaction(); } else { - setToken((com.cinchapi.concourse.thrift.TransactionToken)value); + setTransaction((com.cinchapi.concourse.thrift.TransactionToken)value); } break; @@ -690168,11 +693451,14 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable @Override public java.lang.Object getFieldValue(_Fields field) { switch (field) { + case RECORD: + return getRecord(); + case CREDS: return getCreds(); - case TOKEN: - return getToken(); + case TRANSACTION: + return getTransaction(); case ENVIRONMENT: return getEnvironment(); @@ -690189,10 +693475,12 @@ public boolean isSet(_Fields field) { } switch (field) { + case RECORD: + return isSetRecord(); case CREDS: return isSetCreds(); - case TOKEN: - return isSetToken(); + case TRANSACTION: + return isSetTransaction(); case ENVIRONMENT: return isSetEnvironment(); } @@ -690201,17 +693489,26 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that instanceof time_args) - return this.equals((time_args)that); + if (that instanceof traceRecord_args) + return this.equals((traceRecord_args)that); return false; } - public boolean equals(time_args that) { + public boolean equals(traceRecord_args that) { if (that == null) return false; if (this == that) return true; + boolean this_present_record = true; + boolean that_present_record = true; + if (this_present_record || that_present_record) { + if (!(this_present_record && that_present_record)) + return false; + if (this.record != that.record) + return false; + } + boolean this_present_creds = true && this.isSetCreds(); boolean that_present_creds = true && that.isSetCreds(); if (this_present_creds || that_present_creds) { @@ -690221,12 +693518,12 @@ public boolean equals(time_args that) { return false; } - boolean this_present_token = true && this.isSetToken(); - boolean that_present_token = true && that.isSetToken(); - if (this_present_token || that_present_token) { - if (!(this_present_token && that_present_token)) + boolean this_present_transaction = true && this.isSetTransaction(); + boolean that_present_transaction = true && that.isSetTransaction(); + if (this_present_transaction || that_present_transaction) { + if (!(this_present_transaction && that_present_transaction)) return false; - if (!this.token.equals(that.token)) + if (!this.transaction.equals(that.transaction)) return false; } @@ -690246,13 +693543,15 @@ public boolean equals(time_args that) { public int hashCode() { int hashCode = 1; + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(record); + hashCode = hashCode * 8191 + ((isSetCreds()) ? 131071 : 524287); if (isSetCreds()) hashCode = hashCode * 8191 + creds.hashCode(); - hashCode = hashCode * 8191 + ((isSetToken()) ? 131071 : 524287); - if (isSetToken()) - hashCode = hashCode * 8191 + token.hashCode(); + hashCode = hashCode * 8191 + ((isSetTransaction()) ? 131071 : 524287); + if (isSetTransaction()) + hashCode = hashCode * 8191 + transaction.hashCode(); hashCode = hashCode * 8191 + ((isSetEnvironment()) ? 131071 : 524287); if (isSetEnvironment()) @@ -690262,13 +693561,23 @@ public int hashCode() { } @Override - public int compareTo(time_args other) { + public int compareTo(traceRecord_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; + lastComparison = java.lang.Boolean.compare(isSetRecord(), other.isSetRecord()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRecord()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.record, other.record); + if (lastComparison != 0) { + return lastComparison; + } + } lastComparison = java.lang.Boolean.compare(isSetCreds(), other.isSetCreds()); if (lastComparison != 0) { return lastComparison; @@ -690279,12 +693588,12 @@ public int compareTo(time_args other) { return lastComparison; } } - lastComparison = java.lang.Boolean.compare(isSetToken(), other.isSetToken()); + lastComparison = java.lang.Boolean.compare(isSetTransaction(), other.isSetTransaction()); if (lastComparison != 0) { return lastComparison; } - if (isSetToken()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token); + if (isSetTransaction()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transaction, other.transaction); if (lastComparison != 0) { return lastComparison; } @@ -690320,9 +693629,13 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("time_args("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("traceRecord_args("); boolean first = true; + sb.append("record:"); + sb.append(this.record); + first = false; + if (!first) sb.append(", "); sb.append("creds:"); if (this.creds == null) { sb.append("null"); @@ -690331,11 +693644,11 @@ public java.lang.String toString() { } first = false; if (!first) sb.append(", "); - sb.append("token:"); - if (this.token == null) { + sb.append("transaction:"); + if (this.transaction == null) { sb.append("null"); } else { - sb.append(this.token); + sb.append(this.transaction); } first = false; if (!first) sb.append(", "); @@ -690356,8 +693669,8 @@ public void validate() throws org.apache.thrift.TException { if (creds != null) { creds.validate(); } - if (token != null) { - token.validate(); + if (transaction != null) { + transaction.validate(); } } @@ -690371,23 +693684,25 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept 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 time_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class traceRecord_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public time_argsStandardScheme getScheme() { - return new time_argsStandardScheme(); + public traceRecord_argsStandardScheme getScheme() { + return new traceRecord_argsStandardScheme(); } } - private static class time_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class traceRecord_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, time_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecord_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -690397,7 +693712,15 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, time_args struct) t break; } switch (schemeField.id) { - case 1: // CREDS + case 1: // RECORD + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.record = iprot.readI64(); + struct.setRecordIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // CREDS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); struct.creds.read(iprot); @@ -690406,16 +693729,16 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, time_args struct) t org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 2: // TOKEN + case 3: // TRANSACTION if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.token = new com.cinchapi.concourse.thrift.TransactionToken(); - struct.token.read(iprot); - struct.setTokenIsSet(true); + struct.transaction = new com.cinchapi.concourse.thrift.TransactionToken(); + struct.transaction.read(iprot); + struct.setTransactionIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 3: // ENVIRONMENT + case 4: // ENVIRONMENT if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.environment = iprot.readString(); struct.setEnvironmentIsSet(true); @@ -690435,18 +693758,21 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, time_args struct) t } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, time_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecord_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(RECORD_FIELD_DESC); + oprot.writeI64(struct.record); + oprot.writeFieldEnd(); if (struct.creds != null) { oprot.writeFieldBegin(CREDS_FIELD_DESC); struct.creds.write(oprot); oprot.writeFieldEnd(); } - if (struct.token != null) { - oprot.writeFieldBegin(TOKEN_FIELD_DESC); - struct.token.write(oprot); + if (struct.transaction != null) { + oprot.writeFieldBegin(TRANSACTION_FIELD_DESC); + struct.transaction.write(oprot); oprot.writeFieldEnd(); } if (struct.environment != null) { @@ -690460,34 +693786,40 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, time_args struct) } - private static class time_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class traceRecord_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public time_argsTupleScheme getScheme() { - return new time_argsTupleScheme(); + public traceRecord_argsTupleScheme getScheme() { + return new traceRecord_argsTupleScheme(); } } - private static class time_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class traceRecord_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, time_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, traceRecord_args 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.isSetCreds()) { + if (struct.isSetRecord()) { optionals.set(0); } - if (struct.isSetToken()) { + if (struct.isSetCreds()) { optionals.set(1); } - if (struct.isSetEnvironment()) { + if (struct.isSetTransaction()) { optionals.set(2); } - oprot.writeBitSet(optionals, 3); + if (struct.isSetEnvironment()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.isSetRecord()) { + oprot.writeI64(struct.record); + } if (struct.isSetCreds()) { struct.creds.write(oprot); } - if (struct.isSetToken()) { - struct.token.write(oprot); + if (struct.isSetTransaction()) { + struct.transaction.write(oprot); } if (struct.isSetEnvironment()) { oprot.writeString(struct.environment); @@ -690495,20 +693827,24 @@ public void write(org.apache.thrift.protocol.TProtocol prot, time_args struct) t } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, time_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, traceRecord_args 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); + java.util.BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { + struct.record = iprot.readI64(); + struct.setRecordIsSet(true); + } + if (incoming.get(1)) { struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); struct.creds.read(iprot); struct.setCredsIsSet(true); } - if (incoming.get(1)) { - struct.token = new com.cinchapi.concourse.thrift.TransactionToken(); - struct.token.read(iprot); - struct.setTokenIsSet(true); - } if (incoming.get(2)) { + struct.transaction = new com.cinchapi.concourse.thrift.TransactionToken(); + struct.transaction.read(iprot); + struct.setTransactionIsSet(true); + } + if (incoming.get(3)) { struct.environment = iprot.readString(); struct.setEnvironmentIsSet(true); } @@ -690520,18 +693856,18 @@ private static S scheme(org.apache. } } - public static class time_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("time_result"); + public static class traceRecord_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("traceRecord_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.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.MAP, (short)0); private static final org.apache.thrift.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField EX2_FIELD_DESC = new org.apache.thrift.protocol.TField("ex2", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField EX3_FIELD_DESC = new org.apache.thrift.protocol.TField("ex3", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new time_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new time_resultTupleSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new traceRecord_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new traceRecord_resultTupleSchemeFactory(); - public long success; // required + public @org.apache.thrift.annotation.Nullable java.util.Map> success; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3; // required @@ -690608,13 +693944,14 @@ public java.lang.String getFieldName() { } // 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))); + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), + new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))))); tmpMap.put(_Fields.EX, new org.apache.thrift.meta_data.FieldMetaData("ex", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.SecurityException.class))); tmpMap.put(_Fields.EX2, new org.apache.thrift.meta_data.FieldMetaData("ex2", org.apache.thrift.TFieldRequirementType.DEFAULT, @@ -690622,21 +693959,20 @@ public java.lang.String getFieldName() { tmpMap.put(_Fields.EX3, new org.apache.thrift.meta_data.FieldMetaData("ex3", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.PermissionException.class))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(time_result.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(traceRecord_result.class, metaDataMap); } - public time_result() { + public traceRecord_result() { } - public time_result( - long success, + public traceRecord_result( + java.util.Map> success, com.cinchapi.concourse.thrift.SecurityException ex, com.cinchapi.concourse.thrift.TransactionException ex2, com.cinchapi.concourse.thrift.PermissionException ex3) { this(); this.success = success; - setSuccessIsSet(true); this.ex = ex; this.ex2 = ex2; this.ex3 = ex3; @@ -690645,9 +693981,22 @@ public time_result( /** * Performs a deep copy on other. */ - public time_result(time_result other) { - __isset_bitfield = other.__isset_bitfield; - this.success = other.success; + public traceRecord_result(traceRecord_result other) { + if (other.isSetSuccess()) { + java.util.Map> __this__success = new java.util.LinkedHashMap>(other.success.size()); + for (java.util.Map.Entry> other_element : other.success.entrySet()) { + + java.lang.String other_element_key = other_element.getKey(); + java.util.Set other_element_value = other_element.getValue(); + + java.lang.String __this__success_copy_key = other_element_key; + + java.util.Set __this__success_copy_value = new java.util.LinkedHashSet(other_element_value); + + __this__success.put(__this__success_copy_key, __this__success_copy_value); + } + this.success = __this__success; + } if (other.isSetEx()) { this.ex = new com.cinchapi.concourse.thrift.SecurityException(other.ex); } @@ -690660,40 +694009,52 @@ public time_result(time_result other) { } @Override - public time_result deepCopy() { - return new time_result(this); + public traceRecord_result deepCopy() { + return new traceRecord_result(this); } @Override public void clear() { - setSuccessIsSet(false); - this.success = 0; + this.success = null; this.ex = null; this.ex2 = null; this.ex3 = null; } - public long getSuccess() { + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public void putToSuccess(java.lang.String key, java.util.Set val) { + if (this.success == null) { + this.success = new java.util.LinkedHashMap>(); + } + this.success.put(key, val); + } + + @org.apache.thrift.annotation.Nullable + public java.util.Map> getSuccess() { return this.success; } - public time_result setSuccess(long success) { + public traceRecord_result setSuccess(@org.apache.thrift.annotation.Nullable java.util.Map> success) { this.success = success; - setSuccessIsSet(true); return this; } public void unsetSuccess() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + this.success = null; } /** 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); + return this.success != null; } public void setSuccessIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + if (!value) { + this.success = null; + } } @org.apache.thrift.annotation.Nullable @@ -690701,7 +694062,7 @@ public com.cinchapi.concourse.thrift.SecurityException getEx() { return this.ex; } - public time_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { + public traceRecord_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { this.ex = ex; return this; } @@ -690726,7 +694087,7 @@ public com.cinchapi.concourse.thrift.TransactionException getEx2() { return this.ex2; } - public time_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { + public traceRecord_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { this.ex2 = ex2; return this; } @@ -690751,7 +694112,7 @@ public com.cinchapi.concourse.thrift.PermissionException getEx3() { return this.ex3; } - public time_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3) { + public traceRecord_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3) { this.ex3 = ex3; return this; } @@ -690778,7 +694139,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetSuccess(); } else { - setSuccess((java.lang.Long)value); + setSuccess((java.util.Map>)value); } break; @@ -690851,23 +694212,23 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that instanceof time_result) - return this.equals((time_result)that); + if (that instanceof traceRecord_result) + return this.equals((traceRecord_result)that); return false; } - public boolean equals(time_result that) { + public boolean equals(traceRecord_result that) { if (that == null) return false; if (this == that) return true; - boolean this_present_success = true; - boolean that_present_success = 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 != that.success) + if (!this.success.equals(that.success)) return false; } @@ -690905,7 +694266,9 @@ public boolean equals(time_result that) { public int hashCode() { int hashCode = 1; - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(success); + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); hashCode = hashCode * 8191 + ((isSetEx()) ? 131071 : 524287); if (isSetEx()) @@ -690923,7 +694286,7 @@ public int hashCode() { } @Override - public int compareTo(time_result other) { + public int compareTo(traceRecord_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -690990,11 +694353,15 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("time_result("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("traceRecord_result("); boolean first = true; sb.append("success:"); - sb.append(this.success); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } first = false; if (!first) sb.append(", "); sb.append("ex:"); @@ -691039,25 +694406,23 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept 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 time_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class traceRecord_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public time_resultStandardScheme getScheme() { - return new time_resultStandardScheme(); + public traceRecord_resultStandardScheme getScheme() { + return new traceRecord_resultStandardScheme(); } } - private static class time_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class traceRecord_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, time_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecord_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -691068,8 +694433,30 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, time_result struct) } switch (schemeField.id) { case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.success = iprot.readI64(); + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map7040 = iprot.readMapBegin(); + struct.success = new java.util.LinkedHashMap>(2*_map7040.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key7041; + @org.apache.thrift.annotation.Nullable java.util.Set _val7042; + for (int _i7043 = 0; _i7043 < _map7040.size; ++_i7043) + { + _key7041 = iprot.readString(); + { + org.apache.thrift.protocol.TSet _set7044 = iprot.readSetBegin(); + _val7042 = new java.util.LinkedHashSet(2*_set7044.size); + long _elem7045; + for (int _i7046 = 0; _i7046 < _set7044.size; ++_i7046) + { + _elem7045 = iprot.readI64(); + _val7042.add(_elem7045); + } + iprot.readSetEnd(); + } + struct.success.put(_key7041, _val7042); + } + iprot.readMapEnd(); + } struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); @@ -691114,13 +694501,28 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, time_result struct) } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, time_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecord_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); - if (struct.isSetSuccess()) { + if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeI64(struct.success); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.SET, struct.success.size())); + for (java.util.Map.Entry> _iter7047 : struct.success.entrySet()) + { + oprot.writeString(_iter7047.getKey()); + { + oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I64, _iter7047.getValue().size())); + for (long _iter7048 : _iter7047.getValue()) + { + oprot.writeI64(_iter7048); + } + oprot.writeSetEnd(); + } + } + oprot.writeMapEnd(); + } oprot.writeFieldEnd(); } if (struct.ex != null) { @@ -691144,17 +694546,17 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, time_result struct } - private static class time_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class traceRecord_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public time_resultTupleScheme getScheme() { - return new time_resultTupleScheme(); + public traceRecord_resultTupleScheme getScheme() { + return new traceRecord_resultTupleScheme(); } } - private static class time_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class traceRecord_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, time_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, traceRecord_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()) { @@ -691171,7 +694573,20 @@ public void write(org.apache.thrift.protocol.TProtocol prot, time_result struct) } oprot.writeBitSet(optionals, 4); if (struct.isSetSuccess()) { - oprot.writeI64(struct.success); + { + oprot.writeI32(struct.success.size()); + for (java.util.Map.Entry> _iter7049 : struct.success.entrySet()) + { + oprot.writeString(_iter7049.getKey()); + { + oprot.writeI32(_iter7049.getValue().size()); + for (long _iter7050 : _iter7049.getValue()) + { + oprot.writeI64(_iter7050); + } + } + } + } } if (struct.isSetEx()) { struct.ex.write(oprot); @@ -691185,11 +694600,31 @@ public void write(org.apache.thrift.protocol.TProtocol prot, time_result struct) } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, time_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, traceRecord_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(4); if (incoming.get(0)) { - struct.success = iprot.readI64(); + { + org.apache.thrift.protocol.TMap _map7051 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.SET); + struct.success = new java.util.LinkedHashMap>(2*_map7051.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key7052; + @org.apache.thrift.annotation.Nullable java.util.Set _val7053; + for (int _i7054 = 0; _i7054 < _map7051.size; ++_i7054) + { + _key7052 = iprot.readString(); + { + org.apache.thrift.protocol.TSet _set7055 = iprot.readSetBegin(org.apache.thrift.protocol.TType.I64); + _val7053 = new java.util.LinkedHashSet(2*_set7055.size); + long _elem7056; + for (int _i7057 = 0; _i7057 < _set7055.size; ++_i7057) + { + _elem7056 = iprot.readI64(); + _val7053.add(_elem7056); + } + } + struct.success.put(_key7052, _val7053); + } + } struct.setSuccessIsSet(true); } if (incoming.get(1)) { @@ -691215,28 +694650,31 @@ private static S scheme(org.apache. } } - public static class timePhrase_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("timePhrase_args"); + public static class traceRecordTime_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("traceRecordTime_args"); - private static final org.apache.thrift.protocol.TField PHRASE_FIELD_DESC = new org.apache.thrift.protocol.TField("phrase", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField CREDS_FIELD_DESC = new org.apache.thrift.protocol.TField("creds", org.apache.thrift.protocol.TType.STRUCT, (short)2); - private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.protocol.TField ENVIRONMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("environment", org.apache.thrift.protocol.TType.STRING, (short)4); + private static final org.apache.thrift.protocol.TField RECORD_FIELD_DESC = new org.apache.thrift.protocol.TField("record", org.apache.thrift.protocol.TType.I64, (short)1); + private static final org.apache.thrift.protocol.TField TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("timestamp", org.apache.thrift.protocol.TType.I64, (short)2); + private static final org.apache.thrift.protocol.TField CREDS_FIELD_DESC = new org.apache.thrift.protocol.TField("creds", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final org.apache.thrift.protocol.TField TRANSACTION_FIELD_DESC = new org.apache.thrift.protocol.TField("transaction", org.apache.thrift.protocol.TType.STRUCT, (short)4); + private static final org.apache.thrift.protocol.TField ENVIRONMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("environment", org.apache.thrift.protocol.TType.STRING, (short)5); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new timePhrase_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new timePhrase_argsTupleSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new traceRecordTime_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new traceRecordTime_argsTupleSchemeFactory(); - public @org.apache.thrift.annotation.Nullable java.lang.String phrase; // required + public long record; // required + public long timestamp; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds; // required - public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken token; // required + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction; // required public @org.apache.thrift.annotation.Nullable java.lang.String environment; // 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 { - PHRASE((short)1, "phrase"), - CREDS((short)2, "creds"), - TOKEN((short)3, "token"), - ENVIRONMENT((short)4, "environment"); + RECORD((short)1, "record"), + TIMESTAMP((short)2, "timestamp"), + CREDS((short)3, "creds"), + TRANSACTION((short)4, "transaction"), + ENVIRONMENT((short)5, "environment"); private static final java.util.Map byName = new java.util.LinkedHashMap(); @@ -691252,13 +694690,15 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { - case 1: // PHRASE - return PHRASE; - case 2: // CREDS + case 1: // RECORD + return RECORD; + case 2: // TIMESTAMP + return TIMESTAMP; + case 3: // CREDS return CREDS; - case 3: // TOKEN - return TOKEN; - case 4: // ENVIRONMENT + case 4: // TRANSACTION + return TRANSACTION; + case 5: // ENVIRONMENT return ENVIRONMENT; default: return null; @@ -691303,49 +694743,58 @@ public java.lang.String getFieldName() { } // isset id assignments + private static final int __RECORD_ISSET_ID = 0; + private static final int __TIMESTAMP_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.PHRASE, new org.apache.thrift.meta_data.FieldMetaData("phrase", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.RECORD, new org.apache.thrift.meta_data.FieldMetaData("record", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.CREDS, new org.apache.thrift.meta_data.FieldMetaData("creds", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.AccessToken.class))); - tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.TRANSACTION, new org.apache.thrift.meta_data.FieldMetaData("transaction", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.TransactionToken.class))); tmpMap.put(_Fields.ENVIRONMENT, new org.apache.thrift.meta_data.FieldMetaData("environment", 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(timePhrase_args.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(traceRecordTime_args.class, metaDataMap); } - public timePhrase_args() { + public traceRecordTime_args() { } - public timePhrase_args( - java.lang.String phrase, + public traceRecordTime_args( + long record, + long timestamp, com.cinchapi.concourse.thrift.AccessToken creds, - com.cinchapi.concourse.thrift.TransactionToken token, + com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment) { this(); - this.phrase = phrase; + this.record = record; + setRecordIsSet(true); + this.timestamp = timestamp; + setTimestampIsSet(true); this.creds = creds; - this.token = token; + this.transaction = transaction; this.environment = environment; } /** * Performs a deep copy on other. */ - public timePhrase_args(timePhrase_args other) { - if (other.isSetPhrase()) { - this.phrase = other.phrase; - } + public traceRecordTime_args(traceRecordTime_args other) { + __isset_bitfield = other.__isset_bitfield; + this.record = other.record; + this.timestamp = other.timestamp; if (other.isSetCreds()) { this.creds = new com.cinchapi.concourse.thrift.AccessToken(other.creds); } - if (other.isSetToken()) { - this.token = new com.cinchapi.concourse.thrift.TransactionToken(other.token); + if (other.isSetTransaction()) { + this.transaction = new com.cinchapi.concourse.thrift.TransactionToken(other.transaction); } if (other.isSetEnvironment()) { this.environment = other.environment; @@ -691353,41 +694802,65 @@ public timePhrase_args(timePhrase_args other) { } @Override - public timePhrase_args deepCopy() { - return new timePhrase_args(this); + public traceRecordTime_args deepCopy() { + return new traceRecordTime_args(this); } @Override public void clear() { - this.phrase = null; + setRecordIsSet(false); + this.record = 0; + setTimestampIsSet(false); + this.timestamp = 0; this.creds = null; - this.token = null; + this.transaction = null; this.environment = null; } - @org.apache.thrift.annotation.Nullable - public java.lang.String getPhrase() { - return this.phrase; + public long getRecord() { + return this.record; } - public timePhrase_args setPhrase(@org.apache.thrift.annotation.Nullable java.lang.String phrase) { - this.phrase = phrase; + public traceRecordTime_args setRecord(long record) { + this.record = record; + setRecordIsSet(true); return this; } - public void unsetPhrase() { - this.phrase = null; + public void unsetRecord() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __RECORD_ISSET_ID); } - /** Returns true if field phrase is set (has been assigned a value) and false otherwise */ - public boolean isSetPhrase() { - return this.phrase != null; + /** Returns true if field record is set (has been assigned a value) and false otherwise */ + public boolean isSetRecord() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __RECORD_ISSET_ID); } - public void setPhraseIsSet(boolean value) { - if (!value) { - this.phrase = null; - } + public void setRecordIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __RECORD_ISSET_ID, value); + } + + public long getTimestamp() { + return this.timestamp; + } + + public traceRecordTime_args setTimestamp(long timestamp) { + this.timestamp = timestamp; + setTimestampIsSet(true); + return this; + } + + public void unsetTimestamp() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + } + + /** Returns true if field timestamp is set (has been assigned a value) and false otherwise */ + public boolean isSetTimestamp() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + } + + public void setTimestampIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TIMESTAMP_ISSET_ID, value); } @org.apache.thrift.annotation.Nullable @@ -691395,7 +694868,7 @@ public com.cinchapi.concourse.thrift.AccessToken getCreds() { return this.creds; } - public timePhrase_args setCreds(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds) { + public traceRecordTime_args setCreds(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds) { this.creds = creds; return this; } @@ -691416,27 +694889,27 @@ public void setCredsIsSet(boolean value) { } @org.apache.thrift.annotation.Nullable - public com.cinchapi.concourse.thrift.TransactionToken getToken() { - return this.token; + public com.cinchapi.concourse.thrift.TransactionToken getTransaction() { + return this.transaction; } - public timePhrase_args setToken(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken token) { - this.token = token; + public traceRecordTime_args setTransaction(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction) { + this.transaction = transaction; return this; } - public void unsetToken() { - this.token = null; + public void unsetTransaction() { + this.transaction = null; } - /** Returns true if field token is set (has been assigned a value) and false otherwise */ - public boolean isSetToken() { - return this.token != null; + /** Returns true if field transaction is set (has been assigned a value) and false otherwise */ + public boolean isSetTransaction() { + return this.transaction != null; } - public void setTokenIsSet(boolean value) { + public void setTransactionIsSet(boolean value) { if (!value) { - this.token = null; + this.transaction = null; } } @@ -691445,7 +694918,7 @@ public java.lang.String getEnvironment() { return this.environment; } - public timePhrase_args setEnvironment(@org.apache.thrift.annotation.Nullable java.lang.String environment) { + public traceRecordTime_args setEnvironment(@org.apache.thrift.annotation.Nullable java.lang.String environment) { this.environment = environment; return this; } @@ -691468,11 +694941,19 @@ public void setEnvironmentIsSet(boolean value) { @Override public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { - case PHRASE: + case RECORD: if (value == null) { - unsetPhrase(); + unsetRecord(); } else { - setPhrase((java.lang.String)value); + setRecord((java.lang.Long)value); + } + break; + + case TIMESTAMP: + if (value == null) { + unsetTimestamp(); + } else { + setTimestamp((java.lang.Long)value); } break; @@ -691484,11 +694965,11 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } break; - case TOKEN: + case TRANSACTION: if (value == null) { - unsetToken(); + unsetTransaction(); } else { - setToken((com.cinchapi.concourse.thrift.TransactionToken)value); + setTransaction((com.cinchapi.concourse.thrift.TransactionToken)value); } break; @@ -691507,14 +694988,17 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable @Override public java.lang.Object getFieldValue(_Fields field) { switch (field) { - case PHRASE: - return getPhrase(); + case RECORD: + return getRecord(); + + case TIMESTAMP: + return getTimestamp(); case CREDS: return getCreds(); - case TOKEN: - return getToken(); + case TRANSACTION: + return getTransaction(); case ENVIRONMENT: return getEnvironment(); @@ -691531,12 +695015,14 @@ public boolean isSet(_Fields field) { } switch (field) { - case PHRASE: - return isSetPhrase(); + case RECORD: + return isSetRecord(); + case TIMESTAMP: + return isSetTimestamp(); case CREDS: return isSetCreds(); - case TOKEN: - return isSetToken(); + case TRANSACTION: + return isSetTransaction(); case ENVIRONMENT: return isSetEnvironment(); } @@ -691545,23 +695031,32 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that instanceof timePhrase_args) - return this.equals((timePhrase_args)that); + if (that instanceof traceRecordTime_args) + return this.equals((traceRecordTime_args)that); return false; } - public boolean equals(timePhrase_args that) { + public boolean equals(traceRecordTime_args that) { if (that == null) return false; if (this == that) return true; - boolean this_present_phrase = true && this.isSetPhrase(); - boolean that_present_phrase = true && that.isSetPhrase(); - if (this_present_phrase || that_present_phrase) { - if (!(this_present_phrase && that_present_phrase)) + boolean this_present_record = true; + boolean that_present_record = true; + if (this_present_record || that_present_record) { + if (!(this_present_record && that_present_record)) return false; - if (!this.phrase.equals(that.phrase)) + if (this.record != that.record) + return false; + } + + boolean this_present_timestamp = true; + boolean that_present_timestamp = true; + if (this_present_timestamp || that_present_timestamp) { + if (!(this_present_timestamp && that_present_timestamp)) + return false; + if (this.timestamp != that.timestamp) return false; } @@ -691574,12 +695069,12 @@ public boolean equals(timePhrase_args that) { return false; } - boolean this_present_token = true && this.isSetToken(); - boolean that_present_token = true && that.isSetToken(); - if (this_present_token || that_present_token) { - if (!(this_present_token && that_present_token)) + boolean this_present_transaction = true && this.isSetTransaction(); + boolean that_present_transaction = true && that.isSetTransaction(); + if (this_present_transaction || that_present_transaction) { + if (!(this_present_transaction && that_present_transaction)) return false; - if (!this.token.equals(that.token)) + if (!this.transaction.equals(that.transaction)) return false; } @@ -691599,17 +695094,17 @@ public boolean equals(timePhrase_args that) { public int hashCode() { int hashCode = 1; - hashCode = hashCode * 8191 + ((isSetPhrase()) ? 131071 : 524287); - if (isSetPhrase()) - hashCode = hashCode * 8191 + phrase.hashCode(); + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(record); + + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(timestamp); hashCode = hashCode * 8191 + ((isSetCreds()) ? 131071 : 524287); if (isSetCreds()) hashCode = hashCode * 8191 + creds.hashCode(); - hashCode = hashCode * 8191 + ((isSetToken()) ? 131071 : 524287); - if (isSetToken()) - hashCode = hashCode * 8191 + token.hashCode(); + hashCode = hashCode * 8191 + ((isSetTransaction()) ? 131071 : 524287); + if (isSetTransaction()) + hashCode = hashCode * 8191 + transaction.hashCode(); hashCode = hashCode * 8191 + ((isSetEnvironment()) ? 131071 : 524287); if (isSetEnvironment()) @@ -691619,19 +695114,29 @@ public int hashCode() { } @Override - public int compareTo(timePhrase_args other) { + public int compareTo(traceRecordTime_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; - lastComparison = java.lang.Boolean.compare(isSetPhrase(), other.isSetPhrase()); + lastComparison = java.lang.Boolean.compare(isSetRecord(), other.isSetRecord()); if (lastComparison != 0) { return lastComparison; } - if (isSetPhrase()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.phrase, other.phrase); + if (isSetRecord()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.record, other.record); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetTimestamp(), other.isSetTimestamp()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTimestamp()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, other.timestamp); if (lastComparison != 0) { return lastComparison; } @@ -691646,12 +695151,12 @@ public int compareTo(timePhrase_args other) { return lastComparison; } } - lastComparison = java.lang.Boolean.compare(isSetToken(), other.isSetToken()); + lastComparison = java.lang.Boolean.compare(isSetTransaction(), other.isSetTransaction()); if (lastComparison != 0) { return lastComparison; } - if (isSetToken()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token); + if (isSetTransaction()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transaction, other.transaction); if (lastComparison != 0) { return lastComparison; } @@ -691687,15 +695192,15 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("timePhrase_args("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("traceRecordTime_args("); boolean first = true; - sb.append("phrase:"); - if (this.phrase == null) { - sb.append("null"); - } else { - sb.append(this.phrase); - } + sb.append("record:"); + sb.append(this.record); + first = false; + if (!first) sb.append(", "); + sb.append("timestamp:"); + sb.append(this.timestamp); first = false; if (!first) sb.append(", "); sb.append("creds:"); @@ -691706,11 +695211,11 @@ public java.lang.String toString() { } first = false; if (!first) sb.append(", "); - sb.append("token:"); - if (this.token == null) { + sb.append("transaction:"); + if (this.transaction == null) { sb.append("null"); } else { - sb.append(this.token); + sb.append(this.transaction); } first = false; if (!first) sb.append(", "); @@ -691731,8 +695236,8 @@ public void validate() throws org.apache.thrift.TException { if (creds != null) { creds.validate(); } - if (token != null) { - token.validate(); + if (transaction != null) { + transaction.validate(); } } @@ -691746,23 +695251,25 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept 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 timePhrase_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class traceRecordTime_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public timePhrase_argsStandardScheme getScheme() { - return new timePhrase_argsStandardScheme(); + public traceRecordTime_argsStandardScheme getScheme() { + return new traceRecordTime_argsStandardScheme(); } } - private static class timePhrase_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class traceRecordTime_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, timePhrase_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordTime_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -691772,15 +695279,23 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, timePhrase_args str break; } switch (schemeField.id) { - case 1: // PHRASE - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.phrase = iprot.readString(); - struct.setPhraseIsSet(true); + case 1: // RECORD + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.record = iprot.readI64(); + struct.setRecordIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 2: // CREDS + case 2: // TIMESTAMP + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // CREDS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); struct.creds.read(iprot); @@ -691789,16 +695304,16 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, timePhrase_args str org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 3: // TOKEN + case 4: // TRANSACTION if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.token = new com.cinchapi.concourse.thrift.TransactionToken(); - struct.token.read(iprot); - struct.setTokenIsSet(true); + struct.transaction = new com.cinchapi.concourse.thrift.TransactionToken(); + struct.transaction.read(iprot); + struct.setTransactionIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 4: // ENVIRONMENT + case 5: // ENVIRONMENT if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.environment = iprot.readString(); struct.setEnvironmentIsSet(true); @@ -691818,23 +695333,24 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, timePhrase_args str } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, timePhrase_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecordTime_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); - if (struct.phrase != null) { - oprot.writeFieldBegin(PHRASE_FIELD_DESC); - oprot.writeString(struct.phrase); - oprot.writeFieldEnd(); - } + oprot.writeFieldBegin(RECORD_FIELD_DESC); + oprot.writeI64(struct.record); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC); + oprot.writeI64(struct.timestamp); + oprot.writeFieldEnd(); if (struct.creds != null) { oprot.writeFieldBegin(CREDS_FIELD_DESC); struct.creds.write(oprot); oprot.writeFieldEnd(); } - if (struct.token != null) { - oprot.writeFieldBegin(TOKEN_FIELD_DESC); - struct.token.write(oprot); + if (struct.transaction != null) { + oprot.writeFieldBegin(TRANSACTION_FIELD_DESC); + struct.transaction.write(oprot); oprot.writeFieldEnd(); } if (struct.environment != null) { @@ -691848,40 +695364,46 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, timePhrase_args st } - private static class timePhrase_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class traceRecordTime_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public timePhrase_argsTupleScheme getScheme() { - return new timePhrase_argsTupleScheme(); + public traceRecordTime_argsTupleScheme getScheme() { + return new traceRecordTime_argsTupleScheme(); } } - private static class timePhrase_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class traceRecordTime_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, timePhrase_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordTime_args 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.isSetPhrase()) { + if (struct.isSetRecord()) { optionals.set(0); } - if (struct.isSetCreds()) { + if (struct.isSetTimestamp()) { optionals.set(1); } - if (struct.isSetToken()) { + if (struct.isSetCreds()) { optionals.set(2); } - if (struct.isSetEnvironment()) { + if (struct.isSetTransaction()) { optionals.set(3); } - oprot.writeBitSet(optionals, 4); - if (struct.isSetPhrase()) { - oprot.writeString(struct.phrase); + if (struct.isSetEnvironment()) { + optionals.set(4); + } + oprot.writeBitSet(optionals, 5); + if (struct.isSetRecord()) { + oprot.writeI64(struct.record); + } + if (struct.isSetTimestamp()) { + oprot.writeI64(struct.timestamp); } if (struct.isSetCreds()) { struct.creds.write(oprot); } - if (struct.isSetToken()) { - struct.token.write(oprot); + if (struct.isSetTransaction()) { + struct.transaction.write(oprot); } if (struct.isSetEnvironment()) { oprot.writeString(struct.environment); @@ -691889,24 +695411,28 @@ public void write(org.apache.thrift.protocol.TProtocol prot, timePhrase_args str } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, timePhrase_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, traceRecordTime_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(4); + java.util.BitSet incoming = iprot.readBitSet(5); if (incoming.get(0)) { - struct.phrase = iprot.readString(); - struct.setPhraseIsSet(true); + struct.record = iprot.readI64(); + struct.setRecordIsSet(true); } if (incoming.get(1)) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + } + if (incoming.get(2)) { struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); struct.creds.read(iprot); struct.setCredsIsSet(true); } - if (incoming.get(2)) { - struct.token = new com.cinchapi.concourse.thrift.TransactionToken(); - struct.token.read(iprot); - struct.setTokenIsSet(true); - } if (incoming.get(3)) { + struct.transaction = new com.cinchapi.concourse.thrift.TransactionToken(); + struct.transaction.read(iprot); + struct.setTransactionIsSet(true); + } + if (incoming.get(4)) { struct.environment = iprot.readString(); struct.setEnvironmentIsSet(true); } @@ -691918,31 +695444,28 @@ private static S scheme(org.apache. } } - public static class timePhrase_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("timePhrase_result"); + public static class traceRecordTime_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("traceRecordTime_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.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.MAP, (short)0); private static final org.apache.thrift.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField EX2_FIELD_DESC = new org.apache.thrift.protocol.TField("ex2", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField EX3_FIELD_DESC = new org.apache.thrift.protocol.TField("ex3", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.protocol.TField EX4_FIELD_DESC = new org.apache.thrift.protocol.TField("ex4", org.apache.thrift.protocol.TType.STRUCT, (short)4); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new timePhrase_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new timePhrase_resultTupleSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new traceRecordTime_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new traceRecordTime_resultTupleSchemeFactory(); - public long success; // required + public @org.apache.thrift.annotation.Nullable java.util.Map> success; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2; // required - public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ParseException ex3; // required - public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex4; // required + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3; // 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"), EX((short)1, "ex"), EX2((short)2, "ex2"), - EX3((short)3, "ex3"), - EX4((short)4, "ex4"); + EX3((short)3, "ex3"); private static final java.util.Map byName = new java.util.LinkedHashMap(); @@ -691966,8 +695489,6 @@ public static _Fields findByThriftId(int fieldId) { return EX2; case 3: // EX3 return EX3; - case 4: // EX4 - return EX4; default: return null; } @@ -692011,50 +695532,59 @@ public java.lang.String getFieldName() { } // 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))); + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), + new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))))); tmpMap.put(_Fields.EX, new org.apache.thrift.meta_data.FieldMetaData("ex", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.SecurityException.class))); tmpMap.put(_Fields.EX2, new org.apache.thrift.meta_data.FieldMetaData("ex2", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.TransactionException.class))); tmpMap.put(_Fields.EX3, new org.apache.thrift.meta_data.FieldMetaData("ex3", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.ParseException.class))); - tmpMap.put(_Fields.EX4, new org.apache.thrift.meta_data.FieldMetaData("ex4", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.PermissionException.class))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(timePhrase_result.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(traceRecordTime_result.class, metaDataMap); } - public timePhrase_result() { + public traceRecordTime_result() { } - public timePhrase_result( - long success, + public traceRecordTime_result( + java.util.Map> success, com.cinchapi.concourse.thrift.SecurityException ex, com.cinchapi.concourse.thrift.TransactionException ex2, - com.cinchapi.concourse.thrift.ParseException ex3, - com.cinchapi.concourse.thrift.PermissionException ex4) + com.cinchapi.concourse.thrift.PermissionException ex3) { this(); this.success = success; - setSuccessIsSet(true); this.ex = ex; this.ex2 = ex2; this.ex3 = ex3; - this.ex4 = ex4; } /** * Performs a deep copy on other. */ - public timePhrase_result(timePhrase_result other) { - __isset_bitfield = other.__isset_bitfield; - this.success = other.success; + public traceRecordTime_result(traceRecordTime_result other) { + if (other.isSetSuccess()) { + java.util.Map> __this__success = new java.util.LinkedHashMap>(other.success.size()); + for (java.util.Map.Entry> other_element : other.success.entrySet()) { + + java.lang.String other_element_key = other_element.getKey(); + java.util.Set other_element_value = other_element.getValue(); + + java.lang.String __this__success_copy_key = other_element_key; + + java.util.Set __this__success_copy_value = new java.util.LinkedHashSet(other_element_value); + + __this__success.put(__this__success_copy_key, __this__success_copy_value); + } + this.success = __this__success; + } if (other.isSetEx()) { this.ex = new com.cinchapi.concourse.thrift.SecurityException(other.ex); } @@ -692062,49 +695592,57 @@ public timePhrase_result(timePhrase_result other) { this.ex2 = new com.cinchapi.concourse.thrift.TransactionException(other.ex2); } if (other.isSetEx3()) { - this.ex3 = new com.cinchapi.concourse.thrift.ParseException(other.ex3); - } - if (other.isSetEx4()) { - this.ex4 = new com.cinchapi.concourse.thrift.PermissionException(other.ex4); + this.ex3 = new com.cinchapi.concourse.thrift.PermissionException(other.ex3); } } @Override - public timePhrase_result deepCopy() { - return new timePhrase_result(this); + public traceRecordTime_result deepCopy() { + return new traceRecordTime_result(this); } @Override public void clear() { - setSuccessIsSet(false); - this.success = 0; + this.success = null; this.ex = null; this.ex2 = null; this.ex3 = null; - this.ex4 = null; } - public long getSuccess() { + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public void putToSuccess(java.lang.String key, java.util.Set val) { + if (this.success == null) { + this.success = new java.util.LinkedHashMap>(); + } + this.success.put(key, val); + } + + @org.apache.thrift.annotation.Nullable + public java.util.Map> getSuccess() { return this.success; } - public timePhrase_result setSuccess(long success) { + public traceRecordTime_result setSuccess(@org.apache.thrift.annotation.Nullable java.util.Map> success) { this.success = success; - setSuccessIsSet(true); return this; } public void unsetSuccess() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + this.success = null; } /** 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); + return this.success != null; } public void setSuccessIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + if (!value) { + this.success = null; + } } @org.apache.thrift.annotation.Nullable @@ -692112,7 +695650,7 @@ public com.cinchapi.concourse.thrift.SecurityException getEx() { return this.ex; } - public timePhrase_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { + public traceRecordTime_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { this.ex = ex; return this; } @@ -692137,7 +695675,7 @@ public com.cinchapi.concourse.thrift.TransactionException getEx2() { return this.ex2; } - public timePhrase_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { + public traceRecordTime_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { this.ex2 = ex2; return this; } @@ -692158,11 +695696,11 @@ public void setEx2IsSet(boolean value) { } @org.apache.thrift.annotation.Nullable - public com.cinchapi.concourse.thrift.ParseException getEx3() { + public com.cinchapi.concourse.thrift.PermissionException getEx3() { return this.ex3; } - public timePhrase_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ParseException ex3) { + public traceRecordTime_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3) { this.ex3 = ex3; return this; } @@ -692182,31 +695720,6 @@ public void setEx3IsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable - public com.cinchapi.concourse.thrift.PermissionException getEx4() { - return this.ex4; - } - - public timePhrase_result setEx4(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex4) { - this.ex4 = ex4; - return this; - } - - public void unsetEx4() { - this.ex4 = null; - } - - /** Returns true if field ex4 is set (has been assigned a value) and false otherwise */ - public boolean isSetEx4() { - return this.ex4 != null; - } - - public void setEx4IsSet(boolean value) { - if (!value) { - this.ex4 = null; - } - } - @Override public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { @@ -692214,7 +695727,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetSuccess(); } else { - setSuccess((java.lang.Long)value); + setSuccess((java.util.Map>)value); } break; @@ -692238,15 +695751,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetEx3(); } else { - setEx3((com.cinchapi.concourse.thrift.ParseException)value); - } - break; - - case EX4: - if (value == null) { - unsetEx4(); - } else { - setEx4((com.cinchapi.concourse.thrift.PermissionException)value); + setEx3((com.cinchapi.concourse.thrift.PermissionException)value); } break; @@ -692269,9 +695774,6 @@ public java.lang.Object getFieldValue(_Fields field) { case EX3: return getEx3(); - case EX4: - return getEx4(); - } throw new java.lang.IllegalStateException(); } @@ -692292,31 +695794,29 @@ public boolean isSet(_Fields field) { return isSetEx2(); case EX3: return isSetEx3(); - case EX4: - return isSetEx4(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { - if (that instanceof timePhrase_result) - return this.equals((timePhrase_result)that); + if (that instanceof traceRecordTime_result) + return this.equals((traceRecordTime_result)that); return false; } - public boolean equals(timePhrase_result that) { + public boolean equals(traceRecordTime_result that) { if (that == null) return false; if (this == that) return true; - boolean this_present_success = true; - boolean that_present_success = 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 != that.success) + if (!this.success.equals(that.success)) return false; } @@ -692347,15 +695847,6 @@ public boolean equals(timePhrase_result that) { return false; } - boolean this_present_ex4 = true && this.isSetEx4(); - boolean that_present_ex4 = true && that.isSetEx4(); - if (this_present_ex4 || that_present_ex4) { - if (!(this_present_ex4 && that_present_ex4)) - return false; - if (!this.ex4.equals(that.ex4)) - return false; - } - return true; } @@ -692363,7 +695854,9 @@ public boolean equals(timePhrase_result that) { public int hashCode() { int hashCode = 1; - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(success); + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); hashCode = hashCode * 8191 + ((isSetEx()) ? 131071 : 524287); if (isSetEx()) @@ -692377,15 +695870,11 @@ public int hashCode() { if (isSetEx3()) hashCode = hashCode * 8191 + ex3.hashCode(); - hashCode = hashCode * 8191 + ((isSetEx4()) ? 131071 : 524287); - if (isSetEx4()) - hashCode = hashCode * 8191 + ex4.hashCode(); - return hashCode; } @Override - public int compareTo(timePhrase_result other) { + public int compareTo(traceRecordTime_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -692432,16 +695921,6 @@ public int compareTo(timePhrase_result other) { return lastComparison; } } - lastComparison = java.lang.Boolean.compare(isSetEx4(), other.isSetEx4()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetEx4()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex4, other.ex4); - if (lastComparison != 0) { - return lastComparison; - } - } return 0; } @@ -692462,11 +695941,15 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("timePhrase_result("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("traceRecordTime_result("); boolean first = true; sb.append("success:"); - sb.append(this.success); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } first = false; if (!first) sb.append(", "); sb.append("ex:"); @@ -692492,14 +695975,6 @@ public java.lang.String toString() { sb.append(this.ex3); } first = false; - if (!first) sb.append(", "); - sb.append("ex4:"); - if (this.ex4 == null) { - sb.append("null"); - } else { - sb.append(this.ex4); - } - first = false; sb.append(")"); return sb.toString(); } @@ -692519,25 +695994,23 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept 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 timePhrase_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class traceRecordTime_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public timePhrase_resultStandardScheme getScheme() { - return new timePhrase_resultStandardScheme(); + public traceRecordTime_resultStandardScheme getScheme() { + return new traceRecordTime_resultStandardScheme(); } } - private static class timePhrase_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class traceRecordTime_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, timePhrase_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordTime_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -692548,8 +696021,30 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, timePhrase_result s } switch (schemeField.id) { case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.success = iprot.readI64(); + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map7058 = iprot.readMapBegin(); + struct.success = new java.util.LinkedHashMap>(2*_map7058.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key7059; + @org.apache.thrift.annotation.Nullable java.util.Set _val7060; + for (int _i7061 = 0; _i7061 < _map7058.size; ++_i7061) + { + _key7059 = iprot.readString(); + { + org.apache.thrift.protocol.TSet _set7062 = iprot.readSetBegin(); + _val7060 = new java.util.LinkedHashSet(2*_set7062.size); + long _elem7063; + for (int _i7064 = 0; _i7064 < _set7062.size; ++_i7064) + { + _elem7063 = iprot.readI64(); + _val7060.add(_elem7063); + } + iprot.readSetEnd(); + } + struct.success.put(_key7059, _val7060); + } + iprot.readMapEnd(); + } struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); @@ -692575,22 +696070,13 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, timePhrase_result s break; case 3: // EX3 if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.ex3 = new com.cinchapi.concourse.thrift.ParseException(); + struct.ex3 = new com.cinchapi.concourse.thrift.PermissionException(); struct.ex3.read(iprot); struct.setEx3IsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 4: // EX4 - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.ex4 = new com.cinchapi.concourse.thrift.PermissionException(); - struct.ex4.read(iprot); - struct.setEx4IsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -692603,13 +696089,28 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, timePhrase_result s } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, timePhrase_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecordTime_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); - if (struct.isSetSuccess()) { + if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeI64(struct.success); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.SET, struct.success.size())); + for (java.util.Map.Entry> _iter7065 : struct.success.entrySet()) + { + oprot.writeString(_iter7065.getKey()); + { + oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I64, _iter7065.getValue().size())); + for (long _iter7066 : _iter7065.getValue()) + { + oprot.writeI64(_iter7066); + } + oprot.writeSetEnd(); + } + } + oprot.writeMapEnd(); + } oprot.writeFieldEnd(); } if (struct.ex != null) { @@ -692627,28 +696128,23 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, timePhrase_result struct.ex3.write(oprot); oprot.writeFieldEnd(); } - if (struct.ex4 != null) { - oprot.writeFieldBegin(EX4_FIELD_DESC); - struct.ex4.write(oprot); - oprot.writeFieldEnd(); - } oprot.writeFieldStop(); oprot.writeStructEnd(); } } - private static class timePhrase_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class traceRecordTime_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public timePhrase_resultTupleScheme getScheme() { - return new timePhrase_resultTupleScheme(); + public traceRecordTime_resultTupleScheme getScheme() { + return new traceRecordTime_resultTupleScheme(); } } - private static class timePhrase_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class traceRecordTime_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, timePhrase_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordTime_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()) { @@ -692663,12 +696159,22 @@ public void write(org.apache.thrift.protocol.TProtocol prot, timePhrase_result s if (struct.isSetEx3()) { optionals.set(3); } - if (struct.isSetEx4()) { - optionals.set(4); - } - oprot.writeBitSet(optionals, 5); + oprot.writeBitSet(optionals, 4); if (struct.isSetSuccess()) { - oprot.writeI64(struct.success); + { + oprot.writeI32(struct.success.size()); + for (java.util.Map.Entry> _iter7067 : struct.success.entrySet()) + { + oprot.writeString(_iter7067.getKey()); + { + oprot.writeI32(_iter7067.getValue().size()); + for (long _iter7068 : _iter7067.getValue()) + { + oprot.writeI64(_iter7068); + } + } + } + } } if (struct.isSetEx()) { struct.ex.write(oprot); @@ -692679,17 +696185,34 @@ public void write(org.apache.thrift.protocol.TProtocol prot, timePhrase_result s if (struct.isSetEx3()) { struct.ex3.write(oprot); } - if (struct.isSetEx4()) { - struct.ex4.write(oprot); - } } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, timePhrase_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, traceRecordTime_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(5); + java.util.BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { - struct.success = iprot.readI64(); + { + org.apache.thrift.protocol.TMap _map7069 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.SET); + struct.success = new java.util.LinkedHashMap>(2*_map7069.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key7070; + @org.apache.thrift.annotation.Nullable java.util.Set _val7071; + for (int _i7072 = 0; _i7072 < _map7069.size; ++_i7072) + { + _key7070 = iprot.readString(); + { + org.apache.thrift.protocol.TSet _set7073 = iprot.readSetBegin(org.apache.thrift.protocol.TType.I64); + _val7071 = new java.util.LinkedHashSet(2*_set7073.size); + long _elem7074; + for (int _i7075 = 0; _i7075 < _set7073.size; ++_i7075) + { + _elem7074 = iprot.readI64(); + _val7071.add(_elem7074); + } + } + struct.success.put(_key7070, _val7071); + } + } struct.setSuccessIsSet(true); } if (incoming.get(1)) { @@ -692703,15 +696226,10 @@ public void read(org.apache.thrift.protocol.TProtocol prot, timePhrase_result st struct.setEx2IsSet(true); } if (incoming.get(3)) { - struct.ex3 = new com.cinchapi.concourse.thrift.ParseException(); + struct.ex3 = new com.cinchapi.concourse.thrift.PermissionException(); struct.ex3.read(iprot); struct.setEx3IsSet(true); } - if (incoming.get(4)) { - struct.ex4 = new com.cinchapi.concourse.thrift.PermissionException(); - struct.ex4.read(iprot); - struct.setEx4IsSet(true); - } } } @@ -692720,18 +696238,20 @@ private static S scheme(org.apache. } } - public static class traceRecord_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("traceRecord_args"); + public static class traceRecordTimestr_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("traceRecordTimestr_args"); private static final org.apache.thrift.protocol.TField RECORD_FIELD_DESC = new org.apache.thrift.protocol.TField("record", org.apache.thrift.protocol.TType.I64, (short)1); - private static final org.apache.thrift.protocol.TField CREDS_FIELD_DESC = new org.apache.thrift.protocol.TField("creds", org.apache.thrift.protocol.TType.STRUCT, (short)2); - private static final org.apache.thrift.protocol.TField TRANSACTION_FIELD_DESC = new org.apache.thrift.protocol.TField("transaction", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.protocol.TField ENVIRONMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("environment", org.apache.thrift.protocol.TType.STRING, (short)4); + private static final org.apache.thrift.protocol.TField TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("timestamp", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField CREDS_FIELD_DESC = new org.apache.thrift.protocol.TField("creds", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final org.apache.thrift.protocol.TField TRANSACTION_FIELD_DESC = new org.apache.thrift.protocol.TField("transaction", org.apache.thrift.protocol.TType.STRUCT, (short)4); + private static final org.apache.thrift.protocol.TField ENVIRONMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("environment", org.apache.thrift.protocol.TType.STRING, (short)5); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new traceRecord_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new traceRecord_argsTupleSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new traceRecordTimestr_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new traceRecordTimestr_argsTupleSchemeFactory(); public long record; // required + public @org.apache.thrift.annotation.Nullable java.lang.String timestamp; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction; // required public @org.apache.thrift.annotation.Nullable java.lang.String environment; // required @@ -692739,9 +696259,10 @@ public static class traceRecord_args implements org.apache.thrift.TBase byName = new java.util.LinkedHashMap(); @@ -692759,11 +696280,13 @@ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // RECORD return RECORD; - case 2: // CREDS + case 2: // TIMESTAMP + return TIMESTAMP; + case 3: // CREDS return CREDS; - case 3: // TRANSACTION + case 4: // TRANSACTION return TRANSACTION; - case 4: // ENVIRONMENT + case 5: // ENVIRONMENT return ENVIRONMENT; default: return null; @@ -692815,6 +696338,8 @@ public java.lang.String getFieldName() { 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.RECORD, new org.apache.thrift.meta_data.FieldMetaData("record", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.CREDS, new org.apache.thrift.meta_data.FieldMetaData("creds", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.AccessToken.class))); tmpMap.put(_Fields.TRANSACTION, new org.apache.thrift.meta_data.FieldMetaData("transaction", org.apache.thrift.TFieldRequirementType.DEFAULT, @@ -692822,14 +696347,15 @@ public java.lang.String getFieldName() { tmpMap.put(_Fields.ENVIRONMENT, new org.apache.thrift.meta_data.FieldMetaData("environment", 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(traceRecord_args.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(traceRecordTimestr_args.class, metaDataMap); } - public traceRecord_args() { + public traceRecordTimestr_args() { } - public traceRecord_args( + public traceRecordTimestr_args( long record, + java.lang.String timestamp, com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment) @@ -692837,6 +696363,7 @@ public traceRecord_args( this(); this.record = record; setRecordIsSet(true); + this.timestamp = timestamp; this.creds = creds; this.transaction = transaction; this.environment = environment; @@ -692845,9 +696372,12 @@ public traceRecord_args( /** * Performs a deep copy on other. */ - public traceRecord_args(traceRecord_args other) { + public traceRecordTimestr_args(traceRecordTimestr_args other) { __isset_bitfield = other.__isset_bitfield; this.record = other.record; + if (other.isSetTimestamp()) { + this.timestamp = other.timestamp; + } if (other.isSetCreds()) { this.creds = new com.cinchapi.concourse.thrift.AccessToken(other.creds); } @@ -692860,14 +696390,15 @@ public traceRecord_args(traceRecord_args other) { } @Override - public traceRecord_args deepCopy() { - return new traceRecord_args(this); + public traceRecordTimestr_args deepCopy() { + return new traceRecordTimestr_args(this); } @Override public void clear() { setRecordIsSet(false); this.record = 0; + this.timestamp = null; this.creds = null; this.transaction = null; this.environment = null; @@ -692877,7 +696408,7 @@ public long getRecord() { return this.record; } - public traceRecord_args setRecord(long record) { + public traceRecordTimestr_args setRecord(long record) { this.record = record; setRecordIsSet(true); return this; @@ -692896,12 +696427,37 @@ public void setRecordIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __RECORD_ISSET_ID, value); } + @org.apache.thrift.annotation.Nullable + public java.lang.String getTimestamp() { + return this.timestamp; + } + + public traceRecordTimestr_args setTimestamp(@org.apache.thrift.annotation.Nullable java.lang.String timestamp) { + this.timestamp = timestamp; + return this; + } + + public void unsetTimestamp() { + this.timestamp = null; + } + + /** Returns true if field timestamp is set (has been assigned a value) and false otherwise */ + public boolean isSetTimestamp() { + return this.timestamp != null; + } + + public void setTimestampIsSet(boolean value) { + if (!value) { + this.timestamp = null; + } + } + @org.apache.thrift.annotation.Nullable public com.cinchapi.concourse.thrift.AccessToken getCreds() { return this.creds; } - public traceRecord_args setCreds(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds) { + public traceRecordTimestr_args setCreds(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds) { this.creds = creds; return this; } @@ -692926,7 +696482,7 @@ public com.cinchapi.concourse.thrift.TransactionToken getTransaction() { return this.transaction; } - public traceRecord_args setTransaction(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction) { + public traceRecordTimestr_args setTransaction(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction) { this.transaction = transaction; return this; } @@ -692951,7 +696507,7 @@ public java.lang.String getEnvironment() { return this.environment; } - public traceRecord_args setEnvironment(@org.apache.thrift.annotation.Nullable java.lang.String environment) { + public traceRecordTimestr_args setEnvironment(@org.apache.thrift.annotation.Nullable java.lang.String environment) { this.environment = environment; return this; } @@ -692982,6 +696538,14 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } break; + case TIMESTAMP: + if (value == null) { + unsetTimestamp(); + } else { + setTimestamp((java.lang.String)value); + } + break; + case CREDS: if (value == null) { unsetCreds(); @@ -693016,6 +696580,9 @@ public java.lang.Object getFieldValue(_Fields field) { case RECORD: return getRecord(); + case TIMESTAMP: + return getTimestamp(); + case CREDS: return getCreds(); @@ -693039,6 +696606,8 @@ public boolean isSet(_Fields field) { switch (field) { case RECORD: return isSetRecord(); + case TIMESTAMP: + return isSetTimestamp(); case CREDS: return isSetCreds(); case TRANSACTION: @@ -693051,12 +696620,12 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that instanceof traceRecord_args) - return this.equals((traceRecord_args)that); + if (that instanceof traceRecordTimestr_args) + return this.equals((traceRecordTimestr_args)that); return false; } - public boolean equals(traceRecord_args that) { + public boolean equals(traceRecordTimestr_args that) { if (that == null) return false; if (this == that) @@ -693071,6 +696640,15 @@ public boolean equals(traceRecord_args that) { return false; } + boolean this_present_timestamp = true && this.isSetTimestamp(); + boolean that_present_timestamp = true && that.isSetTimestamp(); + if (this_present_timestamp || that_present_timestamp) { + if (!(this_present_timestamp && that_present_timestamp)) + return false; + if (!this.timestamp.equals(that.timestamp)) + return false; + } + boolean this_present_creds = true && this.isSetCreds(); boolean that_present_creds = true && that.isSetCreds(); if (this_present_creds || that_present_creds) { @@ -693107,6 +696685,10 @@ public int hashCode() { hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(record); + hashCode = hashCode * 8191 + ((isSetTimestamp()) ? 131071 : 524287); + if (isSetTimestamp()) + hashCode = hashCode * 8191 + timestamp.hashCode(); + hashCode = hashCode * 8191 + ((isSetCreds()) ? 131071 : 524287); if (isSetCreds()) hashCode = hashCode * 8191 + creds.hashCode(); @@ -693123,7 +696705,7 @@ public int hashCode() { } @Override - public int compareTo(traceRecord_args other) { + public int compareTo(traceRecordTimestr_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -693140,6 +696722,16 @@ public int compareTo(traceRecord_args other) { return lastComparison; } } + lastComparison = java.lang.Boolean.compare(isSetTimestamp(), other.isSetTimestamp()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTimestamp()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, other.timestamp); + if (lastComparison != 0) { + return lastComparison; + } + } lastComparison = java.lang.Boolean.compare(isSetCreds(), other.isSetCreds()); if (lastComparison != 0) { return lastComparison; @@ -693191,13 +696783,21 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("traceRecord_args("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("traceRecordTimestr_args("); boolean first = true; sb.append("record:"); sb.append(this.record); first = false; if (!first) sb.append(", "); + sb.append("timestamp:"); + if (this.timestamp == null) { + sb.append("null"); + } else { + sb.append(this.timestamp); + } + first = false; + if (!first) sb.append(", "); sb.append("creds:"); if (this.creds == null) { sb.append("null"); @@ -693254,17 +696854,17 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class traceRecord_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class traceRecordTimestr_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public traceRecord_argsStandardScheme getScheme() { - return new traceRecord_argsStandardScheme(); + public traceRecordTimestr_argsStandardScheme getScheme() { + return new traceRecordTimestr_argsStandardScheme(); } } - private static class traceRecord_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class traceRecordTimestr_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecord_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordTimestr_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -693282,7 +696882,15 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecord_args st org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 2: // CREDS + case 2: // TIMESTAMP + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.timestamp = iprot.readString(); + struct.setTimestampIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // CREDS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); struct.creds.read(iprot); @@ -693291,7 +696899,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecord_args st org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 3: // TRANSACTION + case 4: // TRANSACTION if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.transaction = new com.cinchapi.concourse.thrift.TransactionToken(); struct.transaction.read(iprot); @@ -693300,7 +696908,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecord_args st org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 4: // ENVIRONMENT + case 5: // ENVIRONMENT if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.environment = iprot.readString(); struct.setEnvironmentIsSet(true); @@ -693320,13 +696928,18 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecord_args st } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecord_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecordTimestr_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(RECORD_FIELD_DESC); oprot.writeI64(struct.record); oprot.writeFieldEnd(); + if (struct.timestamp != null) { + oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC); + oprot.writeString(struct.timestamp); + oprot.writeFieldEnd(); + } if (struct.creds != null) { oprot.writeFieldBegin(CREDS_FIELD_DESC); struct.creds.write(oprot); @@ -693348,35 +696961,41 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecord_args s } - private static class traceRecord_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class traceRecordTimestr_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public traceRecord_argsTupleScheme getScheme() { - return new traceRecord_argsTupleScheme(); + public traceRecordTimestr_argsTupleScheme getScheme() { + return new traceRecordTimestr_argsTupleScheme(); } } - private static class traceRecord_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class traceRecordTimestr_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, traceRecord_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordTimestr_args 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.isSetRecord()) { optionals.set(0); } - if (struct.isSetCreds()) { + if (struct.isSetTimestamp()) { optionals.set(1); } - if (struct.isSetTransaction()) { + if (struct.isSetCreds()) { optionals.set(2); } - if (struct.isSetEnvironment()) { + if (struct.isSetTransaction()) { optionals.set(3); } - oprot.writeBitSet(optionals, 4); + if (struct.isSetEnvironment()) { + optionals.set(4); + } + oprot.writeBitSet(optionals, 5); if (struct.isSetRecord()) { oprot.writeI64(struct.record); } + if (struct.isSetTimestamp()) { + oprot.writeString(struct.timestamp); + } if (struct.isSetCreds()) { struct.creds.write(oprot); } @@ -693389,24 +697008,28 @@ public void write(org.apache.thrift.protocol.TProtocol prot, traceRecord_args st } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, traceRecord_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, traceRecordTimestr_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(4); + java.util.BitSet incoming = iprot.readBitSet(5); if (incoming.get(0)) { struct.record = iprot.readI64(); struct.setRecordIsSet(true); } if (incoming.get(1)) { + struct.timestamp = iprot.readString(); + struct.setTimestampIsSet(true); + } + if (incoming.get(2)) { struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); struct.creds.read(iprot); struct.setCredsIsSet(true); } - if (incoming.get(2)) { + if (incoming.get(3)) { struct.transaction = new com.cinchapi.concourse.thrift.TransactionToken(); struct.transaction.read(iprot); struct.setTransactionIsSet(true); } - if (incoming.get(3)) { + if (incoming.get(4)) { struct.environment = iprot.readString(); struct.setEnvironmentIsSet(true); } @@ -693418,16 +697041,16 @@ private static S scheme(org.apache. } } - public static class traceRecord_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("traceRecord_result"); + public static class traceRecordTimestr_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("traceRecordTimestr_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.MAP, (short)0); private static final org.apache.thrift.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField EX2_FIELD_DESC = new org.apache.thrift.protocol.TField("ex2", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField EX3_FIELD_DESC = new org.apache.thrift.protocol.TField("ex3", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new traceRecord_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new traceRecord_resultTupleSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new traceRecordTimestr_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new traceRecordTimestr_resultTupleSchemeFactory(); public @org.apache.thrift.annotation.Nullable java.util.Map> success; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex; // required @@ -693521,13 +697144,13 @@ public java.lang.String getFieldName() { tmpMap.put(_Fields.EX3, new org.apache.thrift.meta_data.FieldMetaData("ex3", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.PermissionException.class))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(traceRecord_result.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(traceRecordTimestr_result.class, metaDataMap); } - public traceRecord_result() { + public traceRecordTimestr_result() { } - public traceRecord_result( + public traceRecordTimestr_result( java.util.Map> success, com.cinchapi.concourse.thrift.SecurityException ex, com.cinchapi.concourse.thrift.TransactionException ex2, @@ -693543,7 +697166,7 @@ public traceRecord_result( /** * Performs a deep copy on other. */ - public traceRecord_result(traceRecord_result other) { + public traceRecordTimestr_result(traceRecordTimestr_result other) { if (other.isSetSuccess()) { java.util.Map> __this__success = new java.util.LinkedHashMap>(other.success.size()); for (java.util.Map.Entry> other_element : other.success.entrySet()) { @@ -693571,8 +697194,8 @@ public traceRecord_result(traceRecord_result other) { } @Override - public traceRecord_result deepCopy() { - return new traceRecord_result(this); + public traceRecordTimestr_result deepCopy() { + return new traceRecordTimestr_result(this); } @Override @@ -693599,7 +697222,7 @@ public java.util.Map> getSuccess( return this.success; } - public traceRecord_result setSuccess(@org.apache.thrift.annotation.Nullable java.util.Map> success) { + public traceRecordTimestr_result setSuccess(@org.apache.thrift.annotation.Nullable java.util.Map> success) { this.success = success; return this; } @@ -693624,7 +697247,7 @@ public com.cinchapi.concourse.thrift.SecurityException getEx() { return this.ex; } - public traceRecord_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { + public traceRecordTimestr_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { this.ex = ex; return this; } @@ -693649,7 +697272,7 @@ public com.cinchapi.concourse.thrift.TransactionException getEx2() { return this.ex2; } - public traceRecord_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { + public traceRecordTimestr_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { this.ex2 = ex2; return this; } @@ -693674,7 +697297,7 @@ public com.cinchapi.concourse.thrift.PermissionException getEx3() { return this.ex3; } - public traceRecord_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3) { + public traceRecordTimestr_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3) { this.ex3 = ex3; return this; } @@ -693774,12 +697397,12 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that instanceof traceRecord_result) - return this.equals((traceRecord_result)that); + if (that instanceof traceRecordTimestr_result) + return this.equals((traceRecordTimestr_result)that); return false; } - public boolean equals(traceRecord_result that) { + public boolean equals(traceRecordTimestr_result that) { if (that == null) return false; if (this == that) @@ -693848,7 +697471,7 @@ public int hashCode() { } @Override - public int compareTo(traceRecord_result other) { + public int compareTo(traceRecordTimestr_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -693915,7 +697538,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("traceRecord_result("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("traceRecordTimestr_result("); boolean first = true; sb.append("success:"); @@ -693974,17 +697597,17 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class traceRecord_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class traceRecordTimestr_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public traceRecord_resultStandardScheme getScheme() { - return new traceRecord_resultStandardScheme(); + public traceRecordTimestr_resultStandardScheme getScheme() { + return new traceRecordTimestr_resultStandardScheme(); } } - private static class traceRecord_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class traceRecordTimestr_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecord_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordTimestr_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -693997,25 +697620,25 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecord_result case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { - org.apache.thrift.protocol.TMap _map7040 = iprot.readMapBegin(); - struct.success = new java.util.LinkedHashMap>(2*_map7040.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key7041; - @org.apache.thrift.annotation.Nullable java.util.Set _val7042; - for (int _i7043 = 0; _i7043 < _map7040.size; ++_i7043) + org.apache.thrift.protocol.TMap _map7076 = iprot.readMapBegin(); + struct.success = new java.util.LinkedHashMap>(2*_map7076.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key7077; + @org.apache.thrift.annotation.Nullable java.util.Set _val7078; + for (int _i7079 = 0; _i7079 < _map7076.size; ++_i7079) { - _key7041 = iprot.readString(); + _key7077 = iprot.readString(); { - org.apache.thrift.protocol.TSet _set7044 = iprot.readSetBegin(); - _val7042 = new java.util.LinkedHashSet(2*_set7044.size); - long _elem7045; - for (int _i7046 = 0; _i7046 < _set7044.size; ++_i7046) + org.apache.thrift.protocol.TSet _set7080 = iprot.readSetBegin(); + _val7078 = new java.util.LinkedHashSet(2*_set7080.size); + long _elem7081; + for (int _i7082 = 0; _i7082 < _set7080.size; ++_i7082) { - _elem7045 = iprot.readI64(); - _val7042.add(_elem7045); + _elem7081 = iprot.readI64(); + _val7078.add(_elem7081); } iprot.readSetEnd(); } - struct.success.put(_key7041, _val7042); + struct.success.put(_key7077, _val7078); } iprot.readMapEnd(); } @@ -694063,7 +697686,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecord_result } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecord_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecordTimestr_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); @@ -694071,14 +697694,14 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecord_result oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.SET, struct.success.size())); - for (java.util.Map.Entry> _iter7047 : struct.success.entrySet()) + for (java.util.Map.Entry> _iter7083 : struct.success.entrySet()) { - oprot.writeString(_iter7047.getKey()); + oprot.writeString(_iter7083.getKey()); { - oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I64, _iter7047.getValue().size())); - for (long _iter7048 : _iter7047.getValue()) + oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I64, _iter7083.getValue().size())); + for (long _iter7084 : _iter7083.getValue()) { - oprot.writeI64(_iter7048); + oprot.writeI64(_iter7084); } oprot.writeSetEnd(); } @@ -694108,17 +697731,17 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecord_result } - private static class traceRecord_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class traceRecordTimestr_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public traceRecord_resultTupleScheme getScheme() { - return new traceRecord_resultTupleScheme(); + public traceRecordTimestr_resultTupleScheme getScheme() { + return new traceRecordTimestr_resultTupleScheme(); } } - private static class traceRecord_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class traceRecordTimestr_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, traceRecord_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordTimestr_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()) { @@ -694137,14 +697760,14 @@ public void write(org.apache.thrift.protocol.TProtocol prot, traceRecord_result if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); - for (java.util.Map.Entry> _iter7049 : struct.success.entrySet()) + for (java.util.Map.Entry> _iter7085 : struct.success.entrySet()) { - oprot.writeString(_iter7049.getKey()); + oprot.writeString(_iter7085.getKey()); { - oprot.writeI32(_iter7049.getValue().size()); - for (long _iter7050 : _iter7049.getValue()) + oprot.writeI32(_iter7085.getValue().size()); + for (long _iter7086 : _iter7085.getValue()) { - oprot.writeI64(_iter7050); + oprot.writeI64(_iter7086); } } } @@ -694162,29 +697785,29 @@ public void write(org.apache.thrift.protocol.TProtocol prot, traceRecord_result } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, traceRecord_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, traceRecordTimestr_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(4); if (incoming.get(0)) { { - org.apache.thrift.protocol.TMap _map7051 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.SET); - struct.success = new java.util.LinkedHashMap>(2*_map7051.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key7052; - @org.apache.thrift.annotation.Nullable java.util.Set _val7053; - for (int _i7054 = 0; _i7054 < _map7051.size; ++_i7054) + org.apache.thrift.protocol.TMap _map7087 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.SET); + struct.success = new java.util.LinkedHashMap>(2*_map7087.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key7088; + @org.apache.thrift.annotation.Nullable java.util.Set _val7089; + for (int _i7090 = 0; _i7090 < _map7087.size; ++_i7090) { - _key7052 = iprot.readString(); + _key7088 = iprot.readString(); { - org.apache.thrift.protocol.TSet _set7055 = iprot.readSetBegin(org.apache.thrift.protocol.TType.I64); - _val7053 = new java.util.LinkedHashSet(2*_set7055.size); - long _elem7056; - for (int _i7057 = 0; _i7057 < _set7055.size; ++_i7057) + org.apache.thrift.protocol.TSet _set7091 = iprot.readSetBegin(org.apache.thrift.protocol.TType.I64); + _val7089 = new java.util.LinkedHashSet(2*_set7091.size); + long _elem7092; + for (int _i7093 = 0; _i7093 < _set7091.size; ++_i7093) { - _elem7056 = iprot.readI64(); - _val7053.add(_elem7056); + _elem7092 = iprot.readI64(); + _val7089.add(_elem7092); } } - struct.success.put(_key7052, _val7053); + struct.success.put(_key7088, _val7089); } } struct.setSuccessIsSet(true); @@ -694212,31 +697835,28 @@ private static S scheme(org.apache. } } - public static class traceRecordTime_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("traceRecordTime_args"); + public static class traceRecords_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("traceRecords_args"); - private static final org.apache.thrift.protocol.TField RECORD_FIELD_DESC = new org.apache.thrift.protocol.TField("record", org.apache.thrift.protocol.TType.I64, (short)1); - private static final org.apache.thrift.protocol.TField TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("timestamp", org.apache.thrift.protocol.TType.I64, (short)2); - private static final org.apache.thrift.protocol.TField CREDS_FIELD_DESC = new org.apache.thrift.protocol.TField("creds", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.protocol.TField TRANSACTION_FIELD_DESC = new org.apache.thrift.protocol.TField("transaction", org.apache.thrift.protocol.TType.STRUCT, (short)4); - private static final org.apache.thrift.protocol.TField ENVIRONMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("environment", org.apache.thrift.protocol.TType.STRING, (short)5); + private static final org.apache.thrift.protocol.TField RECORDS_FIELD_DESC = new org.apache.thrift.protocol.TField("records", org.apache.thrift.protocol.TType.LIST, (short)1); + private static final org.apache.thrift.protocol.TField CREDS_FIELD_DESC = new org.apache.thrift.protocol.TField("creds", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final org.apache.thrift.protocol.TField TRANSACTION_FIELD_DESC = new org.apache.thrift.protocol.TField("transaction", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final org.apache.thrift.protocol.TField ENVIRONMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("environment", org.apache.thrift.protocol.TType.STRING, (short)4); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new traceRecordTime_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new traceRecordTime_argsTupleSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new traceRecords_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new traceRecords_argsTupleSchemeFactory(); - public long record; // required - public long timestamp; // required + public @org.apache.thrift.annotation.Nullable java.util.List records; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction; // required public @org.apache.thrift.annotation.Nullable java.lang.String environment; // 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 { - RECORD((short)1, "record"), - TIMESTAMP((short)2, "timestamp"), - CREDS((short)3, "creds"), - TRANSACTION((short)4, "transaction"), - ENVIRONMENT((short)5, "environment"); + RECORDS((short)1, "records"), + CREDS((short)2, "creds"), + TRANSACTION((short)3, "transaction"), + ENVIRONMENT((short)4, "environment"); private static final java.util.Map byName = new java.util.LinkedHashMap(); @@ -694252,15 +697872,13 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { - case 1: // RECORD - return RECORD; - case 2: // TIMESTAMP - return TIMESTAMP; - case 3: // CREDS + case 1: // RECORDS + return RECORDS; + case 2: // CREDS return CREDS; - case 4: // TRANSACTION + case 3: // TRANSACTION return TRANSACTION; - case 5: // ENVIRONMENT + case 4: // ENVIRONMENT return ENVIRONMENT; default: return null; @@ -694305,16 +697923,12 @@ public java.lang.String getFieldName() { } // isset id assignments - private static final int __RECORD_ISSET_ID = 0; - private static final int __TIMESTAMP_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.RECORD, new org.apache.thrift.meta_data.FieldMetaData("record", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.RECORDS, new org.apache.thrift.meta_data.FieldMetaData("records", 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.I64)))); tmpMap.put(_Fields.CREDS, new org.apache.thrift.meta_data.FieldMetaData("creds", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.AccessToken.class))); tmpMap.put(_Fields.TRANSACTION, new org.apache.thrift.meta_data.FieldMetaData("transaction", org.apache.thrift.TFieldRequirementType.DEFAULT, @@ -694322,24 +697936,20 @@ public java.lang.String getFieldName() { tmpMap.put(_Fields.ENVIRONMENT, new org.apache.thrift.meta_data.FieldMetaData("environment", 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(traceRecordTime_args.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(traceRecords_args.class, metaDataMap); } - public traceRecordTime_args() { + public traceRecords_args() { } - public traceRecordTime_args( - long record, - long timestamp, + public traceRecords_args( + java.util.List records, com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment) { this(); - this.record = record; - setRecordIsSet(true); - this.timestamp = timestamp; - setTimestampIsSet(true); + this.records = records; this.creds = creds; this.transaction = transaction; this.environment = environment; @@ -694348,10 +697958,11 @@ public traceRecordTime_args( /** * Performs a deep copy on other. */ - public traceRecordTime_args(traceRecordTime_args other) { - __isset_bitfield = other.__isset_bitfield; - this.record = other.record; - this.timestamp = other.timestamp; + public traceRecords_args(traceRecords_args other) { + if (other.isSetRecords()) { + java.util.List __this__records = new java.util.ArrayList(other.records); + this.records = __this__records; + } if (other.isSetCreds()) { this.creds = new com.cinchapi.concourse.thrift.AccessToken(other.creds); } @@ -694364,65 +697975,57 @@ public traceRecordTime_args(traceRecordTime_args other) { } @Override - public traceRecordTime_args deepCopy() { - return new traceRecordTime_args(this); + public traceRecords_args deepCopy() { + return new traceRecords_args(this); } @Override public void clear() { - setRecordIsSet(false); - this.record = 0; - setTimestampIsSet(false); - this.timestamp = 0; + this.records = null; this.creds = null; this.transaction = null; this.environment = null; } - public long getRecord() { - return this.record; - } - - public traceRecordTime_args setRecord(long record) { - this.record = record; - setRecordIsSet(true); - return this; - } - - public void unsetRecord() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __RECORD_ISSET_ID); + public int getRecordsSize() { + return (this.records == null) ? 0 : this.records.size(); } - /** Returns true if field record is set (has been assigned a value) and false otherwise */ - public boolean isSetRecord() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __RECORD_ISSET_ID); + @org.apache.thrift.annotation.Nullable + public java.util.Iterator getRecordsIterator() { + return (this.records == null) ? null : this.records.iterator(); } - public void setRecordIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __RECORD_ISSET_ID, value); + public void addToRecords(long elem) { + if (this.records == null) { + this.records = new java.util.ArrayList(); + } + this.records.add(elem); } - public long getTimestamp() { - return this.timestamp; + @org.apache.thrift.annotation.Nullable + public java.util.List getRecords() { + return this.records; } - public traceRecordTime_args setTimestamp(long timestamp) { - this.timestamp = timestamp; - setTimestampIsSet(true); + public traceRecords_args setRecords(@org.apache.thrift.annotation.Nullable java.util.List records) { + this.records = records; return this; } - public void unsetTimestamp() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + public void unsetRecords() { + this.records = null; } - /** Returns true if field timestamp is set (has been assigned a value) and false otherwise */ - public boolean isSetTimestamp() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + /** Returns true if field records is set (has been assigned a value) and false otherwise */ + public boolean isSetRecords() { + return this.records != null; } - public void setTimestampIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TIMESTAMP_ISSET_ID, value); + public void setRecordsIsSet(boolean value) { + if (!value) { + this.records = null; + } } @org.apache.thrift.annotation.Nullable @@ -694430,7 +698033,7 @@ public com.cinchapi.concourse.thrift.AccessToken getCreds() { return this.creds; } - public traceRecordTime_args setCreds(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds) { + public traceRecords_args setCreds(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds) { this.creds = creds; return this; } @@ -694455,7 +698058,7 @@ public com.cinchapi.concourse.thrift.TransactionToken getTransaction() { return this.transaction; } - public traceRecordTime_args setTransaction(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction) { + public traceRecords_args setTransaction(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction) { this.transaction = transaction; return this; } @@ -694480,7 +698083,7 @@ public java.lang.String getEnvironment() { return this.environment; } - public traceRecordTime_args setEnvironment(@org.apache.thrift.annotation.Nullable java.lang.String environment) { + public traceRecords_args setEnvironment(@org.apache.thrift.annotation.Nullable java.lang.String environment) { this.environment = environment; return this; } @@ -694503,19 +698106,11 @@ public void setEnvironmentIsSet(boolean value) { @Override public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { - case RECORD: - if (value == null) { - unsetRecord(); - } else { - setRecord((java.lang.Long)value); - } - break; - - case TIMESTAMP: + case RECORDS: if (value == null) { - unsetTimestamp(); + unsetRecords(); } else { - setTimestamp((java.lang.Long)value); + setRecords((java.util.List)value); } break; @@ -694550,11 +698145,8 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable @Override public java.lang.Object getFieldValue(_Fields field) { switch (field) { - case RECORD: - return getRecord(); - - case TIMESTAMP: - return getTimestamp(); + case RECORDS: + return getRecords(); case CREDS: return getCreds(); @@ -694577,10 +698169,8 @@ public boolean isSet(_Fields field) { } switch (field) { - case RECORD: - return isSetRecord(); - case TIMESTAMP: - return isSetTimestamp(); + case RECORDS: + return isSetRecords(); case CREDS: return isSetCreds(); case TRANSACTION: @@ -694593,32 +698183,23 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that instanceof traceRecordTime_args) - return this.equals((traceRecordTime_args)that); + if (that instanceof traceRecords_args) + return this.equals((traceRecords_args)that); return false; } - public boolean equals(traceRecordTime_args that) { + public boolean equals(traceRecords_args that) { if (that == null) return false; if (this == that) return true; - boolean this_present_record = true; - boolean that_present_record = true; - if (this_present_record || that_present_record) { - if (!(this_present_record && that_present_record)) - return false; - if (this.record != that.record) - return false; - } - - boolean this_present_timestamp = true; - boolean that_present_timestamp = true; - if (this_present_timestamp || that_present_timestamp) { - if (!(this_present_timestamp && that_present_timestamp)) + boolean this_present_records = true && this.isSetRecords(); + boolean that_present_records = true && that.isSetRecords(); + if (this_present_records || that_present_records) { + if (!(this_present_records && that_present_records)) return false; - if (this.timestamp != that.timestamp) + if (!this.records.equals(that.records)) return false; } @@ -694656,9 +698237,9 @@ public boolean equals(traceRecordTime_args that) { public int hashCode() { int hashCode = 1; - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(record); - - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(timestamp); + hashCode = hashCode * 8191 + ((isSetRecords()) ? 131071 : 524287); + if (isSetRecords()) + hashCode = hashCode * 8191 + records.hashCode(); hashCode = hashCode * 8191 + ((isSetCreds()) ? 131071 : 524287); if (isSetCreds()) @@ -694676,29 +698257,19 @@ public int hashCode() { } @Override - public int compareTo(traceRecordTime_args other) { + public int compareTo(traceRecords_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; - lastComparison = java.lang.Boolean.compare(isSetRecord(), other.isSetRecord()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRecord()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.record, other.record); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.compare(isSetTimestamp(), other.isSetTimestamp()); + lastComparison = java.lang.Boolean.compare(isSetRecords(), other.isSetRecords()); if (lastComparison != 0) { return lastComparison; } - if (isSetTimestamp()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, other.timestamp); + if (isSetRecords()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.records, other.records); if (lastComparison != 0) { return lastComparison; } @@ -694754,15 +698325,15 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("traceRecordTime_args("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("traceRecords_args("); boolean first = true; - sb.append("record:"); - sb.append(this.record); - first = false; - if (!first) sb.append(", "); - sb.append("timestamp:"); - sb.append(this.timestamp); + sb.append("records:"); + if (this.records == null) { + sb.append("null"); + } else { + sb.append(this.records); + } first = false; if (!first) sb.append(", "); sb.append("creds:"); @@ -694813,25 +698384,23 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept 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 traceRecordTime_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class traceRecords_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public traceRecordTime_argsStandardScheme getScheme() { - return new traceRecordTime_argsStandardScheme(); + public traceRecords_argsStandardScheme getScheme() { + return new traceRecords_argsStandardScheme(); } } - private static class traceRecordTime_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class traceRecords_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordTime_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecords_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -694841,23 +698410,25 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordTime_arg break; } switch (schemeField.id) { - case 1: // RECORD - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.record = iprot.readI64(); - struct.setRecordIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // TIMESTAMP - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.timestamp = iprot.readI64(); - struct.setTimestampIsSet(true); + case 1: // RECORDS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list7094 = iprot.readListBegin(); + struct.records = new java.util.ArrayList(_list7094.size); + long _elem7095; + for (int _i7096 = 0; _i7096 < _list7094.size; ++_i7096) + { + _elem7095 = iprot.readI64(); + struct.records.add(_elem7095); + } + iprot.readListEnd(); + } + struct.setRecordsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 3: // CREDS + case 2: // CREDS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); struct.creds.read(iprot); @@ -694866,7 +698437,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordTime_arg org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 4: // TRANSACTION + case 3: // TRANSACTION if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.transaction = new com.cinchapi.concourse.thrift.TransactionToken(); struct.transaction.read(iprot); @@ -694875,7 +698446,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordTime_arg org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 5: // ENVIRONMENT + case 4: // ENVIRONMENT if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.environment = iprot.readString(); struct.setEnvironmentIsSet(true); @@ -694895,16 +698466,22 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordTime_arg } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecordTime_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecords_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(RECORD_FIELD_DESC); - oprot.writeI64(struct.record); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC); - oprot.writeI64(struct.timestamp); - oprot.writeFieldEnd(); + if (struct.records != null) { + oprot.writeFieldBegin(RECORDS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, struct.records.size())); + for (long _iter7097 : struct.records) + { + oprot.writeI64(_iter7097); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } if (struct.creds != null) { oprot.writeFieldBegin(CREDS_FIELD_DESC); struct.creds.write(oprot); @@ -694926,40 +698503,40 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecordTime_ar } - private static class traceRecordTime_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class traceRecords_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public traceRecordTime_argsTupleScheme getScheme() { - return new traceRecordTime_argsTupleScheme(); + public traceRecords_argsTupleScheme getScheme() { + return new traceRecords_argsTupleScheme(); } } - private static class traceRecordTime_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class traceRecords_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordTime_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, traceRecords_args 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.isSetRecord()) { + if (struct.isSetRecords()) { optionals.set(0); } - if (struct.isSetTimestamp()) { - optionals.set(1); - } if (struct.isSetCreds()) { - optionals.set(2); + optionals.set(1); } if (struct.isSetTransaction()) { - optionals.set(3); + optionals.set(2); } if (struct.isSetEnvironment()) { - optionals.set(4); - } - oprot.writeBitSet(optionals, 5); - if (struct.isSetRecord()) { - oprot.writeI64(struct.record); + optionals.set(3); } - if (struct.isSetTimestamp()) { - oprot.writeI64(struct.timestamp); + oprot.writeBitSet(optionals, 4); + if (struct.isSetRecords()) { + { + oprot.writeI32(struct.records.size()); + for (long _iter7098 : struct.records) + { + oprot.writeI64(_iter7098); + } + } } if (struct.isSetCreds()) { struct.creds.write(oprot); @@ -694973,28 +698550,33 @@ public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordTime_arg } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, traceRecordTime_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, traceRecords_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(5); + java.util.BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { - struct.record = iprot.readI64(); - struct.setRecordIsSet(true); + { + org.apache.thrift.protocol.TList _list7099 = iprot.readListBegin(org.apache.thrift.protocol.TType.I64); + struct.records = new java.util.ArrayList(_list7099.size); + long _elem7100; + for (int _i7101 = 0; _i7101 < _list7099.size; ++_i7101) + { + _elem7100 = iprot.readI64(); + struct.records.add(_elem7100); + } + } + struct.setRecordsIsSet(true); } if (incoming.get(1)) { - struct.timestamp = iprot.readI64(); - struct.setTimestampIsSet(true); - } - if (incoming.get(2)) { struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); struct.creds.read(iprot); struct.setCredsIsSet(true); } - if (incoming.get(3)) { + if (incoming.get(2)) { struct.transaction = new com.cinchapi.concourse.thrift.TransactionToken(); struct.transaction.read(iprot); struct.setTransactionIsSet(true); } - if (incoming.get(4)) { + if (incoming.get(3)) { struct.environment = iprot.readString(); struct.setEnvironmentIsSet(true); } @@ -695006,18 +698588,18 @@ private static S scheme(org.apache. } } - public static class traceRecordTime_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("traceRecordTime_result"); + public static class traceRecords_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("traceRecords_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.MAP, (short)0); private static final org.apache.thrift.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField EX2_FIELD_DESC = new org.apache.thrift.protocol.TField("ex2", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField EX3_FIELD_DESC = new org.apache.thrift.protocol.TField("ex3", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new traceRecordTime_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new traceRecordTime_resultTupleSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new traceRecords_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new traceRecords_resultTupleSchemeFactory(); - public @org.apache.thrift.annotation.Nullable java.util.Map> success; // required + public @org.apache.thrift.annotation.Nullable java.util.Map>> success; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3; // required @@ -695099,9 +698681,11 @@ public java.lang.String getFieldName() { 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.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), - new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))))); + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64), + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), + new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)))))); tmpMap.put(_Fields.EX, new org.apache.thrift.meta_data.FieldMetaData("ex", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.SecurityException.class))); tmpMap.put(_Fields.EX2, new org.apache.thrift.meta_data.FieldMetaData("ex2", org.apache.thrift.TFieldRequirementType.DEFAULT, @@ -695109,14 +698693,14 @@ public java.lang.String getFieldName() { tmpMap.put(_Fields.EX3, new org.apache.thrift.meta_data.FieldMetaData("ex3", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.PermissionException.class))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(traceRecordTime_result.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(traceRecords_result.class, metaDataMap); } - public traceRecordTime_result() { + public traceRecords_result() { } - public traceRecordTime_result( - java.util.Map> success, + public traceRecords_result( + java.util.Map>> success, com.cinchapi.concourse.thrift.SecurityException ex, com.cinchapi.concourse.thrift.TransactionException ex2, com.cinchapi.concourse.thrift.PermissionException ex3) @@ -695131,17 +698715,28 @@ public traceRecordTime_result( /** * Performs a deep copy on other. */ - public traceRecordTime_result(traceRecordTime_result other) { + public traceRecords_result(traceRecords_result other) { if (other.isSetSuccess()) { - java.util.Map> __this__success = new java.util.LinkedHashMap>(other.success.size()); - for (java.util.Map.Entry> other_element : other.success.entrySet()) { + java.util.Map>> __this__success = new java.util.LinkedHashMap>>(other.success.size()); + for (java.util.Map.Entry>> other_element : other.success.entrySet()) { - java.lang.String other_element_key = other_element.getKey(); - java.util.Set other_element_value = other_element.getValue(); + java.lang.Long other_element_key = other_element.getKey(); + java.util.Map> other_element_value = other_element.getValue(); - java.lang.String __this__success_copy_key = other_element_key; + java.lang.Long __this__success_copy_key = other_element_key; - java.util.Set __this__success_copy_value = new java.util.LinkedHashSet(other_element_value); + java.util.Map> __this__success_copy_value = new java.util.LinkedHashMap>(other_element_value.size()); + for (java.util.Map.Entry> other_element_value_element : other_element_value.entrySet()) { + + java.lang.String other_element_value_element_key = other_element_value_element.getKey(); + java.util.Set other_element_value_element_value = other_element_value_element.getValue(); + + java.lang.String __this__success_copy_value_copy_key = other_element_value_element_key; + + java.util.Set __this__success_copy_value_copy_value = new java.util.LinkedHashSet(other_element_value_element_value); + + __this__success_copy_value.put(__this__success_copy_value_copy_key, __this__success_copy_value_copy_value); + } __this__success.put(__this__success_copy_key, __this__success_copy_value); } @@ -695159,8 +698754,8 @@ public traceRecordTime_result(traceRecordTime_result other) { } @Override - public traceRecordTime_result deepCopy() { - return new traceRecordTime_result(this); + public traceRecords_result deepCopy() { + return new traceRecords_result(this); } @Override @@ -695175,19 +698770,19 @@ public int getSuccessSize() { return (this.success == null) ? 0 : this.success.size(); } - public void putToSuccess(java.lang.String key, java.util.Set val) { + public void putToSuccess(long key, java.util.Map> val) { if (this.success == null) { - this.success = new java.util.LinkedHashMap>(); + this.success = new java.util.LinkedHashMap>>(); } this.success.put(key, val); } @org.apache.thrift.annotation.Nullable - public java.util.Map> getSuccess() { + public java.util.Map>> getSuccess() { return this.success; } - public traceRecordTime_result setSuccess(@org.apache.thrift.annotation.Nullable java.util.Map> success) { + public traceRecords_result setSuccess(@org.apache.thrift.annotation.Nullable java.util.Map>> success) { this.success = success; return this; } @@ -695212,7 +698807,7 @@ public com.cinchapi.concourse.thrift.SecurityException getEx() { return this.ex; } - public traceRecordTime_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { + public traceRecords_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { this.ex = ex; return this; } @@ -695237,7 +698832,7 @@ public com.cinchapi.concourse.thrift.TransactionException getEx2() { return this.ex2; } - public traceRecordTime_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { + public traceRecords_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { this.ex2 = ex2; return this; } @@ -695262,7 +698857,7 @@ public com.cinchapi.concourse.thrift.PermissionException getEx3() { return this.ex3; } - public traceRecordTime_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3) { + public traceRecords_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3) { this.ex3 = ex3; return this; } @@ -695289,7 +698884,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetSuccess(); } else { - setSuccess((java.util.Map>)value); + setSuccess((java.util.Map>>)value); } break; @@ -695362,12 +698957,12 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that instanceof traceRecordTime_result) - return this.equals((traceRecordTime_result)that); + if (that instanceof traceRecords_result) + return this.equals((traceRecords_result)that); return false; } - public boolean equals(traceRecordTime_result that) { + public boolean equals(traceRecords_result that) { if (that == null) return false; if (this == that) @@ -695436,7 +699031,7 @@ public int hashCode() { } @Override - public int compareTo(traceRecordTime_result other) { + public int compareTo(traceRecords_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -695503,7 +699098,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("traceRecordTime_result("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("traceRecords_result("); boolean first = true; sb.append("success:"); @@ -695562,17 +699157,17 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class traceRecordTime_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class traceRecords_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public traceRecordTime_resultStandardScheme getScheme() { - return new traceRecordTime_resultStandardScheme(); + public traceRecords_resultStandardScheme getScheme() { + return new traceRecords_resultStandardScheme(); } } - private static class traceRecordTime_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class traceRecords_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordTime_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecords_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -695585,25 +699180,37 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordTime_res case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { - org.apache.thrift.protocol.TMap _map7058 = iprot.readMapBegin(); - struct.success = new java.util.LinkedHashMap>(2*_map7058.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key7059; - @org.apache.thrift.annotation.Nullable java.util.Set _val7060; - for (int _i7061 = 0; _i7061 < _map7058.size; ++_i7061) + org.apache.thrift.protocol.TMap _map7102 = iprot.readMapBegin(); + struct.success = new java.util.LinkedHashMap>>(2*_map7102.size); + long _key7103; + @org.apache.thrift.annotation.Nullable java.util.Map> _val7104; + for (int _i7105 = 0; _i7105 < _map7102.size; ++_i7105) { - _key7059 = iprot.readString(); + _key7103 = iprot.readI64(); { - org.apache.thrift.protocol.TSet _set7062 = iprot.readSetBegin(); - _val7060 = new java.util.LinkedHashSet(2*_set7062.size); - long _elem7063; - for (int _i7064 = 0; _i7064 < _set7062.size; ++_i7064) + org.apache.thrift.protocol.TMap _map7106 = iprot.readMapBegin(); + _val7104 = new java.util.LinkedHashMap>(2*_map7106.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key7107; + @org.apache.thrift.annotation.Nullable java.util.Set _val7108; + for (int _i7109 = 0; _i7109 < _map7106.size; ++_i7109) { - _elem7063 = iprot.readI64(); - _val7060.add(_elem7063); + _key7107 = iprot.readString(); + { + org.apache.thrift.protocol.TSet _set7110 = iprot.readSetBegin(); + _val7108 = new java.util.LinkedHashSet(2*_set7110.size); + long _elem7111; + for (int _i7112 = 0; _i7112 < _set7110.size; ++_i7112) + { + _elem7111 = iprot.readI64(); + _val7108.add(_elem7111); + } + iprot.readSetEnd(); + } + _val7104.put(_key7107, _val7108); } - iprot.readSetEnd(); + iprot.readMapEnd(); } - struct.success.put(_key7059, _val7060); + struct.success.put(_key7103, _val7104); } iprot.readMapEnd(); } @@ -695651,24 +699258,32 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordTime_res } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecordTime_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecords_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.SET, struct.success.size())); - for (java.util.Map.Entry> _iter7065 : struct.success.entrySet()) + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.MAP, struct.success.size())); + for (java.util.Map.Entry>> _iter7113 : struct.success.entrySet()) { - oprot.writeString(_iter7065.getKey()); + oprot.writeI64(_iter7113.getKey()); { - oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I64, _iter7065.getValue().size())); - for (long _iter7066 : _iter7065.getValue()) + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.SET, _iter7113.getValue().size())); + for (java.util.Map.Entry> _iter7114 : _iter7113.getValue().entrySet()) { - oprot.writeI64(_iter7066); + oprot.writeString(_iter7114.getKey()); + { + oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I64, _iter7114.getValue().size())); + for (long _iter7115 : _iter7114.getValue()) + { + oprot.writeI64(_iter7115); + } + oprot.writeSetEnd(); + } } - oprot.writeSetEnd(); + oprot.writeMapEnd(); } } oprot.writeMapEnd(); @@ -695696,17 +699311,17 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecordTime_re } - private static class traceRecordTime_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class traceRecords_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public traceRecordTime_resultTupleScheme getScheme() { - return new traceRecordTime_resultTupleScheme(); + public traceRecords_resultTupleScheme getScheme() { + return new traceRecords_resultTupleScheme(); } } - private static class traceRecordTime_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class traceRecords_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordTime_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, traceRecords_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()) { @@ -695725,14 +699340,21 @@ public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordTime_res if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); - for (java.util.Map.Entry> _iter7067 : struct.success.entrySet()) + for (java.util.Map.Entry>> _iter7116 : struct.success.entrySet()) { - oprot.writeString(_iter7067.getKey()); + oprot.writeI64(_iter7116.getKey()); { - oprot.writeI32(_iter7067.getValue().size()); - for (long _iter7068 : _iter7067.getValue()) + oprot.writeI32(_iter7116.getValue().size()); + for (java.util.Map.Entry> _iter7117 : _iter7116.getValue().entrySet()) { - oprot.writeI64(_iter7068); + oprot.writeString(_iter7117.getKey()); + { + oprot.writeI32(_iter7117.getValue().size()); + for (long _iter7118 : _iter7117.getValue()) + { + oprot.writeI64(_iter7118); + } + } } } } @@ -695750,29 +699372,40 @@ public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordTime_res } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, traceRecordTime_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, traceRecords_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(4); if (incoming.get(0)) { { - org.apache.thrift.protocol.TMap _map7069 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.SET); - struct.success = new java.util.LinkedHashMap>(2*_map7069.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key7070; - @org.apache.thrift.annotation.Nullable java.util.Set _val7071; - for (int _i7072 = 0; _i7072 < _map7069.size; ++_i7072) + org.apache.thrift.protocol.TMap _map7119 = iprot.readMapBegin(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.MAP); + struct.success = new java.util.LinkedHashMap>>(2*_map7119.size); + long _key7120; + @org.apache.thrift.annotation.Nullable java.util.Map> _val7121; + for (int _i7122 = 0; _i7122 < _map7119.size; ++_i7122) { - _key7070 = iprot.readString(); + _key7120 = iprot.readI64(); { - org.apache.thrift.protocol.TSet _set7073 = iprot.readSetBegin(org.apache.thrift.protocol.TType.I64); - _val7071 = new java.util.LinkedHashSet(2*_set7073.size); - long _elem7074; - for (int _i7075 = 0; _i7075 < _set7073.size; ++_i7075) + org.apache.thrift.protocol.TMap _map7123 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.SET); + _val7121 = new java.util.LinkedHashMap>(2*_map7123.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key7124; + @org.apache.thrift.annotation.Nullable java.util.Set _val7125; + for (int _i7126 = 0; _i7126 < _map7123.size; ++_i7126) { - _elem7074 = iprot.readI64(); - _val7071.add(_elem7074); + _key7124 = iprot.readString(); + { + org.apache.thrift.protocol.TSet _set7127 = iprot.readSetBegin(org.apache.thrift.protocol.TType.I64); + _val7125 = new java.util.LinkedHashSet(2*_set7127.size); + long _elem7128; + for (int _i7129 = 0; _i7129 < _set7127.size; ++_i7129) + { + _elem7128 = iprot.readI64(); + _val7125.add(_elem7128); + } + } + _val7121.put(_key7124, _val7125); } } - struct.success.put(_key7070, _val7071); + struct.success.put(_key7120, _val7121); } } struct.setSuccessIsSet(true); @@ -695800,27 +699433,27 @@ private static S scheme(org.apache. } } - public static class traceRecordTimestr_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("traceRecordTimestr_args"); + public static class traceRecordsTime_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("traceRecordsTime_args"); - private static final org.apache.thrift.protocol.TField RECORD_FIELD_DESC = new org.apache.thrift.protocol.TField("record", org.apache.thrift.protocol.TType.I64, (short)1); - private static final org.apache.thrift.protocol.TField TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("timestamp", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField RECORDS_FIELD_DESC = new org.apache.thrift.protocol.TField("records", org.apache.thrift.protocol.TType.LIST, (short)1); + private static final org.apache.thrift.protocol.TField TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("timestamp", org.apache.thrift.protocol.TType.I64, (short)2); private static final org.apache.thrift.protocol.TField CREDS_FIELD_DESC = new org.apache.thrift.protocol.TField("creds", org.apache.thrift.protocol.TType.STRUCT, (short)3); private static final org.apache.thrift.protocol.TField TRANSACTION_FIELD_DESC = new org.apache.thrift.protocol.TField("transaction", org.apache.thrift.protocol.TType.STRUCT, (short)4); private static final org.apache.thrift.protocol.TField ENVIRONMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("environment", org.apache.thrift.protocol.TType.STRING, (short)5); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new traceRecordTimestr_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new traceRecordTimestr_argsTupleSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new traceRecordsTime_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new traceRecordsTime_argsTupleSchemeFactory(); - public long record; // required - public @org.apache.thrift.annotation.Nullable java.lang.String timestamp; // required + public @org.apache.thrift.annotation.Nullable java.util.List records; // required + public long timestamp; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction; // required public @org.apache.thrift.annotation.Nullable java.lang.String environment; // 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 { - RECORD((short)1, "record"), + RECORDS((short)1, "records"), TIMESTAMP((short)2, "timestamp"), CREDS((short)3, "creds"), TRANSACTION((short)4, "transaction"), @@ -695840,8 +699473,8 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { - case 1: // RECORD - return RECORD; + case 1: // RECORDS + return RECORDS; case 2: // TIMESTAMP return TIMESTAMP; case 3: // CREDS @@ -695893,15 +699526,16 @@ public java.lang.String getFieldName() { } // isset id assignments - private static final int __RECORD_ISSET_ID = 0; + private static final int __TIMESTAMP_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.RECORD, new org.apache.thrift.meta_data.FieldMetaData("record", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.RECORDS, new org.apache.thrift.meta_data.FieldMetaData("records", 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.I64)))); tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.CREDS, new org.apache.thrift.meta_data.FieldMetaData("creds", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.AccessToken.class))); tmpMap.put(_Fields.TRANSACTION, new org.apache.thrift.meta_data.FieldMetaData("transaction", org.apache.thrift.TFieldRequirementType.DEFAULT, @@ -695909,23 +699543,23 @@ public java.lang.String getFieldName() { tmpMap.put(_Fields.ENVIRONMENT, new org.apache.thrift.meta_data.FieldMetaData("environment", 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(traceRecordTimestr_args.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(traceRecordsTime_args.class, metaDataMap); } - public traceRecordTimestr_args() { + public traceRecordsTime_args() { } - public traceRecordTimestr_args( - long record, - java.lang.String timestamp, + public traceRecordsTime_args( + java.util.List records, + long timestamp, com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment) { this(); - this.record = record; - setRecordIsSet(true); + this.records = records; this.timestamp = timestamp; + setTimestampIsSet(true); this.creds = creds; this.transaction = transaction; this.environment = environment; @@ -695934,12 +699568,13 @@ public traceRecordTimestr_args( /** * Performs a deep copy on other. */ - public traceRecordTimestr_args(traceRecordTimestr_args other) { + public traceRecordsTime_args(traceRecordsTime_args other) { __isset_bitfield = other.__isset_bitfield; - this.record = other.record; - if (other.isSetTimestamp()) { - this.timestamp = other.timestamp; + if (other.isSetRecords()) { + java.util.List __this__records = new java.util.ArrayList(other.records); + this.records = __this__records; } + this.timestamp = other.timestamp; if (other.isSetCreds()) { this.creds = new com.cinchapi.concourse.thrift.AccessToken(other.creds); } @@ -695952,66 +699587,82 @@ public traceRecordTimestr_args(traceRecordTimestr_args other) { } @Override - public traceRecordTimestr_args deepCopy() { - return new traceRecordTimestr_args(this); + public traceRecordsTime_args deepCopy() { + return new traceRecordsTime_args(this); } @Override public void clear() { - setRecordIsSet(false); - this.record = 0; - this.timestamp = null; + this.records = null; + setTimestampIsSet(false); + this.timestamp = 0; this.creds = null; this.transaction = null; this.environment = null; } - public long getRecord() { - return this.record; + public int getRecordsSize() { + return (this.records == null) ? 0 : this.records.size(); } - public traceRecordTimestr_args setRecord(long record) { - this.record = record; - setRecordIsSet(true); + @org.apache.thrift.annotation.Nullable + public java.util.Iterator getRecordsIterator() { + return (this.records == null) ? null : this.records.iterator(); + } + + public void addToRecords(long elem) { + if (this.records == null) { + this.records = new java.util.ArrayList(); + } + this.records.add(elem); + } + + @org.apache.thrift.annotation.Nullable + public java.util.List getRecords() { + return this.records; + } + + public traceRecordsTime_args setRecords(@org.apache.thrift.annotation.Nullable java.util.List records) { + this.records = records; return this; } - public void unsetRecord() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __RECORD_ISSET_ID); + public void unsetRecords() { + this.records = null; } - /** Returns true if field record is set (has been assigned a value) and false otherwise */ - public boolean isSetRecord() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __RECORD_ISSET_ID); + /** Returns true if field records is set (has been assigned a value) and false otherwise */ + public boolean isSetRecords() { + return this.records != null; } - public void setRecordIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __RECORD_ISSET_ID, value); + public void setRecordsIsSet(boolean value) { + if (!value) { + this.records = null; + } } - @org.apache.thrift.annotation.Nullable - public java.lang.String getTimestamp() { + public long getTimestamp() { return this.timestamp; } - public traceRecordTimestr_args setTimestamp(@org.apache.thrift.annotation.Nullable java.lang.String timestamp) { + public traceRecordsTime_args setTimestamp(long timestamp) { this.timestamp = timestamp; + setTimestampIsSet(true); return this; } public void unsetTimestamp() { - this.timestamp = null; + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); } /** Returns true if field timestamp is set (has been assigned a value) and false otherwise */ public boolean isSetTimestamp() { - return this.timestamp != null; + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); } public void setTimestampIsSet(boolean value) { - if (!value) { - this.timestamp = null; - } + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TIMESTAMP_ISSET_ID, value); } @org.apache.thrift.annotation.Nullable @@ -696019,7 +699670,7 @@ public com.cinchapi.concourse.thrift.AccessToken getCreds() { return this.creds; } - public traceRecordTimestr_args setCreds(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds) { + public traceRecordsTime_args setCreds(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds) { this.creds = creds; return this; } @@ -696044,7 +699695,7 @@ public com.cinchapi.concourse.thrift.TransactionToken getTransaction() { return this.transaction; } - public traceRecordTimestr_args setTransaction(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction) { + public traceRecordsTime_args setTransaction(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction) { this.transaction = transaction; return this; } @@ -696069,7 +699720,7 @@ public java.lang.String getEnvironment() { return this.environment; } - public traceRecordTimestr_args setEnvironment(@org.apache.thrift.annotation.Nullable java.lang.String environment) { + public traceRecordsTime_args setEnvironment(@org.apache.thrift.annotation.Nullable java.lang.String environment) { this.environment = environment; return this; } @@ -696092,11 +699743,11 @@ public void setEnvironmentIsSet(boolean value) { @Override public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { - case RECORD: + case RECORDS: if (value == null) { - unsetRecord(); + unsetRecords(); } else { - setRecord((java.lang.Long)value); + setRecords((java.util.List)value); } break; @@ -696104,7 +699755,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetTimestamp(); } else { - setTimestamp((java.lang.String)value); + setTimestamp((java.lang.Long)value); } break; @@ -696139,8 +699790,8 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable @Override public java.lang.Object getFieldValue(_Fields field) { switch (field) { - case RECORD: - return getRecord(); + case RECORDS: + return getRecords(); case TIMESTAMP: return getTimestamp(); @@ -696166,8 +699817,8 @@ public boolean isSet(_Fields field) { } switch (field) { - case RECORD: - return isSetRecord(); + case RECORDS: + return isSetRecords(); case TIMESTAMP: return isSetTimestamp(); case CREDS: @@ -696182,32 +699833,32 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that instanceof traceRecordTimestr_args) - return this.equals((traceRecordTimestr_args)that); + if (that instanceof traceRecordsTime_args) + return this.equals((traceRecordsTime_args)that); return false; } - public boolean equals(traceRecordTimestr_args that) { + public boolean equals(traceRecordsTime_args that) { if (that == null) return false; if (this == that) return true; - boolean this_present_record = true; - boolean that_present_record = true; - if (this_present_record || that_present_record) { - if (!(this_present_record && that_present_record)) + boolean this_present_records = true && this.isSetRecords(); + boolean that_present_records = true && that.isSetRecords(); + if (this_present_records || that_present_records) { + if (!(this_present_records && that_present_records)) return false; - if (this.record != that.record) + if (!this.records.equals(that.records)) return false; } - boolean this_present_timestamp = true && this.isSetTimestamp(); - boolean that_present_timestamp = true && that.isSetTimestamp(); + boolean this_present_timestamp = true; + boolean that_present_timestamp = true; if (this_present_timestamp || that_present_timestamp) { if (!(this_present_timestamp && that_present_timestamp)) return false; - if (!this.timestamp.equals(that.timestamp)) + if (this.timestamp != that.timestamp) return false; } @@ -696245,11 +699896,11 @@ public boolean equals(traceRecordTimestr_args that) { public int hashCode() { int hashCode = 1; - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(record); + hashCode = hashCode * 8191 + ((isSetRecords()) ? 131071 : 524287); + if (isSetRecords()) + hashCode = hashCode * 8191 + records.hashCode(); - hashCode = hashCode * 8191 + ((isSetTimestamp()) ? 131071 : 524287); - if (isSetTimestamp()) - hashCode = hashCode * 8191 + timestamp.hashCode(); + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(timestamp); hashCode = hashCode * 8191 + ((isSetCreds()) ? 131071 : 524287); if (isSetCreds()) @@ -696267,19 +699918,19 @@ public int hashCode() { } @Override - public int compareTo(traceRecordTimestr_args other) { + public int compareTo(traceRecordsTime_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; - lastComparison = java.lang.Boolean.compare(isSetRecord(), other.isSetRecord()); + lastComparison = java.lang.Boolean.compare(isSetRecords(), other.isSetRecords()); if (lastComparison != 0) { return lastComparison; } - if (isSetRecord()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.record, other.record); + if (isSetRecords()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.records, other.records); if (lastComparison != 0) { return lastComparison; } @@ -696345,21 +699996,21 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("traceRecordTimestr_args("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("traceRecordsTime_args("); boolean first = true; - sb.append("record:"); - sb.append(this.record); - first = false; - if (!first) sb.append(", "); - sb.append("timestamp:"); - if (this.timestamp == null) { + sb.append("records:"); + if (this.records == null) { sb.append("null"); } else { - sb.append(this.timestamp); + sb.append(this.records); } first = false; if (!first) sb.append(", "); + sb.append("timestamp:"); + sb.append(this.timestamp); + first = false; + if (!first) sb.append(", "); sb.append("creds:"); if (this.creds == null) { sb.append("null"); @@ -696416,17 +700067,17 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class traceRecordTimestr_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class traceRecordsTime_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public traceRecordTimestr_argsStandardScheme getScheme() { - return new traceRecordTimestr_argsStandardScheme(); + public traceRecordsTime_argsStandardScheme getScheme() { + return new traceRecordsTime_argsStandardScheme(); } } - private static class traceRecordTimestr_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class traceRecordsTime_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordTimestr_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordsTime_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -696436,17 +700087,27 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordTimestr_ break; } switch (schemeField.id) { - case 1: // RECORD - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.record = iprot.readI64(); - struct.setRecordIsSet(true); + case 1: // RECORDS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list7130 = iprot.readListBegin(); + struct.records = new java.util.ArrayList(_list7130.size); + long _elem7131; + for (int _i7132 = 0; _i7132 < _list7130.size; ++_i7132) + { + _elem7131 = iprot.readI64(); + struct.records.add(_elem7131); + } + iprot.readListEnd(); + } + struct.setRecordsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // TIMESTAMP - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.timestamp = iprot.readString(); + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.timestamp = iprot.readI64(); struct.setTimestampIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); @@ -696490,18 +700151,25 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordTimestr_ } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecordTimestr_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecordsTime_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(RECORD_FIELD_DESC); - oprot.writeI64(struct.record); - oprot.writeFieldEnd(); - if (struct.timestamp != null) { - oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC); - oprot.writeString(struct.timestamp); + if (struct.records != null) { + oprot.writeFieldBegin(RECORDS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, struct.records.size())); + for (long _iter7133 : struct.records) + { + oprot.writeI64(_iter7133); + } + oprot.writeListEnd(); + } oprot.writeFieldEnd(); } + oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC); + oprot.writeI64(struct.timestamp); + oprot.writeFieldEnd(); if (struct.creds != null) { oprot.writeFieldBegin(CREDS_FIELD_DESC); struct.creds.write(oprot); @@ -696523,20 +700191,20 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecordTimestr } - private static class traceRecordTimestr_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class traceRecordsTime_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public traceRecordTimestr_argsTupleScheme getScheme() { - return new traceRecordTimestr_argsTupleScheme(); + public traceRecordsTime_argsTupleScheme getScheme() { + return new traceRecordsTime_argsTupleScheme(); } } - private static class traceRecordTimestr_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class traceRecordsTime_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordTimestr_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordsTime_args 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.isSetRecord()) { + if (struct.isSetRecords()) { optionals.set(0); } if (struct.isSetTimestamp()) { @@ -696552,11 +700220,17 @@ public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordTimestr_ optionals.set(4); } oprot.writeBitSet(optionals, 5); - if (struct.isSetRecord()) { - oprot.writeI64(struct.record); + if (struct.isSetRecords()) { + { + oprot.writeI32(struct.records.size()); + for (long _iter7134 : struct.records) + { + oprot.writeI64(_iter7134); + } + } } if (struct.isSetTimestamp()) { - oprot.writeString(struct.timestamp); + oprot.writeI64(struct.timestamp); } if (struct.isSetCreds()) { struct.creds.write(oprot); @@ -696570,15 +700244,24 @@ public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordTimestr_ } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, traceRecordTimestr_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, traceRecordsTime_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(5); if (incoming.get(0)) { - struct.record = iprot.readI64(); - struct.setRecordIsSet(true); + { + org.apache.thrift.protocol.TList _list7135 = iprot.readListBegin(org.apache.thrift.protocol.TType.I64); + struct.records = new java.util.ArrayList(_list7135.size); + long _elem7136; + for (int _i7137 = 0; _i7137 < _list7135.size; ++_i7137) + { + _elem7136 = iprot.readI64(); + struct.records.add(_elem7136); + } + } + struct.setRecordsIsSet(true); } if (incoming.get(1)) { - struct.timestamp = iprot.readString(); + struct.timestamp = iprot.readI64(); struct.setTimestampIsSet(true); } if (incoming.get(2)) { @@ -696603,18 +700286,18 @@ private static S scheme(org.apache. } } - public static class traceRecordTimestr_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("traceRecordTimestr_result"); + public static class traceRecordsTime_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("traceRecordsTime_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.MAP, (short)0); private static final org.apache.thrift.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField EX2_FIELD_DESC = new org.apache.thrift.protocol.TField("ex2", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField EX3_FIELD_DESC = new org.apache.thrift.protocol.TField("ex3", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new traceRecordTimestr_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new traceRecordTimestr_resultTupleSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new traceRecordsTime_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new traceRecordsTime_resultTupleSchemeFactory(); - public @org.apache.thrift.annotation.Nullable java.util.Map> success; // required + public @org.apache.thrift.annotation.Nullable java.util.Map>> success; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3; // required @@ -696696,9 +700379,11 @@ public java.lang.String getFieldName() { 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.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), - new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))))); + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64), + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), + new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)))))); tmpMap.put(_Fields.EX, new org.apache.thrift.meta_data.FieldMetaData("ex", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.SecurityException.class))); tmpMap.put(_Fields.EX2, new org.apache.thrift.meta_data.FieldMetaData("ex2", org.apache.thrift.TFieldRequirementType.DEFAULT, @@ -696706,14 +700391,14 @@ public java.lang.String getFieldName() { tmpMap.put(_Fields.EX3, new org.apache.thrift.meta_data.FieldMetaData("ex3", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.PermissionException.class))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(traceRecordTimestr_result.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(traceRecordsTime_result.class, metaDataMap); } - public traceRecordTimestr_result() { + public traceRecordsTime_result() { } - public traceRecordTimestr_result( - java.util.Map> success, + public traceRecordsTime_result( + java.util.Map>> success, com.cinchapi.concourse.thrift.SecurityException ex, com.cinchapi.concourse.thrift.TransactionException ex2, com.cinchapi.concourse.thrift.PermissionException ex3) @@ -696728,17 +700413,28 @@ public traceRecordTimestr_result( /** * Performs a deep copy on other. */ - public traceRecordTimestr_result(traceRecordTimestr_result other) { + public traceRecordsTime_result(traceRecordsTime_result other) { if (other.isSetSuccess()) { - java.util.Map> __this__success = new java.util.LinkedHashMap>(other.success.size()); - for (java.util.Map.Entry> other_element : other.success.entrySet()) { + java.util.Map>> __this__success = new java.util.LinkedHashMap>>(other.success.size()); + for (java.util.Map.Entry>> other_element : other.success.entrySet()) { - java.lang.String other_element_key = other_element.getKey(); - java.util.Set other_element_value = other_element.getValue(); + java.lang.Long other_element_key = other_element.getKey(); + java.util.Map> other_element_value = other_element.getValue(); - java.lang.String __this__success_copy_key = other_element_key; + java.lang.Long __this__success_copy_key = other_element_key; - java.util.Set __this__success_copy_value = new java.util.LinkedHashSet(other_element_value); + java.util.Map> __this__success_copy_value = new java.util.LinkedHashMap>(other_element_value.size()); + for (java.util.Map.Entry> other_element_value_element : other_element_value.entrySet()) { + + java.lang.String other_element_value_element_key = other_element_value_element.getKey(); + java.util.Set other_element_value_element_value = other_element_value_element.getValue(); + + java.lang.String __this__success_copy_value_copy_key = other_element_value_element_key; + + java.util.Set __this__success_copy_value_copy_value = new java.util.LinkedHashSet(other_element_value_element_value); + + __this__success_copy_value.put(__this__success_copy_value_copy_key, __this__success_copy_value_copy_value); + } __this__success.put(__this__success_copy_key, __this__success_copy_value); } @@ -696756,8 +700452,8 @@ public traceRecordTimestr_result(traceRecordTimestr_result other) { } @Override - public traceRecordTimestr_result deepCopy() { - return new traceRecordTimestr_result(this); + public traceRecordsTime_result deepCopy() { + return new traceRecordsTime_result(this); } @Override @@ -696772,19 +700468,19 @@ public int getSuccessSize() { return (this.success == null) ? 0 : this.success.size(); } - public void putToSuccess(java.lang.String key, java.util.Set val) { + public void putToSuccess(long key, java.util.Map> val) { if (this.success == null) { - this.success = new java.util.LinkedHashMap>(); + this.success = new java.util.LinkedHashMap>>(); } this.success.put(key, val); } @org.apache.thrift.annotation.Nullable - public java.util.Map> getSuccess() { + public java.util.Map>> getSuccess() { return this.success; } - public traceRecordTimestr_result setSuccess(@org.apache.thrift.annotation.Nullable java.util.Map> success) { + public traceRecordsTime_result setSuccess(@org.apache.thrift.annotation.Nullable java.util.Map>> success) { this.success = success; return this; } @@ -696809,7 +700505,7 @@ public com.cinchapi.concourse.thrift.SecurityException getEx() { return this.ex; } - public traceRecordTimestr_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { + public traceRecordsTime_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { this.ex = ex; return this; } @@ -696834,7 +700530,7 @@ public com.cinchapi.concourse.thrift.TransactionException getEx2() { return this.ex2; } - public traceRecordTimestr_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { + public traceRecordsTime_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { this.ex2 = ex2; return this; } @@ -696859,7 +700555,7 @@ public com.cinchapi.concourse.thrift.PermissionException getEx3() { return this.ex3; } - public traceRecordTimestr_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3) { + public traceRecordsTime_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3) { this.ex3 = ex3; return this; } @@ -696886,7 +700582,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetSuccess(); } else { - setSuccess((java.util.Map>)value); + setSuccess((java.util.Map>>)value); } break; @@ -696959,12 +700655,12 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that instanceof traceRecordTimestr_result) - return this.equals((traceRecordTimestr_result)that); + if (that instanceof traceRecordsTime_result) + return this.equals((traceRecordsTime_result)that); return false; } - public boolean equals(traceRecordTimestr_result that) { + public boolean equals(traceRecordsTime_result that) { if (that == null) return false; if (this == that) @@ -697033,7 +700729,7 @@ public int hashCode() { } @Override - public int compareTo(traceRecordTimestr_result other) { + public int compareTo(traceRecordsTime_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -697100,7 +700796,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("traceRecordTimestr_result("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("traceRecordsTime_result("); boolean first = true; sb.append("success:"); @@ -697159,17 +700855,17 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class traceRecordTimestr_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class traceRecordsTime_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public traceRecordTimestr_resultStandardScheme getScheme() { - return new traceRecordTimestr_resultStandardScheme(); + public traceRecordsTime_resultStandardScheme getScheme() { + return new traceRecordsTime_resultStandardScheme(); } } - private static class traceRecordTimestr_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class traceRecordsTime_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordTimestr_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordsTime_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -697182,25 +700878,37 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordTimestr_ case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { - org.apache.thrift.protocol.TMap _map7076 = iprot.readMapBegin(); - struct.success = new java.util.LinkedHashMap>(2*_map7076.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key7077; - @org.apache.thrift.annotation.Nullable java.util.Set _val7078; - for (int _i7079 = 0; _i7079 < _map7076.size; ++_i7079) + org.apache.thrift.protocol.TMap _map7138 = iprot.readMapBegin(); + struct.success = new java.util.LinkedHashMap>>(2*_map7138.size); + long _key7139; + @org.apache.thrift.annotation.Nullable java.util.Map> _val7140; + for (int _i7141 = 0; _i7141 < _map7138.size; ++_i7141) { - _key7077 = iprot.readString(); + _key7139 = iprot.readI64(); { - org.apache.thrift.protocol.TSet _set7080 = iprot.readSetBegin(); - _val7078 = new java.util.LinkedHashSet(2*_set7080.size); - long _elem7081; - for (int _i7082 = 0; _i7082 < _set7080.size; ++_i7082) + org.apache.thrift.protocol.TMap _map7142 = iprot.readMapBegin(); + _val7140 = new java.util.LinkedHashMap>(2*_map7142.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key7143; + @org.apache.thrift.annotation.Nullable java.util.Set _val7144; + for (int _i7145 = 0; _i7145 < _map7142.size; ++_i7145) { - _elem7081 = iprot.readI64(); - _val7078.add(_elem7081); + _key7143 = iprot.readString(); + { + org.apache.thrift.protocol.TSet _set7146 = iprot.readSetBegin(); + _val7144 = new java.util.LinkedHashSet(2*_set7146.size); + long _elem7147; + for (int _i7148 = 0; _i7148 < _set7146.size; ++_i7148) + { + _elem7147 = iprot.readI64(); + _val7144.add(_elem7147); + } + iprot.readSetEnd(); + } + _val7140.put(_key7143, _val7144); } - iprot.readSetEnd(); + iprot.readMapEnd(); } - struct.success.put(_key7077, _val7078); + struct.success.put(_key7139, _val7140); } iprot.readMapEnd(); } @@ -697248,24 +700956,32 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordTimestr_ } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecordTimestr_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecordsTime_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.SET, struct.success.size())); - for (java.util.Map.Entry> _iter7083 : struct.success.entrySet()) + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.MAP, struct.success.size())); + for (java.util.Map.Entry>> _iter7149 : struct.success.entrySet()) { - oprot.writeString(_iter7083.getKey()); + oprot.writeI64(_iter7149.getKey()); { - oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I64, _iter7083.getValue().size())); - for (long _iter7084 : _iter7083.getValue()) + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.SET, _iter7149.getValue().size())); + for (java.util.Map.Entry> _iter7150 : _iter7149.getValue().entrySet()) { - oprot.writeI64(_iter7084); + oprot.writeString(_iter7150.getKey()); + { + oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I64, _iter7150.getValue().size())); + for (long _iter7151 : _iter7150.getValue()) + { + oprot.writeI64(_iter7151); + } + oprot.writeSetEnd(); + } } - oprot.writeSetEnd(); + oprot.writeMapEnd(); } } oprot.writeMapEnd(); @@ -697293,17 +701009,17 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecordTimestr } - private static class traceRecordTimestr_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class traceRecordsTime_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public traceRecordTimestr_resultTupleScheme getScheme() { - return new traceRecordTimestr_resultTupleScheme(); + public traceRecordsTime_resultTupleScheme getScheme() { + return new traceRecordsTime_resultTupleScheme(); } } - private static class traceRecordTimestr_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class traceRecordsTime_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordTimestr_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordsTime_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()) { @@ -697322,14 +701038,21 @@ public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordTimestr_ if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); - for (java.util.Map.Entry> _iter7085 : struct.success.entrySet()) + for (java.util.Map.Entry>> _iter7152 : struct.success.entrySet()) { - oprot.writeString(_iter7085.getKey()); + oprot.writeI64(_iter7152.getKey()); { - oprot.writeI32(_iter7085.getValue().size()); - for (long _iter7086 : _iter7085.getValue()) + oprot.writeI32(_iter7152.getValue().size()); + for (java.util.Map.Entry> _iter7153 : _iter7152.getValue().entrySet()) { - oprot.writeI64(_iter7086); + oprot.writeString(_iter7153.getKey()); + { + oprot.writeI32(_iter7153.getValue().size()); + for (long _iter7154 : _iter7153.getValue()) + { + oprot.writeI64(_iter7154); + } + } } } } @@ -697347,29 +701070,40 @@ public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordTimestr_ } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, traceRecordTimestr_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, traceRecordsTime_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(4); if (incoming.get(0)) { { - org.apache.thrift.protocol.TMap _map7087 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.SET); - struct.success = new java.util.LinkedHashMap>(2*_map7087.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key7088; - @org.apache.thrift.annotation.Nullable java.util.Set _val7089; - for (int _i7090 = 0; _i7090 < _map7087.size; ++_i7090) + org.apache.thrift.protocol.TMap _map7155 = iprot.readMapBegin(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.MAP); + struct.success = new java.util.LinkedHashMap>>(2*_map7155.size); + long _key7156; + @org.apache.thrift.annotation.Nullable java.util.Map> _val7157; + for (int _i7158 = 0; _i7158 < _map7155.size; ++_i7158) { - _key7088 = iprot.readString(); + _key7156 = iprot.readI64(); { - org.apache.thrift.protocol.TSet _set7091 = iprot.readSetBegin(org.apache.thrift.protocol.TType.I64); - _val7089 = new java.util.LinkedHashSet(2*_set7091.size); - long _elem7092; - for (int _i7093 = 0; _i7093 < _set7091.size; ++_i7093) + org.apache.thrift.protocol.TMap _map7159 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.SET); + _val7157 = new java.util.LinkedHashMap>(2*_map7159.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key7160; + @org.apache.thrift.annotation.Nullable java.util.Set _val7161; + for (int _i7162 = 0; _i7162 < _map7159.size; ++_i7162) { - _elem7092 = iprot.readI64(); - _val7089.add(_elem7092); + _key7160 = iprot.readString(); + { + org.apache.thrift.protocol.TSet _set7163 = iprot.readSetBegin(org.apache.thrift.protocol.TType.I64); + _val7161 = new java.util.LinkedHashSet(2*_set7163.size); + long _elem7164; + for (int _i7165 = 0; _i7165 < _set7163.size; ++_i7165) + { + _elem7164 = iprot.readI64(); + _val7161.add(_elem7164); + } + } + _val7157.put(_key7160, _val7161); } } - struct.success.put(_key7088, _val7089); + struct.success.put(_key7156, _val7157); } } struct.setSuccessIsSet(true); @@ -697397,18 +701131,20 @@ private static S scheme(org.apache. } } - public static class traceRecords_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("traceRecords_args"); + public static class traceRecordsTimestr_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("traceRecordsTimestr_args"); private static final org.apache.thrift.protocol.TField RECORDS_FIELD_DESC = new org.apache.thrift.protocol.TField("records", org.apache.thrift.protocol.TType.LIST, (short)1); - private static final org.apache.thrift.protocol.TField CREDS_FIELD_DESC = new org.apache.thrift.protocol.TField("creds", org.apache.thrift.protocol.TType.STRUCT, (short)2); - private static final org.apache.thrift.protocol.TField TRANSACTION_FIELD_DESC = new org.apache.thrift.protocol.TField("transaction", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.protocol.TField ENVIRONMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("environment", org.apache.thrift.protocol.TType.STRING, (short)4); + private static final org.apache.thrift.protocol.TField TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("timestamp", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField CREDS_FIELD_DESC = new org.apache.thrift.protocol.TField("creds", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final org.apache.thrift.protocol.TField TRANSACTION_FIELD_DESC = new org.apache.thrift.protocol.TField("transaction", org.apache.thrift.protocol.TType.STRUCT, (short)4); + private static final org.apache.thrift.protocol.TField ENVIRONMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("environment", org.apache.thrift.protocol.TType.STRING, (short)5); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new traceRecords_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new traceRecords_argsTupleSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new traceRecordsTimestr_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new traceRecordsTimestr_argsTupleSchemeFactory(); public @org.apache.thrift.annotation.Nullable java.util.List records; // required + public @org.apache.thrift.annotation.Nullable java.lang.String timestamp; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction; // required public @org.apache.thrift.annotation.Nullable java.lang.String environment; // required @@ -697416,9 +701152,10 @@ public static class traceRecords_args implements org.apache.thrift.TBase byName = new java.util.LinkedHashMap(); @@ -697436,11 +701173,13 @@ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // RECORDS return RECORDS; - case 2: // CREDS + case 2: // TIMESTAMP + return TIMESTAMP; + case 3: // CREDS return CREDS; - case 3: // TRANSACTION + case 4: // TRANSACTION return TRANSACTION; - case 4: // ENVIRONMENT + case 5: // ENVIRONMENT return ENVIRONMENT; default: return null; @@ -697491,6 +701230,8 @@ public java.lang.String getFieldName() { tmpMap.put(_Fields.RECORDS, new org.apache.thrift.meta_data.FieldMetaData("records", 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.I64)))); + tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.CREDS, new org.apache.thrift.meta_data.FieldMetaData("creds", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.AccessToken.class))); tmpMap.put(_Fields.TRANSACTION, new org.apache.thrift.meta_data.FieldMetaData("transaction", org.apache.thrift.TFieldRequirementType.DEFAULT, @@ -697498,20 +701239,22 @@ public java.lang.String getFieldName() { tmpMap.put(_Fields.ENVIRONMENT, new org.apache.thrift.meta_data.FieldMetaData("environment", 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(traceRecords_args.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(traceRecordsTimestr_args.class, metaDataMap); } - public traceRecords_args() { + public traceRecordsTimestr_args() { } - public traceRecords_args( + public traceRecordsTimestr_args( java.util.List records, + java.lang.String timestamp, com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment) { this(); this.records = records; + this.timestamp = timestamp; this.creds = creds; this.transaction = transaction; this.environment = environment; @@ -697520,11 +701263,14 @@ public traceRecords_args( /** * Performs a deep copy on other. */ - public traceRecords_args(traceRecords_args other) { + public traceRecordsTimestr_args(traceRecordsTimestr_args other) { if (other.isSetRecords()) { java.util.List __this__records = new java.util.ArrayList(other.records); this.records = __this__records; } + if (other.isSetTimestamp()) { + this.timestamp = other.timestamp; + } if (other.isSetCreds()) { this.creds = new com.cinchapi.concourse.thrift.AccessToken(other.creds); } @@ -697537,13 +701283,14 @@ public traceRecords_args(traceRecords_args other) { } @Override - public traceRecords_args deepCopy() { - return new traceRecords_args(this); + public traceRecordsTimestr_args deepCopy() { + return new traceRecordsTimestr_args(this); } @Override public void clear() { this.records = null; + this.timestamp = null; this.creds = null; this.transaction = null; this.environment = null; @@ -697570,7 +701317,7 @@ public java.util.List getRecords() { return this.records; } - public traceRecords_args setRecords(@org.apache.thrift.annotation.Nullable java.util.List records) { + public traceRecordsTimestr_args setRecords(@org.apache.thrift.annotation.Nullable java.util.List records) { this.records = records; return this; } @@ -697590,12 +701337,37 @@ public void setRecordsIsSet(boolean value) { } } + @org.apache.thrift.annotation.Nullable + public java.lang.String getTimestamp() { + return this.timestamp; + } + + public traceRecordsTimestr_args setTimestamp(@org.apache.thrift.annotation.Nullable java.lang.String timestamp) { + this.timestamp = timestamp; + return this; + } + + public void unsetTimestamp() { + this.timestamp = null; + } + + /** Returns true if field timestamp is set (has been assigned a value) and false otherwise */ + public boolean isSetTimestamp() { + return this.timestamp != null; + } + + public void setTimestampIsSet(boolean value) { + if (!value) { + this.timestamp = null; + } + } + @org.apache.thrift.annotation.Nullable public com.cinchapi.concourse.thrift.AccessToken getCreds() { return this.creds; } - public traceRecords_args setCreds(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds) { + public traceRecordsTimestr_args setCreds(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds) { this.creds = creds; return this; } @@ -697620,7 +701392,7 @@ public com.cinchapi.concourse.thrift.TransactionToken getTransaction() { return this.transaction; } - public traceRecords_args setTransaction(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction) { + public traceRecordsTimestr_args setTransaction(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction) { this.transaction = transaction; return this; } @@ -697645,7 +701417,7 @@ public java.lang.String getEnvironment() { return this.environment; } - public traceRecords_args setEnvironment(@org.apache.thrift.annotation.Nullable java.lang.String environment) { + public traceRecordsTimestr_args setEnvironment(@org.apache.thrift.annotation.Nullable java.lang.String environment) { this.environment = environment; return this; } @@ -697676,6 +701448,14 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } break; + case TIMESTAMP: + if (value == null) { + unsetTimestamp(); + } else { + setTimestamp((java.lang.String)value); + } + break; + case CREDS: if (value == null) { unsetCreds(); @@ -697710,6 +701490,9 @@ public java.lang.Object getFieldValue(_Fields field) { case RECORDS: return getRecords(); + case TIMESTAMP: + return getTimestamp(); + case CREDS: return getCreds(); @@ -697733,6 +701516,8 @@ public boolean isSet(_Fields field) { switch (field) { case RECORDS: return isSetRecords(); + case TIMESTAMP: + return isSetTimestamp(); case CREDS: return isSetCreds(); case TRANSACTION: @@ -697745,12 +701530,12 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that instanceof traceRecords_args) - return this.equals((traceRecords_args)that); + if (that instanceof traceRecordsTimestr_args) + return this.equals((traceRecordsTimestr_args)that); return false; } - public boolean equals(traceRecords_args that) { + public boolean equals(traceRecordsTimestr_args that) { if (that == null) return false; if (this == that) @@ -697765,6 +701550,15 @@ public boolean equals(traceRecords_args that) { return false; } + boolean this_present_timestamp = true && this.isSetTimestamp(); + boolean that_present_timestamp = true && that.isSetTimestamp(); + if (this_present_timestamp || that_present_timestamp) { + if (!(this_present_timestamp && that_present_timestamp)) + return false; + if (!this.timestamp.equals(that.timestamp)) + return false; + } + boolean this_present_creds = true && this.isSetCreds(); boolean that_present_creds = true && that.isSetCreds(); if (this_present_creds || that_present_creds) { @@ -697803,6 +701597,10 @@ public int hashCode() { if (isSetRecords()) hashCode = hashCode * 8191 + records.hashCode(); + hashCode = hashCode * 8191 + ((isSetTimestamp()) ? 131071 : 524287); + if (isSetTimestamp()) + hashCode = hashCode * 8191 + timestamp.hashCode(); + hashCode = hashCode * 8191 + ((isSetCreds()) ? 131071 : 524287); if (isSetCreds()) hashCode = hashCode * 8191 + creds.hashCode(); @@ -697819,7 +701617,7 @@ public int hashCode() { } @Override - public int compareTo(traceRecords_args other) { + public int compareTo(traceRecordsTimestr_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -697836,6 +701634,16 @@ public int compareTo(traceRecords_args other) { return lastComparison; } } + lastComparison = java.lang.Boolean.compare(isSetTimestamp(), other.isSetTimestamp()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTimestamp()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, other.timestamp); + if (lastComparison != 0) { + return lastComparison; + } + } lastComparison = java.lang.Boolean.compare(isSetCreds(), other.isSetCreds()); if (lastComparison != 0) { return lastComparison; @@ -697887,7 +701695,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("traceRecords_args("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("traceRecordsTimestr_args("); boolean first = true; sb.append("records:"); @@ -697898,6 +701706,14 @@ public java.lang.String toString() { } first = false; if (!first) sb.append(", "); + sb.append("timestamp:"); + if (this.timestamp == null) { + sb.append("null"); + } else { + sb.append(this.timestamp); + } + first = false; + if (!first) sb.append(", "); sb.append("creds:"); if (this.creds == null) { sb.append("null"); @@ -697952,17 +701768,17 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class traceRecords_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class traceRecordsTimestr_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public traceRecords_argsStandardScheme getScheme() { - return new traceRecords_argsStandardScheme(); + public traceRecordsTimestr_argsStandardScheme getScheme() { + return new traceRecordsTimestr_argsStandardScheme(); } } - private static class traceRecords_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class traceRecordsTimestr_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecords_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordsTimestr_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -697975,13 +701791,13 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecords_args s case 1: // RECORDS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list7094 = iprot.readListBegin(); - struct.records = new java.util.ArrayList(_list7094.size); - long _elem7095; - for (int _i7096 = 0; _i7096 < _list7094.size; ++_i7096) + org.apache.thrift.protocol.TList _list7166 = iprot.readListBegin(); + struct.records = new java.util.ArrayList(_list7166.size); + long _elem7167; + for (int _i7168 = 0; _i7168 < _list7166.size; ++_i7168) { - _elem7095 = iprot.readI64(); - struct.records.add(_elem7095); + _elem7167 = iprot.readI64(); + struct.records.add(_elem7167); } iprot.readListEnd(); } @@ -697990,7 +701806,15 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecords_args s org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 2: // CREDS + case 2: // TIMESTAMP + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.timestamp = iprot.readString(); + struct.setTimestampIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // CREDS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); struct.creds.read(iprot); @@ -697999,7 +701823,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecords_args s org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 3: // TRANSACTION + case 4: // TRANSACTION if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.transaction = new com.cinchapi.concourse.thrift.TransactionToken(); struct.transaction.read(iprot); @@ -698008,7 +701832,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecords_args s org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 4: // ENVIRONMENT + case 5: // ENVIRONMENT if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.environment = iprot.readString(); struct.setEnvironmentIsSet(true); @@ -698028,7 +701852,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecords_args s } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecords_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecordsTimestr_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); @@ -698036,14 +701860,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecords_args oprot.writeFieldBegin(RECORDS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, struct.records.size())); - for (long _iter7097 : struct.records) + for (long _iter7169 : struct.records) { - oprot.writeI64(_iter7097); + oprot.writeI64(_iter7169); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } + if (struct.timestamp != null) { + oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC); + oprot.writeString(struct.timestamp); + oprot.writeFieldEnd(); + } if (struct.creds != null) { oprot.writeFieldBegin(CREDS_FIELD_DESC); struct.creds.write(oprot); @@ -698065,41 +701894,47 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecords_args } - private static class traceRecords_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class traceRecordsTimestr_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public traceRecords_argsTupleScheme getScheme() { - return new traceRecords_argsTupleScheme(); + public traceRecordsTimestr_argsTupleScheme getScheme() { + return new traceRecordsTimestr_argsTupleScheme(); } } - private static class traceRecords_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class traceRecordsTimestr_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, traceRecords_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordsTimestr_args 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.isSetRecords()) { optionals.set(0); } - if (struct.isSetCreds()) { + if (struct.isSetTimestamp()) { optionals.set(1); } - if (struct.isSetTransaction()) { + if (struct.isSetCreds()) { optionals.set(2); } - if (struct.isSetEnvironment()) { + if (struct.isSetTransaction()) { optionals.set(3); } - oprot.writeBitSet(optionals, 4); + if (struct.isSetEnvironment()) { + optionals.set(4); + } + oprot.writeBitSet(optionals, 5); if (struct.isSetRecords()) { { oprot.writeI32(struct.records.size()); - for (long _iter7098 : struct.records) + for (long _iter7170 : struct.records) { - oprot.writeI64(_iter7098); + oprot.writeI64(_iter7170); } } } + if (struct.isSetTimestamp()) { + oprot.writeString(struct.timestamp); + } if (struct.isSetCreds()) { struct.creds.write(oprot); } @@ -698112,33 +701947,37 @@ public void write(org.apache.thrift.protocol.TProtocol prot, traceRecords_args s } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, traceRecords_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, traceRecordsTimestr_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(4); + java.util.BitSet incoming = iprot.readBitSet(5); if (incoming.get(0)) { { - org.apache.thrift.protocol.TList _list7099 = iprot.readListBegin(org.apache.thrift.protocol.TType.I64); - struct.records = new java.util.ArrayList(_list7099.size); - long _elem7100; - for (int _i7101 = 0; _i7101 < _list7099.size; ++_i7101) + org.apache.thrift.protocol.TList _list7171 = iprot.readListBegin(org.apache.thrift.protocol.TType.I64); + struct.records = new java.util.ArrayList(_list7171.size); + long _elem7172; + for (int _i7173 = 0; _i7173 < _list7171.size; ++_i7173) { - _elem7100 = iprot.readI64(); - struct.records.add(_elem7100); + _elem7172 = iprot.readI64(); + struct.records.add(_elem7172); } } struct.setRecordsIsSet(true); } if (incoming.get(1)) { + struct.timestamp = iprot.readString(); + struct.setTimestampIsSet(true); + } + if (incoming.get(2)) { struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); struct.creds.read(iprot); struct.setCredsIsSet(true); } - if (incoming.get(2)) { + if (incoming.get(3)) { struct.transaction = new com.cinchapi.concourse.thrift.TransactionToken(); struct.transaction.read(iprot); struct.setTransactionIsSet(true); } - if (incoming.get(3)) { + if (incoming.get(4)) { struct.environment = iprot.readString(); struct.setEnvironmentIsSet(true); } @@ -698150,16 +701989,16 @@ private static S scheme(org.apache. } } - public static class traceRecords_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("traceRecords_result"); + public static class traceRecordsTimestr_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("traceRecordsTimestr_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.MAP, (short)0); private static final org.apache.thrift.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField EX2_FIELD_DESC = new org.apache.thrift.protocol.TField("ex2", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField EX3_FIELD_DESC = new org.apache.thrift.protocol.TField("ex3", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new traceRecords_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new traceRecords_resultTupleSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new traceRecordsTimestr_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new traceRecordsTimestr_resultTupleSchemeFactory(); public @org.apache.thrift.annotation.Nullable java.util.Map>> success; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex; // required @@ -698255,13 +702094,13 @@ public java.lang.String getFieldName() { tmpMap.put(_Fields.EX3, new org.apache.thrift.meta_data.FieldMetaData("ex3", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.PermissionException.class))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(traceRecords_result.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(traceRecordsTimestr_result.class, metaDataMap); } - public traceRecords_result() { + public traceRecordsTimestr_result() { } - public traceRecords_result( + public traceRecordsTimestr_result( java.util.Map>> success, com.cinchapi.concourse.thrift.SecurityException ex, com.cinchapi.concourse.thrift.TransactionException ex2, @@ -698277,7 +702116,7 @@ public traceRecords_result( /** * Performs a deep copy on other. */ - public traceRecords_result(traceRecords_result other) { + public traceRecordsTimestr_result(traceRecordsTimestr_result other) { if (other.isSetSuccess()) { java.util.Map>> __this__success = new java.util.LinkedHashMap>>(other.success.size()); for (java.util.Map.Entry>> other_element : other.success.entrySet()) { @@ -698316,8 +702155,8 @@ public traceRecords_result(traceRecords_result other) { } @Override - public traceRecords_result deepCopy() { - return new traceRecords_result(this); + public traceRecordsTimestr_result deepCopy() { + return new traceRecordsTimestr_result(this); } @Override @@ -698344,7 +702183,7 @@ public java.util.Map>> success) { + public traceRecordsTimestr_result setSuccess(@org.apache.thrift.annotation.Nullable java.util.Map>> success) { this.success = success; return this; } @@ -698369,7 +702208,7 @@ public com.cinchapi.concourse.thrift.SecurityException getEx() { return this.ex; } - public traceRecords_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { + public traceRecordsTimestr_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { this.ex = ex; return this; } @@ -698394,7 +702233,7 @@ public com.cinchapi.concourse.thrift.TransactionException getEx2() { return this.ex2; } - public traceRecords_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { + public traceRecordsTimestr_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { this.ex2 = ex2; return this; } @@ -698419,7 +702258,7 @@ public com.cinchapi.concourse.thrift.PermissionException getEx3() { return this.ex3; } - public traceRecords_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3) { + public traceRecordsTimestr_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3) { this.ex3 = ex3; return this; } @@ -698519,12 +702358,12 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that instanceof traceRecords_result) - return this.equals((traceRecords_result)that); + if (that instanceof traceRecordsTimestr_result) + return this.equals((traceRecordsTimestr_result)that); return false; } - public boolean equals(traceRecords_result that) { + public boolean equals(traceRecordsTimestr_result that) { if (that == null) return false; if (this == that) @@ -698593,7 +702432,7 @@ public int hashCode() { } @Override - public int compareTo(traceRecords_result other) { + public int compareTo(traceRecordsTimestr_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -698660,7 +702499,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("traceRecords_result("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("traceRecordsTimestr_result("); boolean first = true; sb.append("success:"); @@ -698719,17 +702558,17 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class traceRecords_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class traceRecordsTimestr_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public traceRecords_resultStandardScheme getScheme() { - return new traceRecords_resultStandardScheme(); + public traceRecordsTimestr_resultStandardScheme getScheme() { + return new traceRecordsTimestr_resultStandardScheme(); } } - private static class traceRecords_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class traceRecordsTimestr_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecords_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordsTimestr_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -698742,37 +702581,37 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecords_result case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { - org.apache.thrift.protocol.TMap _map7102 = iprot.readMapBegin(); - struct.success = new java.util.LinkedHashMap>>(2*_map7102.size); - long _key7103; - @org.apache.thrift.annotation.Nullable java.util.Map> _val7104; - for (int _i7105 = 0; _i7105 < _map7102.size; ++_i7105) + org.apache.thrift.protocol.TMap _map7174 = iprot.readMapBegin(); + struct.success = new java.util.LinkedHashMap>>(2*_map7174.size); + long _key7175; + @org.apache.thrift.annotation.Nullable java.util.Map> _val7176; + for (int _i7177 = 0; _i7177 < _map7174.size; ++_i7177) { - _key7103 = iprot.readI64(); + _key7175 = iprot.readI64(); { - org.apache.thrift.protocol.TMap _map7106 = iprot.readMapBegin(); - _val7104 = new java.util.LinkedHashMap>(2*_map7106.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key7107; - @org.apache.thrift.annotation.Nullable java.util.Set _val7108; - for (int _i7109 = 0; _i7109 < _map7106.size; ++_i7109) + org.apache.thrift.protocol.TMap _map7178 = iprot.readMapBegin(); + _val7176 = new java.util.LinkedHashMap>(2*_map7178.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key7179; + @org.apache.thrift.annotation.Nullable java.util.Set _val7180; + for (int _i7181 = 0; _i7181 < _map7178.size; ++_i7181) { - _key7107 = iprot.readString(); + _key7179 = iprot.readString(); { - org.apache.thrift.protocol.TSet _set7110 = iprot.readSetBegin(); - _val7108 = new java.util.LinkedHashSet(2*_set7110.size); - long _elem7111; - for (int _i7112 = 0; _i7112 < _set7110.size; ++_i7112) + org.apache.thrift.protocol.TSet _set7182 = iprot.readSetBegin(); + _val7180 = new java.util.LinkedHashSet(2*_set7182.size); + long _elem7183; + for (int _i7184 = 0; _i7184 < _set7182.size; ++_i7184) { - _elem7111 = iprot.readI64(); - _val7108.add(_elem7111); + _elem7183 = iprot.readI64(); + _val7180.add(_elem7183); } iprot.readSetEnd(); } - _val7104.put(_key7107, _val7108); + _val7176.put(_key7179, _val7180); } iprot.readMapEnd(); } - struct.success.put(_key7103, _val7104); + struct.success.put(_key7175, _val7176); } iprot.readMapEnd(); } @@ -698820,7 +702659,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecords_result } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecords_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecordsTimestr_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); @@ -698828,19 +702667,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecords_resul oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.MAP, struct.success.size())); - for (java.util.Map.Entry>> _iter7113 : struct.success.entrySet()) + for (java.util.Map.Entry>> _iter7185 : struct.success.entrySet()) { - oprot.writeI64(_iter7113.getKey()); + oprot.writeI64(_iter7185.getKey()); { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.SET, _iter7113.getValue().size())); - for (java.util.Map.Entry> _iter7114 : _iter7113.getValue().entrySet()) + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.SET, _iter7185.getValue().size())); + for (java.util.Map.Entry> _iter7186 : _iter7185.getValue().entrySet()) { - oprot.writeString(_iter7114.getKey()); + oprot.writeString(_iter7186.getKey()); { - oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I64, _iter7114.getValue().size())); - for (long _iter7115 : _iter7114.getValue()) + oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I64, _iter7186.getValue().size())); + for (long _iter7187 : _iter7186.getValue()) { - oprot.writeI64(_iter7115); + oprot.writeI64(_iter7187); } oprot.writeSetEnd(); } @@ -698873,17 +702712,17 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecords_resul } - private static class traceRecords_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class traceRecordsTimestr_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public traceRecords_resultTupleScheme getScheme() { - return new traceRecords_resultTupleScheme(); + public traceRecordsTimestr_resultTupleScheme getScheme() { + return new traceRecordsTimestr_resultTupleScheme(); } } - private static class traceRecords_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class traceRecordsTimestr_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, traceRecords_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordsTimestr_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()) { @@ -698902,19 +702741,19 @@ public void write(org.apache.thrift.protocol.TProtocol prot, traceRecords_result if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); - for (java.util.Map.Entry>> _iter7116 : struct.success.entrySet()) + for (java.util.Map.Entry>> _iter7188 : struct.success.entrySet()) { - oprot.writeI64(_iter7116.getKey()); + oprot.writeI64(_iter7188.getKey()); { - oprot.writeI32(_iter7116.getValue().size()); - for (java.util.Map.Entry> _iter7117 : _iter7116.getValue().entrySet()) + oprot.writeI32(_iter7188.getValue().size()); + for (java.util.Map.Entry> _iter7189 : _iter7188.getValue().entrySet()) { - oprot.writeString(_iter7117.getKey()); + oprot.writeString(_iter7189.getKey()); { - oprot.writeI32(_iter7117.getValue().size()); - for (long _iter7118 : _iter7117.getValue()) + oprot.writeI32(_iter7189.getValue().size()); + for (long _iter7190 : _iter7189.getValue()) { - oprot.writeI64(_iter7118); + oprot.writeI64(_iter7190); } } } @@ -698934,40 +702773,40 @@ public void write(org.apache.thrift.protocol.TProtocol prot, traceRecords_result } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, traceRecords_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, traceRecordsTimestr_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(4); if (incoming.get(0)) { { - org.apache.thrift.protocol.TMap _map7119 = iprot.readMapBegin(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.MAP); - struct.success = new java.util.LinkedHashMap>>(2*_map7119.size); - long _key7120; - @org.apache.thrift.annotation.Nullable java.util.Map> _val7121; - for (int _i7122 = 0; _i7122 < _map7119.size; ++_i7122) + org.apache.thrift.protocol.TMap _map7191 = iprot.readMapBegin(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.MAP); + struct.success = new java.util.LinkedHashMap>>(2*_map7191.size); + long _key7192; + @org.apache.thrift.annotation.Nullable java.util.Map> _val7193; + for (int _i7194 = 0; _i7194 < _map7191.size; ++_i7194) { - _key7120 = iprot.readI64(); + _key7192 = iprot.readI64(); { - org.apache.thrift.protocol.TMap _map7123 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.SET); - _val7121 = new java.util.LinkedHashMap>(2*_map7123.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key7124; - @org.apache.thrift.annotation.Nullable java.util.Set _val7125; - for (int _i7126 = 0; _i7126 < _map7123.size; ++_i7126) + org.apache.thrift.protocol.TMap _map7195 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.SET); + _val7193 = new java.util.LinkedHashMap>(2*_map7195.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key7196; + @org.apache.thrift.annotation.Nullable java.util.Set _val7197; + for (int _i7198 = 0; _i7198 < _map7195.size; ++_i7198) { - _key7124 = iprot.readString(); + _key7196 = iprot.readString(); { - org.apache.thrift.protocol.TSet _set7127 = iprot.readSetBegin(org.apache.thrift.protocol.TType.I64); - _val7125 = new java.util.LinkedHashSet(2*_set7127.size); - long _elem7128; - for (int _i7129 = 0; _i7129 < _set7127.size; ++_i7129) + org.apache.thrift.protocol.TSet _set7199 = iprot.readSetBegin(org.apache.thrift.protocol.TType.I64); + _val7197 = new java.util.LinkedHashSet(2*_set7199.size); + long _elem7200; + for (int _i7201 = 0; _i7201 < _set7199.size; ++_i7201) { - _elem7128 = iprot.readI64(); - _val7125.add(_elem7128); + _elem7200 = iprot.readI64(); + _val7197.add(_elem7200); } } - _val7121.put(_key7124, _val7125); + _val7193.put(_key7196, _val7197); } } - struct.success.put(_key7120, _val7121); + struct.success.put(_key7192, _val7193); } } struct.setSuccessIsSet(true); @@ -698995,20 +702834,18 @@ private static S scheme(org.apache. } } - public static class traceRecordsTime_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("traceRecordsTime_args"); + public static class consolidateRecords_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("consolidateRecords_args"); private static final org.apache.thrift.protocol.TField RECORDS_FIELD_DESC = new org.apache.thrift.protocol.TField("records", org.apache.thrift.protocol.TType.LIST, (short)1); - private static final org.apache.thrift.protocol.TField TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("timestamp", org.apache.thrift.protocol.TType.I64, (short)2); - private static final org.apache.thrift.protocol.TField CREDS_FIELD_DESC = new org.apache.thrift.protocol.TField("creds", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.protocol.TField TRANSACTION_FIELD_DESC = new org.apache.thrift.protocol.TField("transaction", org.apache.thrift.protocol.TType.STRUCT, (short)4); - private static final org.apache.thrift.protocol.TField ENVIRONMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("environment", org.apache.thrift.protocol.TType.STRING, (short)5); + private static final org.apache.thrift.protocol.TField CREDS_FIELD_DESC = new org.apache.thrift.protocol.TField("creds", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final org.apache.thrift.protocol.TField TRANSACTION_FIELD_DESC = new org.apache.thrift.protocol.TField("transaction", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final org.apache.thrift.protocol.TField ENVIRONMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("environment", org.apache.thrift.protocol.TType.STRING, (short)4); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new traceRecordsTime_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new traceRecordsTime_argsTupleSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new consolidateRecords_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new consolidateRecords_argsTupleSchemeFactory(); public @org.apache.thrift.annotation.Nullable java.util.List records; // required - public long timestamp; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction; // required public @org.apache.thrift.annotation.Nullable java.lang.String environment; // required @@ -699016,10 +702853,9 @@ public static class traceRecordsTime_args implements org.apache.thrift.TBase byName = new java.util.LinkedHashMap(); @@ -699037,13 +702873,11 @@ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // RECORDS return RECORDS; - case 2: // TIMESTAMP - return TIMESTAMP; - case 3: // CREDS + case 2: // CREDS return CREDS; - case 4: // TRANSACTION + case 3: // TRANSACTION return TRANSACTION; - case 5: // ENVIRONMENT + case 4: // ENVIRONMENT return ENVIRONMENT; default: return null; @@ -699088,16 +702922,12 @@ public java.lang.String getFieldName() { } // isset id assignments - private static final int __TIMESTAMP_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.RECORDS, new org.apache.thrift.meta_data.FieldMetaData("records", 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.I64)))); - tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.CREDS, new org.apache.thrift.meta_data.FieldMetaData("creds", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.AccessToken.class))); tmpMap.put(_Fields.TRANSACTION, new org.apache.thrift.meta_data.FieldMetaData("transaction", org.apache.thrift.TFieldRequirementType.DEFAULT, @@ -699105,23 +702935,20 @@ public java.lang.String getFieldName() { tmpMap.put(_Fields.ENVIRONMENT, new org.apache.thrift.meta_data.FieldMetaData("environment", 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(traceRecordsTime_args.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(consolidateRecords_args.class, metaDataMap); } - public traceRecordsTime_args() { + public consolidateRecords_args() { } - public traceRecordsTime_args( + public consolidateRecords_args( java.util.List records, - long timestamp, com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment) { this(); this.records = records; - this.timestamp = timestamp; - setTimestampIsSet(true); this.creds = creds; this.transaction = transaction; this.environment = environment; @@ -699130,13 +702957,11 @@ public traceRecordsTime_args( /** * Performs a deep copy on other. */ - public traceRecordsTime_args(traceRecordsTime_args other) { - __isset_bitfield = other.__isset_bitfield; + public consolidateRecords_args(consolidateRecords_args other) { if (other.isSetRecords()) { java.util.List __this__records = new java.util.ArrayList(other.records); this.records = __this__records; } - this.timestamp = other.timestamp; if (other.isSetCreds()) { this.creds = new com.cinchapi.concourse.thrift.AccessToken(other.creds); } @@ -699149,15 +702974,13 @@ public traceRecordsTime_args(traceRecordsTime_args other) { } @Override - public traceRecordsTime_args deepCopy() { - return new traceRecordsTime_args(this); + public consolidateRecords_args deepCopy() { + return new consolidateRecords_args(this); } @Override public void clear() { this.records = null; - setTimestampIsSet(false); - this.timestamp = 0; this.creds = null; this.transaction = null; this.environment = null; @@ -699184,7 +703007,7 @@ public java.util.List getRecords() { return this.records; } - public traceRecordsTime_args setRecords(@org.apache.thrift.annotation.Nullable java.util.List records) { + public consolidateRecords_args setRecords(@org.apache.thrift.annotation.Nullable java.util.List records) { this.records = records; return this; } @@ -699204,35 +703027,12 @@ public void setRecordsIsSet(boolean value) { } } - public long getTimestamp() { - return this.timestamp; - } - - public traceRecordsTime_args setTimestamp(long timestamp) { - this.timestamp = timestamp; - setTimestampIsSet(true); - return this; - } - - public void unsetTimestamp() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); - } - - /** Returns true if field timestamp is set (has been assigned a value) and false otherwise */ - public boolean isSetTimestamp() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); - } - - public void setTimestampIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TIMESTAMP_ISSET_ID, value); - } - @org.apache.thrift.annotation.Nullable public com.cinchapi.concourse.thrift.AccessToken getCreds() { return this.creds; } - public traceRecordsTime_args setCreds(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds) { + public consolidateRecords_args setCreds(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds) { this.creds = creds; return this; } @@ -699257,7 +703057,7 @@ public com.cinchapi.concourse.thrift.TransactionToken getTransaction() { return this.transaction; } - public traceRecordsTime_args setTransaction(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction) { + public consolidateRecords_args setTransaction(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction) { this.transaction = transaction; return this; } @@ -699282,7 +703082,7 @@ public java.lang.String getEnvironment() { return this.environment; } - public traceRecordsTime_args setEnvironment(@org.apache.thrift.annotation.Nullable java.lang.String environment) { + public consolidateRecords_args setEnvironment(@org.apache.thrift.annotation.Nullable java.lang.String environment) { this.environment = environment; return this; } @@ -699313,14 +703113,6 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } break; - case TIMESTAMP: - if (value == null) { - unsetTimestamp(); - } else { - setTimestamp((java.lang.Long)value); - } - break; - case CREDS: if (value == null) { unsetCreds(); @@ -699355,9 +703147,6 @@ public java.lang.Object getFieldValue(_Fields field) { case RECORDS: return getRecords(); - case TIMESTAMP: - return getTimestamp(); - case CREDS: return getCreds(); @@ -699381,8 +703170,6 @@ public boolean isSet(_Fields field) { switch (field) { case RECORDS: return isSetRecords(); - case TIMESTAMP: - return isSetTimestamp(); case CREDS: return isSetCreds(); case TRANSACTION: @@ -699395,12 +703182,12 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that instanceof traceRecordsTime_args) - return this.equals((traceRecordsTime_args)that); + if (that instanceof consolidateRecords_args) + return this.equals((consolidateRecords_args)that); return false; } - public boolean equals(traceRecordsTime_args that) { + public boolean equals(consolidateRecords_args that) { if (that == null) return false; if (this == that) @@ -699415,15 +703202,6 @@ public boolean equals(traceRecordsTime_args that) { return false; } - boolean this_present_timestamp = true; - boolean that_present_timestamp = true; - if (this_present_timestamp || that_present_timestamp) { - if (!(this_present_timestamp && that_present_timestamp)) - return false; - if (this.timestamp != that.timestamp) - return false; - } - boolean this_present_creds = true && this.isSetCreds(); boolean that_present_creds = true && that.isSetCreds(); if (this_present_creds || that_present_creds) { @@ -699462,8 +703240,6 @@ public int hashCode() { if (isSetRecords()) hashCode = hashCode * 8191 + records.hashCode(); - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(timestamp); - hashCode = hashCode * 8191 + ((isSetCreds()) ? 131071 : 524287); if (isSetCreds()) hashCode = hashCode * 8191 + creds.hashCode(); @@ -699480,7 +703256,7 @@ public int hashCode() { } @Override - public int compareTo(traceRecordsTime_args other) { + public int compareTo(consolidateRecords_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -699497,16 +703273,6 @@ public int compareTo(traceRecordsTime_args other) { return lastComparison; } } - lastComparison = java.lang.Boolean.compare(isSetTimestamp(), other.isSetTimestamp()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTimestamp()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, other.timestamp); - if (lastComparison != 0) { - return lastComparison; - } - } lastComparison = java.lang.Boolean.compare(isSetCreds(), other.isSetCreds()); if (lastComparison != 0) { return lastComparison; @@ -699558,7 +703324,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("traceRecordsTime_args("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("consolidateRecords_args("); boolean first = true; sb.append("records:"); @@ -699569,10 +703335,6 @@ public java.lang.String toString() { } first = false; if (!first) sb.append(", "); - sb.append("timestamp:"); - sb.append(this.timestamp); - first = false; - if (!first) sb.append(", "); sb.append("creds:"); if (this.creds == null) { sb.append("null"); @@ -699621,25 +703383,23 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept 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 traceRecordsTime_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class consolidateRecords_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public traceRecordsTime_argsStandardScheme getScheme() { - return new traceRecordsTime_argsStandardScheme(); + public consolidateRecords_argsStandardScheme getScheme() { + return new consolidateRecords_argsStandardScheme(); } } - private static class traceRecordsTime_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class consolidateRecords_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordsTime_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, consolidateRecords_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -699652,13 +703412,13 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordsTime_ar case 1: // RECORDS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list7130 = iprot.readListBegin(); - struct.records = new java.util.ArrayList(_list7130.size); - long _elem7131; - for (int _i7132 = 0; _i7132 < _list7130.size; ++_i7132) + org.apache.thrift.protocol.TList _list7202 = iprot.readListBegin(); + struct.records = new java.util.ArrayList(_list7202.size); + long _elem7203; + for (int _i7204 = 0; _i7204 < _list7202.size; ++_i7204) { - _elem7131 = iprot.readI64(); - struct.records.add(_elem7131); + _elem7203 = iprot.readI64(); + struct.records.add(_elem7203); } iprot.readListEnd(); } @@ -699667,15 +703427,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordsTime_ar org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 2: // TIMESTAMP - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.timestamp = iprot.readI64(); - struct.setTimestampIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // CREDS + case 2: // CREDS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); struct.creds.read(iprot); @@ -699684,7 +703436,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordsTime_ar org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 4: // TRANSACTION + case 3: // TRANSACTION if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.transaction = new com.cinchapi.concourse.thrift.TransactionToken(); struct.transaction.read(iprot); @@ -699693,7 +703445,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordsTime_ar org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 5: // ENVIRONMENT + case 4: // ENVIRONMENT if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.environment = iprot.readString(); struct.setEnvironmentIsSet(true); @@ -699713,7 +703465,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordsTime_ar } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecordsTime_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, consolidateRecords_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); @@ -699721,17 +703473,14 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecordsTime_a oprot.writeFieldBegin(RECORDS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, struct.records.size())); - for (long _iter7133 : struct.records) + for (long _iter7205 : struct.records) { - oprot.writeI64(_iter7133); + oprot.writeI64(_iter7205); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } - oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC); - oprot.writeI64(struct.timestamp); - oprot.writeFieldEnd(); if (struct.creds != null) { oprot.writeFieldBegin(CREDS_FIELD_DESC); struct.creds.write(oprot); @@ -699753,47 +703502,41 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecordsTime_a } - private static class traceRecordsTime_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class consolidateRecords_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public traceRecordsTime_argsTupleScheme getScheme() { - return new traceRecordsTime_argsTupleScheme(); + public consolidateRecords_argsTupleScheme getScheme() { + return new consolidateRecords_argsTupleScheme(); } } - private static class traceRecordsTime_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class consolidateRecords_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordsTime_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, consolidateRecords_args 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.isSetRecords()) { optionals.set(0); } - if (struct.isSetTimestamp()) { - optionals.set(1); - } if (struct.isSetCreds()) { - optionals.set(2); + optionals.set(1); } if (struct.isSetTransaction()) { - optionals.set(3); + optionals.set(2); } if (struct.isSetEnvironment()) { - optionals.set(4); + optionals.set(3); } - oprot.writeBitSet(optionals, 5); + oprot.writeBitSet(optionals, 4); if (struct.isSetRecords()) { { oprot.writeI32(struct.records.size()); - for (long _iter7134 : struct.records) + for (long _iter7206 : struct.records) { - oprot.writeI64(_iter7134); + oprot.writeI64(_iter7206); } } } - if (struct.isSetTimestamp()) { - oprot.writeI64(struct.timestamp); - } if (struct.isSetCreds()) { struct.creds.write(oprot); } @@ -699806,37 +703549,33 @@ public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordsTime_ar } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, traceRecordsTime_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, consolidateRecords_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(5); + java.util.BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { { - org.apache.thrift.protocol.TList _list7135 = iprot.readListBegin(org.apache.thrift.protocol.TType.I64); - struct.records = new java.util.ArrayList(_list7135.size); - long _elem7136; - for (int _i7137 = 0; _i7137 < _list7135.size; ++_i7137) + org.apache.thrift.protocol.TList _list7207 = iprot.readListBegin(org.apache.thrift.protocol.TType.I64); + struct.records = new java.util.ArrayList(_list7207.size); + long _elem7208; + for (int _i7209 = 0; _i7209 < _list7207.size; ++_i7209) { - _elem7136 = iprot.readI64(); - struct.records.add(_elem7136); + _elem7208 = iprot.readI64(); + struct.records.add(_elem7208); } } struct.setRecordsIsSet(true); } if (incoming.get(1)) { - struct.timestamp = iprot.readI64(); - struct.setTimestampIsSet(true); - } - if (incoming.get(2)) { struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); struct.creds.read(iprot); struct.setCredsIsSet(true); } - if (incoming.get(3)) { + if (incoming.get(2)) { struct.transaction = new com.cinchapi.concourse.thrift.TransactionToken(); struct.transaction.read(iprot); struct.setTransactionIsSet(true); } - if (incoming.get(4)) { + if (incoming.get(3)) { struct.environment = iprot.readString(); struct.setEnvironmentIsSet(true); } @@ -699848,18 +703587,18 @@ private static S scheme(org.apache. } } - public static class traceRecordsTime_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("traceRecordsTime_result"); + public static class consolidateRecords_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("consolidateRecords_result"); - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.MAP, (short)0); + 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.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField EX2_FIELD_DESC = new org.apache.thrift.protocol.TField("ex2", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField EX3_FIELD_DESC = new org.apache.thrift.protocol.TField("ex3", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new traceRecordsTime_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new traceRecordsTime_resultTupleSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new consolidateRecords_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new consolidateRecords_resultTupleSchemeFactory(); - public @org.apache.thrift.annotation.Nullable java.util.Map>> success; // required + public boolean success; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3; // required @@ -699936,16 +703675,13 @@ public java.lang.String getFieldName() { } // 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.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64), - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), - new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)))))); + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.EX, new org.apache.thrift.meta_data.FieldMetaData("ex", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.SecurityException.class))); tmpMap.put(_Fields.EX2, new org.apache.thrift.meta_data.FieldMetaData("ex2", org.apache.thrift.TFieldRequirementType.DEFAULT, @@ -699953,20 +703689,21 @@ public java.lang.String getFieldName() { tmpMap.put(_Fields.EX3, new org.apache.thrift.meta_data.FieldMetaData("ex3", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.PermissionException.class))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(traceRecordsTime_result.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(consolidateRecords_result.class, metaDataMap); } - public traceRecordsTime_result() { + public consolidateRecords_result() { } - public traceRecordsTime_result( - java.util.Map>> success, + public consolidateRecords_result( + boolean success, com.cinchapi.concourse.thrift.SecurityException ex, com.cinchapi.concourse.thrift.TransactionException ex2, com.cinchapi.concourse.thrift.PermissionException ex3) { this(); this.success = success; + setSuccessIsSet(true); this.ex = ex; this.ex2 = ex2; this.ex3 = ex3; @@ -699975,33 +703712,9 @@ public traceRecordsTime_result( /** * Performs a deep copy on other. */ - public traceRecordsTime_result(traceRecordsTime_result other) { - if (other.isSetSuccess()) { - java.util.Map>> __this__success = new java.util.LinkedHashMap>>(other.success.size()); - for (java.util.Map.Entry>> other_element : other.success.entrySet()) { - - java.lang.Long other_element_key = other_element.getKey(); - java.util.Map> other_element_value = other_element.getValue(); - - java.lang.Long __this__success_copy_key = other_element_key; - - java.util.Map> __this__success_copy_value = new java.util.LinkedHashMap>(other_element_value.size()); - for (java.util.Map.Entry> other_element_value_element : other_element_value.entrySet()) { - - java.lang.String other_element_value_element_key = other_element_value_element.getKey(); - java.util.Set other_element_value_element_value = other_element_value_element.getValue(); - - java.lang.String __this__success_copy_value_copy_key = other_element_value_element_key; - - java.util.Set __this__success_copy_value_copy_value = new java.util.LinkedHashSet(other_element_value_element_value); - - __this__success_copy_value.put(__this__success_copy_value_copy_key, __this__success_copy_value_copy_value); - } - - __this__success.put(__this__success_copy_key, __this__success_copy_value); - } - this.success = __this__success; - } + public consolidateRecords_result(consolidateRecords_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; if (other.isSetEx()) { this.ex = new com.cinchapi.concourse.thrift.SecurityException(other.ex); } @@ -700014,52 +703727,40 @@ public traceRecordsTime_result(traceRecordsTime_result other) { } @Override - public traceRecordsTime_result deepCopy() { - return new traceRecordsTime_result(this); + public consolidateRecords_result deepCopy() { + return new consolidateRecords_result(this); } @Override public void clear() { - this.success = null; + setSuccessIsSet(false); + this.success = false; this.ex = null; this.ex2 = null; this.ex3 = null; } - public int getSuccessSize() { - return (this.success == null) ? 0 : this.success.size(); - } - - public void putToSuccess(long key, java.util.Map> val) { - if (this.success == null) { - this.success = new java.util.LinkedHashMap>>(); - } - this.success.put(key, val); - } - - @org.apache.thrift.annotation.Nullable - public java.util.Map>> getSuccess() { + public boolean isSuccess() { return this.success; } - public traceRecordsTime_result setSuccess(@org.apache.thrift.annotation.Nullable java.util.Map>> success) { + public consolidateRecords_result setSuccess(boolean success) { this.success = success; + setSuccessIsSet(true); return this; } public void unsetSuccess() { - this.success = null; + __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 this.success != null; + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } @org.apache.thrift.annotation.Nullable @@ -700067,7 +703768,7 @@ public com.cinchapi.concourse.thrift.SecurityException getEx() { return this.ex; } - public traceRecordsTime_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { + public consolidateRecords_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { this.ex = ex; return this; } @@ -700092,7 +703793,7 @@ public com.cinchapi.concourse.thrift.TransactionException getEx2() { return this.ex2; } - public traceRecordsTime_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { + public consolidateRecords_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { this.ex2 = ex2; return this; } @@ -700117,7 +703818,7 @@ public com.cinchapi.concourse.thrift.PermissionException getEx3() { return this.ex3; } - public traceRecordsTime_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3) { + public consolidateRecords_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3) { this.ex3 = ex3; return this; } @@ -700144,7 +703845,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetSuccess(); } else { - setSuccess((java.util.Map>>)value); + setSuccess((java.lang.Boolean)value); } break; @@ -700180,7 +703881,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: - return getSuccess(); + return isSuccess(); case EX: return getEx(); @@ -700217,23 +703918,23 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that instanceof traceRecordsTime_result) - return this.equals((traceRecordsTime_result)that); + if (that instanceof consolidateRecords_result) + return this.equals((consolidateRecords_result)that); return false; } - public boolean equals(traceRecordsTime_result that) { + public boolean equals(consolidateRecords_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(); + 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.equals(that.success)) + if (this.success != that.success) return false; } @@ -700271,9 +703972,7 @@ public boolean equals(traceRecordsTime_result that) { public int hashCode() { int hashCode = 1; - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); + hashCode = hashCode * 8191 + ((success) ? 131071 : 524287); hashCode = hashCode * 8191 + ((isSetEx()) ? 131071 : 524287); if (isSetEx()) @@ -700291,7 +703990,7 @@ public int hashCode() { } @Override - public int compareTo(traceRecordsTime_result other) { + public int compareTo(consolidateRecords_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -700358,15 +704057,11 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("traceRecordsTime_result("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("consolidateRecords_result("); boolean first = true; sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } + sb.append(this.success); first = false; if (!first) sb.append(", "); sb.append("ex:"); @@ -700411,23 +704106,25 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept 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 traceRecordsTime_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class consolidateRecords_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public traceRecordsTime_resultStandardScheme getScheme() { - return new traceRecordsTime_resultStandardScheme(); + public consolidateRecords_resultStandardScheme getScheme() { + return new consolidateRecords_resultStandardScheme(); } } - private static class traceRecordsTime_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class consolidateRecords_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordsTime_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, consolidateRecords_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -700438,42 +704135,8 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordsTime_re } switch (schemeField.id) { case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map7138 = iprot.readMapBegin(); - struct.success = new java.util.LinkedHashMap>>(2*_map7138.size); - long _key7139; - @org.apache.thrift.annotation.Nullable java.util.Map> _val7140; - for (int _i7141 = 0; _i7141 < _map7138.size; ++_i7141) - { - _key7139 = iprot.readI64(); - { - org.apache.thrift.protocol.TMap _map7142 = iprot.readMapBegin(); - _val7140 = new java.util.LinkedHashMap>(2*_map7142.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key7143; - @org.apache.thrift.annotation.Nullable java.util.Set _val7144; - for (int _i7145 = 0; _i7145 < _map7142.size; ++_i7145) - { - _key7143 = iprot.readString(); - { - org.apache.thrift.protocol.TSet _set7146 = iprot.readSetBegin(); - _val7144 = new java.util.LinkedHashSet(2*_set7146.size); - long _elem7147; - for (int _i7148 = 0; _i7148 < _set7146.size; ++_i7148) - { - _elem7147 = iprot.readI64(); - _val7144.add(_elem7147); - } - iprot.readSetEnd(); - } - _val7140.put(_key7143, _val7144); - } - iprot.readMapEnd(); - } - struct.success.put(_key7139, _val7140); - } - iprot.readMapEnd(); - } + 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); @@ -700518,36 +704181,13 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordsTime_re } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecordsTime_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, consolidateRecords_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { + if (struct.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.MAP, struct.success.size())); - for (java.util.Map.Entry>> _iter7149 : struct.success.entrySet()) - { - oprot.writeI64(_iter7149.getKey()); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.SET, _iter7149.getValue().size())); - for (java.util.Map.Entry> _iter7150 : _iter7149.getValue().entrySet()) - { - oprot.writeString(_iter7150.getKey()); - { - oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I64, _iter7150.getValue().size())); - for (long _iter7151 : _iter7150.getValue()) - { - oprot.writeI64(_iter7151); - } - oprot.writeSetEnd(); - } - } - oprot.writeMapEnd(); - } - } - oprot.writeMapEnd(); - } + oprot.writeBool(struct.success); oprot.writeFieldEnd(); } if (struct.ex != null) { @@ -700571,17 +704211,17 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecordsTime_r } - private static class traceRecordsTime_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class consolidateRecords_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public traceRecordsTime_resultTupleScheme getScheme() { - return new traceRecordsTime_resultTupleScheme(); + public consolidateRecords_resultTupleScheme getScheme() { + return new consolidateRecords_resultTupleScheme(); } } - private static class traceRecordsTime_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class consolidateRecords_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordsTime_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, consolidateRecords_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()) { @@ -700598,27 +704238,7 @@ public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordsTime_re } oprot.writeBitSet(optionals, 4); if (struct.isSetSuccess()) { - { - oprot.writeI32(struct.success.size()); - for (java.util.Map.Entry>> _iter7152 : struct.success.entrySet()) - { - oprot.writeI64(_iter7152.getKey()); - { - oprot.writeI32(_iter7152.getValue().size()); - for (java.util.Map.Entry> _iter7153 : _iter7152.getValue().entrySet()) - { - oprot.writeString(_iter7153.getKey()); - { - oprot.writeI32(_iter7153.getValue().size()); - for (long _iter7154 : _iter7153.getValue()) - { - oprot.writeI64(_iter7154); - } - } - } - } - } - } + oprot.writeBool(struct.success); } if (struct.isSetEx()) { struct.ex.write(oprot); @@ -700632,42 +704252,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordsTime_re } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, traceRecordsTime_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, consolidateRecords_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(4); if (incoming.get(0)) { - { - org.apache.thrift.protocol.TMap _map7155 = iprot.readMapBegin(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.MAP); - struct.success = new java.util.LinkedHashMap>>(2*_map7155.size); - long _key7156; - @org.apache.thrift.annotation.Nullable java.util.Map> _val7157; - for (int _i7158 = 0; _i7158 < _map7155.size; ++_i7158) - { - _key7156 = iprot.readI64(); - { - org.apache.thrift.protocol.TMap _map7159 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.SET); - _val7157 = new java.util.LinkedHashMap>(2*_map7159.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key7160; - @org.apache.thrift.annotation.Nullable java.util.Set _val7161; - for (int _i7162 = 0; _i7162 < _map7159.size; ++_i7162) - { - _key7160 = iprot.readString(); - { - org.apache.thrift.protocol.TSet _set7163 = iprot.readSetBegin(org.apache.thrift.protocol.TType.I64); - _val7161 = new java.util.LinkedHashSet(2*_set7163.size); - long _elem7164; - for (int _i7165 = 0; _i7165 < _set7163.size; ++_i7165) - { - _elem7164 = iprot.readI64(); - _val7161.add(_elem7164); - } - } - _val7157.put(_key7160, _val7161); - } - } - struct.success.put(_key7156, _val7157); - } - } + struct.success = iprot.readBool(); struct.setSuccessIsSet(true); } if (incoming.get(1)) { @@ -700693,31 +704282,28 @@ private static S scheme(org.apache. } } - public static class traceRecordsTimestr_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("traceRecordsTimestr_args"); + public static class exec_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("exec_args"); - private static final org.apache.thrift.protocol.TField RECORDS_FIELD_DESC = new org.apache.thrift.protocol.TField("records", org.apache.thrift.protocol.TType.LIST, (short)1); - private static final org.apache.thrift.protocol.TField TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("timestamp", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField CREDS_FIELD_DESC = new org.apache.thrift.protocol.TField("creds", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.protocol.TField TRANSACTION_FIELD_DESC = new org.apache.thrift.protocol.TField("transaction", org.apache.thrift.protocol.TType.STRUCT, (short)4); - private static final org.apache.thrift.protocol.TField ENVIRONMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("environment", org.apache.thrift.protocol.TType.STRING, (short)5); + private static final org.apache.thrift.protocol.TField COMMANDS_FIELD_DESC = new org.apache.thrift.protocol.TField("commands", org.apache.thrift.protocol.TType.LIST, (short)1); + private static final org.apache.thrift.protocol.TField CREDS_FIELD_DESC = new org.apache.thrift.protocol.TField("creds", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final org.apache.thrift.protocol.TField TRANSACTION_FIELD_DESC = new org.apache.thrift.protocol.TField("transaction", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final org.apache.thrift.protocol.TField ENVIRONMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("environment", org.apache.thrift.protocol.TType.STRING, (short)4); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new traceRecordsTimestr_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new traceRecordsTimestr_argsTupleSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new exec_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new exec_argsTupleSchemeFactory(); - public @org.apache.thrift.annotation.Nullable java.util.List records; // required - public @org.apache.thrift.annotation.Nullable java.lang.String timestamp; // required + public @org.apache.thrift.annotation.Nullable java.util.List commands; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction; // required public @org.apache.thrift.annotation.Nullable java.lang.String environment; // 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 { - RECORDS((short)1, "records"), - TIMESTAMP((short)2, "timestamp"), - CREDS((short)3, "creds"), - TRANSACTION((short)4, "transaction"), - ENVIRONMENT((short)5, "environment"); + COMMANDS((short)1, "commands"), + CREDS((short)2, "creds"), + TRANSACTION((short)3, "transaction"), + ENVIRONMENT((short)4, "environment"); private static final java.util.Map byName = new java.util.LinkedHashMap(); @@ -700733,15 +704319,13 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { - case 1: // RECORDS - return RECORDS; - case 2: // TIMESTAMP - return TIMESTAMP; - case 3: // CREDS + case 1: // COMMANDS + return COMMANDS; + case 2: // CREDS return CREDS; - case 4: // TRANSACTION + case 3: // TRANSACTION return TRANSACTION; - case 5: // ENVIRONMENT + case 4: // ENVIRONMENT return ENVIRONMENT; default: return null; @@ -700789,11 +704373,9 @@ public java.lang.String getFieldName() { 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.RECORDS, new org.apache.thrift.meta_data.FieldMetaData("records", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.COMMANDS, new org.apache.thrift.meta_data.FieldMetaData("commands", 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.I64)))); - tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.TCommand.class)))); tmpMap.put(_Fields.CREDS, new org.apache.thrift.meta_data.FieldMetaData("creds", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.AccessToken.class))); tmpMap.put(_Fields.TRANSACTION, new org.apache.thrift.meta_data.FieldMetaData("transaction", org.apache.thrift.TFieldRequirementType.DEFAULT, @@ -700801,22 +704383,20 @@ public java.lang.String getFieldName() { tmpMap.put(_Fields.ENVIRONMENT, new org.apache.thrift.meta_data.FieldMetaData("environment", 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(traceRecordsTimestr_args.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(exec_args.class, metaDataMap); } - public traceRecordsTimestr_args() { + public exec_args() { } - public traceRecordsTimestr_args( - java.util.List records, - java.lang.String timestamp, + public exec_args( + java.util.List commands, com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment) { this(); - this.records = records; - this.timestamp = timestamp; + this.commands = commands; this.creds = creds; this.transaction = transaction; this.environment = environment; @@ -700825,13 +704405,13 @@ public traceRecordsTimestr_args( /** * Performs a deep copy on other. */ - public traceRecordsTimestr_args(traceRecordsTimestr_args other) { - if (other.isSetRecords()) { - java.util.List __this__records = new java.util.ArrayList(other.records); - this.records = __this__records; - } - if (other.isSetTimestamp()) { - this.timestamp = other.timestamp; + public exec_args(exec_args other) { + if (other.isSetCommands()) { + java.util.List __this__commands = new java.util.ArrayList(other.commands.size()); + for (com.cinchapi.concourse.thrift.TCommand other_element : other.commands) { + __this__commands.add(new com.cinchapi.concourse.thrift.TCommand(other_element)); + } + this.commands = __this__commands; } if (other.isSetCreds()) { this.creds = new com.cinchapi.concourse.thrift.AccessToken(other.creds); @@ -700845,82 +704425,56 @@ public traceRecordsTimestr_args(traceRecordsTimestr_args other) { } @Override - public traceRecordsTimestr_args deepCopy() { - return new traceRecordsTimestr_args(this); + public exec_args deepCopy() { + return new exec_args(this); } @Override public void clear() { - this.records = null; - this.timestamp = null; + this.commands = null; this.creds = null; this.transaction = null; this.environment = null; } - public int getRecordsSize() { - return (this.records == null) ? 0 : this.records.size(); - } - - @org.apache.thrift.annotation.Nullable - public java.util.Iterator getRecordsIterator() { - return (this.records == null) ? null : this.records.iterator(); - } - - public void addToRecords(long elem) { - if (this.records == null) { - this.records = new java.util.ArrayList(); - } - this.records.add(elem); + public int getCommandsSize() { + return (this.commands == null) ? 0 : this.commands.size(); } @org.apache.thrift.annotation.Nullable - public java.util.List getRecords() { - return this.records; - } - - public traceRecordsTimestr_args setRecords(@org.apache.thrift.annotation.Nullable java.util.List records) { - this.records = records; - return this; - } - - public void unsetRecords() { - this.records = null; - } - - /** Returns true if field records is set (has been assigned a value) and false otherwise */ - public boolean isSetRecords() { - return this.records != null; + public java.util.Iterator getCommandsIterator() { + return (this.commands == null) ? null : this.commands.iterator(); } - public void setRecordsIsSet(boolean value) { - if (!value) { - this.records = null; + public void addToCommands(com.cinchapi.concourse.thrift.TCommand elem) { + if (this.commands == null) { + this.commands = new java.util.ArrayList(); } + this.commands.add(elem); } @org.apache.thrift.annotation.Nullable - public java.lang.String getTimestamp() { - return this.timestamp; + public java.util.List getCommands() { + return this.commands; } - public traceRecordsTimestr_args setTimestamp(@org.apache.thrift.annotation.Nullable java.lang.String timestamp) { - this.timestamp = timestamp; + public exec_args setCommands(@org.apache.thrift.annotation.Nullable java.util.List commands) { + this.commands = commands; return this; } - public void unsetTimestamp() { - this.timestamp = null; + public void unsetCommands() { + this.commands = null; } - /** Returns true if field timestamp is set (has been assigned a value) and false otherwise */ - public boolean isSetTimestamp() { - return this.timestamp != null; + /** Returns true if field commands is set (has been assigned a value) and false otherwise */ + public boolean isSetCommands() { + return this.commands != null; } - public void setTimestampIsSet(boolean value) { + public void setCommandsIsSet(boolean value) { if (!value) { - this.timestamp = null; + this.commands = null; } } @@ -700929,7 +704483,7 @@ public com.cinchapi.concourse.thrift.AccessToken getCreds() { return this.creds; } - public traceRecordsTimestr_args setCreds(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds) { + public exec_args setCreds(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds) { this.creds = creds; return this; } @@ -700954,7 +704508,7 @@ public com.cinchapi.concourse.thrift.TransactionToken getTransaction() { return this.transaction; } - public traceRecordsTimestr_args setTransaction(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction) { + public exec_args setTransaction(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction) { this.transaction = transaction; return this; } @@ -700979,7 +704533,7 @@ public java.lang.String getEnvironment() { return this.environment; } - public traceRecordsTimestr_args setEnvironment(@org.apache.thrift.annotation.Nullable java.lang.String environment) { + public exec_args setEnvironment(@org.apache.thrift.annotation.Nullable java.lang.String environment) { this.environment = environment; return this; } @@ -701002,19 +704556,11 @@ public void setEnvironmentIsSet(boolean value) { @Override public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { - case RECORDS: - if (value == null) { - unsetRecords(); - } else { - setRecords((java.util.List)value); - } - break; - - case TIMESTAMP: + case COMMANDS: if (value == null) { - unsetTimestamp(); + unsetCommands(); } else { - setTimestamp((java.lang.String)value); + setCommands((java.util.List)value); } break; @@ -701049,11 +704595,8 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable @Override public java.lang.Object getFieldValue(_Fields field) { switch (field) { - case RECORDS: - return getRecords(); - - case TIMESTAMP: - return getTimestamp(); + case COMMANDS: + return getCommands(); case CREDS: return getCreds(); @@ -701076,10 +704619,8 @@ public boolean isSet(_Fields field) { } switch (field) { - case RECORDS: - return isSetRecords(); - case TIMESTAMP: - return isSetTimestamp(); + case COMMANDS: + return isSetCommands(); case CREDS: return isSetCreds(); case TRANSACTION: @@ -701092,32 +704633,23 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that instanceof traceRecordsTimestr_args) - return this.equals((traceRecordsTimestr_args)that); + if (that instanceof exec_args) + return this.equals((exec_args)that); return false; } - public boolean equals(traceRecordsTimestr_args that) { + public boolean equals(exec_args that) { if (that == null) return false; if (this == that) return true; - boolean this_present_records = true && this.isSetRecords(); - boolean that_present_records = true && that.isSetRecords(); - if (this_present_records || that_present_records) { - if (!(this_present_records && that_present_records)) - return false; - if (!this.records.equals(that.records)) - return false; - } - - boolean this_present_timestamp = true && this.isSetTimestamp(); - boolean that_present_timestamp = true && that.isSetTimestamp(); - if (this_present_timestamp || that_present_timestamp) { - if (!(this_present_timestamp && that_present_timestamp)) + boolean this_present_commands = true && this.isSetCommands(); + boolean that_present_commands = true && that.isSetCommands(); + if (this_present_commands || that_present_commands) { + if (!(this_present_commands && that_present_commands)) return false; - if (!this.timestamp.equals(that.timestamp)) + if (!this.commands.equals(that.commands)) return false; } @@ -701155,13 +704687,9 @@ public boolean equals(traceRecordsTimestr_args that) { public int hashCode() { int hashCode = 1; - hashCode = hashCode * 8191 + ((isSetRecords()) ? 131071 : 524287); - if (isSetRecords()) - hashCode = hashCode * 8191 + records.hashCode(); - - hashCode = hashCode * 8191 + ((isSetTimestamp()) ? 131071 : 524287); - if (isSetTimestamp()) - hashCode = hashCode * 8191 + timestamp.hashCode(); + hashCode = hashCode * 8191 + ((isSetCommands()) ? 131071 : 524287); + if (isSetCommands()) + hashCode = hashCode * 8191 + commands.hashCode(); hashCode = hashCode * 8191 + ((isSetCreds()) ? 131071 : 524287); if (isSetCreds()) @@ -701179,29 +704707,19 @@ public int hashCode() { } @Override - public int compareTo(traceRecordsTimestr_args other) { + public int compareTo(exec_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; - lastComparison = java.lang.Boolean.compare(isSetRecords(), other.isSetRecords()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRecords()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.records, other.records); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.compare(isSetTimestamp(), other.isSetTimestamp()); + lastComparison = java.lang.Boolean.compare(isSetCommands(), other.isSetCommands()); if (lastComparison != 0) { return lastComparison; } - if (isSetTimestamp()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, other.timestamp); + if (isSetCommands()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.commands, other.commands); if (lastComparison != 0) { return lastComparison; } @@ -701257,22 +704775,14 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("traceRecordsTimestr_args("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("exec_args("); boolean first = true; - sb.append("records:"); - if (this.records == null) { - sb.append("null"); - } else { - sb.append(this.records); - } - first = false; - if (!first) sb.append(", "); - sb.append("timestamp:"); - if (this.timestamp == null) { + sb.append("commands:"); + if (this.commands == null) { sb.append("null"); } else { - sb.append(this.timestamp); + sb.append(this.commands); } first = false; if (!first) sb.append(", "); @@ -701330,17 +704840,17 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class traceRecordsTimestr_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class exec_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public traceRecordsTimestr_argsStandardScheme getScheme() { - return new traceRecordsTimestr_argsStandardScheme(); + public exec_argsStandardScheme getScheme() { + return new exec_argsStandardScheme(); } } - private static class traceRecordsTimestr_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class exec_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordsTimestr_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, exec_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -701350,33 +704860,26 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordsTimestr break; } switch (schemeField.id) { - case 1: // RECORDS + case 1: // COMMANDS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list7166 = iprot.readListBegin(); - struct.records = new java.util.ArrayList(_list7166.size); - long _elem7167; - for (int _i7168 = 0; _i7168 < _list7166.size; ++_i7168) + org.apache.thrift.protocol.TList _list7210 = iprot.readListBegin(); + struct.commands = new java.util.ArrayList(_list7210.size); + @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TCommand _elem7211; + for (int _i7212 = 0; _i7212 < _list7210.size; ++_i7212) { - _elem7167 = iprot.readI64(); - struct.records.add(_elem7167); + _elem7211 = new com.cinchapi.concourse.thrift.TCommand(); + _elem7211.read(iprot); + struct.commands.add(_elem7211); } iprot.readListEnd(); } - struct.setRecordsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // TIMESTAMP - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.timestamp = iprot.readString(); - struct.setTimestampIsSet(true); + struct.setCommandsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 3: // CREDS + case 2: // CREDS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); struct.creds.read(iprot); @@ -701385,7 +704888,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordsTimestr org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 4: // TRANSACTION + case 3: // TRANSACTION if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.transaction = new com.cinchapi.concourse.thrift.TransactionToken(); struct.transaction.read(iprot); @@ -701394,7 +704897,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordsTimestr org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 5: // ENVIRONMENT + case 4: // ENVIRONMENT if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.environment = iprot.readString(); struct.setEnvironmentIsSet(true); @@ -701414,27 +704917,22 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordsTimestr } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecordsTimestr_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, exec_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); - if (struct.records != null) { - oprot.writeFieldBegin(RECORDS_FIELD_DESC); + if (struct.commands != null) { + oprot.writeFieldBegin(COMMANDS_FIELD_DESC); { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, struct.records.size())); - for (long _iter7169 : struct.records) + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.commands.size())); + for (com.cinchapi.concourse.thrift.TCommand _iter7213 : struct.commands) { - oprot.writeI64(_iter7169); + _iter7213.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } - if (struct.timestamp != null) { - oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC); - oprot.writeString(struct.timestamp); - oprot.writeFieldEnd(); - } if (struct.creds != null) { oprot.writeFieldBegin(CREDS_FIELD_DESC); struct.creds.write(oprot); @@ -701456,47 +704954,41 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecordsTimest } - private static class traceRecordsTimestr_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class exec_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public traceRecordsTimestr_argsTupleScheme getScheme() { - return new traceRecordsTimestr_argsTupleScheme(); + public exec_argsTupleScheme getScheme() { + return new exec_argsTupleScheme(); } } - private static class traceRecordsTimestr_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class exec_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordsTimestr_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, exec_args 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.isSetRecords()) { + if (struct.isSetCommands()) { optionals.set(0); } - if (struct.isSetTimestamp()) { - optionals.set(1); - } if (struct.isSetCreds()) { - optionals.set(2); + optionals.set(1); } if (struct.isSetTransaction()) { - optionals.set(3); + optionals.set(2); } if (struct.isSetEnvironment()) { - optionals.set(4); + optionals.set(3); } - oprot.writeBitSet(optionals, 5); - if (struct.isSetRecords()) { + oprot.writeBitSet(optionals, 4); + if (struct.isSetCommands()) { { - oprot.writeI32(struct.records.size()); - for (long _iter7170 : struct.records) + oprot.writeI32(struct.commands.size()); + for (com.cinchapi.concourse.thrift.TCommand _iter7214 : struct.commands) { - oprot.writeI64(_iter7170); + _iter7214.write(oprot); } } } - if (struct.isSetTimestamp()) { - oprot.writeString(struct.timestamp); - } if (struct.isSetCreds()) { struct.creds.write(oprot); } @@ -701509,37 +705001,34 @@ public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordsTimestr } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, traceRecordsTimestr_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, exec_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(5); + java.util.BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { { - org.apache.thrift.protocol.TList _list7171 = iprot.readListBegin(org.apache.thrift.protocol.TType.I64); - struct.records = new java.util.ArrayList(_list7171.size); - long _elem7172; - for (int _i7173 = 0; _i7173 < _list7171.size; ++_i7173) + org.apache.thrift.protocol.TList _list7215 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT); + struct.commands = new java.util.ArrayList(_list7215.size); + @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TCommand _elem7216; + for (int _i7217 = 0; _i7217 < _list7215.size; ++_i7217) { - _elem7172 = iprot.readI64(); - struct.records.add(_elem7172); + _elem7216 = new com.cinchapi.concourse.thrift.TCommand(); + _elem7216.read(iprot); + struct.commands.add(_elem7216); } } - struct.setRecordsIsSet(true); + struct.setCommandsIsSet(true); } if (incoming.get(1)) { - struct.timestamp = iprot.readString(); - struct.setTimestampIsSet(true); - } - if (incoming.get(2)) { struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); struct.creds.read(iprot); struct.setCredsIsSet(true); } - if (incoming.get(3)) { + if (incoming.get(2)) { struct.transaction = new com.cinchapi.concourse.thrift.TransactionToken(); struct.transaction.read(iprot); struct.setTransactionIsSet(true); } - if (incoming.get(4)) { + if (incoming.get(3)) { struct.environment = iprot.readString(); struct.setEnvironmentIsSet(true); } @@ -701551,28 +705040,34 @@ private static S scheme(org.apache. } } - public static class traceRecordsTimestr_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("traceRecordsTimestr_result"); + public static class exec_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("exec_result"); - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.MAP, (short)0); + 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.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField EX2_FIELD_DESC = new org.apache.thrift.protocol.TField("ex2", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField EX3_FIELD_DESC = new org.apache.thrift.protocol.TField("ex3", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final org.apache.thrift.protocol.TField EX4_FIELD_DESC = new org.apache.thrift.protocol.TField("ex4", org.apache.thrift.protocol.TType.STRUCT, (short)4); + private static final org.apache.thrift.protocol.TField EX5_FIELD_DESC = new org.apache.thrift.protocol.TField("ex5", org.apache.thrift.protocol.TType.STRUCT, (short)5); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new traceRecordsTimestr_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new traceRecordsTimestr_resultTupleSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new exec_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new exec_resultTupleSchemeFactory(); - public @org.apache.thrift.annotation.Nullable java.util.Map>> success; // required + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ComplexTObject success; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2; // required - public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3; // required + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.InvalidArgumentException ex3; // required + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex4; // required + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ParseException ex5; // 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"), EX((short)1, "ex"), EX2((short)2, "ex2"), - EX3((short)3, "ex3"); + EX3((short)3, "ex3"), + EX4((short)4, "ex4"), + EX5((short)5, "ex5"); private static final java.util.Map byName = new java.util.LinkedHashMap(); @@ -701596,6 +705091,10 @@ public static _Fields findByThriftId(int fieldId) { return EX2; case 3: // EX3 return EX3; + case 4: // EX4 + return EX4; + case 5: // EX5 + return EX5; default: return null; } @@ -701643,67 +705142,47 @@ public java.lang.String getFieldName() { 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.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64), - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), - new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)))))); + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.ComplexTObject.class))); tmpMap.put(_Fields.EX, new org.apache.thrift.meta_data.FieldMetaData("ex", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.SecurityException.class))); tmpMap.put(_Fields.EX2, new org.apache.thrift.meta_data.FieldMetaData("ex2", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.TransactionException.class))); tmpMap.put(_Fields.EX3, new org.apache.thrift.meta_data.FieldMetaData("ex3", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.InvalidArgumentException.class))); + tmpMap.put(_Fields.EX4, new org.apache.thrift.meta_data.FieldMetaData("ex4", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.PermissionException.class))); + tmpMap.put(_Fields.EX5, new org.apache.thrift.meta_data.FieldMetaData("ex5", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.ParseException.class))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(traceRecordsTimestr_result.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(exec_result.class, metaDataMap); } - public traceRecordsTimestr_result() { + public exec_result() { } - public traceRecordsTimestr_result( - java.util.Map>> success, + public exec_result( + com.cinchapi.concourse.thrift.ComplexTObject success, com.cinchapi.concourse.thrift.SecurityException ex, com.cinchapi.concourse.thrift.TransactionException ex2, - com.cinchapi.concourse.thrift.PermissionException ex3) + com.cinchapi.concourse.thrift.InvalidArgumentException ex3, + com.cinchapi.concourse.thrift.PermissionException ex4, + com.cinchapi.concourse.thrift.ParseException ex5) { this(); this.success = success; this.ex = ex; this.ex2 = ex2; this.ex3 = ex3; + this.ex4 = ex4; + this.ex5 = ex5; } /** * Performs a deep copy on other. */ - public traceRecordsTimestr_result(traceRecordsTimestr_result other) { + public exec_result(exec_result other) { if (other.isSetSuccess()) { - java.util.Map>> __this__success = new java.util.LinkedHashMap>>(other.success.size()); - for (java.util.Map.Entry>> other_element : other.success.entrySet()) { - - java.lang.Long other_element_key = other_element.getKey(); - java.util.Map> other_element_value = other_element.getValue(); - - java.lang.Long __this__success_copy_key = other_element_key; - - java.util.Map> __this__success_copy_value = new java.util.LinkedHashMap>(other_element_value.size()); - for (java.util.Map.Entry> other_element_value_element : other_element_value.entrySet()) { - - java.lang.String other_element_value_element_key = other_element_value_element.getKey(); - java.util.Set other_element_value_element_value = other_element_value_element.getValue(); - - java.lang.String __this__success_copy_value_copy_key = other_element_value_element_key; - - java.util.Set __this__success_copy_value_copy_value = new java.util.LinkedHashSet(other_element_value_element_value); - - __this__success_copy_value.put(__this__success_copy_value_copy_key, __this__success_copy_value_copy_value); - } - - __this__success.put(__this__success_copy_key, __this__success_copy_value); - } - this.success = __this__success; + this.success = new com.cinchapi.concourse.thrift.ComplexTObject(other.success); } if (other.isSetEx()) { this.ex = new com.cinchapi.concourse.thrift.SecurityException(other.ex); @@ -701712,13 +705191,19 @@ public traceRecordsTimestr_result(traceRecordsTimestr_result other) { this.ex2 = new com.cinchapi.concourse.thrift.TransactionException(other.ex2); } if (other.isSetEx3()) { - this.ex3 = new com.cinchapi.concourse.thrift.PermissionException(other.ex3); + this.ex3 = new com.cinchapi.concourse.thrift.InvalidArgumentException(other.ex3); + } + if (other.isSetEx4()) { + this.ex4 = new com.cinchapi.concourse.thrift.PermissionException(other.ex4); + } + if (other.isSetEx5()) { + this.ex5 = new com.cinchapi.concourse.thrift.ParseException(other.ex5); } } @Override - public traceRecordsTimestr_result deepCopy() { - return new traceRecordsTimestr_result(this); + public exec_result deepCopy() { + return new exec_result(this); } @Override @@ -701727,25 +705212,16 @@ public void clear() { this.ex = null; this.ex2 = null; this.ex3 = null; - } - - public int getSuccessSize() { - return (this.success == null) ? 0 : this.success.size(); - } - - public void putToSuccess(long key, java.util.Map> val) { - if (this.success == null) { - this.success = new java.util.LinkedHashMap>>(); - } - this.success.put(key, val); + this.ex4 = null; + this.ex5 = null; } @org.apache.thrift.annotation.Nullable - public java.util.Map>> getSuccess() { + public com.cinchapi.concourse.thrift.ComplexTObject getSuccess() { return this.success; } - public traceRecordsTimestr_result setSuccess(@org.apache.thrift.annotation.Nullable java.util.Map>> success) { + public exec_result setSuccess(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ComplexTObject success) { this.success = success; return this; } @@ -701770,7 +705246,7 @@ public com.cinchapi.concourse.thrift.SecurityException getEx() { return this.ex; } - public traceRecordsTimestr_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { + public exec_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { this.ex = ex; return this; } @@ -701795,7 +705271,7 @@ public com.cinchapi.concourse.thrift.TransactionException getEx2() { return this.ex2; } - public traceRecordsTimestr_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { + public exec_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { this.ex2 = ex2; return this; } @@ -701816,11 +705292,11 @@ public void setEx2IsSet(boolean value) { } @org.apache.thrift.annotation.Nullable - public com.cinchapi.concourse.thrift.PermissionException getEx3() { + public com.cinchapi.concourse.thrift.InvalidArgumentException getEx3() { return this.ex3; } - public traceRecordsTimestr_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3) { + public exec_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.InvalidArgumentException ex3) { this.ex3 = ex3; return this; } @@ -701840,6 +705316,56 @@ public void setEx3IsSet(boolean value) { } } + @org.apache.thrift.annotation.Nullable + public com.cinchapi.concourse.thrift.PermissionException getEx4() { + return this.ex4; + } + + public exec_result setEx4(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex4) { + this.ex4 = ex4; + return this; + } + + public void unsetEx4() { + this.ex4 = null; + } + + /** Returns true if field ex4 is set (has been assigned a value) and false otherwise */ + public boolean isSetEx4() { + return this.ex4 != null; + } + + public void setEx4IsSet(boolean value) { + if (!value) { + this.ex4 = null; + } + } + + @org.apache.thrift.annotation.Nullable + public com.cinchapi.concourse.thrift.ParseException getEx5() { + return this.ex5; + } + + public exec_result setEx5(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ParseException ex5) { + this.ex5 = ex5; + return this; + } + + public void unsetEx5() { + this.ex5 = null; + } + + /** Returns true if field ex5 is set (has been assigned a value) and false otherwise */ + public boolean isSetEx5() { + return this.ex5 != null; + } + + public void setEx5IsSet(boolean value) { + if (!value) { + this.ex5 = null; + } + } + @Override public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { @@ -701847,7 +705373,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetSuccess(); } else { - setSuccess((java.util.Map>>)value); + setSuccess((com.cinchapi.concourse.thrift.ComplexTObject)value); } break; @@ -701871,7 +705397,23 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetEx3(); } else { - setEx3((com.cinchapi.concourse.thrift.PermissionException)value); + setEx3((com.cinchapi.concourse.thrift.InvalidArgumentException)value); + } + break; + + case EX4: + if (value == null) { + unsetEx4(); + } else { + setEx4((com.cinchapi.concourse.thrift.PermissionException)value); + } + break; + + case EX5: + if (value == null) { + unsetEx5(); + } else { + setEx5((com.cinchapi.concourse.thrift.ParseException)value); } break; @@ -701894,6 +705436,12 @@ public java.lang.Object getFieldValue(_Fields field) { case EX3: return getEx3(); + case EX4: + return getEx4(); + + case EX5: + return getEx5(); + } throw new java.lang.IllegalStateException(); } @@ -701914,18 +705462,22 @@ public boolean isSet(_Fields field) { return isSetEx2(); case EX3: return isSetEx3(); + case EX4: + return isSetEx4(); + case EX5: + return isSetEx5(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { - if (that instanceof traceRecordsTimestr_result) - return this.equals((traceRecordsTimestr_result)that); + if (that instanceof exec_result) + return this.equals((exec_result)that); return false; } - public boolean equals(traceRecordsTimestr_result that) { + public boolean equals(exec_result that) { if (that == null) return false; if (this == that) @@ -701967,6 +705519,24 @@ public boolean equals(traceRecordsTimestr_result that) { return false; } + boolean this_present_ex4 = true && this.isSetEx4(); + boolean that_present_ex4 = true && that.isSetEx4(); + if (this_present_ex4 || that_present_ex4) { + if (!(this_present_ex4 && that_present_ex4)) + return false; + if (!this.ex4.equals(that.ex4)) + return false; + } + + boolean this_present_ex5 = true && this.isSetEx5(); + boolean that_present_ex5 = true && that.isSetEx5(); + if (this_present_ex5 || that_present_ex5) { + if (!(this_present_ex5 && that_present_ex5)) + return false; + if (!this.ex5.equals(that.ex5)) + return false; + } + return true; } @@ -701990,11 +705560,19 @@ public int hashCode() { if (isSetEx3()) hashCode = hashCode * 8191 + ex3.hashCode(); + hashCode = hashCode * 8191 + ((isSetEx4()) ? 131071 : 524287); + if (isSetEx4()) + hashCode = hashCode * 8191 + ex4.hashCode(); + + hashCode = hashCode * 8191 + ((isSetEx5()) ? 131071 : 524287); + if (isSetEx5()) + hashCode = hashCode * 8191 + ex5.hashCode(); + return hashCode; } @Override - public int compareTo(traceRecordsTimestr_result other) { + public int compareTo(exec_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -702041,6 +705619,26 @@ public int compareTo(traceRecordsTimestr_result other) { return lastComparison; } } + lastComparison = java.lang.Boolean.compare(isSetEx4(), other.isSetEx4()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEx4()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex4, other.ex4); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetEx5(), other.isSetEx5()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEx5()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex5, other.ex5); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -702061,7 +705659,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("traceRecordsTimestr_result("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("exec_result("); boolean first = true; sb.append("success:"); @@ -702095,6 +705693,22 @@ public java.lang.String toString() { sb.append(this.ex3); } first = false; + if (!first) sb.append(", "); + sb.append("ex4:"); + if (this.ex4 == null) { + sb.append("null"); + } else { + sb.append(this.ex4); + } + first = false; + if (!first) sb.append(", "); + sb.append("ex5:"); + if (this.ex5 == null) { + sb.append("null"); + } else { + sb.append(this.ex5); + } + first = false; sb.append(")"); return sb.toString(); } @@ -702102,6 +705716,9 @@ public java.lang.String 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 { @@ -702120,17 +705737,17 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class traceRecordsTimestr_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class exec_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public traceRecordsTimestr_resultStandardScheme getScheme() { - return new traceRecordsTimestr_resultStandardScheme(); + public exec_resultStandardScheme getScheme() { + return new exec_resultStandardScheme(); } } - private static class traceRecordsTimestr_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class exec_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordsTimestr_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, exec_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -702141,42 +705758,9 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordsTimestr } switch (schemeField.id) { case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map7174 = iprot.readMapBegin(); - struct.success = new java.util.LinkedHashMap>>(2*_map7174.size); - long _key7175; - @org.apache.thrift.annotation.Nullable java.util.Map> _val7176; - for (int _i7177 = 0; _i7177 < _map7174.size; ++_i7177) - { - _key7175 = iprot.readI64(); - { - org.apache.thrift.protocol.TMap _map7178 = iprot.readMapBegin(); - _val7176 = new java.util.LinkedHashMap>(2*_map7178.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key7179; - @org.apache.thrift.annotation.Nullable java.util.Set _val7180; - for (int _i7181 = 0; _i7181 < _map7178.size; ++_i7181) - { - _key7179 = iprot.readString(); - { - org.apache.thrift.protocol.TSet _set7182 = iprot.readSetBegin(); - _val7180 = new java.util.LinkedHashSet(2*_set7182.size); - long _elem7183; - for (int _i7184 = 0; _i7184 < _set7182.size; ++_i7184) - { - _elem7183 = iprot.readI64(); - _val7180.add(_elem7183); - } - iprot.readSetEnd(); - } - _val7176.put(_key7179, _val7180); - } - iprot.readMapEnd(); - } - struct.success.put(_key7175, _val7176); - } - iprot.readMapEnd(); - } + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.success = new com.cinchapi.concourse.thrift.ComplexTObject(); + struct.success.read(iprot); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); @@ -702202,13 +705786,31 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordsTimestr break; case 3: // EX3 if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.ex3 = new com.cinchapi.concourse.thrift.PermissionException(); + struct.ex3 = new com.cinchapi.concourse.thrift.InvalidArgumentException(); struct.ex3.read(iprot); struct.setEx3IsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 4: // EX4 + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ex4 = new com.cinchapi.concourse.thrift.PermissionException(); + struct.ex4.read(iprot); + struct.setEx4IsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // EX5 + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ex5 = new com.cinchapi.concourse.thrift.ParseException(); + struct.ex5.read(iprot); + struct.setEx5IsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -702221,36 +705823,13 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, traceRecordsTimestr } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecordsTimestr_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, exec_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.MAP, struct.success.size())); - for (java.util.Map.Entry>> _iter7185 : struct.success.entrySet()) - { - oprot.writeI64(_iter7185.getKey()); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.SET, _iter7185.getValue().size())); - for (java.util.Map.Entry> _iter7186 : _iter7185.getValue().entrySet()) - { - oprot.writeString(_iter7186.getKey()); - { - oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I64, _iter7186.getValue().size())); - for (long _iter7187 : _iter7186.getValue()) - { - oprot.writeI64(_iter7187); - } - oprot.writeSetEnd(); - } - } - oprot.writeMapEnd(); - } - } - oprot.writeMapEnd(); - } + struct.success.write(oprot); oprot.writeFieldEnd(); } if (struct.ex != null) { @@ -702268,23 +705847,33 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, traceRecordsTimest struct.ex3.write(oprot); oprot.writeFieldEnd(); } + if (struct.ex4 != null) { + oprot.writeFieldBegin(EX4_FIELD_DESC); + struct.ex4.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ex5 != null) { + oprot.writeFieldBegin(EX5_FIELD_DESC); + struct.ex5.write(oprot); + oprot.writeFieldEnd(); + } oprot.writeFieldStop(); oprot.writeStructEnd(); } } - private static class traceRecordsTimestr_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class exec_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public traceRecordsTimestr_resultTupleScheme getScheme() { - return new traceRecordsTimestr_resultTupleScheme(); + public exec_resultTupleScheme getScheme() { + return new exec_resultTupleScheme(); } } - private static class traceRecordsTimestr_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class exec_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordsTimestr_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, exec_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()) { @@ -702299,29 +705888,15 @@ public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordsTimestr if (struct.isSetEx3()) { optionals.set(3); } - oprot.writeBitSet(optionals, 4); + if (struct.isSetEx4()) { + optionals.set(4); + } + if (struct.isSetEx5()) { + optionals.set(5); + } + oprot.writeBitSet(optionals, 6); if (struct.isSetSuccess()) { - { - oprot.writeI32(struct.success.size()); - for (java.util.Map.Entry>> _iter7188 : struct.success.entrySet()) - { - oprot.writeI64(_iter7188.getKey()); - { - oprot.writeI32(_iter7188.getValue().size()); - for (java.util.Map.Entry> _iter7189 : _iter7188.getValue().entrySet()) - { - oprot.writeString(_iter7189.getKey()); - { - oprot.writeI32(_iter7189.getValue().size()); - for (long _iter7190 : _iter7189.getValue()) - { - oprot.writeI64(_iter7190); - } - } - } - } - } - } + struct.success.write(oprot); } if (struct.isSetEx()) { struct.ex.write(oprot); @@ -702332,45 +705907,21 @@ public void write(org.apache.thrift.protocol.TProtocol prot, traceRecordsTimestr if (struct.isSetEx3()) { struct.ex3.write(oprot); } + if (struct.isSetEx4()) { + struct.ex4.write(oprot); + } + if (struct.isSetEx5()) { + struct.ex5.write(oprot); + } } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, traceRecordsTimestr_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, exec_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(4); + java.util.BitSet incoming = iprot.readBitSet(6); if (incoming.get(0)) { - { - org.apache.thrift.protocol.TMap _map7191 = iprot.readMapBegin(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.MAP); - struct.success = new java.util.LinkedHashMap>>(2*_map7191.size); - long _key7192; - @org.apache.thrift.annotation.Nullable java.util.Map> _val7193; - for (int _i7194 = 0; _i7194 < _map7191.size; ++_i7194) - { - _key7192 = iprot.readI64(); - { - org.apache.thrift.protocol.TMap _map7195 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.SET); - _val7193 = new java.util.LinkedHashMap>(2*_map7195.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key7196; - @org.apache.thrift.annotation.Nullable java.util.Set _val7197; - for (int _i7198 = 0; _i7198 < _map7195.size; ++_i7198) - { - _key7196 = iprot.readString(); - { - org.apache.thrift.protocol.TSet _set7199 = iprot.readSetBegin(org.apache.thrift.protocol.TType.I64); - _val7197 = new java.util.LinkedHashSet(2*_set7199.size); - long _elem7200; - for (int _i7201 = 0; _i7201 < _set7199.size; ++_i7201) - { - _elem7200 = iprot.readI64(); - _val7197.add(_elem7200); - } - } - _val7193.put(_key7196, _val7197); - } - } - struct.success.put(_key7192, _val7193); - } - } + struct.success = new com.cinchapi.concourse.thrift.ComplexTObject(); + struct.success.read(iprot); struct.setSuccessIsSet(true); } if (incoming.get(1)) { @@ -702384,10 +705935,20 @@ public void read(org.apache.thrift.protocol.TProtocol prot, traceRecordsTimestr_ struct.setEx2IsSet(true); } if (incoming.get(3)) { - struct.ex3 = new com.cinchapi.concourse.thrift.PermissionException(); + struct.ex3 = new com.cinchapi.concourse.thrift.InvalidArgumentException(); struct.ex3.read(iprot); struct.setEx3IsSet(true); } + if (incoming.get(4)) { + struct.ex4 = new com.cinchapi.concourse.thrift.PermissionException(); + struct.ex4.read(iprot); + struct.setEx4IsSet(true); + } + if (incoming.get(5)) { + struct.ex5 = new com.cinchapi.concourse.thrift.ParseException(); + struct.ex5.read(iprot); + struct.setEx5IsSet(true); + } } } @@ -702396,25 +705957,25 @@ private static S scheme(org.apache. } } - public static class consolidateRecords_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("consolidateRecords_args"); + public static class submit_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("submit_args"); - private static final org.apache.thrift.protocol.TField RECORDS_FIELD_DESC = new org.apache.thrift.protocol.TField("records", org.apache.thrift.protocol.TType.LIST, (short)1); + private static final org.apache.thrift.protocol.TField COMMANDS_FIELD_DESC = new org.apache.thrift.protocol.TField("commands", org.apache.thrift.protocol.TType.LIST, (short)1); private static final org.apache.thrift.protocol.TField CREDS_FIELD_DESC = new org.apache.thrift.protocol.TField("creds", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField TRANSACTION_FIELD_DESC = new org.apache.thrift.protocol.TField("transaction", org.apache.thrift.protocol.TType.STRUCT, (short)3); private static final org.apache.thrift.protocol.TField ENVIRONMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("environment", org.apache.thrift.protocol.TType.STRING, (short)4); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new consolidateRecords_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new consolidateRecords_argsTupleSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new submit_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new submit_argsTupleSchemeFactory(); - public @org.apache.thrift.annotation.Nullable java.util.List records; // required + public @org.apache.thrift.annotation.Nullable java.util.List commands; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction; // required public @org.apache.thrift.annotation.Nullable java.lang.String environment; // 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 { - RECORDS((short)1, "records"), + COMMANDS((short)1, "commands"), CREDS((short)2, "creds"), TRANSACTION((short)3, "transaction"), ENVIRONMENT((short)4, "environment"); @@ -702433,8 +705994,8 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { - case 1: // RECORDS - return RECORDS; + case 1: // COMMANDS + return COMMANDS; case 2: // CREDS return CREDS; case 3: // TRANSACTION @@ -702487,9 +706048,9 @@ public java.lang.String getFieldName() { 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.RECORDS, new org.apache.thrift.meta_data.FieldMetaData("records", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.COMMANDS, new org.apache.thrift.meta_data.FieldMetaData("commands", 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.I64)))); + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.TCommand.class)))); tmpMap.put(_Fields.CREDS, new org.apache.thrift.meta_data.FieldMetaData("creds", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.AccessToken.class))); tmpMap.put(_Fields.TRANSACTION, new org.apache.thrift.meta_data.FieldMetaData("transaction", org.apache.thrift.TFieldRequirementType.DEFAULT, @@ -702497,20 +706058,20 @@ public java.lang.String getFieldName() { tmpMap.put(_Fields.ENVIRONMENT, new org.apache.thrift.meta_data.FieldMetaData("environment", 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(consolidateRecords_args.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(submit_args.class, metaDataMap); } - public consolidateRecords_args() { + public submit_args() { } - public consolidateRecords_args( - java.util.List records, + public submit_args( + java.util.List commands, com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment) { this(); - this.records = records; + this.commands = commands; this.creds = creds; this.transaction = transaction; this.environment = environment; @@ -702519,10 +706080,13 @@ public consolidateRecords_args( /** * Performs a deep copy on other. */ - public consolidateRecords_args(consolidateRecords_args other) { - if (other.isSetRecords()) { - java.util.List __this__records = new java.util.ArrayList(other.records); - this.records = __this__records; + public submit_args(submit_args other) { + if (other.isSetCommands()) { + java.util.List __this__commands = new java.util.ArrayList(other.commands.size()); + for (com.cinchapi.concourse.thrift.TCommand other_element : other.commands) { + __this__commands.add(new com.cinchapi.concourse.thrift.TCommand(other_element)); + } + this.commands = __this__commands; } if (other.isSetCreds()) { this.creds = new com.cinchapi.concourse.thrift.AccessToken(other.creds); @@ -702536,56 +706100,56 @@ public consolidateRecords_args(consolidateRecords_args other) { } @Override - public consolidateRecords_args deepCopy() { - return new consolidateRecords_args(this); + public submit_args deepCopy() { + return new submit_args(this); } @Override public void clear() { - this.records = null; + this.commands = null; this.creds = null; this.transaction = null; this.environment = null; } - public int getRecordsSize() { - return (this.records == null) ? 0 : this.records.size(); + public int getCommandsSize() { + return (this.commands == null) ? 0 : this.commands.size(); } @org.apache.thrift.annotation.Nullable - public java.util.Iterator getRecordsIterator() { - return (this.records == null) ? null : this.records.iterator(); + public java.util.Iterator getCommandsIterator() { + return (this.commands == null) ? null : this.commands.iterator(); } - public void addToRecords(long elem) { - if (this.records == null) { - this.records = new java.util.ArrayList(); + public void addToCommands(com.cinchapi.concourse.thrift.TCommand elem) { + if (this.commands == null) { + this.commands = new java.util.ArrayList(); } - this.records.add(elem); + this.commands.add(elem); } @org.apache.thrift.annotation.Nullable - public java.util.List getRecords() { - return this.records; + public java.util.List getCommands() { + return this.commands; } - public consolidateRecords_args setRecords(@org.apache.thrift.annotation.Nullable java.util.List records) { - this.records = records; + public submit_args setCommands(@org.apache.thrift.annotation.Nullable java.util.List commands) { + this.commands = commands; return this; } - public void unsetRecords() { - this.records = null; + public void unsetCommands() { + this.commands = null; } - /** Returns true if field records is set (has been assigned a value) and false otherwise */ - public boolean isSetRecords() { - return this.records != null; + /** Returns true if field commands is set (has been assigned a value) and false otherwise */ + public boolean isSetCommands() { + return this.commands != null; } - public void setRecordsIsSet(boolean value) { + public void setCommandsIsSet(boolean value) { if (!value) { - this.records = null; + this.commands = null; } } @@ -702594,7 +706158,7 @@ public com.cinchapi.concourse.thrift.AccessToken getCreds() { return this.creds; } - public consolidateRecords_args setCreds(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds) { + public submit_args setCreds(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds) { this.creds = creds; return this; } @@ -702619,7 +706183,7 @@ public com.cinchapi.concourse.thrift.TransactionToken getTransaction() { return this.transaction; } - public consolidateRecords_args setTransaction(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction) { + public submit_args setTransaction(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction) { this.transaction = transaction; return this; } @@ -702644,7 +706208,7 @@ public java.lang.String getEnvironment() { return this.environment; } - public consolidateRecords_args setEnvironment(@org.apache.thrift.annotation.Nullable java.lang.String environment) { + public submit_args setEnvironment(@org.apache.thrift.annotation.Nullable java.lang.String environment) { this.environment = environment; return this; } @@ -702667,11 +706231,11 @@ public void setEnvironmentIsSet(boolean value) { @Override public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { - case RECORDS: + case COMMANDS: if (value == null) { - unsetRecords(); + unsetCommands(); } else { - setRecords((java.util.List)value); + setCommands((java.util.List)value); } break; @@ -702706,8 +706270,8 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable @Override public java.lang.Object getFieldValue(_Fields field) { switch (field) { - case RECORDS: - return getRecords(); + case COMMANDS: + return getCommands(); case CREDS: return getCreds(); @@ -702730,8 +706294,8 @@ public boolean isSet(_Fields field) { } switch (field) { - case RECORDS: - return isSetRecords(); + case COMMANDS: + return isSetCommands(); case CREDS: return isSetCreds(); case TRANSACTION: @@ -702744,23 +706308,23 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that instanceof consolidateRecords_args) - return this.equals((consolidateRecords_args)that); + if (that instanceof submit_args) + return this.equals((submit_args)that); return false; } - public boolean equals(consolidateRecords_args that) { + public boolean equals(submit_args that) { if (that == null) return false; if (this == that) return true; - boolean this_present_records = true && this.isSetRecords(); - boolean that_present_records = true && that.isSetRecords(); - if (this_present_records || that_present_records) { - if (!(this_present_records && that_present_records)) + boolean this_present_commands = true && this.isSetCommands(); + boolean that_present_commands = true && that.isSetCommands(); + if (this_present_commands || that_present_commands) { + if (!(this_present_commands && that_present_commands)) return false; - if (!this.records.equals(that.records)) + if (!this.commands.equals(that.commands)) return false; } @@ -702798,9 +706362,9 @@ public boolean equals(consolidateRecords_args that) { public int hashCode() { int hashCode = 1; - hashCode = hashCode * 8191 + ((isSetRecords()) ? 131071 : 524287); - if (isSetRecords()) - hashCode = hashCode * 8191 + records.hashCode(); + hashCode = hashCode * 8191 + ((isSetCommands()) ? 131071 : 524287); + if (isSetCommands()) + hashCode = hashCode * 8191 + commands.hashCode(); hashCode = hashCode * 8191 + ((isSetCreds()) ? 131071 : 524287); if (isSetCreds()) @@ -702818,19 +706382,19 @@ public int hashCode() { } @Override - public int compareTo(consolidateRecords_args other) { + public int compareTo(submit_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; - lastComparison = java.lang.Boolean.compare(isSetRecords(), other.isSetRecords()); + lastComparison = java.lang.Boolean.compare(isSetCommands(), other.isSetCommands()); if (lastComparison != 0) { return lastComparison; } - if (isSetRecords()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.records, other.records); + if (isSetCommands()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.commands, other.commands); if (lastComparison != 0) { return lastComparison; } @@ -702886,14 +706450,14 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("consolidateRecords_args("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("submit_args("); boolean first = true; - sb.append("records:"); - if (this.records == null) { + sb.append("commands:"); + if (this.commands == null) { sb.append("null"); } else { - sb.append(this.records); + sb.append(this.commands); } first = false; if (!first) sb.append(", "); @@ -702951,17 +706515,17 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class consolidateRecords_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class submit_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public consolidateRecords_argsStandardScheme getScheme() { - return new consolidateRecords_argsStandardScheme(); + public submit_argsStandardScheme getScheme() { + return new submit_argsStandardScheme(); } } - private static class consolidateRecords_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class submit_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, consolidateRecords_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, submit_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -702971,20 +706535,21 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, consolidateRecords_ break; } switch (schemeField.id) { - case 1: // RECORDS + case 1: // COMMANDS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list7202 = iprot.readListBegin(); - struct.records = new java.util.ArrayList(_list7202.size); - long _elem7203; - for (int _i7204 = 0; _i7204 < _list7202.size; ++_i7204) + org.apache.thrift.protocol.TList _list7218 = iprot.readListBegin(); + struct.commands = new java.util.ArrayList(_list7218.size); + @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TCommand _elem7219; + for (int _i7220 = 0; _i7220 < _list7218.size; ++_i7220) { - _elem7203 = iprot.readI64(); - struct.records.add(_elem7203); + _elem7219 = new com.cinchapi.concourse.thrift.TCommand(); + _elem7219.read(iprot); + struct.commands.add(_elem7219); } iprot.readListEnd(); } - struct.setRecordsIsSet(true); + struct.setCommandsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -703027,17 +706592,17 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, consolidateRecords_ } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, consolidateRecords_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, submit_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); - if (struct.records != null) { - oprot.writeFieldBegin(RECORDS_FIELD_DESC); + if (struct.commands != null) { + oprot.writeFieldBegin(COMMANDS_FIELD_DESC); { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, struct.records.size())); - for (long _iter7205 : struct.records) + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.commands.size())); + for (com.cinchapi.concourse.thrift.TCommand _iter7221 : struct.commands) { - oprot.writeI64(_iter7205); + _iter7221.write(oprot); } oprot.writeListEnd(); } @@ -703064,20 +706629,20 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, consolidateRecords } - private static class consolidateRecords_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class submit_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public consolidateRecords_argsTupleScheme getScheme() { - return new consolidateRecords_argsTupleScheme(); + public submit_argsTupleScheme getScheme() { + return new submit_argsTupleScheme(); } } - private static class consolidateRecords_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class submit_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, consolidateRecords_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, submit_args 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.isSetRecords()) { + if (struct.isSetCommands()) { optionals.set(0); } if (struct.isSetCreds()) { @@ -703090,12 +706655,12 @@ public void write(org.apache.thrift.protocol.TProtocol prot, consolidateRecords_ optionals.set(3); } oprot.writeBitSet(optionals, 4); - if (struct.isSetRecords()) { + if (struct.isSetCommands()) { { - oprot.writeI32(struct.records.size()); - for (long _iter7206 : struct.records) + oprot.writeI32(struct.commands.size()); + for (com.cinchapi.concourse.thrift.TCommand _iter7222 : struct.commands) { - oprot.writeI64(_iter7206); + _iter7222.write(oprot); } } } @@ -703111,21 +706676,22 @@ public void write(org.apache.thrift.protocol.TProtocol prot, consolidateRecords_ } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, consolidateRecords_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, submit_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { { - org.apache.thrift.protocol.TList _list7207 = iprot.readListBegin(org.apache.thrift.protocol.TType.I64); - struct.records = new java.util.ArrayList(_list7207.size); - long _elem7208; - for (int _i7209 = 0; _i7209 < _list7207.size; ++_i7209) + org.apache.thrift.protocol.TList _list7223 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT); + struct.commands = new java.util.ArrayList(_list7223.size); + @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TCommand _elem7224; + for (int _i7225 = 0; _i7225 < _list7223.size; ++_i7225) { - _elem7208 = iprot.readI64(); - struct.records.add(_elem7208); + _elem7224 = new com.cinchapi.concourse.thrift.TCommand(); + _elem7224.read(iprot); + struct.commands.add(_elem7224); } } - struct.setRecordsIsSet(true); + struct.setCommandsIsSet(true); } if (incoming.get(1)) { struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); @@ -703149,28 +706715,34 @@ private static S scheme(org.apache. } } - public static class consolidateRecords_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("consolidateRecords_result"); + public static class submit_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("submit_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.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.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField EX2_FIELD_DESC = new org.apache.thrift.protocol.TField("ex2", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField EX3_FIELD_DESC = new org.apache.thrift.protocol.TField("ex3", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final org.apache.thrift.protocol.TField EX4_FIELD_DESC = new org.apache.thrift.protocol.TField("ex4", org.apache.thrift.protocol.TType.STRUCT, (short)4); + private static final org.apache.thrift.protocol.TField EX5_FIELD_DESC = new org.apache.thrift.protocol.TField("ex5", org.apache.thrift.protocol.TType.STRUCT, (short)5); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new consolidateRecords_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new consolidateRecords_resultTupleSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new submit_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new submit_resultTupleSchemeFactory(); - public boolean success; // required + public @org.apache.thrift.annotation.Nullable java.util.List success; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2; // required - public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3; // required + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.InvalidArgumentException ex3; // required + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex4; // required + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ParseException ex5; // 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"), EX((short)1, "ex"), EX2((short)2, "ex2"), - EX3((short)3, "ex3"); + EX3((short)3, "ex3"), + EX4((short)4, "ex4"), + EX5((short)5, "ex5"); private static final java.util.Map byName = new java.util.LinkedHashMap(); @@ -703194,6 +706766,10 @@ public static _Fields findByThriftId(int fieldId) { return EX2; case 3: // EX3 return EX3; + case 4: // EX4 + return EX4; + case 5: // EX5 + return EX5; default: return null; } @@ -703237,46 +706813,57 @@ public java.lang.String getFieldName() { } // 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))); + 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, com.cinchapi.concourse.thrift.ComplexTObject.class)))); tmpMap.put(_Fields.EX, new org.apache.thrift.meta_data.FieldMetaData("ex", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.SecurityException.class))); tmpMap.put(_Fields.EX2, new org.apache.thrift.meta_data.FieldMetaData("ex2", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.TransactionException.class))); tmpMap.put(_Fields.EX3, new org.apache.thrift.meta_data.FieldMetaData("ex3", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.InvalidArgumentException.class))); + tmpMap.put(_Fields.EX4, new org.apache.thrift.meta_data.FieldMetaData("ex4", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.PermissionException.class))); + tmpMap.put(_Fields.EX5, new org.apache.thrift.meta_data.FieldMetaData("ex5", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.ParseException.class))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(consolidateRecords_result.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(submit_result.class, metaDataMap); } - public consolidateRecords_result() { + public submit_result() { } - public consolidateRecords_result( - boolean success, + public submit_result( + java.util.List success, com.cinchapi.concourse.thrift.SecurityException ex, com.cinchapi.concourse.thrift.TransactionException ex2, - com.cinchapi.concourse.thrift.PermissionException ex3) + com.cinchapi.concourse.thrift.InvalidArgumentException ex3, + com.cinchapi.concourse.thrift.PermissionException ex4, + com.cinchapi.concourse.thrift.ParseException ex5) { this(); this.success = success; - setSuccessIsSet(true); this.ex = ex; this.ex2 = ex2; this.ex3 = ex3; + this.ex4 = ex4; + this.ex5 = ex5; } /** * Performs a deep copy on other. */ - public consolidateRecords_result(consolidateRecords_result other) { - __isset_bitfield = other.__isset_bitfield; - this.success = other.success; + public submit_result(submit_result other) { + if (other.isSetSuccess()) { + java.util.List __this__success = new java.util.ArrayList(other.success.size()); + for (com.cinchapi.concourse.thrift.ComplexTObject other_element : other.success) { + __this__success.add(new com.cinchapi.concourse.thrift.ComplexTObject(other_element)); + } + this.success = __this__success; + } if (other.isSetEx()) { this.ex = new com.cinchapi.concourse.thrift.SecurityException(other.ex); } @@ -703284,45 +706871,70 @@ public consolidateRecords_result(consolidateRecords_result other) { this.ex2 = new com.cinchapi.concourse.thrift.TransactionException(other.ex2); } if (other.isSetEx3()) { - this.ex3 = new com.cinchapi.concourse.thrift.PermissionException(other.ex3); + this.ex3 = new com.cinchapi.concourse.thrift.InvalidArgumentException(other.ex3); + } + if (other.isSetEx4()) { + this.ex4 = new com.cinchapi.concourse.thrift.PermissionException(other.ex4); + } + if (other.isSetEx5()) { + this.ex5 = new com.cinchapi.concourse.thrift.ParseException(other.ex5); } } @Override - public consolidateRecords_result deepCopy() { - return new consolidateRecords_result(this); + public submit_result deepCopy() { + return new submit_result(this); } @Override public void clear() { - setSuccessIsSet(false); - this.success = false; + this.success = null; this.ex = null; this.ex2 = null; this.ex3 = null; + this.ex4 = null; + this.ex5 = null; } - public boolean isSuccess() { + 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(com.cinchapi.concourse.thrift.ComplexTObject 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 consolidateRecords_result setSuccess(boolean success) { + public submit_result setSuccess(@org.apache.thrift.annotation.Nullable java.util.List success) { this.success = success; - setSuccessIsSet(true); return this; } public void unsetSuccess() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + this.success = null; } /** 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); + return this.success != null; } public void setSuccessIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + if (!value) { + this.success = null; + } } @org.apache.thrift.annotation.Nullable @@ -703330,7 +706942,7 @@ public com.cinchapi.concourse.thrift.SecurityException getEx() { return this.ex; } - public consolidateRecords_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { + public submit_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { this.ex = ex; return this; } @@ -703355,7 +706967,7 @@ public com.cinchapi.concourse.thrift.TransactionException getEx2() { return this.ex2; } - public consolidateRecords_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { + public submit_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { this.ex2 = ex2; return this; } @@ -703376,11 +706988,11 @@ public void setEx2IsSet(boolean value) { } @org.apache.thrift.annotation.Nullable - public com.cinchapi.concourse.thrift.PermissionException getEx3() { + public com.cinchapi.concourse.thrift.InvalidArgumentException getEx3() { return this.ex3; } - public consolidateRecords_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex3) { + public submit_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.InvalidArgumentException ex3) { this.ex3 = ex3; return this; } @@ -703400,6 +707012,56 @@ public void setEx3IsSet(boolean value) { } } + @org.apache.thrift.annotation.Nullable + public com.cinchapi.concourse.thrift.PermissionException getEx4() { + return this.ex4; + } + + public submit_result setEx4(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex4) { + this.ex4 = ex4; + return this; + } + + public void unsetEx4() { + this.ex4 = null; + } + + /** Returns true if field ex4 is set (has been assigned a value) and false otherwise */ + public boolean isSetEx4() { + return this.ex4 != null; + } + + public void setEx4IsSet(boolean value) { + if (!value) { + this.ex4 = null; + } + } + + @org.apache.thrift.annotation.Nullable + public com.cinchapi.concourse.thrift.ParseException getEx5() { + return this.ex5; + } + + public submit_result setEx5(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ParseException ex5) { + this.ex5 = ex5; + return this; + } + + public void unsetEx5() { + this.ex5 = null; + } + + /** Returns true if field ex5 is set (has been assigned a value) and false otherwise */ + public boolean isSetEx5() { + return this.ex5 != null; + } + + public void setEx5IsSet(boolean value) { + if (!value) { + this.ex5 = null; + } + } + @Override public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { @@ -703407,7 +707069,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetSuccess(); } else { - setSuccess((java.lang.Boolean)value); + setSuccess((java.util.List)value); } break; @@ -703431,7 +707093,23 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetEx3(); } else { - setEx3((com.cinchapi.concourse.thrift.PermissionException)value); + setEx3((com.cinchapi.concourse.thrift.InvalidArgumentException)value); + } + break; + + case EX4: + if (value == null) { + unsetEx4(); + } else { + setEx4((com.cinchapi.concourse.thrift.PermissionException)value); + } + break; + + case EX5: + if (value == null) { + unsetEx5(); + } else { + setEx5((com.cinchapi.concourse.thrift.ParseException)value); } break; @@ -703443,7 +707121,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: - return isSuccess(); + return getSuccess(); case EX: return getEx(); @@ -703454,6 +707132,12 @@ public java.lang.Object getFieldValue(_Fields field) { case EX3: return getEx3(); + case EX4: + return getEx4(); + + case EX5: + return getEx5(); + } throw new java.lang.IllegalStateException(); } @@ -703474,29 +707158,33 @@ public boolean isSet(_Fields field) { return isSetEx2(); case EX3: return isSetEx3(); + case EX4: + return isSetEx4(); + case EX5: + return isSetEx5(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { - if (that instanceof consolidateRecords_result) - return this.equals((consolidateRecords_result)that); + if (that instanceof submit_result) + return this.equals((submit_result)that); return false; } - public boolean equals(consolidateRecords_result that) { + public boolean equals(submit_result that) { if (that == null) return false; if (this == that) return true; - boolean this_present_success = true; - boolean that_present_success = 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 != that.success) + if (!this.success.equals(that.success)) return false; } @@ -703527,6 +707215,24 @@ public boolean equals(consolidateRecords_result that) { return false; } + boolean this_present_ex4 = true && this.isSetEx4(); + boolean that_present_ex4 = true && that.isSetEx4(); + if (this_present_ex4 || that_present_ex4) { + if (!(this_present_ex4 && that_present_ex4)) + return false; + if (!this.ex4.equals(that.ex4)) + return false; + } + + boolean this_present_ex5 = true && this.isSetEx5(); + boolean that_present_ex5 = true && that.isSetEx5(); + if (this_present_ex5 || that_present_ex5) { + if (!(this_present_ex5 && that_present_ex5)) + return false; + if (!this.ex5.equals(that.ex5)) + return false; + } + return true; } @@ -703534,7 +707240,9 @@ public boolean equals(consolidateRecords_result that) { public int hashCode() { int hashCode = 1; - hashCode = hashCode * 8191 + ((success) ? 131071 : 524287); + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); hashCode = hashCode * 8191 + ((isSetEx()) ? 131071 : 524287); if (isSetEx()) @@ -703548,11 +707256,19 @@ public int hashCode() { if (isSetEx3()) hashCode = hashCode * 8191 + ex3.hashCode(); + hashCode = hashCode * 8191 + ((isSetEx4()) ? 131071 : 524287); + if (isSetEx4()) + hashCode = hashCode * 8191 + ex4.hashCode(); + + hashCode = hashCode * 8191 + ((isSetEx5()) ? 131071 : 524287); + if (isSetEx5()) + hashCode = hashCode * 8191 + ex5.hashCode(); + return hashCode; } @Override - public int compareTo(consolidateRecords_result other) { + public int compareTo(submit_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -703599,6 +707315,26 @@ public int compareTo(consolidateRecords_result other) { return lastComparison; } } + lastComparison = java.lang.Boolean.compare(isSetEx4(), other.isSetEx4()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEx4()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex4, other.ex4); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetEx5(), other.isSetEx5()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEx5()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex5, other.ex5); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -703619,11 +707355,15 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("consolidateRecords_result("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("submit_result("); boolean first = true; sb.append("success:"); - sb.append(this.success); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } first = false; if (!first) sb.append(", "); sb.append("ex:"); @@ -703649,6 +707389,22 @@ public java.lang.String toString() { sb.append(this.ex3); } first = false; + if (!first) sb.append(", "); + sb.append("ex4:"); + if (this.ex4 == null) { + sb.append("null"); + } else { + sb.append(this.ex4); + } + first = false; + if (!first) sb.append(", "); + sb.append("ex5:"); + if (this.ex5 == null) { + sb.append("null"); + } else { + sb.append(this.ex5); + } + first = false; sb.append(")"); return sb.toString(); } @@ -703668,25 +707424,23 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept 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 consolidateRecords_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class submit_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public consolidateRecords_resultStandardScheme getScheme() { - return new consolidateRecords_resultStandardScheme(); + public submit_resultStandardScheme getScheme() { + return new submit_resultStandardScheme(); } } - private static class consolidateRecords_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class submit_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, consolidateRecords_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, submit_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -703697,8 +707451,19 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, consolidateRecords_ } switch (schemeField.id) { case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.success = iprot.readBool(); + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list7226 = iprot.readListBegin(); + struct.success = new java.util.ArrayList(_list7226.size); + @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ComplexTObject _elem7227; + for (int _i7228 = 0; _i7228 < _list7226.size; ++_i7228) + { + _elem7227 = new com.cinchapi.concourse.thrift.ComplexTObject(); + _elem7227.read(iprot); + struct.success.add(_elem7227); + } + iprot.readListEnd(); + } struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); @@ -703724,13 +707489,31 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, consolidateRecords_ break; case 3: // EX3 if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.ex3 = new com.cinchapi.concourse.thrift.PermissionException(); + struct.ex3 = new com.cinchapi.concourse.thrift.InvalidArgumentException(); struct.ex3.read(iprot); struct.setEx3IsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 4: // EX4 + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ex4 = new com.cinchapi.concourse.thrift.PermissionException(); + struct.ex4.read(iprot); + struct.setEx4IsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // EX5 + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ex5 = new com.cinchapi.concourse.thrift.ParseException(); + struct.ex5.read(iprot); + struct.setEx5IsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -703743,13 +707526,20 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, consolidateRecords_ } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, consolidateRecords_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, submit_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); - if (struct.isSetSuccess()) { + if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeBool(struct.success); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); + for (com.cinchapi.concourse.thrift.ComplexTObject _iter7229 : struct.success) + { + _iter7229.write(oprot); + } + oprot.writeListEnd(); + } oprot.writeFieldEnd(); } if (struct.ex != null) { @@ -703767,23 +707557,33 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, consolidateRecords struct.ex3.write(oprot); oprot.writeFieldEnd(); } + if (struct.ex4 != null) { + oprot.writeFieldBegin(EX4_FIELD_DESC); + struct.ex4.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ex5 != null) { + oprot.writeFieldBegin(EX5_FIELD_DESC); + struct.ex5.write(oprot); + oprot.writeFieldEnd(); + } oprot.writeFieldStop(); oprot.writeStructEnd(); } } - private static class consolidateRecords_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class submit_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public consolidateRecords_resultTupleScheme getScheme() { - return new consolidateRecords_resultTupleScheme(); + public submit_resultTupleScheme getScheme() { + return new submit_resultTupleScheme(); } } - private static class consolidateRecords_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class submit_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, consolidateRecords_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, submit_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()) { @@ -703798,9 +707598,21 @@ public void write(org.apache.thrift.protocol.TProtocol prot, consolidateRecords_ if (struct.isSetEx3()) { optionals.set(3); } - oprot.writeBitSet(optionals, 4); + if (struct.isSetEx4()) { + optionals.set(4); + } + if (struct.isSetEx5()) { + optionals.set(5); + } + oprot.writeBitSet(optionals, 6); if (struct.isSetSuccess()) { - oprot.writeBool(struct.success); + { + oprot.writeI32(struct.success.size()); + for (com.cinchapi.concourse.thrift.ComplexTObject _iter7230 : struct.success) + { + _iter7230.write(oprot); + } + } } if (struct.isSetEx()) { struct.ex.write(oprot); @@ -703811,14 +707623,30 @@ public void write(org.apache.thrift.protocol.TProtocol prot, consolidateRecords_ if (struct.isSetEx3()) { struct.ex3.write(oprot); } + if (struct.isSetEx4()) { + struct.ex4.write(oprot); + } + if (struct.isSetEx5()) { + struct.ex5.write(oprot); + } } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, consolidateRecords_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, submit_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(4); + java.util.BitSet incoming = iprot.readBitSet(6); if (incoming.get(0)) { - struct.success = iprot.readBool(); + { + org.apache.thrift.protocol.TList _list7231 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT); + struct.success = new java.util.ArrayList(_list7231.size); + @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ComplexTObject _elem7232; + for (int _i7233 = 0; _i7233 < _list7231.size; ++_i7233) + { + _elem7232 = new com.cinchapi.concourse.thrift.ComplexTObject(); + _elem7232.read(iprot); + struct.success.add(_elem7232); + } + } struct.setSuccessIsSet(true); } if (incoming.get(1)) { @@ -703832,10 +707660,20 @@ public void read(org.apache.thrift.protocol.TProtocol prot, consolidateRecords_r struct.setEx2IsSet(true); } if (incoming.get(3)) { - struct.ex3 = new com.cinchapi.concourse.thrift.PermissionException(); + struct.ex3 = new com.cinchapi.concourse.thrift.InvalidArgumentException(); struct.ex3.read(iprot); struct.setEx3IsSet(true); } + if (incoming.get(4)) { + struct.ex4 = new com.cinchapi.concourse.thrift.PermissionException(); + struct.ex4.read(iprot); + struct.setEx4IsSet(true); + } + if (incoming.get(5)) { + struct.ex5 = new com.cinchapi.concourse.thrift.ParseException(); + struct.ex5.read(iprot); + struct.setEx5IsSet(true); + } } } @@ -703844,25 +707682,25 @@ private static S scheme(org.apache. } } - public static class exec_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("exec_args"); + public static class execCcl_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("execCcl_args"); - private static final org.apache.thrift.protocol.TField COMMANDS_FIELD_DESC = new org.apache.thrift.protocol.TField("commands", org.apache.thrift.protocol.TType.LIST, (short)1); + private static final org.apache.thrift.protocol.TField CCL_FIELD_DESC = new org.apache.thrift.protocol.TField("ccl", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField CREDS_FIELD_DESC = new org.apache.thrift.protocol.TField("creds", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField TRANSACTION_FIELD_DESC = new org.apache.thrift.protocol.TField("transaction", org.apache.thrift.protocol.TType.STRUCT, (short)3); private static final org.apache.thrift.protocol.TField ENVIRONMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("environment", org.apache.thrift.protocol.TType.STRING, (short)4); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new exec_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new exec_argsTupleSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new execCcl_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new execCcl_argsTupleSchemeFactory(); - public @org.apache.thrift.annotation.Nullable java.util.List commands; // required + public @org.apache.thrift.annotation.Nullable java.lang.String ccl; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction; // required public @org.apache.thrift.annotation.Nullable java.lang.String environment; // 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 { - COMMANDS((short)1, "commands"), + CCL((short)1, "ccl"), CREDS((short)2, "creds"), TRANSACTION((short)3, "transaction"), ENVIRONMENT((short)4, "environment"); @@ -703881,8 +707719,8 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { - case 1: // COMMANDS - return COMMANDS; + case 1: // CCL + return CCL; case 2: // CREDS return CREDS; case 3: // TRANSACTION @@ -703935,9 +707773,8 @@ public java.lang.String getFieldName() { 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.COMMANDS, new org.apache.thrift.meta_data.FieldMetaData("commands", 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, com.cinchapi.concourse.thrift.TCommand.class)))); + tmpMap.put(_Fields.CCL, new org.apache.thrift.meta_data.FieldMetaData("ccl", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.CREDS, new org.apache.thrift.meta_data.FieldMetaData("creds", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.AccessToken.class))); tmpMap.put(_Fields.TRANSACTION, new org.apache.thrift.meta_data.FieldMetaData("transaction", org.apache.thrift.TFieldRequirementType.DEFAULT, @@ -703945,20 +707782,20 @@ public java.lang.String getFieldName() { tmpMap.put(_Fields.ENVIRONMENT, new org.apache.thrift.meta_data.FieldMetaData("environment", 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(exec_args.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(execCcl_args.class, metaDataMap); } - public exec_args() { + public execCcl_args() { } - public exec_args( - java.util.List commands, + public execCcl_args( + java.lang.String ccl, com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment) { this(); - this.commands = commands; + this.ccl = ccl; this.creds = creds; this.transaction = transaction; this.environment = environment; @@ -703967,13 +707804,9 @@ public exec_args( /** * Performs a deep copy on other. */ - public exec_args(exec_args other) { - if (other.isSetCommands()) { - java.util.List __this__commands = new java.util.ArrayList(other.commands.size()); - for (com.cinchapi.concourse.thrift.TCommand other_element : other.commands) { - __this__commands.add(new com.cinchapi.concourse.thrift.TCommand(other_element)); - } - this.commands = __this__commands; + public execCcl_args(execCcl_args other) { + if (other.isSetCcl()) { + this.ccl = other.ccl; } if (other.isSetCreds()) { this.creds = new com.cinchapi.concourse.thrift.AccessToken(other.creds); @@ -703987,56 +707820,40 @@ public exec_args(exec_args other) { } @Override - public exec_args deepCopy() { - return new exec_args(this); + public execCcl_args deepCopy() { + return new execCcl_args(this); } @Override public void clear() { - this.commands = null; + this.ccl = null; this.creds = null; this.transaction = null; this.environment = null; } - public int getCommandsSize() { - return (this.commands == null) ? 0 : this.commands.size(); - } - @org.apache.thrift.annotation.Nullable - public java.util.Iterator getCommandsIterator() { - return (this.commands == null) ? null : this.commands.iterator(); - } - - public void addToCommands(com.cinchapi.concourse.thrift.TCommand elem) { - if (this.commands == null) { - this.commands = new java.util.ArrayList(); - } - this.commands.add(elem); - } - - @org.apache.thrift.annotation.Nullable - public java.util.List getCommands() { - return this.commands; + public java.lang.String getCcl() { + return this.ccl; } - public exec_args setCommands(@org.apache.thrift.annotation.Nullable java.util.List commands) { - this.commands = commands; + public execCcl_args setCcl(@org.apache.thrift.annotation.Nullable java.lang.String ccl) { + this.ccl = ccl; return this; } - public void unsetCommands() { - this.commands = null; + public void unsetCcl() { + this.ccl = null; } - /** Returns true if field commands is set (has been assigned a value) and false otherwise */ - public boolean isSetCommands() { - return this.commands != null; + /** Returns true if field ccl is set (has been assigned a value) and false otherwise */ + public boolean isSetCcl() { + return this.ccl != null; } - public void setCommandsIsSet(boolean value) { + public void setCclIsSet(boolean value) { if (!value) { - this.commands = null; + this.ccl = null; } } @@ -704045,7 +707862,7 @@ public com.cinchapi.concourse.thrift.AccessToken getCreds() { return this.creds; } - public exec_args setCreds(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds) { + public execCcl_args setCreds(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds) { this.creds = creds; return this; } @@ -704070,7 +707887,7 @@ public com.cinchapi.concourse.thrift.TransactionToken getTransaction() { return this.transaction; } - public exec_args setTransaction(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction) { + public execCcl_args setTransaction(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction) { this.transaction = transaction; return this; } @@ -704095,7 +707912,7 @@ public java.lang.String getEnvironment() { return this.environment; } - public exec_args setEnvironment(@org.apache.thrift.annotation.Nullable java.lang.String environment) { + public execCcl_args setEnvironment(@org.apache.thrift.annotation.Nullable java.lang.String environment) { this.environment = environment; return this; } @@ -704118,11 +707935,11 @@ public void setEnvironmentIsSet(boolean value) { @Override public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { - case COMMANDS: + case CCL: if (value == null) { - unsetCommands(); + unsetCcl(); } else { - setCommands((java.util.List)value); + setCcl((java.lang.String)value); } break; @@ -704157,8 +707974,8 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable @Override public java.lang.Object getFieldValue(_Fields field) { switch (field) { - case COMMANDS: - return getCommands(); + case CCL: + return getCcl(); case CREDS: return getCreds(); @@ -704181,8 +707998,8 @@ public boolean isSet(_Fields field) { } switch (field) { - case COMMANDS: - return isSetCommands(); + case CCL: + return isSetCcl(); case CREDS: return isSetCreds(); case TRANSACTION: @@ -704195,23 +708012,23 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that instanceof exec_args) - return this.equals((exec_args)that); + if (that instanceof execCcl_args) + return this.equals((execCcl_args)that); return false; } - public boolean equals(exec_args that) { + public boolean equals(execCcl_args that) { if (that == null) return false; if (this == that) return true; - boolean this_present_commands = true && this.isSetCommands(); - boolean that_present_commands = true && that.isSetCommands(); - if (this_present_commands || that_present_commands) { - if (!(this_present_commands && that_present_commands)) + boolean this_present_ccl = true && this.isSetCcl(); + boolean that_present_ccl = true && that.isSetCcl(); + if (this_present_ccl || that_present_ccl) { + if (!(this_present_ccl && that_present_ccl)) return false; - if (!this.commands.equals(that.commands)) + if (!this.ccl.equals(that.ccl)) return false; } @@ -704249,9 +708066,9 @@ public boolean equals(exec_args that) { public int hashCode() { int hashCode = 1; - hashCode = hashCode * 8191 + ((isSetCommands()) ? 131071 : 524287); - if (isSetCommands()) - hashCode = hashCode * 8191 + commands.hashCode(); + hashCode = hashCode * 8191 + ((isSetCcl()) ? 131071 : 524287); + if (isSetCcl()) + hashCode = hashCode * 8191 + ccl.hashCode(); hashCode = hashCode * 8191 + ((isSetCreds()) ? 131071 : 524287); if (isSetCreds()) @@ -704269,19 +708086,19 @@ public int hashCode() { } @Override - public int compareTo(exec_args other) { + public int compareTo(execCcl_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; - lastComparison = java.lang.Boolean.compare(isSetCommands(), other.isSetCommands()); + lastComparison = java.lang.Boolean.compare(isSetCcl(), other.isSetCcl()); if (lastComparison != 0) { return lastComparison; } - if (isSetCommands()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.commands, other.commands); + if (isSetCcl()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ccl, other.ccl); if (lastComparison != 0) { return lastComparison; } @@ -704337,14 +708154,14 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("exec_args("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("execCcl_args("); boolean first = true; - sb.append("commands:"); - if (this.commands == null) { + sb.append("ccl:"); + if (this.ccl == null) { sb.append("null"); } else { - sb.append(this.commands); + sb.append(this.ccl); } first = false; if (!first) sb.append(", "); @@ -704402,17 +708219,17 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class exec_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class execCcl_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public exec_argsStandardScheme getScheme() { - return new exec_argsStandardScheme(); + public execCcl_argsStandardScheme getScheme() { + return new execCcl_argsStandardScheme(); } } - private static class exec_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class execCcl_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, exec_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, execCcl_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -704422,21 +708239,10 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, exec_args struct) t break; } switch (schemeField.id) { - case 1: // COMMANDS - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list7210 = iprot.readListBegin(); - struct.commands = new java.util.ArrayList(_list7210.size); - @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TCommand _elem7211; - for (int _i7212 = 0; _i7212 < _list7210.size; ++_i7212) - { - _elem7211 = new com.cinchapi.concourse.thrift.TCommand(); - _elem7211.read(iprot); - struct.commands.add(_elem7211); - } - iprot.readListEnd(); - } - struct.setCommandsIsSet(true); + case 1: // CCL + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.ccl = iprot.readString(); + struct.setCclIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -704479,20 +708285,13 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, exec_args struct) t } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, exec_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, execCcl_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); - if (struct.commands != null) { - oprot.writeFieldBegin(COMMANDS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.commands.size())); - for (com.cinchapi.concourse.thrift.TCommand _iter7213 : struct.commands) - { - _iter7213.write(oprot); - } - oprot.writeListEnd(); - } + if (struct.ccl != null) { + oprot.writeFieldBegin(CCL_FIELD_DESC); + oprot.writeString(struct.ccl); oprot.writeFieldEnd(); } if (struct.creds != null) { @@ -704516,20 +708315,20 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, exec_args struct) } - private static class exec_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class execCcl_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public exec_argsTupleScheme getScheme() { - return new exec_argsTupleScheme(); + public execCcl_argsTupleScheme getScheme() { + return new execCcl_argsTupleScheme(); } } - private static class exec_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class execCcl_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, exec_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, execCcl_args 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.isSetCommands()) { + if (struct.isSetCcl()) { optionals.set(0); } if (struct.isSetCreds()) { @@ -704542,14 +708341,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, exec_args struct) t optionals.set(3); } oprot.writeBitSet(optionals, 4); - if (struct.isSetCommands()) { - { - oprot.writeI32(struct.commands.size()); - for (com.cinchapi.concourse.thrift.TCommand _iter7214 : struct.commands) - { - _iter7214.write(oprot); - } - } + if (struct.isSetCcl()) { + oprot.writeString(struct.ccl); } if (struct.isSetCreds()) { struct.creds.write(oprot); @@ -704563,22 +708356,12 @@ public void write(org.apache.thrift.protocol.TProtocol prot, exec_args struct) t } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, exec_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, execCcl_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { - { - org.apache.thrift.protocol.TList _list7215 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT); - struct.commands = new java.util.ArrayList(_list7215.size); - @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TCommand _elem7216; - for (int _i7217 = 0; _i7217 < _list7215.size; ++_i7217) - { - _elem7216 = new com.cinchapi.concourse.thrift.TCommand(); - _elem7216.read(iprot); - struct.commands.add(_elem7216); - } - } - struct.setCommandsIsSet(true); + struct.ccl = iprot.readString(); + struct.setCclIsSet(true); } if (incoming.get(1)) { struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); @@ -704602,8 +708385,8 @@ private static S scheme(org.apache. } } - public static class exec_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("exec_result"); + public static class execCcl_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("execCcl_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.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1); @@ -704612,8 +708395,8 @@ public static class exec_result implements org.apache.thrift.TBaseother. */ - public exec_result(exec_result other) { + public execCcl_result(execCcl_result other) { if (other.isSetSuccess()) { this.success = new com.cinchapi.concourse.thrift.ComplexTObject(other.success); } @@ -704764,8 +708547,8 @@ public exec_result(exec_result other) { } @Override - public exec_result deepCopy() { - return new exec_result(this); + public execCcl_result deepCopy() { + return new execCcl_result(this); } @Override @@ -704783,7 +708566,7 @@ public com.cinchapi.concourse.thrift.ComplexTObject getSuccess() { return this.success; } - public exec_result setSuccess(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ComplexTObject success) { + public execCcl_result setSuccess(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ComplexTObject success) { this.success = success; return this; } @@ -704808,7 +708591,7 @@ public com.cinchapi.concourse.thrift.SecurityException getEx() { return this.ex; } - public exec_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { + public execCcl_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { this.ex = ex; return this; } @@ -704833,7 +708616,7 @@ public com.cinchapi.concourse.thrift.TransactionException getEx2() { return this.ex2; } - public exec_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { + public execCcl_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { this.ex2 = ex2; return this; } @@ -704858,7 +708641,7 @@ public com.cinchapi.concourse.thrift.InvalidArgumentException getEx3() { return this.ex3; } - public exec_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.InvalidArgumentException ex3) { + public execCcl_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.InvalidArgumentException ex3) { this.ex3 = ex3; return this; } @@ -704883,7 +708666,7 @@ public com.cinchapi.concourse.thrift.PermissionException getEx4() { return this.ex4; } - public exec_result setEx4(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex4) { + public execCcl_result setEx4(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex4) { this.ex4 = ex4; return this; } @@ -704908,7 +708691,7 @@ public com.cinchapi.concourse.thrift.ParseException getEx5() { return this.ex5; } - public exec_result setEx5(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ParseException ex5) { + public execCcl_result setEx5(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ParseException ex5) { this.ex5 = ex5; return this; } @@ -705034,12 +708817,12 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that instanceof exec_result) - return this.equals((exec_result)that); + if (that instanceof execCcl_result) + return this.equals((execCcl_result)that); return false; } - public boolean equals(exec_result that) { + public boolean equals(execCcl_result that) { if (that == null) return false; if (this == that) @@ -705134,7 +708917,7 @@ public int hashCode() { } @Override - public int compareTo(exec_result other) { + public int compareTo(execCcl_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -705221,7 +709004,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("exec_result("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("execCcl_result("); boolean first = true; sb.append("success:"); @@ -705299,17 +709082,17 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class exec_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class execCcl_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public exec_resultStandardScheme getScheme() { - return new exec_resultStandardScheme(); + public execCcl_resultStandardScheme getScheme() { + return new execCcl_resultStandardScheme(); } } - private static class exec_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class execCcl_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, exec_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, execCcl_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -705385,7 +709168,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, exec_result struct) } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, exec_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, execCcl_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); @@ -705425,17 +709208,17 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, exec_result struct } - private static class exec_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class execCcl_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public exec_resultTupleScheme getScheme() { - return new exec_resultTupleScheme(); + public execCcl_resultTupleScheme getScheme() { + return new execCcl_resultTupleScheme(); } } - private static class exec_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class execCcl_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, exec_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, execCcl_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()) { @@ -705478,7 +709261,7 @@ public void write(org.apache.thrift.protocol.TProtocol prot, exec_result struct) } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, exec_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, execCcl_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(6); if (incoming.get(0)) { @@ -705519,25 +709302,25 @@ private static S scheme(org.apache. } } - public static class submit_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("submit_args"); + public static class submitCcl_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("submitCcl_args"); - private static final org.apache.thrift.protocol.TField COMMANDS_FIELD_DESC = new org.apache.thrift.protocol.TField("commands", org.apache.thrift.protocol.TType.LIST, (short)1); + private static final org.apache.thrift.protocol.TField CCL_FIELD_DESC = new org.apache.thrift.protocol.TField("ccl", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField CREDS_FIELD_DESC = new org.apache.thrift.protocol.TField("creds", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField TRANSACTION_FIELD_DESC = new org.apache.thrift.protocol.TField("transaction", org.apache.thrift.protocol.TType.STRUCT, (short)3); private static final org.apache.thrift.protocol.TField ENVIRONMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("environment", org.apache.thrift.protocol.TType.STRING, (short)4); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new submit_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new submit_argsTupleSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new submitCcl_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new submitCcl_argsTupleSchemeFactory(); - public @org.apache.thrift.annotation.Nullable java.util.List commands; // required + public @org.apache.thrift.annotation.Nullable java.lang.String ccl; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction; // required public @org.apache.thrift.annotation.Nullable java.lang.String environment; // 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 { - COMMANDS((short)1, "commands"), + CCL((short)1, "ccl"), CREDS((short)2, "creds"), TRANSACTION((short)3, "transaction"), ENVIRONMENT((short)4, "environment"); @@ -705556,8 +709339,8 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { - case 1: // COMMANDS - return COMMANDS; + case 1: // CCL + return CCL; case 2: // CREDS return CREDS; case 3: // TRANSACTION @@ -705610,9 +709393,8 @@ public java.lang.String getFieldName() { 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.COMMANDS, new org.apache.thrift.meta_data.FieldMetaData("commands", 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, com.cinchapi.concourse.thrift.TCommand.class)))); + tmpMap.put(_Fields.CCL, new org.apache.thrift.meta_data.FieldMetaData("ccl", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.CREDS, new org.apache.thrift.meta_data.FieldMetaData("creds", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.AccessToken.class))); tmpMap.put(_Fields.TRANSACTION, new org.apache.thrift.meta_data.FieldMetaData("transaction", org.apache.thrift.TFieldRequirementType.DEFAULT, @@ -705620,20 +709402,20 @@ public java.lang.String getFieldName() { tmpMap.put(_Fields.ENVIRONMENT, new org.apache.thrift.meta_data.FieldMetaData("environment", 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(submit_args.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(submitCcl_args.class, metaDataMap); } - public submit_args() { + public submitCcl_args() { } - public submit_args( - java.util.List commands, + public submitCcl_args( + java.lang.String ccl, com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment) { this(); - this.commands = commands; + this.ccl = ccl; this.creds = creds; this.transaction = transaction; this.environment = environment; @@ -705642,13 +709424,9 @@ public submit_args( /** * Performs a deep copy on other. */ - public submit_args(submit_args other) { - if (other.isSetCommands()) { - java.util.List __this__commands = new java.util.ArrayList(other.commands.size()); - for (com.cinchapi.concourse.thrift.TCommand other_element : other.commands) { - __this__commands.add(new com.cinchapi.concourse.thrift.TCommand(other_element)); - } - this.commands = __this__commands; + public submitCcl_args(submitCcl_args other) { + if (other.isSetCcl()) { + this.ccl = other.ccl; } if (other.isSetCreds()) { this.creds = new com.cinchapi.concourse.thrift.AccessToken(other.creds); @@ -705662,56 +709440,40 @@ public submit_args(submit_args other) { } @Override - public submit_args deepCopy() { - return new submit_args(this); + public submitCcl_args deepCopy() { + return new submitCcl_args(this); } @Override public void clear() { - this.commands = null; + this.ccl = null; this.creds = null; this.transaction = null; this.environment = null; } - public int getCommandsSize() { - return (this.commands == null) ? 0 : this.commands.size(); - } - @org.apache.thrift.annotation.Nullable - public java.util.Iterator getCommandsIterator() { - return (this.commands == null) ? null : this.commands.iterator(); - } - - public void addToCommands(com.cinchapi.concourse.thrift.TCommand elem) { - if (this.commands == null) { - this.commands = new java.util.ArrayList(); - } - this.commands.add(elem); - } - - @org.apache.thrift.annotation.Nullable - public java.util.List getCommands() { - return this.commands; + public java.lang.String getCcl() { + return this.ccl; } - public submit_args setCommands(@org.apache.thrift.annotation.Nullable java.util.List commands) { - this.commands = commands; + public submitCcl_args setCcl(@org.apache.thrift.annotation.Nullable java.lang.String ccl) { + this.ccl = ccl; return this; } - public void unsetCommands() { - this.commands = null; + public void unsetCcl() { + this.ccl = null; } - /** Returns true if field commands is set (has been assigned a value) and false otherwise */ - public boolean isSetCommands() { - return this.commands != null; + /** Returns true if field ccl is set (has been assigned a value) and false otherwise */ + public boolean isSetCcl() { + return this.ccl != null; } - public void setCommandsIsSet(boolean value) { + public void setCclIsSet(boolean value) { if (!value) { - this.commands = null; + this.ccl = null; } } @@ -705720,7 +709482,7 @@ public com.cinchapi.concourse.thrift.AccessToken getCreds() { return this.creds; } - public submit_args setCreds(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds) { + public submitCcl_args setCreds(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds) { this.creds = creds; return this; } @@ -705745,7 +709507,7 @@ public com.cinchapi.concourse.thrift.TransactionToken getTransaction() { return this.transaction; } - public submit_args setTransaction(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction) { + public submitCcl_args setTransaction(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction) { this.transaction = transaction; return this; } @@ -705770,7 +709532,7 @@ public java.lang.String getEnvironment() { return this.environment; } - public submit_args setEnvironment(@org.apache.thrift.annotation.Nullable java.lang.String environment) { + public submitCcl_args setEnvironment(@org.apache.thrift.annotation.Nullable java.lang.String environment) { this.environment = environment; return this; } @@ -705793,11 +709555,11 @@ public void setEnvironmentIsSet(boolean value) { @Override public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { - case COMMANDS: + case CCL: if (value == null) { - unsetCommands(); + unsetCcl(); } else { - setCommands((java.util.List)value); + setCcl((java.lang.String)value); } break; @@ -705832,8 +709594,8 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable @Override public java.lang.Object getFieldValue(_Fields field) { switch (field) { - case COMMANDS: - return getCommands(); + case CCL: + return getCcl(); case CREDS: return getCreds(); @@ -705856,8 +709618,8 @@ public boolean isSet(_Fields field) { } switch (field) { - case COMMANDS: - return isSetCommands(); + case CCL: + return isSetCcl(); case CREDS: return isSetCreds(); case TRANSACTION: @@ -705870,23 +709632,23 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that instanceof submit_args) - return this.equals((submit_args)that); + if (that instanceof submitCcl_args) + return this.equals((submitCcl_args)that); return false; } - public boolean equals(submit_args that) { + public boolean equals(submitCcl_args that) { if (that == null) return false; if (this == that) return true; - boolean this_present_commands = true && this.isSetCommands(); - boolean that_present_commands = true && that.isSetCommands(); - if (this_present_commands || that_present_commands) { - if (!(this_present_commands && that_present_commands)) + boolean this_present_ccl = true && this.isSetCcl(); + boolean that_present_ccl = true && that.isSetCcl(); + if (this_present_ccl || that_present_ccl) { + if (!(this_present_ccl && that_present_ccl)) return false; - if (!this.commands.equals(that.commands)) + if (!this.ccl.equals(that.ccl)) return false; } @@ -705924,9 +709686,9 @@ public boolean equals(submit_args that) { public int hashCode() { int hashCode = 1; - hashCode = hashCode * 8191 + ((isSetCommands()) ? 131071 : 524287); - if (isSetCommands()) - hashCode = hashCode * 8191 + commands.hashCode(); + hashCode = hashCode * 8191 + ((isSetCcl()) ? 131071 : 524287); + if (isSetCcl()) + hashCode = hashCode * 8191 + ccl.hashCode(); hashCode = hashCode * 8191 + ((isSetCreds()) ? 131071 : 524287); if (isSetCreds()) @@ -705944,19 +709706,19 @@ public int hashCode() { } @Override - public int compareTo(submit_args other) { + public int compareTo(submitCcl_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; - lastComparison = java.lang.Boolean.compare(isSetCommands(), other.isSetCommands()); + lastComparison = java.lang.Boolean.compare(isSetCcl(), other.isSetCcl()); if (lastComparison != 0) { return lastComparison; } - if (isSetCommands()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.commands, other.commands); + if (isSetCcl()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ccl, other.ccl); if (lastComparison != 0) { return lastComparison; } @@ -706012,14 +709774,14 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("submit_args("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("submitCcl_args("); boolean first = true; - sb.append("commands:"); - if (this.commands == null) { + sb.append("ccl:"); + if (this.ccl == null) { sb.append("null"); } else { - sb.append(this.commands); + sb.append(this.ccl); } first = false; if (!first) sb.append(", "); @@ -706077,17 +709839,17 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class submit_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class submitCcl_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public submit_argsStandardScheme getScheme() { - return new submit_argsStandardScheme(); + public submitCcl_argsStandardScheme getScheme() { + return new submitCcl_argsStandardScheme(); } } - private static class submit_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class submitCcl_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, submit_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, submitCcl_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -706097,21 +709859,10 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, submit_args struct) break; } switch (schemeField.id) { - case 1: // COMMANDS - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list7218 = iprot.readListBegin(); - struct.commands = new java.util.ArrayList(_list7218.size); - @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TCommand _elem7219; - for (int _i7220 = 0; _i7220 < _list7218.size; ++_i7220) - { - _elem7219 = new com.cinchapi.concourse.thrift.TCommand(); - _elem7219.read(iprot); - struct.commands.add(_elem7219); - } - iprot.readListEnd(); - } - struct.setCommandsIsSet(true); + case 1: // CCL + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.ccl = iprot.readString(); + struct.setCclIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -706154,20 +709905,13 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, submit_args struct) } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, submit_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, submitCcl_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); - if (struct.commands != null) { - oprot.writeFieldBegin(COMMANDS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.commands.size())); - for (com.cinchapi.concourse.thrift.TCommand _iter7221 : struct.commands) - { - _iter7221.write(oprot); - } - oprot.writeListEnd(); - } + if (struct.ccl != null) { + oprot.writeFieldBegin(CCL_FIELD_DESC); + oprot.writeString(struct.ccl); oprot.writeFieldEnd(); } if (struct.creds != null) { @@ -706191,20 +709935,20 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, submit_args struct } - private static class submit_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class submitCcl_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public submit_argsTupleScheme getScheme() { - return new submit_argsTupleScheme(); + public submitCcl_argsTupleScheme getScheme() { + return new submitCcl_argsTupleScheme(); } } - private static class submit_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class submitCcl_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, submit_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, submitCcl_args 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.isSetCommands()) { + if (struct.isSetCcl()) { optionals.set(0); } if (struct.isSetCreds()) { @@ -706217,14 +709961,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, submit_args struct) optionals.set(3); } oprot.writeBitSet(optionals, 4); - if (struct.isSetCommands()) { - { - oprot.writeI32(struct.commands.size()); - for (com.cinchapi.concourse.thrift.TCommand _iter7222 : struct.commands) - { - _iter7222.write(oprot); - } - } + if (struct.isSetCcl()) { + oprot.writeString(struct.ccl); } if (struct.isSetCreds()) { struct.creds.write(oprot); @@ -706238,22 +709976,12 @@ public void write(org.apache.thrift.protocol.TProtocol prot, submit_args struct) } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, submit_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, submitCcl_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { - { - org.apache.thrift.protocol.TList _list7223 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT); - struct.commands = new java.util.ArrayList(_list7223.size); - @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TCommand _elem7224; - for (int _i7225 = 0; _i7225 < _list7223.size; ++_i7225) - { - _elem7224 = new com.cinchapi.concourse.thrift.TCommand(); - _elem7224.read(iprot); - struct.commands.add(_elem7224); - } - } - struct.setCommandsIsSet(true); + struct.ccl = iprot.readString(); + struct.setCclIsSet(true); } if (incoming.get(1)) { struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); @@ -706277,8 +710005,8 @@ private static S scheme(org.apache. } } - public static class submit_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("submit_result"); + public static class submitCcl_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("submitCcl_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.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1); @@ -706287,8 +710015,8 @@ public static class submit_result implements org.apache.thrift.TBase success; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex; // required @@ -706392,13 +710120,13 @@ public java.lang.String getFieldName() { tmpMap.put(_Fields.EX5, new org.apache.thrift.meta_data.FieldMetaData("ex5", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.ParseException.class))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(submit_result.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(submitCcl_result.class, metaDataMap); } - public submit_result() { + public submitCcl_result() { } - public submit_result( + public submitCcl_result( java.util.List success, com.cinchapi.concourse.thrift.SecurityException ex, com.cinchapi.concourse.thrift.TransactionException ex2, @@ -706418,7 +710146,7 @@ public submit_result( /** * Performs a deep copy on other. */ - public submit_result(submit_result other) { + public submitCcl_result(submitCcl_result other) { if (other.isSetSuccess()) { java.util.List __this__success = new java.util.ArrayList(other.success.size()); for (com.cinchapi.concourse.thrift.ComplexTObject other_element : other.success) { @@ -706444,8 +710172,8 @@ public submit_result(submit_result other) { } @Override - public submit_result deepCopy() { - return new submit_result(this); + public submitCcl_result deepCopy() { + return new submitCcl_result(this); } @Override @@ -706479,7 +710207,7 @@ public java.util.List getSuccess() return this.success; } - public submit_result setSuccess(@org.apache.thrift.annotation.Nullable java.util.List success) { + public submitCcl_result setSuccess(@org.apache.thrift.annotation.Nullable java.util.List success) { this.success = success; return this; } @@ -706504,7 +710232,7 @@ public com.cinchapi.concourse.thrift.SecurityException getEx() { return this.ex; } - public submit_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { + public submitCcl_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { this.ex = ex; return this; } @@ -706529,7 +710257,7 @@ public com.cinchapi.concourse.thrift.TransactionException getEx2() { return this.ex2; } - public submit_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { + public submitCcl_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionException ex2) { this.ex2 = ex2; return this; } @@ -706554,7 +710282,7 @@ public com.cinchapi.concourse.thrift.InvalidArgumentException getEx3() { return this.ex3; } - public submit_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.InvalidArgumentException ex3) { + public submitCcl_result setEx3(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.InvalidArgumentException ex3) { this.ex3 = ex3; return this; } @@ -706579,7 +710307,7 @@ public com.cinchapi.concourse.thrift.PermissionException getEx4() { return this.ex4; } - public submit_result setEx4(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex4) { + public submitCcl_result setEx4(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex4) { this.ex4 = ex4; return this; } @@ -706604,7 +710332,7 @@ public com.cinchapi.concourse.thrift.ParseException getEx5() { return this.ex5; } - public submit_result setEx5(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ParseException ex5) { + public submitCcl_result setEx5(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ParseException ex5) { this.ex5 = ex5; return this; } @@ -706730,12 +710458,12 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that instanceof submit_result) - return this.equals((submit_result)that); + if (that instanceof submitCcl_result) + return this.equals((submitCcl_result)that); return false; } - public boolean equals(submit_result that) { + public boolean equals(submitCcl_result that) { if (that == null) return false; if (this == that) @@ -706830,7 +710558,7 @@ public int hashCode() { } @Override - public int compareTo(submit_result other) { + public int compareTo(submitCcl_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -706917,7 +710645,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("submit_result("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("submitCcl_result("); boolean first = true; sb.append("success:"); @@ -706992,17 +710720,17 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class submit_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class submitCcl_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public submit_resultStandardScheme getScheme() { - return new submit_resultStandardScheme(); + public submitCcl_resultStandardScheme getScheme() { + return new submitCcl_resultStandardScheme(); } } - private static class submit_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class submitCcl_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, submit_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, submitCcl_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -707015,14 +710743,14 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, submit_result struc case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list7226 = iprot.readListBegin(); - struct.success = new java.util.ArrayList(_list7226.size); - @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ComplexTObject _elem7227; - for (int _i7228 = 0; _i7228 < _list7226.size; ++_i7228) + org.apache.thrift.protocol.TList _list7234 = iprot.readListBegin(); + struct.success = new java.util.ArrayList(_list7234.size); + @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ComplexTObject _elem7235; + for (int _i7236 = 0; _i7236 < _list7234.size; ++_i7236) { - _elem7227 = new com.cinchapi.concourse.thrift.ComplexTObject(); - _elem7227.read(iprot); - struct.success.add(_elem7227); + _elem7235 = new com.cinchapi.concourse.thrift.ComplexTObject(); + _elem7235.read(iprot); + struct.success.add(_elem7235); } iprot.readListEnd(); } @@ -707088,7 +710816,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, submit_result struc } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, submit_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, submitCcl_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); @@ -707096,9 +710824,9 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, submit_result stru oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); - for (com.cinchapi.concourse.thrift.ComplexTObject _iter7229 : struct.success) + for (com.cinchapi.concourse.thrift.ComplexTObject _iter7237 : struct.success) { - _iter7229.write(oprot); + _iter7237.write(oprot); } oprot.writeListEnd(); } @@ -707135,17 +710863,17 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, submit_result stru } - private static class submit_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class submitCcl_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public submit_resultTupleScheme getScheme() { - return new submit_resultTupleScheme(); + public submitCcl_resultTupleScheme getScheme() { + return new submitCcl_resultTupleScheme(); } } - private static class submit_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class submitCcl_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, submit_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, submitCcl_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()) { @@ -707170,9 +710898,9 @@ public void write(org.apache.thrift.protocol.TProtocol prot, submit_result struc if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); - for (com.cinchapi.concourse.thrift.ComplexTObject _iter7230 : struct.success) + for (com.cinchapi.concourse.thrift.ComplexTObject _iter7238 : struct.success) { - _iter7230.write(oprot); + _iter7238.write(oprot); } } } @@ -707194,19 +710922,19 @@ public void write(org.apache.thrift.protocol.TProtocol prot, submit_result struc } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, submit_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, submitCcl_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(6); if (incoming.get(0)) { { - org.apache.thrift.protocol.TList _list7231 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT); - struct.success = new java.util.ArrayList(_list7231.size); - @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ComplexTObject _elem7232; - for (int _i7233 = 0; _i7233 < _list7231.size; ++_i7233) + org.apache.thrift.protocol.TList _list7239 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT); + struct.success = new java.util.ArrayList(_list7239.size); + @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ComplexTObject _elem7240; + for (int _i7241 = 0; _i7241 < _list7239.size; ++_i7241) { - _elem7232 = new com.cinchapi.concourse.thrift.ComplexTObject(); - _elem7232.read(iprot); - struct.success.add(_elem7232); + _elem7240 = new com.cinchapi.concourse.thrift.ComplexTObject(); + _elem7240.read(iprot); + struct.success.add(_elem7240); } } struct.setSuccessIsSet(true); @@ -707748,14 +711476,14 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, invokeManagement_ar case 3: // PARAMS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list7234 = iprot.readListBegin(); - struct.params = new java.util.ArrayList(_list7234.size); - @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ComplexTObject _elem7235; - for (int _i7236 = 0; _i7236 < _list7234.size; ++_i7236) + org.apache.thrift.protocol.TList _list7242 = iprot.readListBegin(); + struct.params = new java.util.ArrayList(_list7242.size); + @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ComplexTObject _elem7243; + for (int _i7244 = 0; _i7244 < _list7242.size; ++_i7244) { - _elem7235 = new com.cinchapi.concourse.thrift.ComplexTObject(); - _elem7235.read(iprot); - struct.params.add(_elem7235); + _elem7243 = new com.cinchapi.concourse.thrift.ComplexTObject(); + _elem7243.read(iprot); + struct.params.add(_elem7243); } iprot.readListEnd(); } @@ -707798,9 +711526,9 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, invokeManagement_a oprot.writeFieldBegin(PARAMS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.params.size())); - for (com.cinchapi.concourse.thrift.ComplexTObject _iter7237 : struct.params) + for (com.cinchapi.concourse.thrift.ComplexTObject _iter7245 : struct.params) { - _iter7237.write(oprot); + _iter7245.write(oprot); } oprot.writeListEnd(); } @@ -707846,9 +711574,9 @@ public void write(org.apache.thrift.protocol.TProtocol prot, invokeManagement_ar if (struct.isSetParams()) { { oprot.writeI32(struct.params.size()); - for (com.cinchapi.concourse.thrift.ComplexTObject _iter7238 : struct.params) + for (com.cinchapi.concourse.thrift.ComplexTObject _iter7246 : struct.params) { - _iter7238.write(oprot); + _iter7246.write(oprot); } } } @@ -707867,14 +711595,14 @@ public void read(org.apache.thrift.protocol.TProtocol prot, invokeManagement_arg } if (incoming.get(1)) { { - org.apache.thrift.protocol.TList _list7239 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT); - struct.params = new java.util.ArrayList(_list7239.size); - @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ComplexTObject _elem7240; - for (int _i7241 = 0; _i7241 < _list7239.size; ++_i7241) + org.apache.thrift.protocol.TList _list7247 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT); + struct.params = new java.util.ArrayList(_list7247.size); + @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ComplexTObject _elem7248; + for (int _i7249 = 0; _i7249 < _list7247.size; ++_i7249) { - _elem7240 = new com.cinchapi.concourse.thrift.ComplexTObject(); - _elem7240.read(iprot); - struct.params.add(_elem7240); + _elem7248 = new com.cinchapi.concourse.thrift.ComplexTObject(); + _elem7248.read(iprot); + struct.params.add(_elem7248); } } struct.setParamsIsSet(true); diff --git a/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/CommandCompilationTest.java b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/CommandCompilationTest.java index 639d586f4..1ccc1640b 100644 --- a/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/CommandCompilationTest.java +++ b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/CommandCompilationTest.java @@ -56,7 +56,7 @@ public class CommandCompilationTest { */ @Test public void testFindCompiles() { - assertCompiles(Command.find("age > 30").ccl(), "FIND"); + assertCompiles(Command.to().find("age > 30").ccl(), "FIND"); } /** @@ -77,9 +77,8 @@ public void testFindCompiles() { */ @Test public void testFindWithTimestampCompiles() { - assertCompiles( - Command.find("age > 30").at(Timestamp.fromMicros(12345)).ccl(), - "FIND"); + assertCompiles(Command.to().find("age > 30") + .at(Timestamp.fromMicros(12345)).ccl(), "FIND"); } /** @@ -100,8 +99,9 @@ public void testFindWithTimestampCompiles() { */ @Test public void testFindWithOrderAndPageCompiles() { - assertCompiles(Command.find("age > 30").order(Order.by("name").build()) - .page(Page.sized(10)).ccl(), "FIND"); + assertCompiles(Command.to().find("age > 30") + .order(Order.by("name").build()).page(Page.sized(10)).ccl(), + "FIND"); } /** @@ -121,7 +121,7 @@ public void testFindWithOrderAndPageCompiles() { */ @Test public void testSelectAllFromRecordCompiles() { - assertCompiles(Command.selectAll().from(1).ccl(), "SELECT"); + assertCompiles(Command.to().selectAll().from(1).ccl(), "SELECT"); } /** @@ -142,7 +142,7 @@ public void testSelectAllFromRecordCompiles() { */ @Test public void testSelectFromRecordCompiles() { - assertCompiles(Command.select("name").from(1).ccl(), "SELECT"); + assertCompiles(Command.to().select("name").from(1).ccl(), "SELECT"); } /** @@ -163,7 +163,7 @@ public void testSelectFromRecordCompiles() { */ @Test public void testSelectMultipleKeysFromRecordsCompiles() { - assertCompiles(Command.select("name", "age").from(1, 2, 3).ccl(), + assertCompiles(Command.to().select("name", "age").from(1, 2, 3).ccl(), "SELECT"); } @@ -185,7 +185,8 @@ public void testSelectMultipleKeysFromRecordsCompiles() { */ @Test public void testSelectWhereCompiles() { - assertCompiles(Command.select("name").where("status = active").ccl(), + assertCompiles( + Command.to().select("name").where("status = active").ccl(), "SELECT"); } @@ -207,7 +208,7 @@ public void testSelectWhereCompiles() { */ @Test public void testGetFromRecordCompiles() { - assertCompiles(Command.get("name").from(1).ccl(), "GET"); + assertCompiles(Command.to().get("name").from(1).ccl(), "GET"); } /** @@ -229,7 +230,7 @@ public void testGetFromRecordCompiles() { */ @Test public void testGetWhereCompiles() { - assertCompiles(Command.get("name").where("status = active").ccl(), + assertCompiles(Command.to().get("name").where("status = active").ccl(), "GET"); } @@ -251,7 +252,7 @@ public void testGetWhereCompiles() { */ @Test public void testNavigateFromRecordCompiles() { - assertCompiles(Command.navigate("friends.name").from(1).ccl(), + assertCompiles(Command.to().navigate("friends.name").from(1).ccl(), "NAVIGATE"); } @@ -273,9 +274,8 @@ public void testNavigateFromRecordCompiles() { */ @Test public void testNavigateWhereCompiles() { - assertCompiles( - Command.navigate("friends.name").where("active = true").ccl(), - "NAVIGATE"); + assertCompiles(Command.to().navigate("friends.name") + .where("active = true").ccl(), "NAVIGATE"); } // ========== Write Commands ========== @@ -298,7 +298,7 @@ public void testNavigateWhereCompiles() { */ @Test public void testAddCompiles() { - assertCompiles(Command.add("name").as("jeff").ccl(), "ADD"); + assertCompiles(Command.to().add("name").as("jeff").ccl(), "ADD"); } /** @@ -319,7 +319,7 @@ public void testAddCompiles() { */ @Test public void testAddInRecordCompiles() { - assertCompiles(Command.add("name").as("jeff").in(1).ccl(), "ADD"); + assertCompiles(Command.to().add("name").as("jeff").in(1).ccl(), "ADD"); } /** @@ -340,7 +340,7 @@ public void testAddInRecordCompiles() { */ @Test public void testAddNumericValueCompiles() { - assertCompiles(Command.add("age").as(30).ccl(), "ADD"); + assertCompiles(Command.to().add("age").as(30).ccl(), "ADD"); } /** @@ -361,7 +361,7 @@ public void testAddNumericValueCompiles() { */ @Test public void testSetCompiles() { - assertCompiles(Command.set("name").as("jeff").in(1).ccl(), "SET"); + assertCompiles(Command.to().set("name").as("jeff").in(1).ccl(), "SET"); } /** @@ -382,7 +382,7 @@ public void testSetCompiles() { */ @Test public void testRemoveCompiles() { - assertCompiles(Command.remove("name").as("jeff").from(1).ccl(), + assertCompiles(Command.to().remove("name").as("jeff").from(1).ccl(), "REMOVE"); } @@ -404,7 +404,7 @@ public void testRemoveCompiles() { */ @Test public void testClearKeyFromRecordCompiles() { - assertCompiles(Command.clear("name").from(1).ccl(), "CLEAR"); + assertCompiles(Command.to().clear("name").from(1).ccl(), "CLEAR"); } /** @@ -424,7 +424,7 @@ public void testClearKeyFromRecordCompiles() { */ @Test public void testClearRecordsCompiles() { - assertCompiles(Command.clear(1).ccl(), "CLEAR"); + assertCompiles(Command.to().clear(1).ccl(), "CLEAR"); } /** @@ -445,7 +445,8 @@ public void testClearRecordsCompiles() { */ @Test public void testInsertCompiles() { - assertCompiles(Command.insert("{\"name\":\"jeff\"}").ccl(), "INSERT"); + assertCompiles(Command.to().insert("{\"name\":\"jeff\"}").ccl(), + "INSERT"); } /** @@ -466,7 +467,7 @@ public void testInsertCompiles() { */ @Test public void testInsertInRecordCompiles() { - assertCompiles(Command.insert("{\"name\":\"jeff\"}").in(1).ccl(), + assertCompiles(Command.to().insert("{\"name\":\"jeff\"}").in(1).ccl(), "INSERT"); } @@ -490,7 +491,8 @@ public void testInsertInRecordCompiles() { */ @Test public void testLinkCompiles() { - assertCompiles(Command.link("friends").from(1).to(2).ccl(), "LINK"); + assertCompiles(Command.to().link("friends").from(1).to(2).ccl(), + "LINK"); } /** @@ -511,7 +513,8 @@ public void testLinkCompiles() { */ @Test public void testUnlinkCompiles() { - assertCompiles(Command.unlink("friends").from(1).to(2).ccl(), "UNLINK"); + assertCompiles(Command.to().unlink("friends").from(1).to(2).ccl(), + "UNLINK"); } // ========== Verify Commands ========== @@ -534,7 +537,8 @@ public void testUnlinkCompiles() { */ @Test public void testVerifyCompiles() { - assertCompiles(Command.verify("name").as("jeff").in(1).ccl(), "VERIFY"); + assertCompiles(Command.to().verify("name").as("jeff").in(1).ccl(), + "VERIFY"); } /** @@ -555,7 +559,7 @@ public void testVerifyCompiles() { */ @Test public void testVerifyWithTimestampCompiles() { - assertCompiles(Command.verify("name").as("jeff").in(1) + assertCompiles(Command.to().verify("name").as("jeff").in(1) .at(Timestamp.fromMicros(12345)).ccl(), "VERIFY"); } @@ -578,7 +582,7 @@ public void testVerifyWithTimestampCompiles() { */ @Test public void testVerifyAndSwapCompiles() { - assertCompiles(Command.verifyAndSwap("name").as("jeff").in(1) + assertCompiles(Command.to().verifyAndSwap("name").as("jeff").in(1) .with("bob").ccl(), "VERIFY_AND_SWAP"); } @@ -600,7 +604,7 @@ public void testVerifyAndSwapCompiles() { */ @Test public void testVerifyOrSetCompiles() { - assertCompiles(Command.verifyOrSet("name").as("jeff").in(1).ccl(), + assertCompiles(Command.to().verifyOrSet("name").as("jeff").in(1).ccl(), "VERIFY_OR_SET"); } @@ -622,7 +626,7 @@ public void testVerifyOrSetCompiles() { */ @Test public void testFindOrAddCompiles() { - assertCompiles(Command.findOrAdd("name").as("jeff").ccl(), + assertCompiles(Command.to().findOrAdd("name").as("jeff").ccl(), "FIND_OR_ADD"); } @@ -644,7 +648,7 @@ public void testFindOrAddCompiles() { */ @Test public void testFindOrInsertCompiles() { - assertCompiles(Command.findOrInsert("name = jeff") + assertCompiles(Command.to().findOrInsert("name = jeff") .json("{\"name\":\"jeff\"}").ccl(), "FIND_OR_INSERT"); } @@ -667,7 +671,7 @@ public void testFindOrInsertCompiles() { */ @Test public void testBrowseCompiles() { - assertCompiles(Command.browse("name").ccl(), "BROWSE"); + assertCompiles(Command.to().browse("name").ccl(), "BROWSE"); } /** @@ -688,9 +692,8 @@ public void testBrowseCompiles() { */ @Test public void testBrowseWithTimestampCompiles() { - assertCompiles( - Command.browse("name").at(Timestamp.fromMicros(12345)).ccl(), - "BROWSE"); + assertCompiles(Command.to().browse("name") + .at(Timestamp.fromMicros(12345)).ccl(), "BROWSE"); } /** @@ -711,7 +714,8 @@ public void testBrowseWithTimestampCompiles() { */ @Test public void testSearchCompiles() { - assertCompiles(Command.search("name").forQuery("jeff").ccl(), "SEARCH"); + assertCompiles(Command.to().search("name").forQuery("jeff").ccl(), + "SEARCH"); } /** @@ -731,7 +735,7 @@ public void testSearchCompiles() { */ @Test public void testDescribeCompiles() { - assertCompiles(Command.describe(1).ccl(), "DESCRIBE"); + assertCompiles(Command.to().describe(1).ccl(), "DESCRIBE"); } /** @@ -751,7 +755,7 @@ public void testDescribeCompiles() { */ @Test public void testDescribeAllCompiles() { - assertCompiles(Command.describeAll().ccl(), "DESCRIBE"); + assertCompiles(Command.to().describeAll().ccl(), "DESCRIBE"); } /** @@ -771,7 +775,7 @@ public void testDescribeAllCompiles() { */ @Test public void testTraceCompiles() { - assertCompiles(Command.trace(1).ccl(), "TRACE"); + assertCompiles(Command.to().trace(1).ccl(), "TRACE"); } /** @@ -792,7 +796,7 @@ public void testTraceCompiles() { */ @Test public void testHoldsCompiles() { - assertCompiles(Command.holds(1, 2).ccl(), "HOLDS"); + assertCompiles(Command.to().holds(1, 2).ccl(), "HOLDS"); } /** @@ -812,7 +816,7 @@ public void testHoldsCompiles() { */ @Test public void testJsonifyCompiles() { - assertCompiles(Command.jsonify(1).ccl(), "JSONIFY"); + assertCompiles(Command.to().jsonify(1).ccl(), "JSONIFY"); } // ========== Utility Commands ========== @@ -834,7 +838,7 @@ public void testJsonifyCompiles() { */ @Test public void testPingCompiles() { - assertCompiles(Command.ping().ccl(), "PING"); + assertCompiles(Command.to().ping().ccl(), "PING"); } /** @@ -854,7 +858,7 @@ public void testPingCompiles() { */ @Test public void testStageCompiles() { - assertCompiles(Command.stage().ccl(), "STAGE"); + assertCompiles(Command.to().stage().ccl(), "STAGE"); } /** @@ -874,7 +878,7 @@ public void testStageCompiles() { */ @Test public void testCommitCompiles() { - assertCompiles(Command.commit().ccl(), "COMMIT"); + assertCompiles(Command.to().commit().ccl(), "COMMIT"); } /** @@ -894,7 +898,7 @@ public void testCommitCompiles() { */ @Test public void testAbortCompiles() { - assertCompiles(Command.abort().ccl(), "ABORT"); + assertCompiles(Command.to().abort().ccl(), "ABORT"); } /** @@ -914,7 +918,7 @@ public void testAbortCompiles() { */ @Test public void testInventoryCompiles() { - assertCompiles(Command.inventory().ccl(), "INVENTORY"); + assertCompiles(Command.to().inventory().ccl(), "INVENTORY"); } // ========== Temporal Commands ========== @@ -937,7 +941,7 @@ public void testInventoryCompiles() { */ @Test public void testChronicleCompiles() { - assertCompiles(Command.chronicle("name").in(1).ccl(), "CHRONICLE"); + assertCompiles(Command.to().chronicle("name").in(1).ccl(), "CHRONICLE"); } /** @@ -958,10 +962,9 @@ public void testChronicleCompiles() { */ @Test public void testChronicleWithRangeCompiles() { - assertCompiles( - Command.chronicle("name").in(1).at(Timestamp.fromMicros(100)) - .at(Timestamp.fromMicros(200)).ccl(), - "CHRONICLE"); + assertCompiles(Command.to().chronicle("name").in(1) + .at(Timestamp.fromMicros(100)).at(Timestamp.fromMicros(200)) + .ccl(), "CHRONICLE"); } /** @@ -982,7 +985,8 @@ public void testChronicleWithRangeCompiles() { */ @Test public void testDiffRecordCompiles() { - assertCompiles(Command.diff(1L).at(Timestamp.fromMicros(100)).ccl(), + assertCompiles( + Command.to().diff(1L).at(Timestamp.fromMicros(100)).ccl(), "DIFF"); } @@ -1004,9 +1008,8 @@ public void testDiffRecordCompiles() { */ @Test public void testDiffKeyInRecordCompiles() { - assertCompiles( - Command.diff("name").in(1).at(Timestamp.fromMicros(100)).ccl(), - "DIFF"); + assertCompiles(Command.to().diff("name").in(1) + .at(Timestamp.fromMicros(100)).ccl(), "DIFF"); } /** @@ -1026,7 +1029,7 @@ public void testDiffKeyInRecordCompiles() { */ @Test public void testAuditRecordCompiles() { - assertCompiles(Command.audit(1L).ccl(), "AUDIT"); + assertCompiles(Command.to().audit(1L).ccl(), "AUDIT"); } /** @@ -1047,7 +1050,7 @@ public void testAuditRecordCompiles() { */ @Test public void testAuditKeyInRecordCompiles() { - assertCompiles(Command.audit("name").in(1).ccl(), "AUDIT"); + assertCompiles(Command.to().audit("name").in(1).ccl(), "AUDIT"); } /** @@ -1069,7 +1072,7 @@ public void testAuditKeyInRecordCompiles() { @Test public void testReconcileCompiles() { assertCompiles( - Command.reconcile("name").in(1).with("jeff", "bob").ccl(), + Command.to().reconcile("name").in(1).with("jeff", "bob").ccl(), "RECONCILE"); } @@ -1091,7 +1094,7 @@ public void testReconcileCompiles() { */ @Test public void testRevertCompiles() { - assertCompiles(Command.revert("name").in(1) + assertCompiles(Command.to().revert("name").in(1) .to(Timestamp.fromMicros(100)).ccl(), "REVERT"); } @@ -1113,7 +1116,7 @@ public void testRevertCompiles() { */ @Test public void testConsolidateCompiles() { - assertCompiles(Command.consolidate(1, 2, 3).ccl(), "CONSOLIDATE"); + assertCompiles(Command.to().consolidate(1, 2, 3).ccl(), "CONSOLIDATE"); } /** @@ -1134,7 +1137,8 @@ public void testConsolidateCompiles() { */ @Test public void testCalculateCompiles() { - assertCompiles(Command.calculate("sum", "salary").ccl(), "CALCULATE"); + assertCompiles(Command.to().calculate("sum", "salary").ccl(), + "CALCULATE"); } /** @@ -1155,7 +1159,7 @@ public void testCalculateCompiles() { */ @Test public void testCalculateWhereCompiles() { - assertCompiles(Command.calculate("count", "status") + assertCompiles(Command.to().calculate("count", "status") .where("active = true").ccl(), "CALCULATE"); } @@ -1177,7 +1181,7 @@ public void testCalculateWhereCompiles() { */ @Test public void testCalculateInRecordsCompiles() { - assertCompiles(Command.calculate("avg", "age").in(1, 2).ccl(), + assertCompiles(Command.to().calculate("avg", "age").in(1, 2).ccl(), "CALCULATE"); } @@ -1199,7 +1203,7 @@ public void testCalculateInRecordsCompiles() { */ @Test public void testJsonifyWithIdentifierCompiles() { - assertCompiles(Command.jsonify(1).identifier().ccl(), "JSONIFY"); + assertCompiles(Command.to().jsonify(1).identifier().ccl(), "JSONIFY"); } /** @@ -1220,7 +1224,7 @@ public void testJsonifyWithIdentifierCompiles() { */ @Test public void testJsonifyWithIdentifierAndTimestampCompiles() { - assertCompiles(Command.jsonify(1).identifier() + assertCompiles(Command.to().jsonify(1).identifier() .at(Timestamp.fromMicros(12345)).ccl(), "JSONIFY"); } @@ -1242,7 +1246,8 @@ public void testJsonifyWithIdentifierAndTimestampCompiles() { */ @Test public void testDiffKeyOnlyCompiles() { - assertCompiles(Command.diff("name").at(Timestamp.fromMicros(100)).ccl(), + assertCompiles( + Command.to().diff("name").at(Timestamp.fromMicros(100)).ccl(), "DIFF"); } @@ -1264,7 +1269,7 @@ public void testDiffKeyOnlyCompiles() { */ @Test public void testDiffKeyOnlyRangeCompiles() { - assertCompiles(Command.diff("name").at(Timestamp.fromMicros(100)) + assertCompiles(Command.to().diff("name").at(Timestamp.fromMicros(100)) .at(Timestamp.fromMicros(200)).ccl(), "DIFF"); } @@ -1287,7 +1292,7 @@ public void testDiffKeyOnlyRangeCompiles() { */ @Test public void testFindOrInsertWithTimestampCompiles() { - assertCompiles(Command.findOrInsert("name = jeff") + assertCompiles(Command.to().findOrInsert("name = jeff") .at(Timestamp.fromMicros(12345)).json("{\"name\":\"jeff\"}") .ccl(), "FIND_OR_INSERT"); } @@ -1309,9 +1314,8 @@ public void testFindOrInsertWithTimestampCompiles() { */ @Test public void testDescribeAllWithTimestampCompiles() { - assertCompiles( - Command.describeAll().at(Timestamp.fromMicros(12345)).ccl(), - "DESCRIBE"); + assertCompiles(Command.to().describeAll() + .at(Timestamp.fromMicros(12345)).ccl(), "DESCRIBE"); } // ========== Temporal Variant Coverage ========== @@ -1334,7 +1338,7 @@ public void testDescribeAllWithTimestampCompiles() { */ @Test public void testDiffRecordRangeCompiles() { - assertCompiles(Command.diff(1L).at(Timestamp.fromMicros(100)) + assertCompiles(Command.to().diff(1L).at(Timestamp.fromMicros(100)) .at(Timestamp.fromMicros(200)).ccl(), "DIFF"); } @@ -1356,8 +1360,10 @@ public void testDiffRecordRangeCompiles() { */ @Test public void testDiffKeyInRecordRangeCompiles() { - assertCompiles(Command.diff("name").in(1).at(Timestamp.fromMicros(100)) - .at(Timestamp.fromMicros(200)).ccl(), "DIFF"); + assertCompiles( + Command.to().diff("name").in(1).at(Timestamp.fromMicros(100)) + .at(Timestamp.fromMicros(200)).ccl(), + "DIFF"); } /** @@ -1378,7 +1384,7 @@ public void testDiffKeyInRecordRangeCompiles() { */ @Test public void testChronicleWithTimestampCompiles() { - assertCompiles(Command.chronicle("name").in(1) + assertCompiles(Command.to().chronicle("name").in(1) .at(Timestamp.fromMicros(12345)).ccl(), "CHRONICLE"); } @@ -1399,7 +1405,8 @@ public void testChronicleWithTimestampCompiles() { */ @Test public void testAuditRecordWithTimestampCompiles() { - assertCompiles(Command.audit(1L).at(Timestamp.fromMicros(12345)).ccl(), + assertCompiles( + Command.to().audit(1L).at(Timestamp.fromMicros(12345)).ccl(), "AUDIT"); } @@ -1421,7 +1428,7 @@ public void testAuditRecordWithTimestampCompiles() { */ @Test public void testAuditRecordRangeCompiles() { - assertCompiles(Command.audit(1L).at(Timestamp.fromMicros(100)) + assertCompiles(Command.to().audit(1L).at(Timestamp.fromMicros(100)) .at(Timestamp.fromMicros(200)).ccl(), "AUDIT"); } @@ -1443,7 +1450,7 @@ public void testAuditRecordRangeCompiles() { */ @Test public void testAuditKeyInRecordWithTimestampCompiles() { - assertCompiles(Command.audit("name").in(1) + assertCompiles(Command.to().audit("name").in(1) .at(Timestamp.fromMicros(12345)).ccl(), "AUDIT"); } @@ -1465,8 +1472,10 @@ public void testAuditKeyInRecordWithTimestampCompiles() { */ @Test public void testAuditKeyInRecordRangeCompiles() { - assertCompiles(Command.audit("name").in(1).at(Timestamp.fromMicros(100)) - .at(Timestamp.fromMicros(200)).ccl(), "AUDIT"); + assertCompiles( + Command.to().audit("name").in(1).at(Timestamp.fromMicros(100)) + .at(Timestamp.fromMicros(200)).ccl(), + "AUDIT"); } /** @@ -1486,7 +1495,8 @@ public void testAuditKeyInRecordRangeCompiles() { */ @Test public void testTraceWithTimestampCompiles() { - assertCompiles(Command.trace(1).at(Timestamp.fromMicros(12345)).ccl(), + assertCompiles( + Command.to().trace(1).at(Timestamp.fromMicros(12345)).ccl(), "TRACE"); } @@ -1508,7 +1518,7 @@ public void testTraceWithTimestampCompiles() { */ @Test public void testNavigateWithTimestampCompiles() { - assertCompiles(Command.navigate("friends.name").from(1) + assertCompiles(Command.to().navigate("friends.name").from(1) .at(Timestamp.fromMicros(12345)).ccl(), "NAVIGATE"); } @@ -1531,7 +1541,7 @@ public void testNavigateWithTimestampCompiles() { @Test public void testDescribeRecordWithTimestampCompiles() { assertCompiles( - Command.describe(1).at(Timestamp.fromMicros(12345)).ccl(), + Command.to().describe(1).at(Timestamp.fromMicros(12345)).ccl(), "DESCRIBE"); } @@ -1553,7 +1563,7 @@ public void testDescribeRecordWithTimestampCompiles() { */ @Test public void testCalculateWithTimestampCompiles() { - assertCompiles(Command.calculate("sum", "salary") + assertCompiles(Command.to().calculate("sum", "salary") .at(Timestamp.fromMicros(12345)).ccl(), "CALCULATE"); } @@ -1574,7 +1584,8 @@ public void testCalculateWithTimestampCompiles() { */ @Test public void testJsonifyWithTimestampCompiles() { - assertCompiles(Command.jsonify(1).at(Timestamp.fromMicros(12345)).ccl(), + assertCompiles( + Command.to().jsonify(1).at(Timestamp.fromMicros(12345)).ccl(), "JSONIFY"); } @@ -1598,7 +1609,7 @@ public void testJsonifyWithTimestampCompiles() { */ @Test public void testSelectWithOrderCompiles() { - assertCompiles(Command.select("name").from(1) + assertCompiles(Command.to().select("name").from(1) .order(Order.by("name").build()).ccl(), "SELECT"); } @@ -1620,7 +1631,7 @@ public void testSelectWithOrderCompiles() { */ @Test public void testSelectWithPageCompiles() { - assertCompiles(Command.select("name").where("age > 30") + assertCompiles(Command.to().select("name").where("age > 30") .page(Page.sized(10)).ccl(), "SELECT"); } @@ -1642,7 +1653,7 @@ public void testSelectWithPageCompiles() { */ @Test public void testSelectFromRecordWithTimestampCompiles() { - assertCompiles(Command.select("name").from(1) + assertCompiles(Command.to().select("name").from(1) .at(Timestamp.fromMicros(12345)).ccl(), "SELECT"); } @@ -1666,7 +1677,8 @@ public void testSelectFromRecordWithTimestampCompiles() { */ @Test public void testAddInMultipleRecordsCompiles() { - assertCompiles(Command.add("name").as("jeff").in(1, 2).ccl(), "ADD"); + assertCompiles(Command.to().add("name").as("jeff").in(1, 2).ccl(), + "ADD"); } /** @@ -1687,7 +1699,8 @@ public void testAddInMultipleRecordsCompiles() { */ @Test public void testLinkMultipleDestinationsCompiles() { - assertCompiles(Command.link("friends").from(1).to(2, 3).ccl(), "LINK"); + assertCompiles(Command.to().link("friends").from(1).to(2, 3).ccl(), + "LINK"); } /** @@ -1707,7 +1720,7 @@ public void testLinkMultipleDestinationsCompiles() { */ @Test public void testDescribeMultipleRecordsCompiles() { - assertCompiles(Command.describe(1, 2, 3).ccl(), "DESCRIBE"); + assertCompiles(Command.to().describe(1, 2, 3).ccl(), "DESCRIBE"); } /** @@ -1728,7 +1741,7 @@ public void testDescribeMultipleRecordsCompiles() { */ @Test public void testRevertMultipleKeysAndRecordsCompiles() { - assertCompiles(Command.revert("name", "age").in(1, 2) + assertCompiles(Command.to().revert("name", "age").in(1, 2) .to(Timestamp.fromMicros(12345)).ccl(), "REVERT"); } @@ -1752,7 +1765,7 @@ public void testRevertMultipleKeysAndRecordsCompiles() { */ @Test public void testSelectAllWhereCompiles() { - assertCompiles(Command.selectAll().where("active = true").ccl(), + assertCompiles(Command.to().selectAll().where("active = true").ccl(), "SELECT"); } @@ -1773,7 +1786,7 @@ public void testSelectAllWhereCompiles() { */ @Test public void testGetAllFromRecordCompiles() { - assertCompiles(Command.getAll().from(1).ccl(), "GET"); + assertCompiles(Command.to().getAll().from(1).ccl(), "GET"); } /** @@ -1793,7 +1806,7 @@ public void testGetAllFromRecordCompiles() { */ @Test public void testGetAllFromMultipleRecordsCompiles() { - assertCompiles(Command.getAll().from(1, 2).ccl(), "GET"); + assertCompiles(Command.to().getAll().from(1, 2).ccl(), "GET"); } /** @@ -1814,7 +1827,8 @@ public void testGetAllFromMultipleRecordsCompiles() { */ @Test public void testGetAllWhereCompiles() { - assertCompiles(Command.getAll().where("active = true").ccl(), "GET"); + assertCompiles(Command.to().getAll().where("active = true").ccl(), + "GET"); } // ========== Helper ========== diff --git a/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/CommandSerializationTest.java b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/CommandSerializationTest.java index 1a8a55b0d..8c9b00c77 100644 --- a/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/CommandSerializationTest.java +++ b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/CommandSerializationTest.java @@ -62,8 +62,9 @@ public class CommandSerializationTest { */ @Test public void testNullaryCommandsRoundTrip() { - Command[] commands = { Command.ping(), Command.stage(), - Command.commit(), Command.abort(), Command.inventory() }; + Command[] commands = { Command.to().ping(), Command.to().stage(), + Command.to().commit(), Command.to().abort(), + Command.to().inventory() }; for (Command cmd : commands) { TCommand tc = cmd.toThrift(); Assert.assertEquals(cmd.ccl(), tc.getVerb().name().toLowerCase()); @@ -89,7 +90,7 @@ public void testNullaryCommandsRoundTrip() { */ @Test public void testFindWithConditionRoundTrip() { - Command cmd = Command.find("age > 30"); + Command cmd = Command.to().find("age > 30"); TCommand tc = cmd.toThrift(); Assert.assertEquals(TCommandVerb.FIND, tc.getVerb()); Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); @@ -114,7 +115,8 @@ public void testFindWithConditionRoundTrip() { */ @Test public void testFindWithTimestampRoundTrip() { - Command cmd = Command.find("age > 30").at(Timestamp.fromMicros(12345)); + Command cmd = Command.to().find("age > 30") + .at(Timestamp.fromMicros(12345)); TCommand tc = cmd.toThrift(); Assert.assertTrue(tc.isSetTimestamp()); Assert.assertEquals(12345, tc.getTimestamp()); @@ -139,8 +141,8 @@ public void testFindWithTimestampRoundTrip() { */ @Test public void testFindWithOrderAndPageRoundTrip() { - Command cmd = Command.find("age > 30").order(Order.by("name").build()) - .page(Page.sized(10)); + Command cmd = Command.to().find("age > 30") + .order(Order.by("name").build()).page(Page.sized(10)); TCommand tc = cmd.toThrift(); Assert.assertTrue(tc.isSetOrder()); Assert.assertTrue(tc.isSetPage()); @@ -171,7 +173,7 @@ public void testFindWithOrderAndPageRoundTrip() { public void testFindWithCriteriaRoundTrip() { Criteria criteria = Criteria.where().key("age") .operator(Operator.GREATER_THAN).value(30).build(); - Command cmd = Command.find(criteria); + Command cmd = Command.to().find(criteria); TCommand tc = cmd.toThrift(); Assert.assertEquals(TCommandVerb.FIND, tc.getVerb()); Assert.assertTrue(tc.isSetCriteria()); @@ -198,7 +200,7 @@ public void testFindWithCriteriaRoundTrip() { */ @Test public void testSelectKeysFromRecordsRoundTrip() { - Command cmd = Command.select("name", "age").from(1, 2, 3); + Command cmd = Command.to().select("name", "age").from(1, 2, 3); TCommand tc = cmd.toThrift(); Assert.assertEquals(TCommandVerb.SELECT, tc.getVerb()); Assert.assertEquals(Arrays.asList("name", "age"), tc.getKeys()); @@ -223,7 +225,7 @@ public void testSelectKeysFromRecordsRoundTrip() { */ @Test public void testSelectAllFromRecordRoundTrip() { - Command cmd = Command.selectAll().from(1); + Command cmd = Command.to().selectAll().from(1); TCommand tc = cmd.toThrift(); Assert.assertFalse(tc.isSetKeys()); Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); @@ -248,7 +250,7 @@ public void testSelectAllFromRecordRoundTrip() { */ @Test public void testSelectWithConditionRoundTrip() { - Command cmd = Command.select("name").where("status = active"); + Command cmd = Command.to().select("name").where("status = active"); TCommand tc = cmd.toThrift(); Assert.assertTrue(tc.isSetCondition()); Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); @@ -273,7 +275,7 @@ public void testSelectWithConditionRoundTrip() { */ @Test public void testSelectWithAllOptionsRoundTrip() { - Command cmd = Command.select("name").from(1) + Command cmd = Command.to().select("name").from(1) .at(Timestamp.fromMicros(5000)).order(Order.by("name").build()) .page(Page.sized(5)); TCommand tc = cmd.toThrift(); @@ -302,7 +304,7 @@ public void testSelectWithAllOptionsRoundTrip() { */ @Test public void testGetFromRecordRoundTrip() { - Command cmd = Command.get("name").from(1); + Command cmd = Command.to().get("name").from(1); TCommand tc = cmd.toThrift(); Assert.assertEquals(TCommandVerb.GET, tc.getVerb()); Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); @@ -327,7 +329,7 @@ public void testGetFromRecordRoundTrip() { */ @Test public void testGetAllWithConditionRoundTrip() { - Command cmd = Command.getAll().where("active = true"); + Command cmd = Command.to().getAll().where("active = true"); TCommand tc = cmd.toThrift(); Assert.assertTrue(tc.isSetCondition()); Assert.assertFalse(tc.isSetKeys()); @@ -353,7 +355,7 @@ public void testGetAllWithConditionRoundTrip() { */ @Test public void testGetWithTimestampRoundTrip() { - Command cmd = Command.get("name").from(1) + Command cmd = Command.to().get("name").from(1) .at(Timestamp.fromMicros(5000)); TCommand tc = cmd.toThrift(); Assert.assertTrue(tc.isSetTimestamp()); @@ -380,8 +382,9 @@ public void testGetWithTimestampRoundTrip() { */ @Test public void testGetWithAllOptionsRoundTrip() { - Command cmd = Command.get("name").from(1).at(Timestamp.fromMicros(5000)) - .order(Order.by("name").build()).page(Page.sized(5)); + Command cmd = Command.to().get("name").from(1) + .at(Timestamp.fromMicros(5000)).order(Order.by("name").build()) + .page(Page.sized(5)); TCommand tc = cmd.toThrift(); Assert.assertTrue(tc.isSetTimestamp()); Assert.assertTrue(tc.isSetOrder()); @@ -408,7 +411,7 @@ public void testGetWithAllOptionsRoundTrip() { */ @Test public void testNavigateFromRecordRoundTrip() { - Command cmd = Command.navigate("friends.name").from(1); + Command cmd = Command.to().navigate("friends.name").from(1); TCommand tc = cmd.toThrift(); Assert.assertEquals(TCommandVerb.NAVIGATE, tc.getVerb()); Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); @@ -433,8 +436,8 @@ public void testNavigateFromRecordRoundTrip() { */ @Test public void testNavigateWithConditionAndTimestampRoundTrip() { - Command cmd = Command.navigate("friends.name").where("active = true") - .at(Timestamp.fromMicros(9999)); + Command cmd = Command.to().navigate("friends.name") + .where("active = true").at(Timestamp.fromMicros(9999)); TCommand tc = cmd.toThrift(); Assert.assertTrue(tc.isSetCondition()); Assert.assertTrue(tc.isSetTimestamp()); @@ -461,7 +464,7 @@ public void testNavigateWithConditionAndTimestampRoundTrip() { */ @Test public void testAddKeyValueRoundTrip() { - Command cmd = Command.add("name").as("jeff"); + Command cmd = Command.to().add("name").as("jeff"); TCommand tc = cmd.toThrift(); Assert.assertEquals(TCommandVerb.ADD, tc.getVerb()); Assert.assertFalse(tc.isSetRecords()); @@ -487,7 +490,7 @@ public void testAddKeyValueRoundTrip() { */ @Test public void testAddKeyValueInRecordsRoundTrip() { - Command cmd = Command.add("name").as("jeff").in(1, 2); + Command cmd = Command.to().add("name").as("jeff").in(1, 2); TCommand tc = cmd.toThrift(); Assert.assertTrue(tc.isSetRecords()); Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); @@ -512,7 +515,7 @@ public void testAddKeyValueInRecordsRoundTrip() { */ @Test public void testSetRoundTrip() { - Command cmd = Command.set("name").as("jeff").in(1); + Command cmd = Command.to().set("name").as("jeff").in(1); TCommand tc = cmd.toThrift(); Assert.assertEquals(TCommandVerb.SET, tc.getVerb()); Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); @@ -537,7 +540,7 @@ public void testSetRoundTrip() { */ @Test public void testRemoveRoundTrip() { - Command cmd = Command.remove("name").as("jeff").from(1); + Command cmd = Command.to().remove("name").as("jeff").from(1); TCommand tc = cmd.toThrift(); Assert.assertEquals(TCommandVerb.REMOVE, tc.getVerb()); Assert.assertTrue(tc.isSetValue()); @@ -565,7 +568,7 @@ public void testRemoveRoundTrip() { */ @Test public void testClearKeysFromRecordsRoundTrip() { - Command cmd = Command.clear("name", "age").from(1, 2); + Command cmd = Command.to().clear("name", "age").from(1, 2); TCommand tc = cmd.toThrift(); Assert.assertEquals(TCommandVerb.CLEAR, tc.getVerb()); Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); @@ -590,7 +593,7 @@ public void testClearKeysFromRecordsRoundTrip() { */ @Test public void testClearRecordsOnlyRoundTrip() { - Command cmd = Command.clear(1, 2); + Command cmd = Command.to().clear(1, 2); TCommand tc = cmd.toThrift(); Assert.assertFalse(tc.isSetKeys()); Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); @@ -614,7 +617,7 @@ public void testClearRecordsOnlyRoundTrip() { */ @Test public void testInsertJsonRoundTrip() { - Command cmd = Command.insert("{\"name\":\"jeff\"}"); + Command cmd = Command.to().insert("{\"name\":\"jeff\"}"); TCommand tc = cmd.toThrift(); Assert.assertEquals(TCommandVerb.INSERT, tc.getVerb()); Assert.assertFalse(tc.isSetRecords()); @@ -639,7 +642,7 @@ public void testInsertJsonRoundTrip() { */ @Test public void testInsertJsonInRecordRoundTrip() { - Command cmd = Command.insert("{\"name\":\"jeff\"}").in(1); + Command cmd = Command.to().insert("{\"name\":\"jeff\"}").in(1); TCommand tc = cmd.toThrift(); Assert.assertTrue(tc.isSetRecords()); Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); @@ -663,7 +666,7 @@ public void testInsertJsonInRecordRoundTrip() { */ @Test public void testLinkRoundTrip() { - Command cmd = Command.link("friends").from(1).to(2); + Command cmd = Command.to().link("friends").from(1).to(2); TCommand tc = cmd.toThrift(); Assert.assertEquals(TCommandVerb.LINK, tc.getVerb()); Assert.assertEquals(1, tc.getSourceRecord()); @@ -689,7 +692,7 @@ public void testLinkRoundTrip() { */ @Test public void testUnlinkRoundTrip() { - Command cmd = Command.unlink("friends").from(1).to(2); + Command cmd = Command.to().unlink("friends").from(1).to(2); TCommand tc = cmd.toThrift(); Assert.assertEquals(TCommandVerb.UNLINK, tc.getVerb()); Assert.assertEquals(1, tc.getSourceRecord()); @@ -715,7 +718,7 @@ public void testUnlinkRoundTrip() { */ @Test public void testVerifyRoundTrip() { - Command cmd = Command.verify("name").as("jeff").in(1); + Command cmd = Command.to().verify("name").as("jeff").in(1); TCommand tc = cmd.toThrift(); Assert.assertEquals(TCommandVerb.VERIFY, tc.getVerb()); Assert.assertFalse(tc.isSetTimestamp()); @@ -740,7 +743,7 @@ public void testVerifyRoundTrip() { */ @Test public void testVerifyWithTimestampRoundTrip() { - Command cmd = Command.verify("name").as("jeff").in(1) + Command cmd = Command.to().verify("name").as("jeff").in(1) .at(Timestamp.fromMicros(5000)); TCommand tc = cmd.toThrift(); Assert.assertTrue(tc.isSetTimestamp()); @@ -766,7 +769,7 @@ public void testVerifyWithTimestampRoundTrip() { */ @Test public void testVerifyAndSwapRoundTrip() { - Command cmd = Command.verifyAndSwap("name").as("jeff").in(1) + Command cmd = Command.to().verifyAndSwap("name").as("jeff").in(1) .with("bob"); TCommand tc = cmd.toThrift(); Assert.assertEquals(TCommandVerb.VERIFY_AND_SWAP, tc.getVerb()); @@ -793,7 +796,7 @@ public void testVerifyAndSwapRoundTrip() { */ @Test public void testVerifyOrSetRoundTrip() { - Command cmd = Command.verifyOrSet("name").as("jeff").in(1); + Command cmd = Command.to().verifyOrSet("name").as("jeff").in(1); TCommand tc = cmd.toThrift(); Assert.assertEquals(TCommandVerb.VERIFY_OR_SET, tc.getVerb()); Assert.assertTrue(tc.isSetValue()); @@ -820,7 +823,7 @@ public void testVerifyOrSetRoundTrip() { */ @Test public void testFindOrAddRoundTrip() { - Command cmd = Command.findOrAdd("name").as("jeff"); + Command cmd = Command.to().findOrAdd("name").as("jeff"); TCommand tc = cmd.toThrift(); Assert.assertEquals(TCommandVerb.FIND_OR_ADD, tc.getVerb()); Assert.assertTrue(tc.isSetValue()); @@ -848,7 +851,7 @@ public void testFindOrAddRoundTrip() { */ @Test public void testFindOrInsertRoundTrip() { - Command cmd = Command.findOrInsert("name = jeff") + Command cmd = Command.to().findOrInsert("name = jeff") .json("{\"name\":\"jeff\"}"); TCommand tc = cmd.toThrift(); Assert.assertEquals(TCommandVerb.FIND_OR_INSERT, tc.getVerb()); @@ -875,7 +878,7 @@ public void testFindOrInsertRoundTrip() { */ @Test public void testSearchRoundTrip() { - Command cmd = Command.search("name").forQuery("jeff"); + Command cmd = Command.to().search("name").forQuery("jeff"); TCommand tc = cmd.toThrift(); Assert.assertEquals(TCommandVerb.SEARCH, tc.getVerb()); Assert.assertEquals("jeff", tc.getQuery()); @@ -899,7 +902,7 @@ public void testSearchRoundTrip() { */ @Test public void testBrowseRoundTrip() { - Command cmd = Command.browse("name"); + Command cmd = Command.to().browse("name"); TCommand tc = cmd.toThrift(); Assert.assertEquals(TCommandVerb.BROWSE, tc.getVerb()); Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); @@ -923,7 +926,8 @@ public void testBrowseRoundTrip() { */ @Test public void testBrowseWithTimestampRoundTrip() { - Command cmd = Command.browse("name").at(Timestamp.fromMicros(5000)); + Command cmd = Command.to().browse("name") + .at(Timestamp.fromMicros(5000)); TCommand tc = cmd.toThrift(); Assert.assertTrue(tc.isSetTimestamp()); Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); @@ -947,7 +951,7 @@ public void testBrowseWithTimestampRoundTrip() { */ @Test public void testDescribeRecordsRoundTrip() { - Command cmd = Command.describe(1, 2); + Command cmd = Command.to().describe(1, 2); TCommand tc = cmd.toThrift(); Assert.assertEquals(TCommandVerb.DESCRIBE, tc.getVerb()); Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); @@ -970,7 +974,7 @@ public void testDescribeRecordsRoundTrip() { */ @Test public void testDescribeAllRoundTrip() { - Command cmd = Command.describeAll(); + Command cmd = Command.to().describeAll(); TCommand tc = cmd.toThrift(); Assert.assertFalse(tc.isSetRecords()); Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); @@ -994,7 +998,7 @@ public void testDescribeAllRoundTrip() { */ @Test public void testDescribeAllWithTimestampRoundTrip() { - Command cmd = Command.describeAll().at(Timestamp.fromMicros(5000)); + Command cmd = Command.to().describeAll().at(Timestamp.fromMicros(5000)); TCommand tc = cmd.toThrift(); Assert.assertTrue(tc.isSetTimestamp()); Assert.assertFalse(tc.isSetRecords()); @@ -1020,7 +1024,7 @@ public void testDescribeAllWithTimestampRoundTrip() { */ @Test public void testTraceRoundTrip() { - Command cmd = Command.trace(1, 2); + Command cmd = Command.to().trace(1, 2); TCommand tc = cmd.toThrift(); Assert.assertEquals(TCommandVerb.TRACE, tc.getVerb()); Assert.assertEquals(Arrays.asList(1L, 2L), tc.getRecords()); @@ -1046,7 +1050,7 @@ public void testTraceRoundTrip() { */ @Test public void testTraceWithTimestampRoundTrip() { - Command cmd = Command.trace(1).at(Timestamp.fromMicros(5000)); + Command cmd = Command.to().trace(1).at(Timestamp.fromMicros(5000)); TCommand tc = cmd.toThrift(); Assert.assertTrue(tc.isSetTimestamp()); Assert.assertEquals(5000, tc.getTimestamp()); @@ -1071,7 +1075,7 @@ public void testTraceWithTimestampRoundTrip() { */ @Test public void testHoldsRoundTrip() { - Command cmd = Command.holds(1, 2); + Command cmd = Command.to().holds(1, 2); TCommand tc = cmd.toThrift(); Assert.assertEquals(TCommandVerb.HOLDS, tc.getVerb()); Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); @@ -1094,7 +1098,7 @@ public void testHoldsRoundTrip() { */ @Test public void testJsonifyRoundTrip() { - Command cmd = Command.jsonify(1); + Command cmd = Command.to().jsonify(1); TCommand tc = cmd.toThrift(); Assert.assertEquals(TCommandVerb.JSONIFY, tc.getVerb()); Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); @@ -1118,7 +1122,7 @@ public void testJsonifyRoundTrip() { */ @Test public void testJsonifyWithTimestampRoundTrip() { - Command cmd = Command.jsonify(1).at(Timestamp.fromMicros(5000)); + Command cmd = Command.to().jsonify(1).at(Timestamp.fromMicros(5000)); TCommand tc = cmd.toThrift(); Assert.assertTrue(tc.isSetTimestamp()); Assert.assertEquals(5000, tc.getTimestamp()); @@ -1143,7 +1147,7 @@ public void testJsonifyWithTimestampRoundTrip() { */ @Test public void testChronicleRoundTrip() { - Command cmd = Command.chronicle("name").in(1); + Command cmd = Command.to().chronicle("name").in(1); TCommand tc = cmd.toThrift(); Assert.assertEquals(TCommandVerb.CHRONICLE, tc.getVerb()); Assert.assertFalse(tc.isSetTimestamp()); @@ -1168,7 +1172,7 @@ public void testChronicleRoundTrip() { */ @Test public void testChronicleWithTimestampRoundTrip() { - Command cmd = Command.chronicle("name").in(1) + Command cmd = Command.to().chronicle("name").in(1) .at(Timestamp.fromMicros(5000)); TCommand tc = cmd.toThrift(); Assert.assertTrue(tc.isSetTimestamp()); @@ -1195,7 +1199,7 @@ public void testChronicleWithTimestampRoundTrip() { */ @Test public void testChronicleWithRangeRoundTrip() { - Command cmd = Command.chronicle("name").in(1) + Command cmd = Command.to().chronicle("name").in(1) .at(Timestamp.fromMicros(1000)).at(Timestamp.fromMicros(2000)); TCommand tc = cmd.toThrift(); Assert.assertTrue(tc.isSetTimestamp()); @@ -1221,7 +1225,7 @@ public void testChronicleWithRangeRoundTrip() { */ @Test public void testDiffRecordTimestampRoundTrip() { - Command cmd = Command.diff(1).at(Timestamp.fromMicros(5000)); + Command cmd = Command.to().diff(1).at(Timestamp.fromMicros(5000)); TCommand tc = cmd.toThrift(); Assert.assertEquals(TCommandVerb.DIFF, tc.getVerb()); Assert.assertTrue(tc.isSetRecords()); @@ -1250,7 +1254,7 @@ public void testDiffRecordTimestampRoundTrip() { */ @Test public void testDiffRecordRangeRoundTrip() { - Command cmd = Command.diff(1).at(Timestamp.fromMicros(1000)) + Command cmd = Command.to().diff(1).at(Timestamp.fromMicros(1000)) .at(Timestamp.fromMicros(2000)); TCommand tc = cmd.toThrift(); Assert.assertTrue(tc.isSetRecords()); @@ -1280,7 +1284,7 @@ public void testDiffRecordRangeRoundTrip() { */ @Test public void testDiffKeyTimestampRoundTrip() { - Command cmd = Command.diff("name").at(Timestamp.fromMicros(5000)); + Command cmd = Command.to().diff("name").at(Timestamp.fromMicros(5000)); TCommand tc = cmd.toThrift(); Assert.assertTrue(tc.isSetKeys()); Assert.assertFalse(tc.isSetRecords()); @@ -1309,7 +1313,7 @@ public void testDiffKeyTimestampRoundTrip() { */ @Test public void testDiffKeyRangeRoundTrip() { - Command cmd = Command.diff("name").at(Timestamp.fromMicros(1000)) + Command cmd = Command.to().diff("name").at(Timestamp.fromMicros(1000)) .at(Timestamp.fromMicros(2000)); TCommand tc = cmd.toThrift(); Assert.assertTrue(tc.isSetKeys()); @@ -1337,7 +1341,8 @@ public void testDiffKeyRangeRoundTrip() { */ @Test public void testDiffKeyRecordTimestampRoundTrip() { - Command cmd = Command.diff("name").in(1).at(Timestamp.fromMicros(5000)); + Command cmd = Command.to().diff("name").in(1) + .at(Timestamp.fromMicros(5000)); TCommand tc = cmd.toThrift(); Assert.assertTrue(tc.isSetKeys()); Assert.assertTrue(tc.isSetRecords()); @@ -1365,8 +1370,8 @@ public void testDiffKeyRecordTimestampRoundTrip() { */ @Test public void testDiffKeyRecordRangeRoundTrip() { - Command cmd = Command.diff("name").in(1).at(Timestamp.fromMicros(1000)) - .at(Timestamp.fromMicros(2000)); + Command cmd = Command.to().diff("name").in(1) + .at(Timestamp.fromMicros(1000)).at(Timestamp.fromMicros(2000)); TCommand tc = cmd.toThrift(); Assert.assertTrue(tc.isSetKeys()); Assert.assertTrue(tc.isSetRecords()); @@ -1393,7 +1398,7 @@ public void testDiffKeyRecordRangeRoundTrip() { */ @Test public void testAuditRecordRoundTrip() { - Command cmd = Command.audit(1); + Command cmd = Command.to().audit(1); TCommand tc = cmd.toThrift(); Assert.assertEquals(TCommandVerb.AUDIT, tc.getVerb()); Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); @@ -1418,7 +1423,7 @@ public void testAuditRecordRoundTrip() { */ @Test public void testAuditRecordTimestampRoundTrip() { - Command cmd = Command.audit(1).at(Timestamp.fromMicros(5000)); + Command cmd = Command.to().audit(1).at(Timestamp.fromMicros(5000)); TCommand tc = cmd.toThrift(); Assert.assertTrue(tc.isSetTimestamp()); Assert.assertFalse(tc.isSetKeys()); @@ -1444,7 +1449,7 @@ public void testAuditRecordTimestampRoundTrip() { */ @Test public void testAuditRecordRangeRoundTrip() { - Command cmd = Command.audit(1).at(Timestamp.fromMicros(1000)) + Command cmd = Command.to().audit(1).at(Timestamp.fromMicros(1000)) .at(Timestamp.fromMicros(2000)); TCommand tc = cmd.toThrift(); Assert.assertTrue(tc.isSetTimestamp()); @@ -1472,7 +1477,7 @@ public void testAuditRecordRangeRoundTrip() { */ @Test public void testAuditKeyRecordRoundTrip() { - Command cmd = Command.audit("name").in(1); + Command cmd = Command.to().audit("name").in(1); TCommand tc = cmd.toThrift(); Assert.assertTrue(tc.isSetKeys()); Assert.assertEquals(Arrays.asList("name"), tc.getKeys()); @@ -1499,7 +1504,7 @@ public void testAuditKeyRecordRoundTrip() { */ @Test public void testAuditKeyRecordTimestampRoundTrip() { - Command cmd = Command.audit("name").in(1) + Command cmd = Command.to().audit("name").in(1) .at(Timestamp.fromMicros(5000)); TCommand tc = cmd.toThrift(); Assert.assertTrue(tc.isSetKeys()); @@ -1527,8 +1532,8 @@ public void testAuditKeyRecordTimestampRoundTrip() { */ @Test public void testAuditKeyRecordRangeRoundTrip() { - Command cmd = Command.audit("name").in(1).at(Timestamp.fromMicros(1000)) - .at(Timestamp.fromMicros(2000)); + Command cmd = Command.to().audit("name").in(1) + .at(Timestamp.fromMicros(1000)).at(Timestamp.fromMicros(2000)); TCommand tc = cmd.toThrift(); Assert.assertTrue(tc.isSetKeys()); Assert.assertTrue(tc.isSetTimestamp()); @@ -1554,7 +1559,7 @@ public void testAuditKeyRecordRangeRoundTrip() { */ @Test public void testRevertRoundTrip() { - Command cmd = Command.revert("name").in(1) + Command cmd = Command.to().revert("name").in(1) .to(Timestamp.fromMicros(5000)); TCommand tc = cmd.toThrift(); Assert.assertEquals(TCommandVerb.REVERT, tc.getVerb()); @@ -1583,7 +1588,7 @@ public void testRevertRoundTrip() { */ @Test public void testReconcileRoundTrip() { - Command cmd = Command.reconcile("name").in(1).with("jeff", "bob"); + Command cmd = Command.to().reconcile("name").in(1).with("jeff", "bob"); TCommand tc = cmd.toThrift(); Assert.assertEquals(TCommandVerb.RECONCILE, tc.getVerb()); Assert.assertTrue(tc.isSetValues()); @@ -1609,7 +1614,7 @@ public void testReconcileRoundTrip() { */ @Test public void testConsolidateRoundTrip() { - Command cmd = Command.consolidate(1, 2, 3); + Command cmd = Command.to().consolidate(1, 2, 3); TCommand tc = cmd.toThrift(); Assert.assertEquals(TCommandVerb.CONSOLIDATE, tc.getVerb()); Assert.assertEquals(Arrays.asList(1L, 2L, 3L), tc.getRecords()); @@ -1634,7 +1639,7 @@ public void testConsolidateRoundTrip() { */ @Test public void testCalculateWithRecordsRoundTrip() { - Command cmd = Command.calculate("count", "name").in(1, 2); + Command cmd = Command.to().calculate("count", "name").in(1, 2); TCommand tc = cmd.toThrift(); Assert.assertEquals(TCommandVerb.CALCULATE, tc.getVerb()); Assert.assertEquals("count", tc.getFunction()); @@ -1659,7 +1664,8 @@ public void testCalculateWithRecordsRoundTrip() { */ @Test public void testCalculateWithConditionRoundTrip() { - Command cmd = Command.calculate("count", "name").where("active = true"); + Command cmd = Command.to().calculate("count", "name") + .where("active = true"); TCommand tc = cmd.toThrift(); Assert.assertTrue(tc.isSetCondition()); Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); @@ -1684,8 +1690,8 @@ public void testCalculateWithConditionRoundTrip() { */ @Test public void testCalculateWithConditionAndTimestampRoundTrip() { - Command cmd = Command.calculate("count", "name").where("active = true") - .at(Timestamp.fromMicros(5000)); + Command cmd = Command.to().calculate("count", "name") + .where("active = true").at(Timestamp.fromMicros(5000)); TCommand tc = cmd.toThrift(); Assert.assertTrue(tc.isSetCondition()); Assert.assertTrue(tc.isSetTimestamp()); diff --git a/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/InspectionCommandTest.java b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/InspectionCommandTest.java index b27bdfe7e..dbf41a1db 100644 --- a/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/InspectionCommandTest.java +++ b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/InspectionCommandTest.java @@ -47,7 +47,7 @@ public class InspectionCommandTest { */ @Test public void testSearch() { - String ccl = Command.search("name").forQuery("jeff").ccl(); + String ccl = Command.to().search("name").forQuery("jeff").ccl(); Assert.assertEquals("search name for \"jeff\"", ccl); } @@ -67,7 +67,7 @@ public void testSearch() { */ @Test public void testBrowseSingleKey() { - String ccl = Command.browse("name").ccl(); + String ccl = Command.to().browse("name").ccl(); Assert.assertEquals("browse name", ccl); } @@ -89,7 +89,7 @@ public void testBrowseSingleKey() { */ @Test public void testBrowseMultipleKeys() { - String ccl = Command.browse("name", "age").ccl(); + String ccl = Command.to().browse("name", "age").ccl(); Assert.assertEquals("browse [name, age]", ccl); } @@ -111,7 +111,7 @@ public void testBrowseMultipleKeys() { */ @Test public void testBrowseWithTimestamp() { - String ccl = Command.browse("name").at(Timestamp.fromMicros(12345)) + String ccl = Command.to().browse("name").at(Timestamp.fromMicros(12345)) .ccl(); Assert.assertEquals("browse name at 12345", ccl); } @@ -132,7 +132,7 @@ public void testBrowseWithTimestamp() { */ @Test public void testDescribeSingleRecord() { - String ccl = Command.describe(1).ccl(); + String ccl = Command.to().describe(1).ccl(); Assert.assertEquals("describe 1", ccl); } @@ -154,7 +154,7 @@ public void testDescribeSingleRecord() { */ @Test public void testDescribeMultipleRecords() { - String ccl = Command.describe(1, 2, 3).ccl(); + String ccl = Command.to().describe(1, 2, 3).ccl(); Assert.assertEquals("describe [1, 2, 3]", ccl); } @@ -176,7 +176,8 @@ public void testDescribeMultipleRecords() { */ @Test public void testDescribeWithTimestamp() { - String ccl = Command.describe(1).at(Timestamp.fromMicros(12345)).ccl(); + String ccl = Command.to().describe(1).at(Timestamp.fromMicros(12345)) + .ccl(); Assert.assertEquals("describe 1 at 12345", ccl); } @@ -196,7 +197,7 @@ public void testDescribeWithTimestamp() { */ @Test public void testDescribeAll() { - String ccl = Command.describeAll().ccl(); + String ccl = Command.to().describeAll().ccl(); Assert.assertEquals("describe", ccl); } @@ -216,7 +217,7 @@ public void testDescribeAll() { */ @Test public void testTrace() { - String ccl = Command.trace(1).ccl(); + String ccl = Command.to().trace(1).ccl(); Assert.assertEquals("trace 1", ccl); } @@ -239,7 +240,8 @@ public void testTrace() { */ @Test public void testTraceWithTimestamp() { - String ccl = Command.trace(1, 2).at(Timestamp.fromMicros(12345)).ccl(); + String ccl = Command.to().trace(1, 2).at(Timestamp.fromMicros(12345)) + .ccl(); Assert.assertEquals("trace [1, 2] at 12345", ccl); } @@ -260,7 +262,7 @@ public void testTraceWithTimestamp() { */ @Test public void testHolds() { - String ccl = Command.holds(1, 2).ccl(); + String ccl = Command.to().holds(1, 2).ccl(); Assert.assertEquals("holds [1, 2]", ccl); } @@ -280,7 +282,7 @@ public void testHolds() { */ @Test public void testJsonify() { - String ccl = Command.jsonify(1).ccl(); + String ccl = Command.to().jsonify(1).ccl(); Assert.assertEquals("jsonify 1", ccl); } @@ -303,7 +305,7 @@ public void testJsonify() { */ @Test public void testJsonifyWithTimestampAndIdentifier() { - String ccl = Command.jsonify(1).identifier() + String ccl = Command.to().jsonify(1).identifier() .at(Timestamp.fromMicros(12345)).ccl(); Assert.assertEquals("jsonify 1 with $id$ at 12345", ccl); } @@ -326,7 +328,7 @@ public void testJsonifyWithTimestampAndIdentifier() { */ @Test public void testJsonifyWithIdentifierOnly() { - String ccl = Command.jsonify(1).identifier().ccl(); + String ccl = Command.to().jsonify(1).identifier().ccl(); Assert.assertEquals("jsonify 1 with $id$", ccl); } @@ -346,7 +348,7 @@ public void testJsonifyWithIdentifierOnly() { */ @Test public void testDescribeAllWithTimestamp() { - String ccl = Command.describeAll().at(Timestamp.fromMicros(12345)) + String ccl = Command.to().describeAll().at(Timestamp.fromMicros(12345)) .ccl(); Assert.assertEquals("describe at 12345", ccl); } @@ -367,7 +369,7 @@ public void testDescribeAllWithTimestamp() { */ @Test public void testPing() { - String ccl = Command.ping().ccl(); + String ccl = Command.to().ping().ccl(); Assert.assertEquals("ping", ccl); } @@ -387,7 +389,7 @@ public void testPing() { */ @Test public void testStage() { - String ccl = Command.stage().ccl(); + String ccl = Command.to().stage().ccl(); Assert.assertEquals("stage", ccl); } @@ -407,7 +409,7 @@ public void testStage() { */ @Test public void testCommit() { - String ccl = Command.commit().ccl(); + String ccl = Command.to().commit().ccl(); Assert.assertEquals("commit", ccl); } @@ -427,7 +429,7 @@ public void testCommit() { */ @Test public void testAbort() { - String ccl = Command.abort().ccl(); + String ccl = Command.to().abort().ccl(); Assert.assertEquals("abort", ccl); } @@ -447,7 +449,7 @@ public void testAbort() { */ @Test public void testInventory() { - String ccl = Command.inventory().ccl(); + String ccl = Command.to().inventory().ccl(); Assert.assertEquals("inventory", ccl); } diff --git a/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/LinkCommandTest.java b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/LinkCommandTest.java index 6e30e6d3b..92b924400 100644 --- a/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/LinkCommandTest.java +++ b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/LinkCommandTest.java @@ -47,7 +47,7 @@ public class LinkCommandTest { */ @Test public void testLinkSingleDestination() { - String ccl = Command.link("friends").from(1).to(2).ccl(); + String ccl = Command.to().link("friends").from(1).to(2).ccl(); Assert.assertEquals("link friends from 1 to 2", ccl); } @@ -69,7 +69,7 @@ public void testLinkSingleDestination() { */ @Test public void testLinkMultipleDestinations() { - String ccl = Command.link("friends").from(1).to(2, 3).ccl(); + String ccl = Command.to().link("friends").from(1).to(2, 3).ccl(); Assert.assertEquals("link friends from 1 to [2, 3]", ccl); } @@ -91,7 +91,7 @@ public void testLinkMultipleDestinations() { */ @Test public void testUnlink() { - String ccl = Command.unlink("friends").from(1).to(2).ccl(); + String ccl = Command.to().unlink("friends").from(1).to(2).ccl(); Assert.assertEquals("unlink friends from 1 to 2", ccl); } @@ -113,7 +113,7 @@ public void testUnlink() { */ @Test public void testVerify() { - String ccl = Command.verify("name").as("jeff").in(1).ccl(); + String ccl = Command.to().verify("name").as("jeff").in(1).ccl(); Assert.assertEquals("verify name as \"jeff\" in 1", ccl); } @@ -137,7 +137,7 @@ public void testVerify() { */ @Test public void testVerifyWithTimestamp() { - String ccl = Command.verify("name").as("jeff").in(1) + String ccl = Command.to().verify("name").as("jeff").in(1) .at(Timestamp.fromMicros(12345)).ccl(); Assert.assertEquals("verify name as \"jeff\" in 1 at 12345", ccl); } @@ -162,8 +162,8 @@ public void testVerifyWithTimestamp() { */ @Test public void testVerifyAndSwap() { - String ccl = Command.verifyAndSwap("name").as("jeff").in(1).with("bob") - .ccl(); + String ccl = Command.to().verifyAndSwap("name").as("jeff").in(1) + .with("bob").ccl(); Assert.assertEquals( "verifyAndSwap name as \"jeff\" in 1" + " with \"bob\"", ccl); } @@ -187,7 +187,7 @@ public void testVerifyAndSwap() { */ @Test public void testVerifyOrSet() { - String ccl = Command.verifyOrSet("name").as("jeff").in(1).ccl(); + String ccl = Command.to().verifyOrSet("name").as("jeff").in(1).ccl(); Assert.assertEquals("verifyOrSet name as \"jeff\" in 1", ccl); } @@ -209,7 +209,7 @@ public void testVerifyOrSet() { */ @Test public void testFindOrAdd() { - String ccl = Command.findOrAdd("name").as("jeff").ccl(); + String ccl = Command.to().findOrAdd("name").as("jeff").ccl(); Assert.assertEquals("findOrAdd name as \"jeff\"", ccl); } @@ -231,7 +231,7 @@ public void testFindOrAdd() { */ @Test public void testVerifyWithinRecordAlias() { - String ccl = Command.verify("name").as("jeff").within(1).ccl(); + String ccl = Command.to().verify("name").as("jeff").within(1).ccl(); Assert.assertEquals("verify name as \"jeff\" in 1", ccl); } @@ -254,7 +254,7 @@ public void testVerifyWithinRecordAlias() { */ @Test public void testVerifyAndSwapWithinRecordAlias() { - String ccl = Command.verifyAndSwap("name").as("jeff").within(1) + String ccl = Command.to().verifyAndSwap("name").as("jeff").within(1) .with("bob").ccl(); Assert.assertEquals( "verifyAndSwap name as \"jeff\" in 1" + " with \"bob\"", ccl); @@ -278,7 +278,8 @@ public void testVerifyAndSwapWithinRecordAlias() { */ @Test public void testVerifyOrSetWithinRecordAlias() { - String ccl = Command.verifyOrSet("name").as("jeff").within(1).ccl(); + String ccl = Command.to().verifyOrSet("name").as("jeff").within(1) + .ccl(); Assert.assertEquals("verifyOrSet name as \"jeff\" in 1", ccl); } @@ -301,7 +302,7 @@ public void testVerifyOrSetWithinRecordAlias() { @Test public void testFindOrInsertWithCondition() { String json = "{\"name\":\"jeff\"}"; - String ccl = Command.findOrInsert("name = jeff").json(json).ccl(); + String ccl = Command.to().findOrInsert("name = jeff").json(json).ccl(); Assert.assertEquals("findOrInsert name = jeff '" + json + "'", ccl); } @@ -326,7 +327,7 @@ public void testFindOrInsertWithCondition() { @Test public void testFindOrInsertWithTimestamp() { String json = "{\"name\":\"jeff\"}"; - String ccl = Command.findOrInsert("name = jeff") + String ccl = Command.to().findOrInsert("name = jeff") .at(Timestamp.fromMicros(12345)).json(json).ccl(); Assert.assertEquals("findOrInsert name = jeff at 12345 '" + json + "'", ccl); diff --git a/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/QueryCommandTest.java b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/QueryCommandTest.java index abf0665d2..343400f7d 100644 --- a/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/QueryCommandTest.java +++ b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/QueryCommandTest.java @@ -47,7 +47,7 @@ public class QueryCommandTest { */ @Test public void testFindWithCclCondition() { - String ccl = Command.find("age > 30").ccl(); + String ccl = Command.to().find("age > 30").ccl(); Assert.assertEquals("find age > 30", ccl); } @@ -69,8 +69,8 @@ public void testFindWithCclCondition() { */ @Test public void testFindWithTimestamp() { - String ccl = Command.find("age > 30").at(Timestamp.fromMicros(12345)) - .ccl(); + String ccl = Command.to().find("age > 30") + .at(Timestamp.fromMicros(12345)).ccl(); Assert.assertEquals("find age > 30 at 12345", ccl); } @@ -93,8 +93,8 @@ public void testFindWithTimestamp() { */ @Test public void testFindWithOrderAndPage() { - String ccl = Command.find("age > 30").order(Order.by("name").build()) - .page(Page.sized(10)).ccl(); + String ccl = Command.to().find("age > 30") + .order(Order.by("name").build()).page(Page.sized(10)).ccl(); Assert.assertEquals("find age > 30 order by name page 1 size 10", ccl); } @@ -116,7 +116,7 @@ public void testFindWithOrderAndPage() { */ @Test public void testSelectKeysFromRecords() { - String ccl = Command.select("name", "age").from(1, 2, 3).ccl(); + String ccl = Command.to().select("name", "age").from(1, 2, 3).ccl(); Assert.assertEquals("select [name, age] from [1, 2, 3]", ccl); } @@ -136,7 +136,7 @@ public void testSelectKeysFromRecords() { */ @Test public void testSelectAllKeysFromRecord() { - String ccl = Command.selectAll().from(1).ccl(); + String ccl = Command.to().selectAll().from(1).ccl(); Assert.assertEquals("select 1", ccl); } @@ -158,7 +158,7 @@ public void testSelectAllKeysFromRecord() { */ @Test public void testSelectWithCondition() { - String ccl = Command.select("name").where("status = active").ccl(); + String ccl = Command.to().select("name").where("status = active").ccl(); Assert.assertEquals("select name where status = active", ccl); } @@ -179,7 +179,7 @@ public void testSelectWithCondition() { */ @Test public void testGetFromRecord() { - String ccl = Command.get("name").from(1).ccl(); + String ccl = Command.to().get("name").from(1).ccl(); Assert.assertEquals("get name from 1", ccl); } @@ -200,7 +200,7 @@ public void testGetFromRecord() { */ @Test public void testGetAllKeysFromRecords() { - String ccl = Command.getAll().from(1, 2).ccl(); + String ccl = Command.to().getAll().from(1, 2).ccl(); Assert.assertEquals("get [1, 2]", ccl); } @@ -222,7 +222,8 @@ public void testGetAllKeysFromRecords() { */ @Test public void testGetWithCondition() { - String ccl = Command.get("name", "age").where("status = active").ccl(); + String ccl = Command.to().get("name", "age").where("status = active") + .ccl(); Assert.assertEquals("get [name, age] where status = active", ccl); } @@ -244,7 +245,7 @@ public void testGetWithCondition() { */ @Test public void testNavigateFromRecords() { - String ccl = Command.navigate("friends.name").from(1).ccl(); + String ccl = Command.to().navigate("friends.name").from(1).ccl(); Assert.assertEquals("navigate friends.name from 1", ccl); } @@ -266,8 +267,8 @@ public void testNavigateFromRecords() { */ @Test public void testNavigateWithCondition() { - String ccl = Command.navigate("friends.name").where("active = true") - .ccl(); + String ccl = Command.to().navigate("friends.name") + .where("active = true").ccl(); Assert.assertEquals("navigate friends.name where active = true", ccl); } @@ -289,7 +290,7 @@ public void testNavigateWithCondition() { */ @Test public void testNavigateWithTimestamp() { - String ccl = Command.navigate("friends.name").from(1) + String ccl = Command.to().navigate("friends.name").from(1) .at(Timestamp.fromMicros(12345)).ccl(); Assert.assertEquals("navigate friends.name from 1 at 12345", ccl); } @@ -312,7 +313,7 @@ public void testNavigateWithTimestamp() { */ @Test public void testSelectSingleKeyFromRecord() { - String ccl = Command.select("name").from(1).ccl(); + String ccl = Command.to().select("name").from(1).ccl(); Assert.assertEquals("select name from 1", ccl); } @@ -334,7 +335,7 @@ public void testSelectSingleKeyFromRecord() { */ @Test public void testSelectKeyInRecordAlias() { - String ccl = Command.select("name").in(1).ccl(); + String ccl = Command.to().select("name").in(1).ccl(); Assert.assertEquals("select name from 1", ccl); } @@ -354,7 +355,7 @@ public void testSelectKeyInRecordAlias() { */ @Test public void testSelectAllInRecordAlias() { - String ccl = Command.selectAll().in(1).ccl(); + String ccl = Command.to().selectAll().in(1).ccl(); Assert.assertEquals("select 1", ccl); } @@ -375,7 +376,7 @@ public void testSelectAllInRecordAlias() { */ @Test public void testGetKeyInRecordAlias() { - String ccl = Command.get("name").in(1).ccl(); + String ccl = Command.to().get("name").in(1).ccl(); Assert.assertEquals("get name from 1", ccl); } @@ -397,7 +398,7 @@ public void testGetKeyInRecordAlias() { */ @Test public void testNavigateInRecordAlias() { - String ccl = Command.navigate("friends.name").in(1).ccl(); + String ccl = Command.to().navigate("friends.name").in(1).ccl(); Assert.assertEquals("navigate friends.name from 1", ccl); } @@ -419,7 +420,7 @@ public void testNavigateInRecordAlias() { */ @Test public void testSelectAllWithCondition() { - String ccl = Command.selectAll().where("active = true").ccl(); + String ccl = Command.to().selectAll().where("active = true").ccl(); Assert.assertEquals("select where active = true", ccl); } @@ -441,7 +442,7 @@ public void testSelectAllWithCondition() { */ @Test public void testSelectKeyWithinRecordAlias() { - String ccl = Command.select("name").within(1).ccl(); + String ccl = Command.to().select("name").within(1).ccl(); Assert.assertEquals("select name from 1", ccl); } @@ -461,7 +462,7 @@ public void testSelectKeyWithinRecordAlias() { */ @Test public void testSelectAllWithinRecordAlias() { - String ccl = Command.selectAll().within(1).ccl(); + String ccl = Command.to().selectAll().within(1).ccl(); Assert.assertEquals("select 1", ccl); } @@ -482,7 +483,7 @@ public void testSelectAllWithinRecordAlias() { */ @Test public void testGetKeyWithinRecordAlias() { - String ccl = Command.get("name").within(1).ccl(); + String ccl = Command.to().get("name").within(1).ccl(); Assert.assertEquals("get name from 1", ccl); } @@ -502,7 +503,7 @@ public void testGetKeyWithinRecordAlias() { */ @Test public void testGetAllWithinRecordAlias() { - String ccl = Command.getAll().within(1).ccl(); + String ccl = Command.to().getAll().within(1).ccl(); Assert.assertEquals("get 1", ccl); } @@ -524,7 +525,7 @@ public void testGetAllWithinRecordAlias() { */ @Test public void testNavigateWithinRecordAlias() { - String ccl = Command.navigate("friends.name").within(1).ccl(); + String ccl = Command.to().navigate("friends.name").within(1).ccl(); Assert.assertEquals("navigate friends.name from 1", ccl); } @@ -546,7 +547,7 @@ public void testNavigateWithinRecordAlias() { */ @Test public void testGetAllWithCondition() { - String ccl = Command.getAll().where("active = true").ccl(); + String ccl = Command.to().getAll().where("active = true").ccl(); Assert.assertEquals("get where active = true", ccl); } diff --git a/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/TemporalCommandTest.java b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/TemporalCommandTest.java index b60be5b9c..d55417454 100644 --- a/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/TemporalCommandTest.java +++ b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/TemporalCommandTest.java @@ -47,7 +47,7 @@ public class TemporalCommandTest { */ @Test public void testChronicle() { - String ccl = Command.chronicle("name").in(1).ccl(); + String ccl = Command.to().chronicle("name").in(1).ccl(); Assert.assertEquals("chronicle name in 1", ccl); } @@ -68,7 +68,7 @@ public void testChronicle() { */ @Test public void testChronicleWithTimestamp() { - String ccl = Command.chronicle("name").in(1) + String ccl = Command.to().chronicle("name").in(1) .at(Timestamp.fromMicros(100)).ccl(); Assert.assertEquals("chronicle name in 1 at 100", ccl); } @@ -90,7 +90,7 @@ public void testChronicleWithTimestamp() { */ @Test public void testChronicleWithRange() { - String ccl = Command.chronicle("name").in(1) + String ccl = Command.to().chronicle("name").in(1) .at(Timestamp.fromMicros(100)).at(Timestamp.fromMicros(200)) .ccl(); Assert.assertEquals("chronicle name in 1 at 100 at 200", ccl); @@ -113,7 +113,7 @@ public void testChronicleWithRange() { */ @Test public void testDiffRecord() { - String ccl = Command.diff(1L).at(Timestamp.fromMicros(100)).ccl(); + String ccl = Command.to().diff(1L).at(Timestamp.fromMicros(100)).ccl(); Assert.assertEquals("diff 1 at 100", ccl); } @@ -134,7 +134,7 @@ public void testDiffRecord() { */ @Test public void testDiffRecordRange() { - String ccl = Command.diff(1L).at(Timestamp.fromMicros(100)) + String ccl = Command.to().diff(1L).at(Timestamp.fromMicros(100)) .at(Timestamp.fromMicros(200)).ccl(); Assert.assertEquals("diff 1 at 100 at 200", ccl); } @@ -157,8 +157,8 @@ public void testDiffRecordRange() { */ @Test public void testDiffKeyInRecord() { - String ccl = Command.diff("name").in(1).at(Timestamp.fromMicros(100)) - .ccl(); + String ccl = Command.to().diff("name").in(1) + .at(Timestamp.fromMicros(100)).ccl(); Assert.assertEquals("diff name in 1 at 100", ccl); } @@ -180,8 +180,9 @@ public void testDiffKeyInRecord() { */ @Test public void testDiffKeyInRecordRange() { - String ccl = Command.diff("name").in(1).at(Timestamp.fromMicros(100)) - .at(Timestamp.fromMicros(200)).ccl(); + String ccl = Command.to().diff("name").in(1) + .at(Timestamp.fromMicros(100)).at(Timestamp.fromMicros(200)) + .ccl(); Assert.assertEquals("diff name in 1 at 100 at 200", ccl); } @@ -201,7 +202,7 @@ public void testDiffKeyInRecordRange() { */ @Test public void testAuditRecord() { - String ccl = Command.audit(1L).ccl(); + String ccl = Command.to().audit(1L).ccl(); Assert.assertEquals("audit 1", ccl); } @@ -222,7 +223,7 @@ public void testAuditRecord() { */ @Test public void testAuditRecordWithTimestamp() { - String ccl = Command.audit(1L).at(Timestamp.fromMicros(100)).ccl(); + String ccl = Command.to().audit(1L).at(Timestamp.fromMicros(100)).ccl(); Assert.assertEquals("audit 1 at 100", ccl); } @@ -243,7 +244,7 @@ public void testAuditRecordWithTimestamp() { */ @Test public void testAuditKeyInRecord() { - String ccl = Command.audit("name").in(1).ccl(); + String ccl = Command.to().audit("name").in(1).ccl(); Assert.assertEquals("audit name in 1", ccl); } @@ -265,7 +266,7 @@ public void testAuditKeyInRecord() { */ @Test public void testRevert() { - String ccl = Command.revert("name", "age").in(1, 2) + String ccl = Command.to().revert("name", "age").in(1, 2) .to(Timestamp.fromMicros(100)).ccl(); Assert.assertEquals("revert [name, age] in [1, 2] at 100", ccl); } @@ -288,7 +289,8 @@ public void testRevert() { */ @Test public void testReconcile() { - String ccl = Command.reconcile("name").in(1).with("jeff", "bob").ccl(); + String ccl = Command.to().reconcile("name").in(1).with("jeff", "bob") + .ccl(); Assert.assertTrue(ccl.contains("reconcile name in 1 with")); } @@ -310,7 +312,7 @@ public void testReconcile() { */ @Test public void testConsolidate() { - String ccl = Command.consolidate(1, 2, 3).ccl(); + String ccl = Command.to().consolidate(1, 2, 3).ccl(); Assert.assertEquals("consolidate 1 [2, 3]", ccl); } @@ -332,7 +334,7 @@ public void testConsolidate() { */ @Test public void testCalculateBasic() { - String ccl = Command.calculate("sum", "salary").ccl(); + String ccl = Command.to().calculate("sum", "salary").ccl(); Assert.assertEquals("calculate sum salary", ccl); } @@ -354,7 +356,7 @@ public void testCalculateBasic() { */ @Test public void testCalculateInRecords() { - String ccl = Command.calculate("avg", "age").in(1, 2).ccl(); + String ccl = Command.to().calculate("avg", "age").in(1, 2).ccl(); Assert.assertEquals("calculate avg age in [1, 2]", ccl); } @@ -375,8 +377,8 @@ public void testCalculateInRecords() { */ @Test public void testCalculateWithCondition() { - String ccl = Command.calculate("count", "status").where("active = true") - .ccl(); + String ccl = Command.to().calculate("count", "status") + .where("active = true").ccl(); Assert.assertTrue(ccl.contains("where")); Assert.assertEquals("calculate count status where active = true", ccl); } @@ -399,7 +401,7 @@ public void testCalculateWithCondition() { */ @Test public void testCalculateWithTimestamp() { - String ccl = Command.calculate("sum", "salary") + String ccl = Command.to().calculate("sum", "salary") .at(Timestamp.fromMicros(12345)).ccl(); Assert.assertEquals("calculate sum salary at 12345", ccl); } @@ -423,7 +425,7 @@ public void testCalculateWithTimestamp() { */ @Test public void testRevertFromRecordAlias() { - String ccl = Command.revert("name").from(1) + String ccl = Command.to().revert("name").from(1) .to(Timestamp.fromMicros(100)).ccl(); Assert.assertEquals("revert name in 1 at 100", ccl); } @@ -446,7 +448,7 @@ public void testRevertFromRecordAlias() { */ @Test public void testChronicleWithinRecordAlias() { - String ccl = Command.chronicle("name").within(1).ccl(); + String ccl = Command.to().chronicle("name").within(1).ccl(); Assert.assertEquals("chronicle name in 1", ccl); } @@ -467,7 +469,8 @@ public void testChronicleWithinRecordAlias() { */ @Test public void testDiffKeyOnly() { - String ccl = Command.diff("name").at(Timestamp.fromMicros(100)).ccl(); + String ccl = Command.to().diff("name").at(Timestamp.fromMicros(100)) + .ccl(); Assert.assertEquals("diff name at 100", ccl); } @@ -489,7 +492,7 @@ public void testDiffKeyOnly() { */ @Test public void testDiffKeyOnlyRange() { - String ccl = Command.diff("name").at(Timestamp.fromMicros(100)) + String ccl = Command.to().diff("name").at(Timestamp.fromMicros(100)) .at(Timestamp.fromMicros(200)).ccl(); Assert.assertEquals("diff name at 100 at 200", ccl); } @@ -513,7 +516,7 @@ public void testDiffKeyOnlyRange() { */ @Test public void testDiffKeyWithinRecordAlias() { - String ccl = Command.diff("name").within(1) + String ccl = Command.to().diff("name").within(1) .at(Timestamp.fromMicros(100)).ccl(); Assert.assertEquals("diff name in 1 at 100", ccl); } @@ -535,7 +538,7 @@ public void testDiffKeyWithinRecordAlias() { */ @Test public void testAuditKeyWithinRecordAlias() { - String ccl = Command.audit("name").within(1).ccl(); + String ccl = Command.to().audit("name").within(1).ccl(); Assert.assertEquals("audit name in 1", ccl); } @@ -558,7 +561,7 @@ public void testAuditKeyWithinRecordAlias() { */ @Test public void testRevertWithinRecordAlias() { - String ccl = Command.revert("name").within(1) + String ccl = Command.to().revert("name").within(1) .to(Timestamp.fromMicros(100)).ccl(); Assert.assertEquals("revert name in 1 at 100", ccl); } @@ -582,7 +585,7 @@ public void testRevertWithinRecordAlias() { */ @Test public void testRevertWithinMultipleRecordsAlias() { - String ccl = Command.revert("name").within(1, 2) + String ccl = Command.to().revert("name").within(1, 2) .to(Timestamp.fromMicros(100)).ccl(); Assert.assertEquals("revert name in [1, 2] at 100", ccl); } @@ -606,8 +609,8 @@ public void testRevertWithinMultipleRecordsAlias() { */ @Test public void testReconcileWithinRecordAlias() { - String ccl = Command.reconcile("name").within(1).with("jeff", "bob") - .ccl(); + String ccl = Command.to().reconcile("name").within(1) + .with("jeff", "bob").ccl(); Assert.assertTrue(ccl.contains("reconcile name in 1 with")); } @@ -629,7 +632,7 @@ public void testReconcileWithinRecordAlias() { */ @Test public void testCalculateFromRecordAlias() { - String ccl = Command.calculate("sum", "salary").from(1).ccl(); + String ccl = Command.to().calculate("sum", "salary").from(1).ccl(); Assert.assertEquals("calculate sum salary in 1", ccl); } @@ -652,7 +655,7 @@ public void testCalculateFromRecordAlias() { */ @Test public void testCalculateWithinRecordsAlias() { - String ccl = Command.calculate("avg", "age").within(1, 2).ccl(); + String ccl = Command.to().calculate("avg", "age").within(1, 2).ccl(); Assert.assertEquals("calculate avg age in [1, 2]", ccl); } @@ -674,7 +677,7 @@ public void testCalculateWithinRecordsAlias() { */ @Test public void testCalculateInSingleRecord() { - String ccl = Command.calculate("sum", "salary").in(1).ccl(); + String ccl = Command.to().calculate("sum", "salary").in(1).ccl(); Assert.assertEquals("calculate sum salary in 1", ccl); } diff --git a/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/WriteCommandTest.java b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/WriteCommandTest.java index 06db026d9..1c5c944cb 100644 --- a/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/WriteCommandTest.java +++ b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/WriteCommandTest.java @@ -44,7 +44,7 @@ public class WriteCommandTest { */ @Test public void testAddKeyValue() { - String ccl = Command.add("name").as("jeff").ccl(); + String ccl = Command.to().add("name").as("jeff").ccl(); Assert.assertEquals("add name as \"jeff\"", ccl); } @@ -66,7 +66,7 @@ public void testAddKeyValue() { */ @Test public void testAddKeyValueInRecord() { - String ccl = Command.add("name").as("jeff").in(1).ccl(); + String ccl = Command.to().add("name").as("jeff").in(1).ccl(); Assert.assertEquals("add name as \"jeff\" in 1", ccl); } @@ -88,7 +88,7 @@ public void testAddKeyValueInRecord() { */ @Test public void testAddKeyValueInMultipleRecords() { - String ccl = Command.add("name").as("jeff").in(1, 2, 3).ccl(); + String ccl = Command.to().add("name").as("jeff").in(1, 2, 3).ccl(); Assert.assertEquals("add name as \"jeff\" in [1, 2, 3]", ccl); } @@ -109,7 +109,7 @@ public void testAddKeyValueInMultipleRecords() { */ @Test public void testAddNumericValue() { - String ccl = Command.add("age").as(30).ccl(); + String ccl = Command.to().add("age").as(30).ccl(); Assert.assertEquals("add age as 30", ccl); } @@ -131,7 +131,7 @@ public void testAddNumericValue() { */ @Test public void testSetKeyValueInRecord() { - String ccl = Command.set("name").as("jeff").in(1).ccl(); + String ccl = Command.to().set("name").as("jeff").in(1).ccl(); Assert.assertEquals("set name as \"jeff\" in 1", ccl); } @@ -153,7 +153,7 @@ public void testSetKeyValueInRecord() { */ @Test public void testSetKeyValueInMultipleRecords() { - String ccl = Command.set("name").as("jeff").in(1, 2).ccl(); + String ccl = Command.to().set("name").as("jeff").in(1, 2).ccl(); Assert.assertEquals("set name as \"jeff\" in [1, 2]", ccl); } @@ -175,7 +175,7 @@ public void testSetKeyValueInMultipleRecords() { */ @Test public void testRemoveKeyValueFromRecord() { - String ccl = Command.remove("name").as("jeff").from(1).ccl(); + String ccl = Command.to().remove("name").as("jeff").from(1).ccl(); Assert.assertEquals("remove name as \"jeff\" from 1", ccl); } @@ -197,7 +197,7 @@ public void testRemoveKeyValueFromRecord() { */ @Test public void testClearKeysInRecords() { - String ccl = Command.clear("name", "age").from(1, 2).ccl(); + String ccl = Command.to().clear("name", "age").from(1, 2).ccl(); Assert.assertEquals("clear [name, age] from [1, 2]", ccl); } @@ -218,7 +218,7 @@ public void testClearKeysInRecords() { */ @Test public void testClearRecords() { - String ccl = Command.clear(1, 2).ccl(); + String ccl = Command.to().clear(1, 2).ccl(); Assert.assertEquals("clear [1, 2]", ccl); } @@ -239,7 +239,7 @@ public void testClearRecords() { */ @Test public void testClearSingleKeyInSingleRecord() { - String ccl = Command.clear("name").from(1).ccl(); + String ccl = Command.to().clear("name").from(1).ccl(); Assert.assertEquals("clear name from 1", ccl); } @@ -262,7 +262,7 @@ public void testClearSingleKeyInSingleRecord() { @Test public void testInsertJson() { String json = "{\"name\":\"jeff\"}"; - String ccl = Command.insert(json).ccl(); + String ccl = Command.to().insert(json).ccl(); Assert.assertEquals("insert '" + json + "'", ccl); } @@ -285,7 +285,7 @@ public void testInsertJson() { @Test public void testInsertJsonInRecord() { String json = "{\"name\":\"jeff\"}"; - String ccl = Command.insert(json).in(1).ccl(); + String ccl = Command.to().insert(json).in(1).ccl(); Assert.assertEquals("insert '" + json + "' in 1", ccl); } @@ -308,7 +308,7 @@ public void testInsertJsonInRecord() { */ @Test public void testRemoveKeyValueInRecordAlias() { - String ccl = Command.remove("name").as("jeff").in(1).ccl(); + String ccl = Command.to().remove("name").as("jeff").in(1).ccl(); Assert.assertEquals("remove name as \"jeff\" from 1", ccl); } @@ -329,7 +329,7 @@ public void testRemoveKeyValueInRecordAlias() { */ @Test public void testClearKeyInRecordAlias() { - String ccl = Command.clear("name").in(1).ccl(); + String ccl = Command.to().clear("name").in(1).ccl(); Assert.assertEquals("clear name from 1", ccl); } @@ -351,7 +351,7 @@ public void testClearKeyInRecordAlias() { */ @Test public void testAddKeyValueToRecordAlias() { - String ccl = Command.add("name").as("jeff").to(1).ccl(); + String ccl = Command.to().add("name").as("jeff").to(1).ccl(); Assert.assertEquals("add name as \"jeff\" in 1", ccl); } @@ -373,7 +373,7 @@ public void testAddKeyValueToRecordAlias() { */ @Test public void testAddKeyValueWithinRecordAlias() { - String ccl = Command.add("name").as("jeff").within(1).ccl(); + String ccl = Command.to().add("name").as("jeff").within(1).ccl(); Assert.assertEquals("add name as \"jeff\" in 1", ccl); } @@ -395,7 +395,7 @@ public void testAddKeyValueWithinRecordAlias() { */ @Test public void testSetKeyValueWithinRecordAlias() { - String ccl = Command.set("name").as("jeff").within(1).ccl(); + String ccl = Command.to().set("name").as("jeff").within(1).ccl(); Assert.assertEquals("set name as \"jeff\" in 1", ccl); } @@ -418,7 +418,7 @@ public void testSetKeyValueWithinRecordAlias() { @Test public void testInsertJsonIntoRecordAlias() { String json = "{\"name\":\"jeff\"}"; - String ccl = Command.insert(json).into(1).ccl(); + String ccl = Command.to().insert(json).into(1).ccl(); Assert.assertEquals("insert '" + json + "' in 1", ccl); } @@ -441,7 +441,7 @@ public void testInsertJsonIntoRecordAlias() { @Test public void testInsertJsonToRecordAlias() { String json = "{\"name\":\"jeff\"}"; - String ccl = Command.insert(json).to(1).ccl(); + String ccl = Command.to().insert(json).to(1).ccl(); Assert.assertEquals("insert '" + json + "' in 1", ccl); } @@ -464,7 +464,7 @@ public void testInsertJsonToRecordAlias() { @Test public void testInsertJsonWithinRecordAlias() { String json = "{\"name\":\"jeff\"}"; - String ccl = Command.insert(json).within(1).ccl(); + String ccl = Command.to().insert(json).within(1).ccl(); Assert.assertEquals("insert '" + json + "' in 1", ccl); } @@ -486,7 +486,7 @@ public void testInsertJsonWithinRecordAlias() { */ @Test public void testRemoveKeyValueWithinRecordAlias() { - String ccl = Command.remove("name").as("jeff").within(1).ccl(); + String ccl = Command.to().remove("name").as("jeff").within(1).ccl(); Assert.assertEquals("remove name as \"jeff\" from 1", ccl); } @@ -507,7 +507,7 @@ public void testRemoveKeyValueWithinRecordAlias() { */ @Test public void testClearKeyWithinRecordAlias() { - String ccl = Command.clear("name").within(1).ccl(); + String ccl = Command.to().clear("name").within(1).ccl(); Assert.assertEquals("clear name from 1", ccl); } @@ -529,7 +529,7 @@ public void testClearKeyWithinRecordAlias() { */ @Test public void testAddValueWithQuotes() { - String ccl = Command.add("title").as("say \"hello\"").ccl(); + String ccl = Command.to().add("title").as("say \"hello\"").ccl(); Assert.assertEquals("add title as \"say \\\"hello\\\"\"", ccl); } diff --git a/concourse-integration-tests/src/test/java/com/cinchapi/concourse/CommandExecutionTest.java b/concourse-integration-tests/src/test/java/com/cinchapi/concourse/CommandExecutionTest.java index 6f8fdc9f6..ed087786e 100644 --- a/concourse-integration-tests/src/test/java/com/cinchapi/concourse/CommandExecutionTest.java +++ b/concourse-integration-tests/src/test/java/com/cinchapi/concourse/CommandExecutionTest.java @@ -27,7 +27,7 @@ import com.cinchapi.concourse.test.Variables; /** - * Integration tests for the {@code exec}, {@code submit}, and {@code group} + * Integration tests for the {@code exec}, {@code submit}, and {@code prepare} * command execution APIs. * * @author Jeff Nelson @@ -54,7 +54,7 @@ public class CommandExecutionTest extends ConcourseIntegrationTest { public void testExecSingleAddCommand() { String key = Variables.register("key", "name"); String value = Variables.register("value", "Jeff"); - Command command = Command.add(key).as(value); + Command command = Command.to().add(key).as(value); Object result = client.exec(command); Assert.assertNotNull(result); long record = ((Number) result).longValue(); @@ -80,8 +80,8 @@ long record = ((Number) result).longValue(); */ @Test public void testExecMultipleCommandsReturnsLast() { - Command cmd1 = Command.add("name").as("Alice").in(1); - Command cmd2 = Command.add("name").as("Bob").in(2); + Command cmd1 = Command.to().add("name").as("Alice").in(1); + Command cmd2 = Command.to().add("name").as("Bob").in(2); Object result = client.exec(cmd1, cmd2); Assert.assertTrue((Boolean) result); Assert.assertTrue(client.verify("name", "Alice", 1)); @@ -106,8 +106,8 @@ public void testExecMultipleCommandsReturnsLast() { */ @Test public void testSubmitReturnsAllResults() { - Command cmd1 = Command.add("name").as("Alice").in(1); - Command cmd2 = Command.add("age").as(30).in(1); + Command cmd1 = Command.to().add("name").as("Alice").in(1); + Command cmd2 = Command.to().add("age").as(30).in(1); List results = client.submit(cmd1, cmd2); Assert.assertEquals(2, results.size()); Assert.assertTrue((Boolean) results.get(0)); @@ -117,14 +117,14 @@ public void testSubmitReturnsAllResults() { } /** - * Goal: Verify that {@code group()} collects commands and - * {@code submit(group)} executes them as a batch. + * Goal: Verify that {@code prepare()} collects commands + * and {@code submit(group)} executes them as a batch. *

    * Start state: An empty database. *

    * Workflow: *

      - *
    • Create a {@link CommandGroup} via {@code client.group()}.
    • + *
    • Create a {@link CommandGroup} via {@code client.prepare()}.
    • *
    • Add several operations to the group.
    • *
    • Submit the group.
    • *
    • Verify all operations took effect.
    • @@ -135,7 +135,7 @@ public void testSubmitReturnsAllResults() { */ @Test public void testGroupSubmit() { - CommandGroup group = client.group(); + CommandGroup group = client.prepare(); group.add("name", "Alice", 1); group.add("age", 25, 1); group.add("name", "Bob", 2); @@ -165,10 +165,10 @@ public void testGroupSubmit() { */ @Test public void testSubmitWithStageAndCommit() { - Command stage = Command.stage(); - Command add1 = Command.add("x").as(1).in(100); - Command add2 = Command.add("y").as(2).in(100); - Command commit = Command.commit(); + Command stage = Command.to().stage(); + Command add1 = Command.to().add("x").as(1).in(100); + Command add2 = Command.to().add("y").as(2).in(100); + Command commit = Command.to().commit(); List results = client.submit(stage, add1, add2, commit); Assert.assertEquals(4, results.size()); Assert.assertTrue(client.verify("x", 1, 100)); @@ -196,7 +196,7 @@ public void testSubmitWithStageAndCommit() { public void testExecWithinTransaction() { client.stage(); client.add("a", 1, 10); - client.exec(Command.add("b").as(2).in(10)); + client.exec(Command.to().add("b").as(2).in(10)); client.commit(); Assert.assertTrue(client.verify("a", 1, 10)); Assert.assertTrue(client.verify("b", 2, 10)); @@ -223,7 +223,7 @@ public void testExecWithinTransaction() { public void testExecSelectCommand() { client.add("name", "Alice", 1); client.add("age", 30, 1); - Command cmd = Command.select("name").from(1); + Command cmd = Command.to().select("name").from(1); Object result = client.exec(cmd); Assert.assertNotNull(result); Set values = (Set) result; @@ -252,7 +252,7 @@ public void testExecFindCommand() { client.add("score", 100, 1); client.add("score", 50, 2); client.add("score", 75, 3); - Command cmd = Command.find("score > 60"); + Command cmd = Command.to().find("score > 60"); Object result = client.exec(cmd); Assert.assertNotNull(result); Set records = (Set) result; @@ -281,7 +281,7 @@ public void testExecFindCommand() { public void testExecRemoveCommand() { client.add("color", "red", 5); Assert.assertTrue(client.verify("color", "red", 5)); - Command cmd = Command.remove("color").as("red").from(5); + Command cmd = Command.to().remove("color").as("red").from(5); Object result = client.exec(cmd); Assert.assertTrue((Boolean) result); Assert.assertFalse(client.verify("color", "red", 5)); @@ -303,7 +303,7 @@ public void testExecRemoveCommand() { */ @Test public void testExecPingCommand() { - Object result = client.exec(Command.ping()); + Object result = client.exec(Command.to().ping()); Assert.assertTrue((Boolean) result); } diff --git a/concourse-plugin-core/src/main/java/com/cinchapi/concourse/server/plugin/StatefulConcourseService.java b/concourse-plugin-core/src/main/java/com/cinchapi/concourse/server/plugin/StatefulConcourseService.java index 395a8f939..b796c3f3c 100644 --- a/concourse-plugin-core/src/main/java/com/cinchapi/concourse/server/plugin/StatefulConcourseService.java +++ b/concourse-plugin-core/src/main/java/com/cinchapi/concourse/server/plugin/StatefulConcourseService.java @@ -3184,6 +3184,14 @@ public List submit(List commands) { throw new UnsupportedOperationException(); } + public ComplexTObject execCcl(String ccl) { + throw new UnsupportedOperationException(); + } + + public List submitCcl(String ccl) { + throw new UnsupportedOperationException(); + } + public boolean ping() { throw new UnsupportedOperationException(); } diff --git a/concourse-server/src/main/java/com/cinchapi/concourse/server/ConcourseServer.java b/concourse-server/src/main/java/com/cinchapi/concourse/server/ConcourseServer.java index ff174bc7c..b33440f57 100644 --- a/concourse-server/src/main/java/com/cinchapi/concourse/server/ConcourseServer.java +++ b/concourse-server/src/main/java/com/cinchapi/concourse/server/ConcourseServer.java @@ -56,6 +56,7 @@ import org.jctools.maps.NonBlockingHashMap; import com.cinchapi.ccl.syntax.AbstractSyntaxTree; +import com.cinchapi.ccl.syntax.CommandTree; import com.cinchapi.ccl.util.NaturalLanguage; import com.cinchapi.common.base.AnyStrings; import com.cinchapi.common.base.Array; @@ -91,6 +92,7 @@ import com.cinchapi.concourse.server.monitoring.Tracker; import com.cinchapi.concourse.server.ops.AtomicOperations; import com.cinchapi.concourse.server.ops.CommandDispatcher; +import com.cinchapi.concourse.server.ops.CommandTreeConverter; import com.cinchapi.concourse.server.ops.InsufficientAtomicityException; import com.cinchapi.concourse.server.ops.Operations; import com.cinchapi.concourse.server.ops.Stores; @@ -1623,6 +1625,18 @@ public ComplexTObject exec(List commands, AccessToken creds, : results.get(results.size() - 1); } + @Override + @TranslateClientExceptions + @VerifyAccessToken + public ComplexTObject execCcl(String ccl, AccessToken creds, + TransactionToken transaction, String environment) + throws TException { + List results = submitCcl(ccl, creds, transaction, + environment); + return results.isEmpty() ? ComplexTObject.fromJavaObject(null) + : results.get(results.size() - 1); + } + @Override @TranslateClientExceptions @VerifyAccessToken @@ -6120,10 +6134,11 @@ public List submit(List commands, results.add(ComplexTObject.fromJavaObject(result)); } } - catch (TException e) { + catch (Exception e) { if(active != null && active != transaction) { - // If the batch started its own transaction (active != - // transaction), abort it so it doesn't leak on the server. + // NOTE: If the batch started its own transaction + // (active != transaction), abort it so it doesn't + // leak on the server. abort(creds, active, environment); } throw e; @@ -6131,6 +6146,20 @@ public List submit(List commands, return results; } + @Override + @TranslateClientExceptions + @VerifyAccessToken + public List submitCcl(String ccl, AccessToken creds, + TransactionToken transaction, String environment) + throws TException { + List trees = compiler.compile(ccl); + List commands = Lists.newArrayListWithCapacity(trees.size()); + for (AbstractSyntaxTree tree : trees) { + commands.add(CommandTreeConverter.convert((CommandTree) tree)); + } + return submit(commands, creds, transaction, environment); + } + /** * Start the server. * diff --git a/concourse-server/src/main/java/com/cinchapi/concourse/server/ops/CommandDispatcher.java b/concourse-server/src/main/java/com/cinchapi/concourse/server/ops/CommandDispatcher.java index dd98c9e92..c4eb31722 100644 --- a/concourse-server/src/main/java/com/cinchapi/concourse/server/ops/CommandDispatcher.java +++ b/concourse-server/src/main/java/com/cinchapi/concourse/server/ops/CommandDispatcher.java @@ -205,23 +205,13 @@ private static Object dispatchLink(TCommand cmd, Object server, throws TException { String key = cmd.getKeys().get(0); long source = cmd.getSourceRecord(); - List destinations = cmd.getRecords(); - if(destinations.size() == 1) { - return invoke(server, "addKeyValueRecord", key, - Convert.javaToThrift(Link.to(destinations.get(0))), source, - creds, transaction, environment); - } - else { - // NOTE: Link to multiple destinations requires individual add - // calls. Return the result of the last one. - Object result = null; - for (long destination : destinations) { - result = invoke(server, "addKeyValueRecord", key, - Convert.javaToThrift(Link.to(destination)), source, - creds, transaction, environment); - } - return result; + Object result = null; + for (long destination : cmd.getRecords()) { + result = invoke(server, "addKeyValueRecord", key, + Convert.javaToThrift(Link.to(destination)), source, creds, + transaction, environment); } + return result; } /** diff --git a/concourse-server/src/main/java/com/cinchapi/concourse/server/ops/CommandTreeConverter.java b/concourse-server/src/main/java/com/cinchapi/concourse/server/ops/CommandTreeConverter.java new file mode 100644 index 000000000..76584846f --- /dev/null +++ b/concourse-server/src/main/java/com/cinchapi/concourse/server/ops/CommandTreeConverter.java @@ -0,0 +1,813 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.server.ops; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +import com.cinchapi.ccl.grammar.ConjunctionSymbol; +import com.cinchapi.ccl.grammar.DirectionSymbol; +import com.cinchapi.ccl.grammar.ExpressionSymbol; +import com.cinchapi.ccl.grammar.KeyTokenSymbol; +import com.cinchapi.ccl.grammar.OrderComponentSymbol; +import com.cinchapi.ccl.grammar.OrderSymbol; +import com.cinchapi.ccl.grammar.PageSymbol; +import com.cinchapi.ccl.grammar.TimestampSymbol; +import com.cinchapi.ccl.grammar.ValueTokenSymbol; +import com.cinchapi.ccl.grammar.command.AbortSymbol; +import com.cinchapi.ccl.grammar.command.AddSymbol; +import com.cinchapi.ccl.grammar.command.AuditSymbol; +import com.cinchapi.ccl.grammar.command.BrowseSymbol; +import com.cinchapi.ccl.grammar.command.CalculateSymbol; +import com.cinchapi.ccl.grammar.command.ChronicleSymbol; +import com.cinchapi.ccl.grammar.command.ClearSymbol; +import com.cinchapi.ccl.grammar.command.CommandSymbol; +import com.cinchapi.ccl.grammar.command.CommitSymbol; +import com.cinchapi.ccl.grammar.command.ConsolidateSymbol; +import com.cinchapi.ccl.grammar.command.DescribeSymbol; +import com.cinchapi.ccl.grammar.command.DiffSymbol; +import com.cinchapi.ccl.grammar.command.FindOrAddSymbol; +import com.cinchapi.ccl.grammar.command.FindOrInsertSymbol; +import com.cinchapi.ccl.grammar.command.FindSymbol; +import com.cinchapi.ccl.grammar.command.GetSymbol; +import com.cinchapi.ccl.grammar.command.HoldsSymbol; +import com.cinchapi.ccl.grammar.command.InsertSymbol; +import com.cinchapi.ccl.grammar.command.InventorySymbol; +import com.cinchapi.ccl.grammar.command.JsonifySymbol; +import com.cinchapi.ccl.grammar.command.LinkSymbol; +import com.cinchapi.ccl.grammar.command.NavigateSymbol; +import com.cinchapi.ccl.grammar.command.PingSymbol; +import com.cinchapi.ccl.grammar.command.ReconcileSymbol; +import com.cinchapi.ccl.grammar.command.RemoveSymbol; +import com.cinchapi.ccl.grammar.command.RevertSymbol; +import com.cinchapi.ccl.grammar.command.SearchSymbol; +import com.cinchapi.ccl.grammar.command.SelectSymbol; +import com.cinchapi.ccl.grammar.command.SetSymbol; +import com.cinchapi.ccl.grammar.command.StageSymbol; +import com.cinchapi.ccl.grammar.command.TraceSymbol; +import com.cinchapi.ccl.grammar.command.UnlinkSymbol; +import com.cinchapi.ccl.grammar.command.VerifyAndSwapSymbol; +import com.cinchapi.ccl.grammar.command.VerifyOrSetSymbol; +import com.cinchapi.ccl.grammar.command.VerifySymbol; +import com.cinchapi.ccl.syntax.CommandTree; +import com.cinchapi.ccl.syntax.ConditionTree; +import com.cinchapi.ccl.syntax.ConjunctionTree; +import com.cinchapi.ccl.syntax.ExpressionTree; +import com.cinchapi.ccl.syntax.OrderTree; +import com.cinchapi.ccl.syntax.PageTree; +import com.cinchapi.concourse.thrift.TCommand; +import com.cinchapi.concourse.thrift.TCommandVerb; +import com.cinchapi.concourse.thrift.TObject; +import com.cinchapi.concourse.thrift.TOrder; +import com.cinchapi.concourse.thrift.TOrderComponent; +import com.cinchapi.concourse.thrift.TPage; +import com.cinchapi.concourse.util.Convert; + +/** + * Convert a {@link CommandTree} produced by the CCL compiler into a + * {@link TCommand} suitable for dispatch via {@link CommandDispatcher}. + * + * @author Jeff Nelson + */ +public final class CommandTreeConverter { + + /** + * Convert a {@link CommandTree} to a {@link TCommand}. + * + * @param tree the {@link CommandTree} to convert + * @return the equivalent {@link TCommand} + * @throws UnsupportedOperationException if the command type is not + * recognized + */ + public static TCommand convert(CommandTree tree) { + CommandSymbol symbol = (CommandSymbol) tree.root(); + TCommand tc; + if(symbol instanceof FindSymbol) { + tc = convertFind((FindSymbol) symbol, tree); + } + else if(symbol instanceof SelectSymbol) { + tc = convertSelect((SelectSymbol) symbol, tree); + } + else if(symbol instanceof GetSymbol) { + tc = convertGet((GetSymbol) symbol, tree); + } + else if(symbol instanceof NavigateSymbol) { + tc = convertNavigate((NavigateSymbol) symbol, tree); + } + else if(symbol instanceof AddSymbol) { + tc = convertAdd((AddSymbol) symbol); + } + else if(symbol instanceof SetSymbol) { + tc = convertSet((SetSymbol) symbol); + } + else if(symbol instanceof RemoveSymbol) { + tc = convertRemove((RemoveSymbol) symbol); + } + else if(symbol instanceof ClearSymbol) { + tc = convertClear((ClearSymbol) symbol); + } + else if(symbol instanceof InsertSymbol) { + tc = convertInsert((InsertSymbol) symbol); + } + else if(symbol instanceof LinkSymbol) { + tc = convertLink((LinkSymbol) symbol); + } + else if(symbol instanceof UnlinkSymbol) { + tc = convertUnlink((UnlinkSymbol) symbol); + } + else if(symbol instanceof VerifySymbol) { + tc = convertVerify((VerifySymbol) symbol); + } + else if(symbol instanceof VerifyAndSwapSymbol) { + tc = convertVerifyAndSwap((VerifyAndSwapSymbol) symbol); + } + else if(symbol instanceof VerifyOrSetSymbol) { + tc = convertVerifyOrSet((VerifyOrSetSymbol) symbol); + } + else if(symbol instanceof FindOrAddSymbol) { + tc = convertFindOrAdd((FindOrAddSymbol) symbol, tree); + } + else if(symbol instanceof FindOrInsertSymbol) { + tc = convertFindOrInsert((FindOrInsertSymbol) symbol, tree); + } + else if(symbol instanceof SearchSymbol) { + tc = convertSearch((SearchSymbol) symbol); + } + else if(symbol instanceof BrowseSymbol) { + tc = convertBrowse((BrowseSymbol) symbol); + } + else if(symbol instanceof DescribeSymbol) { + tc = convertDescribe((DescribeSymbol) symbol); + } + else if(symbol instanceof TraceSymbol) { + tc = convertTrace((TraceSymbol) symbol); + } + else if(symbol instanceof HoldsSymbol) { + tc = convertHolds((HoldsSymbol) symbol); + } + else if(symbol instanceof JsonifySymbol) { + tc = convertJsonify((JsonifySymbol) symbol); + } + else if(symbol instanceof ChronicleSymbol) { + tc = convertChronicle((ChronicleSymbol) symbol); + } + else if(symbol instanceof DiffSymbol) { + tc = convertDiff((DiffSymbol) symbol); + } + else if(symbol instanceof AuditSymbol) { + tc = convertAudit((AuditSymbol) symbol); + } + else if(symbol instanceof RevertSymbol) { + tc = convertRevert((RevertSymbol) symbol); + } + else if(symbol instanceof ReconcileSymbol) { + tc = convertReconcile((ReconcileSymbol) symbol); + } + else if(symbol instanceof ConsolidateSymbol) { + tc = convertConsolidate((ConsolidateSymbol) symbol); + } + else if(symbol instanceof CalculateSymbol) { + tc = convertCalculate((CalculateSymbol) symbol, tree); + } + else if(symbol instanceof PingSymbol) { + tc = new TCommand(TCommandVerb.PING); + } + else if(symbol instanceof StageSymbol) { + tc = new TCommand(TCommandVerb.STAGE); + } + else if(symbol instanceof CommitSymbol) { + tc = new TCommand(TCommandVerb.COMMIT); + } + else if(symbol instanceof AbortSymbol) { + tc = new TCommand(TCommandVerb.ABORT); + } + else if(symbol instanceof InventorySymbol) { + tc = new TCommand(TCommandVerb.INVENTORY); + } + else { + throw new UnsupportedOperationException( + "Cannot convert command of type " + symbol.type()); + } + return tc; + } + + /** + * Render a {@link ConditionTree} back to a CCL condition string that can be + * used with the {@code condition} field of a {@link TCommand}. + * + * @param tree the {@link ConditionTree} to render + * @return the CCL condition string + */ + /* package */ static String renderCondition(ConditionTree tree) { + if(tree instanceof ExpressionTree) { + ExpressionSymbol expr = (ExpressionSymbol) tree.root(); + StringBuilder sb = new StringBuilder(); + sb.append(expr.key().key().toString()); + sb.append(' ').append(expr.operator().toString()); + for (ValueTokenSymbol value : expr.values()) { + sb.append(' ').append(value.toString()); + } + if(expr.timestamp() != null + && expr.timestamp() != TimestampSymbol.PRESENT) { + sb.append(" at ").append(expr.timestamp().timestamp()); + } + return sb.toString(); + } + else if(tree instanceof ConjunctionTree) { + ConjunctionTree ct = (ConjunctionTree) tree; + String left = renderCondition(ct.left()); + String right = renderCondition(ct.right()); + ConjunctionSymbol conj = (ConjunctionSymbol) ct.root(); + return "(" + left + " " + conj.name().toLowerCase() + " " + right + + ")"; + } + else { + throw new UnsupportedOperationException( + "Cannot render condition tree of type " + + tree.getClass().getName()); + } + } + + /** + * Convert an {@link OrderTree} to a {@link TOrder}. + * + * @param tree the {@link OrderTree} to convert + * @return the equivalent {@link TOrder} + */ + private static TOrder convertOrder(OrderTree tree) { + OrderSymbol sym = (OrderSymbol) tree.root(); + List spec = new ArrayList<>(); + for (OrderComponentSymbol comp : sym.components()) { + TOrderComponent toc = new TOrderComponent( + comp.key().key().toString(), + comp.direction() == DirectionSymbol.ASCENDING ? 0 : 1); + if(comp.timestamp() != null + && comp.timestamp() != TimestampSymbol.PRESENT) { + toc.setTimestamp( + Convert.javaToThrift(comp.timestamp().timestamp())); + } + spec.add(toc); + } + return new TOrder(spec); + } + + /** + * Convert a {@link PageTree} to a {@link TPage}. + * + * @param tree the {@link PageTree} to convert + * @return the equivalent {@link TPage} + */ + private static TPage convertPage(PageTree tree) { + PageSymbol sym = (PageSymbol) tree.root(); + return new TPage(sym.skip(), sym.limit()); + } + + /** + * Apply the optional condition from a {@link CommandTree} to a + * {@link TCommand}. + * + * @param tc the {@link TCommand} to modify + * @param tree the {@link CommandTree} containing the condition + */ + private static void applyCondition(TCommand tc, CommandTree tree) { + ConditionTree ct = tree.conditionTree(); + if(ct != null) { + tc.setCondition(renderCondition(ct)); + } + } + + /** + * Apply the optional order from a {@link CommandTree} to a + * {@link TCommand}. + * + * @param tc the {@link TCommand} to modify + * @param tree the {@link CommandTree} containing the order + */ + private static void applyOrder(TCommand tc, CommandTree tree) { + OrderTree ot = tree.orderTree(); + if(ot != null) { + tc.setOrder(convertOrder(ot)); + } + } + + /** + * Apply the optional page from a {@link CommandTree} to a {@link TCommand}. + * + * @param tc the {@link TCommand} to modify + * @param tree the {@link CommandTree} containing the page + */ + private static void applyPage(TCommand tc, CommandTree tree) { + PageTree pt = tree.pageTree(); + if(pt != null) { + tc.setPage(convertPage(pt)); + } + } + + /** + * Set the timestamp on a {@link TCommand} if the given + * {@link TimestampSymbol} is not {@code null} and not + * {@link TimestampSymbol#PRESENT}. + * + * @param tc the {@link TCommand} to modify + * @param ts the {@link TimestampSymbol}, or {@code null} + */ + private static void setTimestamp(TCommand tc, TimestampSymbol ts) { + if(ts != null && ts != TimestampSymbol.PRESENT) { + tc.setTimestamp(ts.timestamp()); + } + } + + /** + * Extract key strings from a collection of {@link KeyTokenSymbol + * KeyTokenSymbols}. + * + * @param keys the key symbols + * @return a list of key strings + */ + private static List extractKeys( + Collection> keys) { + return keys.stream().map(k -> k.key().toString()) + .collect(Collectors.toList()); + } + + /** + * Collect a single record and an optional collection of records into a + * single list. + * + * @param record the single record, or {@code null} + * @param records the additional records, or {@code null} + * @return the consolidated list + */ + private static List collectRecords(Long record, + Collection records) { + if(records != null) { + return new ArrayList<>(records); + } + else if(record != null) { + return Collections.singletonList(record); + } + else { + return null; + } + } + + /** + * Convert a value from a {@link ValueTokenSymbol} to a {@link TObject}. + * + * @param value the value symbol + * @return the {@link TObject} + */ + private static TObject convertValue(ValueTokenSymbol value) { + return Convert.javaToThrift(value.value()); + } + + // ---- Individual command conversions ---- + + /** + * Convert a {@link FindSymbol}. + */ + private static TCommand convertFind(FindSymbol sym, CommandTree tree) { + TCommand tc = new TCommand(TCommandVerb.FIND); + applyCondition(tc, tree); + setTimestamp(tc, sym.timestamp()); + applyOrder(tc, tree); + applyPage(tc, tree); + return tc; + } + + /** + * Convert a {@link SelectSymbol}. + */ + private static TCommand convertSelect(SelectSymbol sym, CommandTree tree) { + TCommand tc = new TCommand(TCommandVerb.SELECT); + if(sym.keys() != null && !sym.keys().isEmpty()) { + tc.setKeys(extractKeys(sym.keys())); + } + List records = collectRecords(sym.record(), sym.records()); + if(records != null) { + tc.setRecords(records); + } + applyCondition(tc, tree); + setTimestamp(tc, sym.timestamp()); + applyOrder(tc, tree); + applyPage(tc, tree); + return tc; + } + + /** + * Convert a {@link GetSymbol}. + */ + private static TCommand convertGet(GetSymbol sym, CommandTree tree) { + TCommand tc = new TCommand(TCommandVerb.GET); + if(sym.key() != null) { + tc.setKeys(Collections.singletonList(sym.key().key().toString())); + } + else if(sym.keys() != null && !sym.keys().isEmpty()) { + tc.setKeys(extractKeys(sym.keys())); + } + if(sym.record() >= 0) { + tc.setRecords(Collections.singletonList(sym.record())); + } + else if(sym.records() != null) { + tc.setRecords(new ArrayList<>(sym.records())); + } + applyCondition(tc, tree); + setTimestamp(tc, sym.timestamp()); + applyOrder(tc, tree); + applyPage(tc, tree); + return tc; + } + + /** + * Convert a {@link NavigateSymbol}. + */ + private static TCommand convertNavigate(NavigateSymbol sym, + CommandTree tree) { + TCommand tc = new TCommand(TCommandVerb.NAVIGATE); + if(sym.keys() != null && !sym.keys().isEmpty()) { + tc.setKeys(extractKeys(sym.keys())); + } + Long record = sym.record(); + Collection records = sym.records(); + if(record != null) { + tc.setRecords(Collections.singletonList(record)); + } + else if(records != null) { + tc.setRecords(new ArrayList<>(records)); + } + // NOTE: NavigateSymbol may carry its own ccl() condition + // string, but we prefer the ConditionTree from the + // CommandTree since it's more reliable. + applyCondition(tc, tree); + setTimestamp(tc, sym.timestamp()); + return tc; + } + + /** + * Convert an {@link AddSymbol}. + */ + private static TCommand convertAdd(AddSymbol sym) { + TCommand tc = new TCommand(TCommandVerb.ADD); + tc.setKeys(Collections.singletonList(sym.key().key().toString())); + tc.setValue(convertValue(sym.value())); + List records = collectRecords(sym.record(), sym.records()); + if(records != null) { + tc.setRecords(records); + } + return tc; + } + + /** + * Convert a {@link SetSymbol}. + */ + private static TCommand convertSet(SetSymbol sym) { + TCommand tc = new TCommand(TCommandVerb.SET); + tc.setKeys(Collections.singletonList(sym.key().key().toString())); + tc.setValue(convertValue(sym.value())); + if(sym.records() != null) { + tc.setRecords(new ArrayList<>(sym.records())); + } + else if(sym.record() >= 0) { + tc.setRecords(Collections.singletonList(sym.record())); + } + return tc; + } + + /** + * Convert a {@link RemoveSymbol}. + */ + private static TCommand convertRemove(RemoveSymbol sym) { + TCommand tc = new TCommand(TCommandVerb.REMOVE); + tc.setKeys(Collections.singletonList(sym.key().key().toString())); + if(sym.value() != null) { + tc.setValue(convertValue(sym.value())); + } + if(sym.records() != null) { + tc.setRecords(new ArrayList<>(sym.records())); + } + else if(sym.record() >= 0) { + tc.setRecords(Collections.singletonList(sym.record())); + } + return tc; + } + + /** + * Convert a {@link ClearSymbol}. + */ + private static TCommand convertClear(ClearSymbol sym) { + TCommand tc = new TCommand(TCommandVerb.CLEAR); + if(sym.key() != null) { + tc.setKeys(Collections.singletonList(sym.key().key().toString())); + } + else if(sym.keys() != null) { + tc.setKeys(extractKeys(sym.keys())); + } + if(sym.records() != null) { + tc.setRecords(new ArrayList<>(sym.records())); + } + else if(sym.record() >= 0) { + tc.setRecords(Collections.singletonList(sym.record())); + } + return tc; + } + + /** + * Convert an {@link InsertSymbol}. + */ + private static TCommand convertInsert(InsertSymbol sym) { + TCommand tc = new TCommand(TCommandVerb.INSERT); + tc.setJson(sym.json()); + List records = collectRecords(sym.record(), sym.records()); + if(records != null) { + tc.setRecords(records); + } + return tc; + } + + /** + * Convert a {@link LinkSymbol}. + */ + private static TCommand convertLink(LinkSymbol sym) { + TCommand tc = new TCommand(TCommandVerb.LINK); + tc.setKeys(Collections.singletonList(sym.key().key().toString())); + tc.setSourceRecord(sym.source()); + tc.setRecords(new ArrayList<>(sym.destinations())); + return tc; + } + + /** + * Convert an {@link UnlinkSymbol}. + */ + private static TCommand convertUnlink(UnlinkSymbol sym) { + TCommand tc = new TCommand(TCommandVerb.UNLINK); + tc.setKeys(Collections.singletonList(sym.key().key().toString())); + tc.setSourceRecord(sym.source()); + tc.setRecords(Collections.singletonList(sym.destination())); + return tc; + } + + /** + * Convert a {@link VerifySymbol}. + */ + private static TCommand convertVerify(VerifySymbol sym) { + TCommand tc = new TCommand(TCommandVerb.VERIFY); + tc.setKeys(Collections.singletonList(sym.key().key().toString())); + tc.setValue(convertValue(sym.value())); + tc.setRecords(Collections.singletonList(sym.record())); + setTimestamp(tc, sym.timestamp()); + return tc; + } + + /** + * Convert a {@link VerifyAndSwapSymbol}. + */ + private static TCommand convertVerifyAndSwap(VerifyAndSwapSymbol sym) { + TCommand tc = new TCommand(TCommandVerb.VERIFY_AND_SWAP); + tc.setKeys(Collections.singletonList(sym.key().key().toString())); + tc.setValue(convertValue(sym.expected())); + tc.setReplacement(convertValue(sym.replacement())); + tc.setRecords(Collections.singletonList(sym.record())); + return tc; + } + + /** + * Convert a {@link VerifyOrSetSymbol}. + */ + private static TCommand convertVerifyOrSet(VerifyOrSetSymbol sym) { + TCommand tc = new TCommand(TCommandVerb.VERIFY_OR_SET); + tc.setKeys(Collections.singletonList(sym.key().key().toString())); + tc.setValue(convertValue(sym.value())); + tc.setRecords(Collections.singletonList(sym.record())); + return tc; + } + + /** + * Convert a {@link FindOrAddSymbol}. + */ + private static TCommand convertFindOrAdd(FindOrAddSymbol sym, + CommandTree tree) { + TCommand tc = new TCommand(TCommandVerb.FIND_OR_ADD); + tc.setKeys(Collections.singletonList(sym.key().key().toString())); + tc.setValue(convertValue(sym.value())); + return tc; + } + + /** + * Convert a {@link FindOrInsertSymbol}. + */ + private static TCommand convertFindOrInsert(FindOrInsertSymbol sym, + CommandTree tree) { + TCommand tc = new TCommand(TCommandVerb.FIND_OR_INSERT); + applyCondition(tc, tree); + setTimestamp(tc, sym.timestamp()); + tc.setJson(sym.json()); + return tc; + } + + /** + * Convert a {@link SearchSymbol}. + */ + private static TCommand convertSearch(SearchSymbol sym) { + TCommand tc = new TCommand(TCommandVerb.SEARCH); + tc.setKeys(Collections.singletonList(sym.key().key().toString())); + tc.setQuery(sym.query()); + return tc; + } + + /** + * Convert a {@link BrowseSymbol}. + */ + private static TCommand convertBrowse(BrowseSymbol sym) { + TCommand tc = new TCommand(TCommandVerb.BROWSE); + if(sym.keys() != null && !sym.keys().isEmpty()) { + tc.setKeys(extractKeys(sym.keys())); + } + setTimestamp(tc, sym.timestamp()); + return tc; + } + + /** + * Convert a {@link DescribeSymbol}. + */ + private static TCommand convertDescribe(DescribeSymbol sym) { + TCommand tc = new TCommand(TCommandVerb.DESCRIBE); + List records = collectRecords(sym.record(), sym.records()); + if(records != null) { + tc.setRecords(records); + } + setTimestamp(tc, sym.timestamp()); + return tc; + } + + /** + * Convert a {@link TraceSymbol}. + */ + private static TCommand convertTrace(TraceSymbol sym) { + TCommand tc = new TCommand(TCommandVerb.TRACE); + List records = collectRecords(sym.record(), sym.records()); + if(records != null) { + tc.setRecords(records); + } + setTimestamp(tc, sym.timestamp()); + return tc; + } + + /** + * Convert a {@link HoldsSymbol}. + */ + private static TCommand convertHolds(HoldsSymbol sym) { + TCommand tc = new TCommand(TCommandVerb.HOLDS); + List records = collectRecords(sym.record(), sym.records()); + if(records != null) { + tc.setRecords(records); + } + return tc; + } + + /** + * Convert a {@link JsonifySymbol}. + */ + private static TCommand convertJsonify(JsonifySymbol sym) { + TCommand tc = new TCommand(TCommandVerb.JSONIFY); + List records = collectRecords(sym.record(), sym.records()); + if(records != null) { + tc.setRecords(records); + } + setTimestamp(tc, sym.timestamp()); + return tc; + } + + /** + * Convert a {@link ChronicleSymbol}. + */ + private static TCommand convertChronicle(ChronicleSymbol sym) { + TCommand tc = new TCommand(TCommandVerb.CHRONICLE); + tc.setKeys(Collections.singletonList(sym.key().key().toString())); + tc.setRecords(Collections.singletonList(sym.record())); + if(sym.start() != null && sym.start() != TimestampSymbol.PRESENT) { + tc.setTimestamp(sym.start().timestamp()); + } + if(sym.end() != null && sym.end() != TimestampSymbol.PRESENT) { + tc.setEndTimestamp(sym.end().timestamp()); + } + return tc; + } + + /** + * Convert a {@link DiffSymbol}. + */ + private static TCommand convertDiff(DiffSymbol sym) { + TCommand tc = new TCommand(TCommandVerb.DIFF); + if(sym.key() != null) { + tc.setKeys(Collections.singletonList(sym.key().key().toString())); + } + if(sym.record() != null) { + tc.setRecords(Collections.singletonList(sym.record())); + } + tc.setTimestamp(sym.start().timestamp()); + if(sym.end() != null && sym.end() != TimestampSymbol.PRESENT) { + tc.setEndTimestamp(sym.end().timestamp()); + } + return tc; + } + + /** + * Convert an {@link AuditSymbol}. + */ + private static TCommand convertAudit(AuditSymbol sym) { + TCommand tc = new TCommand(TCommandVerb.AUDIT); + if(sym.key() != null) { + tc.setKeys(Collections.singletonList(sym.key().key().toString())); + } + tc.setRecords(Collections.singletonList(sym.record())); + if(sym.start() != null && sym.start() != TimestampSymbol.PRESENT) { + tc.setTimestamp(sym.start().timestamp()); + } + if(sym.end() != null && sym.end() != TimestampSymbol.PRESENT) { + tc.setEndTimestamp(sym.end().timestamp()); + } + return tc; + } + + /** + * Convert a {@link RevertSymbol}. + */ + private static TCommand convertRevert(RevertSymbol sym) { + TCommand tc = new TCommand(TCommandVerb.REVERT); + if(sym.key() != null) { + tc.setKeys(Collections.singletonList(sym.key().key().toString())); + } + else if(sym.keys() != null) { + tc.setKeys(extractKeys(sym.keys())); + } + if(sym.records() != null) { + tc.setRecords(new ArrayList<>(sym.records())); + } + else if(sym.record() >= 0) { + tc.setRecords(Collections.singletonList(sym.record())); + } + tc.setTimestamp(sym.timestamp().timestamp()); + return tc; + } + + /** + * Convert a {@link ReconcileSymbol}. + */ + private static TCommand convertReconcile(ReconcileSymbol sym) { + TCommand tc = new TCommand(TCommandVerb.RECONCILE); + tc.setKeys(Collections.singletonList(sym.key().key().toString())); + tc.setRecords(Collections.singletonList(sym.record())); + List values = sym.values().stream() + .map(CommandTreeConverter::convertValue) + .collect(Collectors.toList()); + tc.setValues(values); + return tc; + } + + /** + * Convert a {@link ConsolidateSymbol}. + */ + private static TCommand convertConsolidate(ConsolidateSymbol sym) { + TCommand tc = new TCommand(TCommandVerb.CONSOLIDATE); + List records = new ArrayList<>(); + records.add(sym.first()); + records.addAll(sym.remaining()); + tc.setRecords(records); + return tc; + } + + /** + * Convert a {@link CalculateSymbol}. + */ + private static TCommand convertCalculate(CalculateSymbol sym, + CommandTree tree) { + TCommand tc = new TCommand(TCommandVerb.CALCULATE); + tc.setFunction(sym.function()); + tc.setKeys(Collections.singletonList(sym.key().key().toString())); + if(sym.records() != null) { + tc.setRecords(new ArrayList<>(sym.records())); + } + applyCondition(tc, tree); + setTimestamp(tc, sym.timestamp()); + return tc; + } + + private CommandTreeConverter() {/* no-init */} + +} diff --git a/concourse-server/src/test/java/com/cinchapi/concourse/server/ops/CommandDispatcherTest.java b/concourse-server/src/test/java/com/cinchapi/concourse/server/ops/CommandDispatcherTest.java new file mode 100644 index 000000000..d5cb4a6fb --- /dev/null +++ b/concourse-server/src/test/java/com/cinchapi/concourse/server/ops/CommandDispatcherTest.java @@ -0,0 +1,453 @@ +/* + * Copyright (c) 2013-2026 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.server.ops; + +import java.util.List; + +import org.junit.Assert; +import org.junit.Test; + +import com.cinchapi.common.reflect.Reflection; +import com.cinchapi.concourse.test.ConcourseBaseTest; +import com.cinchapi.concourse.test.Variables; +import com.cinchapi.concourse.thrift.TCommand; +import com.cinchapi.concourse.thrift.TCommandVerb; +import com.cinchapi.concourse.util.Convert; +import com.google.common.collect.ImmutableList; + +/** + * Unit tests for {@link CommandDispatcher}. + * + * @author Jeff Nelson + */ +public class CommandDispatcherTest extends ConcourseBaseTest { + + /** + * Goal: Verify that an ADD command with a single record + * resolves to {@code addKeyValueRecord}. + *

      + * Start state: No prior state needed. + *

      + * Workflow: + *

        + *
      • Create a {@link TCommand} with verb ADD, one key, one value, and one + * record.
      • + *
      • Call {@code resolveMethodName}.
      • + *
      + *

      + * Expected: The resolved method name is + * {@code "addKeyValueRecord"}. + */ + @Test + public void testResolveMethodNameAddKeyValueRecord() { + TCommand cmd = Variables.register("cmd", + new TCommand(TCommandVerb.ADD)); + cmd.setKeys(ImmutableList.of("name")); + cmd.setValue(Convert.javaToThrift("Alice")); + cmd.setRecords(ImmutableList.of(1L)); + String methodName = Variables.register("methodName", + resolveMethodName(cmd)); + Assert.assertEquals("addKeyValueRecord", methodName); + } + + /** + * Goal: Verify that an ADD command without a record + * resolves to {@code addKeyValue}. + *

      + * Start state: No prior state needed. + *

      + * Workflow: + *

        + *
      • Create a {@link TCommand} with verb ADD, one key, and one value but + * no record.
      • + *
      • Call {@code resolveMethodName}.
      • + *
      + *

      + * Expected: The resolved method name is + * {@code "addKeyValue"}. + */ + @Test + public void testResolveMethodNameAddKeyValue() { + TCommand cmd = Variables.register("cmd", + new TCommand(TCommandVerb.ADD)); + cmd.setKeys(ImmutableList.of("name")); + cmd.setValue(Convert.javaToThrift("Alice")); + String methodName = Variables.register("methodName", + resolveMethodName(cmd)); + Assert.assertEquals("addKeyValue", methodName); + } + + /** + * Goal: Verify that a SELECT command with a single key and + * single record resolves to {@code selectKeyRecord}. + *

      + * Start state: No prior state needed. + *

      + * Workflow: + *

        + *
      • Create a {@link TCommand} with verb SELECT, one key, and one + * record.
      • + *
      • Call {@code resolveMethodName}.
      • + *
      + *

      + * Expected: The resolved method name is + * {@code "selectKeyRecord"}. + */ + @Test + public void testResolveMethodNameSelectKeyRecord() { + TCommand cmd = Variables.register("cmd", + new TCommand(TCommandVerb.SELECT)); + cmd.setKeys(ImmutableList.of("name")); + cmd.setRecords(ImmutableList.of(1L)); + String methodName = Variables.register("methodName", + resolveMethodName(cmd)); + Assert.assertEquals("selectKeyRecord", methodName); + } + + /** + * Goal: Verify that a SELECT command with multiple keys + * and a CCL condition resolves to {@code selectKeysCcl}. + *

      + * Start state: No prior state needed. + *

      + * Workflow: + *

        + *
      • Create a {@link TCommand} with verb SELECT, multiple keys, and a CCL + * condition string.
      • + *
      • Call {@code resolveMethodName}.
      • + *
      + *

      + * Expected: The resolved method name is + * {@code "selectKeysCcl"}. + */ + @Test + public void testResolveMethodNameSelectKeysCcl() { + TCommand cmd = Variables.register("cmd", + new TCommand(TCommandVerb.SELECT)); + cmd.setKeys(ImmutableList.of("name", "age")); + cmd.setCondition("age > 30"); + String methodName = Variables.register("methodName", + resolveMethodName(cmd)); + Assert.assertEquals("selectKeysCcl", methodName); + } + + /** + * Goal: Verify that a SELECT command with a single record + * and a timestamp resolves to {@code selectRecordTime}. + *

      + * Start state: No prior state needed. + *

      + * Workflow: + *

        + *
      • Create a {@link TCommand} with verb SELECT, one record, and a + * timestamp.
      • + *
      • Call {@code resolveMethodName}.
      • + *
      + *

      + * Expected: The resolved method name is + * {@code "selectRecordTime"}. + */ + @Test + public void testResolveMethodNameSelectRecordTime() { + TCommand cmd = Variables.register("cmd", + new TCommand(TCommandVerb.SELECT)); + cmd.setRecords(ImmutableList.of(1L)); + cmd.setTimestamp(123456789L); + String methodName = Variables.register("methodName", + resolveMethodName(cmd)); + Assert.assertEquals("selectRecordTime", methodName); + } + + /** + * Goal: Verify that a FIND command with a CCL condition + * resolves to {@code findCcl}. + *

      + * Start state: No prior state needed. + *

      + * Workflow: + *

        + *
      • Create a {@link TCommand} with verb FIND and a CCL condition.
      • + *
      • Call {@code resolveMethodName}.
      • + *
      + *

      + * Expected: The resolved method name is {@code "findCcl"}. + */ + @Test + public void testResolveMethodNameFindCcl() { + TCommand cmd = Variables.register("cmd", + new TCommand(TCommandVerb.FIND)); + cmd.setCondition("age > 30"); + String methodName = Variables.register("methodName", + resolveMethodName(cmd)); + Assert.assertEquals("findCcl", methodName); + } + + /** + * Goal: Verify that a DIFF command with a key and record + * resolves to {@code diffKeyRecordStart}. + *

      + * Start state: No prior state needed. + *

      + * Workflow: + *

        + *
      • Create a {@link TCommand} with verb DIFF, a key, a record, and a + * timestamp.
      • + *
      • Call {@code resolveMethodName}.
      • + *
      + *

      + * Expected: The resolved method name is + * {@code "diffKeyRecordStart"}. + */ + @Test + public void testResolveMethodNameDiffKeyRecordStart() { + TCommand cmd = Variables.register("cmd", + new TCommand(TCommandVerb.DIFF)); + cmd.setKeys(ImmutableList.of("name")); + cmd.setRecords(ImmutableList.of(1L)); + cmd.setTimestamp(123456789L); + String methodName = Variables.register("methodName", + resolveMethodName(cmd)); + Assert.assertEquals("diffKeyRecordStart", methodName); + } + + /** + * Goal: Verify that a DIFF command with a key, record, and + * both start and end timestamps resolves to {@code diffKeyRecordStartEnd}. + *

      + * Start state: No prior state needed. + *

      + * Workflow: + *

        + *
      • Create a {@link TCommand} with verb DIFF, a key, a record, a start + * timestamp, and an end timestamp.
      • + *
      • Call {@code resolveMethodName}.
      • + *
      + *

      + * Expected: The resolved method name is + * {@code "diffKeyRecordStartEnd"}. + */ + @Test + public void testResolveMethodNameDiffKeyRecordStartEnd() { + TCommand cmd = Variables.register("cmd", + new TCommand(TCommandVerb.DIFF)); + cmd.setKeys(ImmutableList.of("name")); + cmd.setRecords(ImmutableList.of(1L)); + cmd.setTimestamp(100L); + cmd.setEndTimestamp(200L); + String methodName = Variables.register("methodName", + resolveMethodName(cmd)); + Assert.assertEquals("diffKeyRecordStartEnd", methodName); + } + + /** + * Goal: Verify that a CALCULATE command with a key and + * record resolves to the correct method name using the function name. + *

      + * Start state: No prior state needed. + *

      + * Workflow: + *

        + *
      • Create a {@link TCommand} with verb CALCULATE, a function of "sum", a + * key, and a record.
      • + *
      • Call {@code resolveMethodName}.
      • + *
      + *

      + * Expected: The resolved method name is + * {@code "sumKeyRecord"}. + */ + @Test + public void testResolveMethodNameCalculateSumKeyRecord() { + TCommand cmd = Variables.register("cmd", + new TCommand(TCommandVerb.CALCULATE)); + cmd.setFunction("sum"); + cmd.setKeys(ImmutableList.of("salary")); + cmd.setRecords(ImmutableList.of(1L)); + String methodName = Variables.register("methodName", + resolveMethodName(cmd)); + Assert.assertEquals("sumKeyRecord", methodName); + } + + /** + * Goal: Verify that PING resolves to {@code "ping"}. + *

      + * Start state: No prior state needed. + *

      + * Workflow: + *

        + *
      • Create a {@link TCommand} with verb PING.
      • + *
      • Call {@code resolveMethodName}.
      • + *
      + *

      + * Expected: The resolved method name is {@code "ping"}. + */ + @Test + public void testResolveMethodNamePing() { + TCommand cmd = Variables.register("cmd", + new TCommand(TCommandVerb.PING)); + String methodName = Variables.register("methodName", + resolveMethodName(cmd)); + Assert.assertEquals("ping", methodName); + } + + /** + * Goal: Verify that the argument list for an ADD command + * with a key, value, and record is built correctly. + *

      + * Start state: No prior state needed. + *

      + * Workflow: + *

        + *
      • Create a {@link TCommand} with verb ADD, one key, one value, and one + * record.
      • + *
      • Call {@code resolveArguments}.
      • + *
      + *

      + * Expected: The argument list contains the key, value, and + * record in that order. + */ + @Test + public void testResolveArgumentsAddKeyValueRecord() { + TCommand cmd = Variables.register("cmd", + new TCommand(TCommandVerb.ADD)); + cmd.setKeys(ImmutableList.of("name")); + cmd.setValue(Convert.javaToThrift("Alice")); + cmd.setRecords(ImmutableList.of(1L)); + List args = Variables.register("args", resolveArguments(cmd)); + Assert.assertEquals(3, args.size()); + Assert.assertEquals("name", args.get(0)); + Assert.assertEquals(Convert.javaToThrift("Alice"), args.get(1)); + Assert.assertEquals(1L, args.get(2)); + } + + /** + * Goal: Verify that the argument list for a CLEAR command + * with multiple keys and multiple records is built correctly. + *

      + * Start state: No prior state needed. + *

      + * Workflow: + *

        + *
      • Create a {@link TCommand} with verb CLEAR, multiple keys, and + * multiple records.
      • + *
      • Call {@code resolveArguments}.
      • + *
      + *

      + * Expected: The argument list contains the keys list and + * the records list. + */ + @Test + public void testResolveArgumentsClearKeysRecords() { + TCommand cmd = Variables.register("cmd", + new TCommand(TCommandVerb.CLEAR)); + List keys = ImmutableList.of("name", "age"); + List records = ImmutableList.of(1L, 2L, 3L); + cmd.setKeys(keys); + cmd.setRecords(records); + List args = Variables.register("args", resolveArguments(cmd)); + Assert.assertEquals(2, args.size()); + Assert.assertEquals(keys, args.get(0)); + Assert.assertEquals(records, args.get(1)); + } + + /** + * Goal: Verify that PING produces an empty argument list. + *

      + * Start state: No prior state needed. + *

      + * Workflow: + *

        + *
      • Create a {@link TCommand} with verb PING.
      • + *
      • Call {@code resolveArguments}.
      • + *
      + *

      + * Expected: The argument list is empty. + */ + @Test + public void testResolveArgumentsPingIsEmpty() { + TCommand cmd = Variables.register("cmd", + new TCommand(TCommandVerb.PING)); + List args = Variables.register("args", resolveArguments(cmd)); + Assert.assertTrue(args.isEmpty()); + } + + /** + * Goal: Verify that a REMOVE command with multiple records + * resolves to {@code removeKeyValueRecords}. + *

      + * Start state: No prior state needed. + *

      + * Workflow: + *

        + *
      • Create a {@link TCommand} with verb REMOVE, one key, one value, and + * multiple records.
      • + *
      • Call {@code resolveMethodName}.
      • + *
      + *

      + * Expected: The resolved method name is + * {@code "removeKeyValueRecords"}. + */ + @Test + public void testResolveMethodNameRemoveKeyValueRecords() { + TCommand cmd = Variables.register("cmd", + new TCommand(TCommandVerb.REMOVE)); + cmd.setKeys(ImmutableList.of("name")); + cmd.setValue(Convert.javaToThrift("Alice")); + cmd.setRecords(ImmutableList.of(1L, 2L, 3L)); + String methodName = Variables.register("methodName", + resolveMethodName(cmd)); + Assert.assertEquals("removeKeyValueRecords", methodName); + } + + /** + * Goal: Verify that an unsupported verb throws + * {@link UnsupportedOperationException}. + *

      + * Start state: No prior state needed. + *

      + * Workflow: + *

        + *
      • Create a {@link TCommand} with verb STAGE.
      • + *
      • Call {@code resolveMethodName}.
      • + *
      + *

      + * Expected: An {@link UnsupportedOperationException} is + * thrown because STAGE is handled by the server directly, not dispatched. + */ + @Test(expected = UnsupportedOperationException.class) + public void testResolveMethodNameThrowsForUnsupportedVerb() { + TCommand cmd = new TCommand(TCommandVerb.STAGE); + resolveMethodName(cmd); + } + + /** + * Delegate to the private static + * {@link CommandDispatcher#resolveMethodName(TCommand)} via reflection. + */ + private static String resolveMethodName(TCommand cmd) { + return Reflection.callStatic(CommandDispatcher.class, + "resolveMethodName", cmd); + } + + /** + * Delegate to the private static + * {@link CommandDispatcher#resolveArguments(TCommand)} via reflection. + */ + private static List resolveArguments(TCommand cmd) { + return Reflection.callStatic(CommandDispatcher.class, + "resolveArguments", cmd); + } + +} diff --git a/concourse-shell/src/main/java/com/cinchapi/concourse/shell/ConcourseShell.java b/concourse-shell/src/main/java/com/cinchapi/concourse/shell/ConcourseShell.java index aa4696195..84afcbc97 100644 --- a/concourse-shell/src/main/java/com/cinchapi/concourse/shell/ConcourseShell.java +++ b/concourse-shell/src/main/java/com/cinchapi/concourse/shell/ConcourseShell.java @@ -27,6 +27,7 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; +import java.util.ArrayList; import java.util.List; import java.util.Set; import java.util.concurrent.TimeUnit; @@ -52,6 +53,7 @@ import com.cinchapi.concourse.Tag; import com.cinchapi.concourse.Timestamp; import com.cinchapi.concourse.config.ConcourseClientConfiguration; +import com.cinchapi.concourse.lang.ConcourseCompiler; import com.cinchapi.concourse.lang.Criteria; import com.cinchapi.concourse.lang.StartState; import com.cinchapi.concourse.lang.paginate.Page; @@ -67,6 +69,7 @@ import com.google.common.base.Stopwatch; import com.google.common.base.Strings; import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; import com.google.common.collect.Sets; @@ -131,6 +134,7 @@ public static void main(String... args) throws Exception { try { cash.concourse = Concourse.connect(opts.host, opts.port, opts.username, opts.password, opts.environment); + Reflection.set("usePrettyCollections", true, cash.concourse); cash.whoami = opts.username; } catch (Exception e) { @@ -311,6 +315,8 @@ private static String[] getAccessibleApiMethodsUsingShortSyntax() { for (Showable showable : Showable.values()) { methods.add("show " + showable.getName()); } + // Add CCL keywords for tab completion + methods.addAll(CCL_KEYWORDS); return methods.toArray(new String[methods.size()]); } @@ -413,6 +419,30 @@ private static String tryGetCorrectApiMethod(String alias) { .filter(method -> !BANNED_API_METHODS.contains(method)) .collect(Collectors.toList()); + /** + * The set of verbs recognized as CCL command prefixes. Input that begins + * with one of these words (and is not followed by an open parenthesis) is + * treated as CCL. + */ + private static final Set CCL_VERBS = ImmutableSet.of("abort", "add", + "audit", "browse", "calculate", "chronicle", "clear", "commit", + "consolidate", "describe", "diff", "find", "get", "holds", "insert", + "inventory", "jsonify", "link", "navigate", "ping", "reconcile", + "remove", "revert", "search", "select", "set", "stage", "trace", + "unlink", "verify"); + + /** + * CCL keywords to include in tab completion. + */ + private static final List CCL_KEYWORDS = ImmutableList.of("abort", + "add", "audit", "browse", "calculate", "chronicle", "clear", + "commit", "consolidate", "describe", "diff", "find", "get", "holds", + "insert", "inventory", "jsonify", "link", "navigate", "ping", + "reconcile", "remove", "revert", "search", "select", "set", "stage", + "trace", "unlink", "verify", "prepare", "submit", "discard", + "where", "from", "in", "at", "as", "to", "for", "order", "by", + "page", "size"); + /** * A list which contains all of the accessible API methods. This list is * used to expand short syntax that is used in any evaluatable line. @@ -529,6 +559,18 @@ public StartState call() { */ private Script script = null; + /** + * Indicates whether prepare mode is active. When {@code true}, CCL commands + * are accumulated rather than executed immediately. + */ + private boolean prepareMode = false; + + /** + * The accumulated CCL commands collected during prepare mode. Only non-null + * when {@link #prepareMode} is {@code true}. + */ + private List preparedCcl = null; + /** * A closure that responds to the 'show' command and returns information to * display to the user based on the input argument(s). @@ -598,12 +640,103 @@ protected ConcourseShell() throws Exception { */ @SuppressWarnings("serial") public String evaluate(String input) throws IrregularEvaluationResult { + String inputLowerCase = input.trim().toLowerCase(); + + // Handle special commands first + if(inputLowerCase.equalsIgnoreCase("exit")) { + throw new ExitRequest(); + } + else if(inputLowerCase.startsWith("help") + || inputLowerCase.startsWith("man")) { + String[] toks = input.split(" "); + if(toks.length == 1) { + throw new HelpRequest(); + } + else { + String topic = toks[1]; + throw new HelpRequest(topic); + } + } + else if(Strings.isNullOrEmpty(input)) { // CON-170 + throw new NewLineRequest(); + } + else if(containsBannedCharSequence(input)) { + throw new EvaluationException(BANNED_CHAR_SEQUENCE_ERROR_MESSAGE); + } + + // Handle prepare mode meta-commands + if(inputLowerCase.equals("prepare")) { + prepareMode = true; + preparedCcl = new ArrayList<>(); + setDefaultPrompt(); + return "Entering prepare mode."; + } + else if(inputLowerCase.equals("discard")) { + if(prepareMode) { + int count = preparedCcl.size(); + prepareMode = false; + preparedCcl = null; + setDefaultPrompt(); + return "Discarded " + count + " prepared " + + (count == 1 ? "command" : "commands") + "."; + } + else { + throw new EvaluationException("ERROR: Not in prepare mode"); + } + } + else if(inputLowerCase.equals("submit") && prepareMode) { + if(preparedCcl.isEmpty()) { + prepareMode = false; + preparedCcl = null; + setDefaultPrompt(); + return "Nothing to submit."; + } + String ccl = String.join("; ", preparedCcl); + int count = preparedCcl.size(); + prepareMode = false; + preparedCcl = null; + setDefaultPrompt(); + watch.reset().start(); + List results = concourse.submit(ccl); + watch.stop(); + long elapsed = watch.elapsed(TimeUnit.MILLISECONDS); + double seconds = elapsed / 1000.0; + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < results.size(); ++i) { + Object value = results.get(i); + if(value != null) { + sb.append(" [").append(i + 1).append("] Returned '") + .append(value).append("'"); + } + else { + sb.append(" [").append(i + 1).append("] Completed"); + } + sb.append('\n'); + } + sb.append("Submitted ").append(count) + .append(count == 1 ? " command" : " commands") + .append(" in ").append(seconds).append(" sec"); + return sb.toString(); + } + + // Try CCL path before Groovy + if(looksLikeCcl(input)) { + try { + ConcourseCompiler.get().compile(input); + return evaluateCcl(input); + } + catch (Exception e) { + // Fall through to Groovy evaluation + } + } + + // Existing Groovy evaluation path input = SyntaxTools.handleShortSyntax(input, methods); - String inputLowerCase = input.toLowerCase(); - // NOTE: These must always be set before evaluating a line just in case - // an attempt was made to bind the variables to different values in a - // previous evaluation. + // NOTE: These must always be set before evaluating + // a line just in case an attempt was made to bind the + // variables to different values in a previous + // evaluation. groovyBinding.setVariable("concourse", concourse); groovyBinding.setVariable("eq", Operator.EQUALS); groovyBinding.setVariable("ne", Operator.NOT_EQUALS); @@ -635,9 +768,9 @@ public String evaluate(String input) throws IrregularEvaluationResult { if(script != null) { groovyBinding.setVariable(EXTERNAL_SCRIPT_NAME, script); } - // GH-463: Define each accessible Concourse API method as a Closure - // directly within Groovy to ensure that they can be called with short - // syntax. + // GH-463: Define each accessible Concourse API + // method as a Closure directly within Groovy to + // ensure that they can be called with short syntax. CLOSURE_ELIGIBLE_API_METHODS.forEach(method -> { groovyBinding.setVariable(method, new Closure(null) { @@ -648,90 +781,69 @@ public Object call(Object... args) { }); }); - if(inputLowerCase.equalsIgnoreCase("exit")) { - throw new ExitRequest(); - } - else if(inputLowerCase.startsWith("help") - || inputLowerCase.startsWith("man")) { - String[] toks = input.split(" "); - if(toks.length == 1) { - throw new HelpRequest(); + StringBuilder result = new StringBuilder(); + try { + watch.reset().start(); + Object value = groovy.evaluate(input, "ConcourseShell"); + watch.stop(); + long elapsed = watch.elapsed(TimeUnit.MILLISECONDS); + double seconds = elapsed / 1000.0; + if(value != null) { + result.append( + "Returned '" + value + "' in " + seconds + " sec"); } else { - String topic = toks[1]; - throw new HelpRequest(topic); + result.append("Completed in " + seconds + " sec"); } + return result.toString(); } - else if(containsBannedCharSequence(input)) { - throw new EvaluationException(BANNED_CHAR_SEQUENCE_ERROR_MESSAGE); + catch (CompilationFailedException e) { + throw new MultiLineRequest(e.getMessage()); } - else if(Strings.isNullOrEmpty(input)) { // CON-170 - throw new NewLineRequest(); - } - else { - StringBuilder result = new StringBuilder(); - try { - watch.reset().start(); - Object value = groovy.evaluate(input, "ConcourseShell"); - watch.stop(); - long elapsed = watch.elapsed(TimeUnit.MILLISECONDS); - double seconds = elapsed / 1000.0; - if(value != null) { - result.append( - "Returned '" + value + "' in " + seconds + " sec"); - } - else { - result.append("Completed in " + seconds + " sec"); - } - return result.toString(); + catch (Exception e) { + // CON-331: Here we catch a generic Exception and + // examine additional context (i.e. the cause or + // other environmental aspects) to perform + // additional logic that determines the + // appropriate response. These cases SHOULD NOT be + // placed in their own separate catch block. + String method = null; + String methodCorrected = null; + if(e.getCause() instanceof TTransportException) { + throw new ProgramCrash(e.getMessage()); } - catch (CompilationFailedException e) { - throw new MultiLineRequest(e.getMessage()); + else if(e.getCause() instanceof SecurityException) { + throw new ProgramCrash("A security change has occurred and " + + "your session cannot " + "continue"); } - catch (Exception e) { - // CON-331: Here we catch a generic Exception and examine - // additional context (i.e. the cause or other environmental - // aspects) to perform additional logic that determines the - // appropriate response. These cases SHOULD NOT be placed in - // their own separate catch block. - String method = null; - String methodCorrected = null; - if(e.getCause() instanceof TTransportException) { - throw new ProgramCrash(e.getMessage()); + else if(e instanceof MissingMethodException + && ErrorCause.determine( + e.getMessage()) == ErrorCause.MISSING_CASH_METHOD + && ((methodCorrected = tryGetCorrectApiMethod( + (method = ((MissingMethodException) e) + .getMethod()))) != null + || hasExternalScript())) { + if(methodCorrected != null) { + input = input.replaceAll(method, methodCorrected); } - else if(e.getCause() instanceof SecurityException) { - throw new ProgramCrash( - "A security change has occurred and your " - + "session cannot continue"); + else { + input = input.replaceAll(method, "ext." + method); } - else if(e instanceof MissingMethodException - && ErrorCause.determine(e - .getMessage()) == ErrorCause.MISSING_CASH_METHOD - && ((methodCorrected = tryGetCorrectApiMethod( - (method = ((MissingMethodException) e) - .getMethod()))) != null - || hasExternalScript())) { - if(methodCorrected != null) { - input = input.replaceAll(method, methodCorrected); - } - else { - input = input.replaceAll(method, "ext." + method); - } - return evaluate(input); + return evaluate(input); + } + else { + String message; + if(e.getCause() instanceof TApplicationException) { + message = e.getCause().getMessage() + + ". Please check server logs " + + "for more details."; } else { - String message; - if(e.getCause() instanceof TApplicationException) { - message = e.getCause().getMessage() - + ". Please check server logs for more details."; - } - else { - message = e.getCause() instanceof ParseException - ? e.getCause().getMessage() - : e.getMessage(); - } - throw new EvaluationException("ERROR: " + message); + message = e.getCause() instanceof ParseException + ? e.getCause().getMessage() + : e.getMessage(); } + throw new EvaluationException("ERROR: " + message); } } } @@ -899,12 +1011,79 @@ public void run() { getAccessibleApiMethodsUsingShortSyntax())); } + /** + * Return {@code true} if the given {@code input} looks like a CCL command + * rather than a Groovy expression. The heuristic checks whether the first + * token is a recognized CCL verb and the next non-whitespace character is + * not an open parenthesis (which would indicate a Groovy method call). + * + * @param input the input to check + * @return {@code true} if the input looks like CCL + */ + private boolean looksLikeCcl(String input) { + int space = input.indexOf(' '); + String verb = space > 0 ? input.substring(0, space).toLowerCase() + : input.toLowerCase(); + if(!CCL_VERBS.contains(verb)) { + return false; + } + if(space < 0) { + // Bare command (e.g., ping, stage, commit) + return true; + } + // If the next non-whitespace char is '(' then + // this is a Groovy method call, not CCL + for (int i = space + 1; i < input.length(); ++i) { + char c = input.charAt(i); + if(c == ' ') { + continue; + } + return c != '('; + } + return true; + } + + /** + * Evaluate a CCL command by sending it to the server for execution, or + * accumulate it if in prepare mode. + * + * @param input the CCL input + * @return the formatted result string + */ + private String evaluateCcl(String input) { + if(prepareMode) { + preparedCcl.add(input); + setDefaultPrompt(); + return " [" + preparedCcl.size() + "] " + input; + } + watch.reset().start(); + Object value = concourse.exec(input); + watch.stop(); + long elapsed = watch.elapsed(TimeUnit.MILLISECONDS); + double seconds = elapsed / 1000.0; + if(value != null) { + return "Returned '" + value + "' in " + seconds + " sec"; + } + else { + return "Completed in " + seconds + " sec"; + } + } + /** * Set the {@link #defaultPrompt} variable to account for the current - * {@link #env}. + * {@link #env}, transaction state, and prepare mode. */ private void setDefaultPrompt() { - this.defaultPrompt = format("[{0}/cash]$ ", env); + StringBuilder sb = new StringBuilder("["); + sb.append(env).append("/cash"); + if(concourse != null && concourse.inTransaction()) { + sb.append(":txn"); + } + if(prepareMode) { + sb.append(":prepare(").append(preparedCcl.size()).append(")"); + } + sb.append("]$ "); + this.defaultPrompt = sb.toString(); } /** diff --git a/interface/concourse.thrift b/interface/concourse.thrift index c6bf1db9f..06d6aabed 100644 --- a/interface/concourse.thrift +++ b/interface/concourse.thrift @@ -6575,6 +6575,34 @@ service ConcourseService { 5: exceptions.ParseException ex5 ); + complex.ComplexTObject execCcl( + 1: string ccl, + 2: shared.AccessToken creds, + 3: shared.TransactionToken transaction, + 4: string environment + ) + throws ( + 1: exceptions.SecurityException ex, + 2: exceptions.TransactionException ex2, + 3: exceptions.InvalidArgumentException ex3, + 4: exceptions.PermissionException ex4, + 5: exceptions.ParseException ex5 + ); + + list submitCcl( + 1: string ccl, + 2: shared.AccessToken creds, + 3: shared.TransactionToken transaction, + 4: string environment + ) + throws ( + 1: exceptions.SecurityException ex, + 2: exceptions.TransactionException ex2, + 3: exceptions.InvalidArgumentException ex3, + 4: exceptions.PermissionException ex4, + 5: exceptions.ParseException ex5 + ); + complex.ComplexTObject invokeManagement( 2: string method, 3: list params, From ffc03ea48024e72dc9370cb938d8abb60db9cab0 Mon Sep 17 00:00:00 2001 From: Jeff Nelson Date: Sun, 15 Mar 2026 19:47:37 -0400 Subject: [PATCH 10/13] changes in response to first code review --- .../server/ManagedConcourseServer.java | 8 +- .../com/cinchapi/concourse/Concourse.java | 9 - .../concourse/ConcourseThriftDriver.java | 298 ++++++------- .../concourse/ForwardingConcourse.java | 5 - .../com/cinchapi/concourse/NoOpConcourse.java | 5 - .../concourse/thrift/JavaThriftBridge.java | 13 + .../concourse/server/ConcourseServer.java | 11 +- .../concourse/shell/ConcourseShell.java | 396 ++++++++---------- utils/codegen/CommandGroupGenerator.groovy | 121 ++---- .../StatefulConcourseServiceGenerator.groovy | 3 +- 10 files changed, 381 insertions(+), 488 deletions(-) diff --git a/concourse-automation/src/main/java/com/cinchapi/concourse/automation/server/ManagedConcourseServer.java b/concourse-automation/src/main/java/com/cinchapi/concourse/automation/server/ManagedConcourseServer.java index 971929161..7c60536f2 100644 --- a/concourse-automation/src/main/java/com/cinchapi/concourse/automation/server/ManagedConcourseServer.java +++ b/concourse-automation/src/main/java/com/cinchapi/concourse/automation/server/ManagedConcourseServer.java @@ -76,7 +76,6 @@ import com.cinchapi.concourse.lang.Criteria; import com.cinchapi.concourse.lang.command.Command; import com.cinchapi.concourse.lang.command.CommandGroup; -import com.cinchapi.concourse.lang.command.DefaultCommandGroup; import com.cinchapi.concourse.lang.paginate.Page; import com.cinchapi.concourse.lang.sort.Order; import com.cinchapi.concourse.lang.sort.OrderComponent; @@ -2162,7 +2161,7 @@ public String getServerVersion() { @Override public CommandGroup prepare() { - return new DefaultCommandGroup(); + return invoke("prepare").with(); } @Override @@ -3086,11 +3085,6 @@ public List submit(String ccl) { return invoke("submit", String.class).with(ccl); } - @Override - public boolean inTransaction() { - return invoke("inTransaction").with(); - } - @Override public Timestamp time() { return invoke("time").with(); diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/Concourse.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/Concourse.java index 083b2d3b8..8dc9d70f3 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/Concourse.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/Concourse.java @@ -7585,15 +7585,6 @@ public final boolean stage(Runnable task) throws TransactionException { */ public abstract List submit(String ccl); - /** - * Return {@code true} if this client is currently within a transaction - * (i.e., {@link #stage()} has been called without a corresponding - * {@link #commit()} or {@link #abort()}). - * - * @return {@code true} if a transaction is active - */ - public abstract boolean inTransaction(); - /** * Return a {@link Timestamp} that represents the current instant according * to the server. diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/ConcourseThriftDriver.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/ConcourseThriftDriver.java index c689168fb..824c003f8 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/ConcourseThriftDriver.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/ConcourseThriftDriver.java @@ -80,6 +80,7 @@ import com.google.common.base.Throwables; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Iterables; import com.google.common.collect.Lists; import com.google.common.collect.Sets; @@ -4115,8 +4116,7 @@ public Object exec(Command command, Command... more) { @Override public Object exec(List commands) { return execute(() -> { - List tcommands = commands.stream().map(Command::toThrift) - .collect(Collectors.toList()); + List tcommands = JavaThriftBridge.convert(commands); TCommandVerb verb = usePrettyCollections && !tcommands.isEmpty() ? tcommands.get(tcommands.size() - 1).getVerb() : null; @@ -4142,8 +4142,7 @@ public List submit(Command command, Command... more) { @Override public List submit(List commands) { return execute(() -> { - List tcommands = commands.stream().map(Command::toThrift) - .collect(Collectors.toList()); + List tcommands = JavaThriftBridge.convert(commands); List results = core.submit(tcommands, creds, transaction, environment); List prettified = Lists @@ -4171,15 +4170,16 @@ public CommandGroup prepare() { @Override public Object exec(String ccl) { return execute(() -> { + List verbs = extractCommandVerbsIfNecessary(ccl); return prettify(core.execCcl(ccl, creds, transaction, environment) - .getJavaObject(), extractLastVerb(ccl)); + .getJavaObject(), Iterables.getLast(verbs, null)); }); } @Override public List submit(String ccl) { return execute(() -> { - List verbs = extractVerbs(ccl); + List verbs = extractCommandVerbsIfNecessary(ccl); List results = core.submitCcl(ccl, creds, transaction, environment); List prettified = Lists @@ -4192,11 +4192,6 @@ public List submit(String ccl) { }); } - @Override - public boolean inTransaction() { - return transaction != null; - } - @Override public Timestamp time() { return execute(() -> Timestamp @@ -4767,55 +4762,18 @@ private boolean isConnectedToLegacyServer() { } /** - * Return the {@link TCommandVerb} for a single CCL segment. - * - * @param segment the CCL segment - * @return the {@link TCommandVerb}, or {@code null} if the verb cannot be - * determined - */ - @Nullable - private TCommandVerb extractVerb(String segment) { - if(segment.isEmpty()) { - return null; - } - int space = segment.indexOf(' '); - String token = space > 0 ? segment.substring(0, space) : segment; - try { - return TCommandVerb.valueOf(token.toUpperCase()); - } - catch (IllegalArgumentException e) { - return null; - } - } - - /** - * Return the {@link TCommandVerb} for the last command in a CCL string. - * - * @param ccl the CCL string - * @return the {@link TCommandVerb}, or {@code null} if the verb cannot be - * determined - */ - @Nullable - private TCommandVerb extractLastVerb(String ccl) { - if(usePrettyCollections) { - int last = ccl.lastIndexOf(';'); - String segment = last >= 0 ? ccl.substring(last + 1).trim() - : ccl.trim(); - return extractVerb(segment); - } - else { - return null; - } - } - - /** - * Return a {@link TCommandVerb} for each command in a CCL string, in order. - * Entries are {@code null} when the verb cannot be determined. + * Extract the {@link TCommandVerb} for each command in a CCL string, in + * order. If pretty collections are disabled, return an empty {@link List} + * so callers can proceed without verb-based formatting. + *

      + * Entries are {@code null} when the verb cannot be determined for a + * particular segment. + *

      * * @param ccl the CCL string * @return a {@link List} of {@link TCommandVerb TCommandVerbs} */ - private List extractVerbs(String ccl) { + private List extractCommandVerbsIfNecessary(String ccl) { if(usePrettyCollections) { String[] segments = ccl.split(";"); List verbs = Lists @@ -4823,7 +4781,17 @@ private List extractVerbs(String ccl) { for (String segment : segments) { String trimmed = segment.trim(); if(!trimmed.isEmpty()) { - verbs.add(extractVerb(trimmed)); + int space = trimmed.indexOf(' '); + String token = space > 0 ? trimmed.substring(0, space) + : trimmed; + TCommandVerb verb; + try { + verb = TCommandVerb.valueOf(token.toUpperCase()); + } + catch (IllegalArgumentException e) { + verb = null; + } + verbs.add(verb); } } return verbs; @@ -4847,137 +4815,139 @@ private List extractVerbs(String ccl) { */ @SuppressWarnings({ "unchecked", "rawtypes" }) private Object prettify(Object value, @Nullable TCommandVerb verb) { - if(usePrettyCollections) { - if(verb != null && NON_MAP_VERBS.contains(verb)) { - return value; - } - if(!(value instanceof Map)) { - return value; - } + if(!usePrettyCollections) { + return value; + } + else if(verb != null && NON_MAP_VERBS.contains(verb)) { + return value; + } + else if(!(value instanceof Map)) { + return value; + } + else { Map map = (Map) value; if(map.isEmpty()) { return value; } - Entry first = map.entrySet().iterator().next(); - Object firstKey = first.getKey(); - Object firstVal = first.getValue(); - if(verb != null) { - switch (verb) { - case SELECT: - case NAVIGATE: - if(firstKey instanceof Long && firstVal instanceof Map) { - return DataTable.multiValued((Map) value); - } - else { - return DataRow.multiValued((Map) value); - } - case GET: - if(firstKey instanceof Long && firstVal instanceof Map) { - return DataTable.singleValued((Map) value); - } - else { - return DataRow.singleValued((Map) value); - } - case BROWSE: - if(firstKey instanceof TObject) { - return DataProjection.of((Map) value); - } - else if(firstVal instanceof Map) { - return DataIndex.of((Map) value); - } - break; - case AUDIT: - case CHRONICLE: - return PrettyLinkedHashMap.of((Map) value, "DateTime", - "Revision"); - case DIFF: - if(isDiffResult(map)) { - return PrettyLinkedHashMap.of((Map) value, "Operation", - "Value"); - } - else if(firstVal instanceof Map) { + else { + Entry first = map.entrySet().iterator().next(); + Object firstKey = first.getKey(); + Object firstVal = first.getValue(); + boolean isDiff = map.keySet().stream().allMatch( + k -> "ADDED".equals(k) || "REMOVED".equals(k)); + if(verb != null) { + switch (verb) { + case SELECT: + case NAVIGATE: + if(firstKey instanceof Long + && firstVal instanceof Map) { + return DataTable.multiValued((Map) value); + } + else { + return DataRow.multiValued((Map) value); + } + case GET: + if(firstKey instanceof Long + && firstVal instanceof Map) { + return DataTable.singleValued((Map) value); + } + else { + return DataRow.singleValued((Map) value); + } + case BROWSE: if(firstKey instanceof TObject) { + return DataProjection.of((Map) value); + } + else if(firstVal instanceof Map) { + return DataIndex.of((Map) value); + } + else { + break; + } + case AUDIT: + case CHRONICLE: + return PrettyLinkedHashMap.of((Map) value, "DateTime", + "Revision"); + case DIFF: + if(isDiff) { + return PrettyLinkedHashMap.of((Map) value, + "Operation", "Value"); + } + else if(firstVal instanceof Map) { + if(firstKey instanceof TObject) { + return PrettyLinkedTableMap.of((Map) value, + "Value"); + } + else { + return PrettyLinkedTableMap.of((Map) value, + "Key"); + } + } + else { + break; + } + case TRACE: + if(firstKey instanceof Long + && firstVal instanceof Map) { return PrettyLinkedTableMap.of((Map) value, - "Value"); + "Record"); } else { - return PrettyLinkedTableMap.of((Map) value, "Key"); + return PrettyLinkedHashMap.of((Map) value, "Key", + "Sources"); } + case DESCRIBE: + return PrettyLinkedHashMap.of((Map) value, "Record", + "Keys"); + default: + break; } - break; - case TRACE: - if(firstKey instanceof Long && firstVal instanceof Map) { + } + // Generic type-based fallback + if(firstVal instanceof Map) { + if(firstKey instanceof Long) { return PrettyLinkedTableMap.of((Map) value, "Record"); } + else if(firstKey instanceof TObject) { + return PrettyLinkedTableMap.of((Map) value, "Value"); + } else { - return PrettyLinkedHashMap.of((Map) value, "Key", - "Sources"); + return PrettyLinkedTableMap.of((Map) value, "Key"); } - case DESCRIBE: - return PrettyLinkedHashMap.of((Map) value, "Record", - "Keys"); - default: - break; } - } - // Generic type-based fallback for null/unknown verbs - if(firstVal instanceof Map) { - if(firstKey instanceof Long) { - return PrettyLinkedTableMap.of((Map) value, "Record"); + else if(firstKey instanceof Long && firstVal instanceof List) { + return PrettyLinkedHashMap.of((Map) value, "DateTime", + "Revision"); } - else if(firstKey instanceof TObject) { - return PrettyLinkedTableMap.of((Map) value, "Value"); + else if(firstKey instanceof Long + && firstVal instanceof Boolean) { + return PrettyLinkedHashMap.of((Map) value, "Record", + "Successful"); } - else { - return PrettyLinkedTableMap.of((Map) value, "Key"); + else if(isDiff) { + return PrettyLinkedHashMap.of((Map) value, "Operation", + "Value"); } - } - else if(firstKey instanceof Long && firstVal instanceof List) { - return PrettyLinkedHashMap.of((Map) value, "DateTime", - "Revision"); - } - else if(firstKey instanceof Long && firstVal instanceof Boolean) { - return PrettyLinkedHashMap.of((Map) value, "Record", - "Successful"); - } - else if(isDiffResult(map)) { - return PrettyLinkedHashMap.of((Map) value, "Operation", - "Value"); - } - else if(firstKey instanceof TObject) { - String valHeader = firstVal instanceof Set ? "Records" - : "Record"; - return PrettyLinkedHashMap.of((Map) value, "Value", valHeader); - } - else { - String valHeader = firstVal instanceof Set ? "Values" : "Value"; - if(firstKey instanceof Long) { - return PrettyLinkedHashMap.of((Map) value, "Record", + else if(firstKey instanceof TObject) { + String valHeader = firstVal instanceof Set ? "Records" + : "Record"; + return PrettyLinkedHashMap.of((Map) value, "Value", valHeader); } else { - return PrettyLinkedHashMap.of((Map) value, "Key", - valHeader); + String valHeader = firstVal instanceof Set ? "Values" + : "Value"; + if(firstKey instanceof Long) { + return PrettyLinkedHashMap.of((Map) value, "Record", + valHeader); + } + else { + return PrettyLinkedHashMap.of((Map) value, "Key", + valHeader); + } } } } - else { - return value; - } - } - - /** - * Return {@code true} if {@code map} appears to be a diff result — - * all keys are {@link String} representations of - * {@link com.cinchapi.concourse.thrift.Diff} enum constants - * ({@code "ADDED"} and/or {@code "REMOVED"}). - * - * @param map the {@link Map} to inspect - * @return {@code true} if the map looks like a diff result - */ - private boolean isDiffResult(Map map) { - return map.keySet().stream() - .allMatch(k -> "ADDED".equals(k) || "REMOVED".equals(k)); } } diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/ForwardingConcourse.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/ForwardingConcourse.java index 5d08a5a68..d6dd6951d 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/ForwardingConcourse.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/ForwardingConcourse.java @@ -1762,11 +1762,6 @@ public List submit(String ccl) { return concourse.submit(ccl); } - @Override - public boolean inTransaction() { - return concourse.inTransaction(); - } - @Override boolean failed() { return concourse.failed(); diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/NoOpConcourse.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/NoOpConcourse.java index 279b94989..4d519e89b 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/NoOpConcourse.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/NoOpConcourse.java @@ -1748,11 +1748,6 @@ public List submit(String ccl) { throw new UnsupportedOperationException(); } - @Override - public boolean inTransaction() { - return false; - } - @Override protected Concourse copyConnection() { throw new UnsupportedOperationException(); diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/thrift/JavaThriftBridge.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/thrift/JavaThriftBridge.java index bee924186..01fbf54bd 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/thrift/JavaThriftBridge.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/thrift/JavaThriftBridge.java @@ -20,6 +20,7 @@ import com.cinchapi.ccl.util.NaturalLanguage; import com.cinchapi.concourse.Timestamp; +import com.cinchapi.concourse.lang.command.Command; import com.cinchapi.concourse.lang.paginate.Page; import com.cinchapi.concourse.lang.sort.Direction; import com.cinchapi.concourse.lang.sort.Order; @@ -150,6 +151,18 @@ public static Page convert(TPage tpage) { return Page.of(tpage.getSkip(), tpage.getLimit()); } + /** + * Convert a {@link List} of {@link Command Commands} to a {@link List} of + * {@link TCommand TCommands}. + * + * @param commands the {@link Command Commands} to convert + * @return the equivalent {@link TCommand TCommands} + */ + public static List convert(List commands) { + return commands.stream().map(Command::toThrift) + .collect(Collectors.toList()); + } + private JavaThriftBridge() {/* no-init */} } diff --git a/concourse-server/src/main/java/com/cinchapi/concourse/server/ConcourseServer.java b/concourse-server/src/main/java/com/cinchapi/concourse/server/ConcourseServer.java index b33440f57..e46ed692d 100644 --- a/concourse-server/src/main/java/com/cinchapi/concourse/server/ConcourseServer.java +++ b/concourse-server/src/main/java/com/cinchapi/concourse/server/ConcourseServer.java @@ -22,6 +22,7 @@ import java.lang.management.MemoryUsage; import java.net.ServerSocket; import java.nio.ByteBuffer; +import java.util.ArrayList; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; @@ -1622,7 +1623,7 @@ public ComplexTObject exec(List commands, AccessToken creds, List results = submit(commands, creds, transaction, environment); return results.isEmpty() ? ComplexTObject.fromJavaObject(null) - : results.get(results.size() - 1); + : Iterables.getLast(results); } @Override @@ -1634,7 +1635,7 @@ public ComplexTObject execCcl(String ccl, AccessToken creds, List results = submitCcl(ccl, creds, transaction, environment); return results.isEmpty() ? ComplexTObject.fromJavaObject(null) - : results.get(results.size() - 1); + : Iterables.getLast(results); } @Override @@ -6103,10 +6104,14 @@ public List submit(List commands, AccessToken creds, TransactionToken transaction, String environment) throws TException { TransactionToken active = transaction; - List results = Lists.newArrayList(); + List results = new ArrayList<>(); try { for (TCommand command : commands) { Object result; + // NOTE: Transaction commands are handled + // explicitly (not via CommandDispatcher) + // because we must block attempts to start + // nested transactions. switch (command.getVerb()) { case STAGE: if(active != null) { diff --git a/concourse-shell/src/main/java/com/cinchapi/concourse/shell/ConcourseShell.java b/concourse-shell/src/main/java/com/cinchapi/concourse/shell/ConcourseShell.java index 84afcbc97..8abde9ff0 100644 --- a/concourse-shell/src/main/java/com/cinchapi/concourse/shell/ConcourseShell.java +++ b/concourse-shell/src/main/java/com/cinchapi/concourse/shell/ConcourseShell.java @@ -28,6 +28,7 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import java.util.Set; import java.util.concurrent.TimeUnit; @@ -63,13 +64,13 @@ import com.cinchapi.concourse.thrift.Operator; import com.cinchapi.concourse.thrift.ParseException; import com.cinchapi.concourse.thrift.SecurityException; +import com.cinchapi.concourse.thrift.TCommandVerb; import com.cinchapi.concourse.util.FileOps; import com.cinchapi.concourse.util.Version; import com.google.common.base.CaseFormat; import com.google.common.base.Stopwatch; import com.google.common.base.Strings; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; import com.google.common.collect.Sets; @@ -315,8 +316,10 @@ private static String[] getAccessibleApiMethodsUsingShortSyntax() { for (Showable showable : Showable.values()) { methods.add("show " + showable.getName()); } - // Add CCL keywords for tab completion - methods.addAll(CCL_KEYWORDS); + // Add CCL syntax words and shell meta-commands + methods.addAll(ImmutableList.of("where", "from", "in", "at", "as", "to", + "for", "order", "by", "page", "size", "prepare", "submit", + "discard")); return methods.toArray(new String[methods.size()]); } @@ -422,26 +425,15 @@ private static String tryGetCorrectApiMethod(String alias) { /** * The set of verbs recognized as CCL command prefixes. Input that begins * with one of these words (and is not followed by an open parenthesis) is - * treated as CCL. + * treated as CCL. Derived from the {@link TCommandVerb} enum so that it + * stays in sync with the Thrift IDL automatically. */ - private static final Set CCL_VERBS = ImmutableSet.of("abort", "add", - "audit", "browse", "calculate", "chronicle", "clear", "commit", - "consolidate", "describe", "diff", "find", "get", "holds", "insert", - "inventory", "jsonify", "link", "navigate", "ping", "reconcile", - "remove", "revert", "search", "select", "set", "stage", "trace", - "unlink", "verify"); - - /** - * CCL keywords to include in tab completion. - */ - private static final List CCL_KEYWORDS = ImmutableList.of("abort", - "add", "audit", "browse", "calculate", "chronicle", "clear", - "commit", "consolidate", "describe", "diff", "find", "get", "holds", - "insert", "inventory", "jsonify", "link", "navigate", "ping", - "reconcile", "remove", "revert", "search", "select", "set", "stage", - "trace", "unlink", "verify", "prepare", "submit", "discard", - "where", "from", "in", "at", "as", "to", "for", "order", "by", - "page", "size"); + private static final Set CCL_VERBS = Arrays + .stream(TCommandVerb.values()).map(v -> { + String name = v.name().toLowerCase(); + int underscore = name.indexOf('_'); + return underscore > 0 ? name.substring(0, underscore) : name; + }).collect(Collectors.toSet()); /** * A list which contains all of the accessible API methods. This list is @@ -563,13 +555,13 @@ public StartState call() { * Indicates whether prepare mode is active. When {@code true}, CCL commands * are accumulated rather than executed immediately. */ - private boolean prepareMode = false; + private boolean inPrepareMode = false; /** * The accumulated CCL commands collected during prepare mode. Only non-null - * when {@link #prepareMode} is {@code true}. + * when {@link #inPrepareMode} is {@code true}. */ - private List preparedCcl = null; + private List pendingPreparedCommands = null; /** * A closure that responds to the 'show' command and returns information to @@ -640,103 +632,13 @@ protected ConcourseShell() throws Exception { */ @SuppressWarnings("serial") public String evaluate(String input) throws IrregularEvaluationResult { - String inputLowerCase = input.trim().toLowerCase(); - - // Handle special commands first - if(inputLowerCase.equalsIgnoreCase("exit")) { - throw new ExitRequest(); - } - else if(inputLowerCase.startsWith("help") - || inputLowerCase.startsWith("man")) { - String[] toks = input.split(" "); - if(toks.length == 1) { - throw new HelpRequest(); - } - else { - String topic = toks[1]; - throw new HelpRequest(topic); - } - } - else if(Strings.isNullOrEmpty(input)) { // CON-170 - throw new NewLineRequest(); - } - else if(containsBannedCharSequence(input)) { - throw new EvaluationException(BANNED_CHAR_SEQUENCE_ERROR_MESSAGE); - } - - // Handle prepare mode meta-commands - if(inputLowerCase.equals("prepare")) { - prepareMode = true; - preparedCcl = new ArrayList<>(); - setDefaultPrompt(); - return "Entering prepare mode."; - } - else if(inputLowerCase.equals("discard")) { - if(prepareMode) { - int count = preparedCcl.size(); - prepareMode = false; - preparedCcl = null; - setDefaultPrompt(); - return "Discarded " + count + " prepared " - + (count == 1 ? "command" : "commands") + "."; - } - else { - throw new EvaluationException("ERROR: Not in prepare mode"); - } - } - else if(inputLowerCase.equals("submit") && prepareMode) { - if(preparedCcl.isEmpty()) { - prepareMode = false; - preparedCcl = null; - setDefaultPrompt(); - return "Nothing to submit."; - } - String ccl = String.join("; ", preparedCcl); - int count = preparedCcl.size(); - prepareMode = false; - preparedCcl = null; - setDefaultPrompt(); - watch.reset().start(); - List results = concourse.submit(ccl); - watch.stop(); - long elapsed = watch.elapsed(TimeUnit.MILLISECONDS); - double seconds = elapsed / 1000.0; - StringBuilder sb = new StringBuilder(); - for (int i = 0; i < results.size(); ++i) { - Object value = results.get(i); - if(value != null) { - sb.append(" [").append(i + 1).append("] Returned '") - .append(value).append("'"); - } - else { - sb.append(" [").append(i + 1).append("] Completed"); - } - sb.append('\n'); - } - sb.append("Submitted ").append(count) - .append(count == 1 ? " command" : " commands") - .append(" in ").append(seconds).append(" sec"); - return sb.toString(); - } - - // Try CCL path before Groovy - if(looksLikeCcl(input)) { - try { - ConcourseCompiler.get().compile(input); - return evaluateCcl(input); - } - catch (Exception e) { - // Fall through to Groovy evaluation - } - } - - // Existing Groovy evaluation path + String rawInput = input; input = SyntaxTools.handleShortSyntax(input, methods); + String inputLowerCase = input.toLowerCase(); - // NOTE: These must always be set before evaluating - // a line just in case an attempt was made to bind the - // variables to different values in a previous - // evaluation. + // NOTE: These must always be set before evaluating a line just in case + // an attempt was made to bind the variables to different values in a + // previous evaluation. groovyBinding.setVariable("concourse", concourse); groovyBinding.setVariable("eq", Operator.EQUALS); groovyBinding.setVariable("ne", Operator.NOT_EQUALS); @@ -768,9 +670,9 @@ else if(inputLowerCase.equals("submit") && prepareMode) { if(script != null) { groovyBinding.setVariable(EXTERNAL_SCRIPT_NAME, script); } - // GH-463: Define each accessible Concourse API - // method as a Closure directly within Groovy to - // ensure that they can be called with short syntax. + // GH-463: Define each accessible Concourse API method as a Closure + // directly within Groovy to ensure that they can be called with short + // syntax. CLOSURE_ELIGIBLE_API_METHODS.forEach(method -> { groovyBinding.setVariable(method, new Closure(null) { @@ -781,69 +683,164 @@ public Object call(Object... args) { }); }); - StringBuilder result = new StringBuilder(); - try { - watch.reset().start(); - Object value = groovy.evaluate(input, "ConcourseShell"); - watch.stop(); - long elapsed = watch.elapsed(TimeUnit.MILLISECONDS); - double seconds = elapsed / 1000.0; - if(value != null) { - result.append( - "Returned '" + value + "' in " + seconds + " sec"); + if(inputLowerCase.equalsIgnoreCase("exit")) { + throw new ExitRequest(); + } + else if(inputLowerCase.startsWith("help") + || inputLowerCase.startsWith("man")) { + String[] toks = input.split(" "); + if(toks.length == 1) { + throw new HelpRequest(); } else { - result.append("Completed in " + seconds + " sec"); + String topic = toks[1]; + throw new HelpRequest(topic); } - return result.toString(); } - catch (CompilationFailedException e) { - throw new MultiLineRequest(e.getMessage()); + else if(containsBannedCharSequence(input)) { + throw new EvaluationException(BANNED_CHAR_SEQUENCE_ERROR_MESSAGE); + } + else if(Strings.isNullOrEmpty(input)) { // CON-170 + throw new NewLineRequest(); + } + else if(inputLowerCase.equals("prepare")) { + inPrepareMode = true; + pendingPreparedCommands = new ArrayList<>(); + setDefaultPrompt(); + return "Entering prepare mode. Type commands " + + "to queue them. Use 'submit' to " + + "execute or 'discard' to cancel."; } - catch (Exception e) { - // CON-331: Here we catch a generic Exception and - // examine additional context (i.e. the cause or - // other environmental aspects) to perform - // additional logic that determines the - // appropriate response. These cases SHOULD NOT be - // placed in their own separate catch block. - String method = null; - String methodCorrected = null; - if(e.getCause() instanceof TTransportException) { - throw new ProgramCrash(e.getMessage()); + else if(inputLowerCase.equals("discard")) { + if(inPrepareMode) { + int count = pendingPreparedCommands.size(); + inPrepareMode = false; + pendingPreparedCommands = null; + setDefaultPrompt(); + return "Discarded " + count + " prepared " + + (count == 1 ? "command" : "commands") + "."; } - else if(e.getCause() instanceof SecurityException) { - throw new ProgramCrash("A security change has occurred and " - + "your session cannot " + "continue"); + else { + throw new EvaluationException("ERROR: Not in prepare mode"); } - else if(e instanceof MissingMethodException - && ErrorCause.determine( - e.getMessage()) == ErrorCause.MISSING_CASH_METHOD - && ((methodCorrected = tryGetCorrectApiMethod( - (method = ((MissingMethodException) e) - .getMethod()))) != null - || hasExternalScript())) { - if(methodCorrected != null) { - input = input.replaceAll(method, methodCorrected); + } + else if(inputLowerCase.equals("submit")) { + if(inPrepareMode) { + String ccl = String.join("; ", pendingPreparedCommands); + int count = pendingPreparedCommands.size(); + inPrepareMode = false; + pendingPreparedCommands = null; + setDefaultPrompt(); + watch.reset().start(); + List results = concourse.submit(ccl); + watch.stop(); + long elapsed = watch.elapsed(TimeUnit.MILLISECONDS); + double seconds = elapsed / 1000.0; + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < results.size(); ++i) { + Object value = results.get(i); + if(value != null) { + sb.append(" [").append(i + 1).append("] Returned '") + .append(value).append("'"); + } + else { + sb.append(" [").append(i + 1).append("] Completed"); + } + sb.append('\n'); + } + sb.append("Submitted ").append(count) + .append(count == 1 ? " command" : " commands") + .append(" in ").append(seconds).append(" sec"); + return sb.toString(); + } + else { + throw new EvaluationException("ERROR: Not in prepare mode"); + } + } + else { + StringBuilder result = new StringBuilder(); + try { + watch.reset().start(); + Object value; + if(looksLikeCcl(rawInput)) { + try { + ConcourseCompiler.get().compile(rawInput); + if(inPrepareMode) { + watch.stop(); + pendingPreparedCommands.add(rawInput); + setDefaultPrompt(); + return " [" + pendingPreparedCommands.size() + "] " + + rawInput; + } + value = concourse.exec(rawInput); + } + catch (Exception e) { + // Fall through to Groovy + value = groovy.evaluate(input, "ConcourseShell"); + } + } + else { + value = groovy.evaluate(input, "ConcourseShell"); + } + watch.stop(); + long elapsed = watch.elapsed(TimeUnit.MILLISECONDS); + double seconds = elapsed / 1000.0; + if(value != null) { + result.append( + "Returned '" + value + "' in " + seconds + " sec"); } else { - input = input.replaceAll(method, "ext." + method); + result.append("Completed in " + seconds + " sec"); } - return evaluate(input); + return result.toString(); } - else { - String message; - if(e.getCause() instanceof TApplicationException) { - message = e.getCause().getMessage() - + ". Please check server logs " - + "for more details."; + catch (CompilationFailedException e) { + throw new MultiLineRequest(e.getMessage()); + } + catch (Exception e) { + // CON-331: Here we catch a generic Exception and examine + // additional context (i.e. the cause or other environmental + // aspects) to perform additional logic that determines the + // appropriate response. These cases SHOULD NOT be placed in + // their own separate catch block. + String method = null; + String methodCorrected = null; + if(e.getCause() instanceof TTransportException) { + throw new ProgramCrash(e.getMessage()); + } + else if(e.getCause() instanceof SecurityException) { + throw new ProgramCrash( + "A security change has occurred and your " + + "session cannot continue"); + } + else if(e instanceof MissingMethodException + && ErrorCause.determine(e + .getMessage()) == ErrorCause.MISSING_CASH_METHOD + && ((methodCorrected = tryGetCorrectApiMethod( + (method = ((MissingMethodException) e) + .getMethod()))) != null + || hasExternalScript())) { + if(methodCorrected != null) { + input = input.replaceAll(method, methodCorrected); + } + else { + input = input.replaceAll(method, "ext." + method); + } + return evaluate(input); } else { - message = e.getCause() instanceof ParseException - ? e.getCause().getMessage() - : e.getMessage(); + String message; + if(e.getCause() instanceof TApplicationException) { + message = e.getCause().getMessage() + + ". Please check server logs for more details."; + } + else { + message = e.getCause() instanceof ParseException + ? e.getCause().getMessage() + : e.getMessage(); + } + throw new EvaluationException("ERROR: " + message); } - throw new EvaluationException("ERROR: " + message); } } } @@ -1027,60 +1024,33 @@ private boolean looksLikeCcl(String input) { if(!CCL_VERBS.contains(verb)) { return false; } - if(space < 0) { + else if(space < 0) { // Bare command (e.g., ping, stage, commit) return true; } - // If the next non-whitespace char is '(' then - // this is a Groovy method call, not CCL - for (int i = space + 1; i < input.length(); ++i) { - char c = input.charAt(i); - if(c == ' ') { - continue; - } - return c != '('; - } - return true; - } - - /** - * Evaluate a CCL command by sending it to the server for execution, or - * accumulate it if in prepare mode. - * - * @param input the CCL input - * @return the formatted result string - */ - private String evaluateCcl(String input) { - if(prepareMode) { - preparedCcl.add(input); - setDefaultPrompt(); - return " [" + preparedCcl.size() + "] " + input; - } - watch.reset().start(); - Object value = concourse.exec(input); - watch.stop(); - long elapsed = watch.elapsed(TimeUnit.MILLISECONDS); - double seconds = elapsed / 1000.0; - if(value != null) { - return "Returned '" + value + "' in " + seconds + " sec"; - } else { - return "Completed in " + seconds + " sec"; + // If the next non-whitespace char is '(' then + // this is a Groovy method call, not CCL + for (int i = space + 1; i < input.length(); ++i) { + char c = input.charAt(i); + if(c != ' ') { + return c != '('; + } + } + return true; } } /** * Set the {@link #defaultPrompt} variable to account for the current - * {@link #env}, transaction state, and prepare mode. + * {@link #env} and prepare mode. */ private void setDefaultPrompt() { StringBuilder sb = new StringBuilder("["); sb.append(env).append("/cash"); - if(concourse != null && concourse.inTransaction()) { - sb.append(":txn"); - } - if(prepareMode) { - sb.append(":prepare(").append(preparedCcl.size()).append(")"); + if(inPrepareMode) { + sb.append(":prepare(").append(pendingPreparedCommands.size()) + .append(")"); } sb.append("]$ "); this.defaultPrompt = sb.toString(); diff --git a/utils/codegen/CommandGroupGenerator.groovy b/utils/codegen/CommandGroupGenerator.groovy index f67f8643e..6ef26e139 100644 --- a/utils/codegen/CommandGroupGenerator.groovy +++ b/utils/codegen/CommandGroupGenerator.groovy @@ -62,11 +62,13 @@ public class CommandGroupGenerator { /** * Compound verbs that consist of multiple camelCase words. - * These must be checked before the single-word verb extraction. + * These must be checked before the single-word verb + * extraction. */ private static Set COMPOUND_VERBS = Sets.newHashSet( "verifyAndSwap", "verifyOrSet", "findOrAdd", - "findOrInsert", "invokeManagement", "invokePlugin"); + "findOrInsert", "invokeManagement", + "invokePlugin"); /** * Methods that should be excluded from the generated @@ -96,8 +98,7 @@ public class CommandGroupGenerator { String source = args[i]; InputSupplier input = Files.asCharSource( new File(source), StandardCharsets.UTF_8); - Document document = - ThriftIdlParser.parseThriftIdl(input); + Document document = ThriftIdlParser.parseThriftIdl(input); signatures.addAll(getMethodSignatures(document)); } String generated = """/** @@ -173,46 +174,32 @@ public interface CommandGroup { Document document) { List signatures = Lists.newArrayList(); Set seen = Sets.newHashSet(); - for (Definition definition : - document.getDefinitions()) { + for (Definition definition : document.getDefinitions()) { if(definition instanceof Service) { Service service = (Service) definition; - for (ThriftMethod method : - service.getMethods()) { + for (ThriftMethod method : service.getMethods()) { String name = method.getName(); if(!BANNED_METHODS.contains(name)) { String verb = extractVerb(name); - StringBuilder sb = - new StringBuilder(); - for (ThriftField field : - method.getArguments()) { - if(!BANNED_PARAMS.contains( - field.getName())) { - String type = - thriftTypeToJavaType( - field.getType(), - true); + StringBuilder sb = new StringBuilder(); + for (ThriftField field : method.getArguments()) { + if(!BANNED_PARAMS.contains(field.getName())) { + String type = thriftTypeToJavaType( + field.getType(), true); if(type.equals("TObject")) { type = "Object"; } - else if(type.contains( - "TObject") - && !type.contains( - "ComplexTObject")) { - type = type.replaceAll( - "TObject", - "Object"); + else if(type.contains("TObject") + && !type.contains("ComplexTObject")) { + type = type.replaceAll("TObject", "Object"); } - else if(type.equals( - "TCriteria")) { + else if(type.equals("TCriteria")) { type = "Criteria"; } - else if(type.equals( - "TOrder")) { + else if(type.equals("TOrder")) { type = "Order"; } - else if(type.equals( - "TPage")) { + else if(type.equals("TPage")) { type = "Page"; } sb.append(type); @@ -222,60 +209,40 @@ public interface CommandGroup { } } if(sb.length() > 1) { - sb.delete(sb.length() - 2, - sb.length()); + sb.delete(sb.length() - 2, sb.length()); } String params = sb.toString(); - String signature = - "void ${verb}(${params})"; - // Build a type-only key for - // dedup (Java overload - // resolution uses types, not - // param names) + String signature = "void ${verb}(${params})"; + // Build a type-only key for dedup (Java overload + // resolution uses types, not param names) String typeKey = verb + "("; boolean first = true; - for (ThriftField field : - method.getArguments()) { - if(!BANNED_PARAMS.contains( - field.getName())) { - String type = - thriftTypeToJavaType( - field.getType(), - true); + for (ThriftField field : method.getArguments()) { + if(!BANNED_PARAMS.contains(field.getName())) { + String type = thriftTypeToJavaType( + field.getType(), true); if(type.equals("TObject")) { type = "Object"; } - else if(type.contains( - "TObject") - && !type.contains( - "ComplexTObject")) { - type = type.replaceAll( - "TObject", - "Object"); + else if(type.contains("TObject") + && !type.contains("ComplexTObject")) { + type = type.replaceAll("TObject", "Object"); } - else if(type.equals( - "TCriteria")) { + else if(type.equals("TCriteria")) { type = "Criteria"; } - else if(type.equals( - "TOrder")) { + else if(type.equals("TOrder")) { type = "Order"; } - else if(type.equals( - "TPage")) { + else if(type.equals("TPage")) { type = "Page"; } if(!first) { typeKey += ","; } - // Use erased type for - // dedup to avoid - // List vs - // List clashes - String erased = type - .replaceAll( - "<.*>", - ""); + // Use erased type for dedup to avoid + // List vs List clashes + String erased = type.replaceAll("<.*>", ""); typeKey += erased; first = false; } @@ -347,11 +314,9 @@ public interface CommandGroup { MapType map = (MapType) type; StringBuilder sb = new StringBuilder(); sb.append("Map<"); - sb.append(thriftTypeToJavaType( - map.getKeyType(), false)); + sb.append(thriftTypeToJavaType(map.getKeyType(), false)); sb.append(","); - sb.append(thriftTypeToJavaType( - map.getValueType(), false)); + sb.append(thriftTypeToJavaType(map.getValueType(), false)); sb.append(">"); return sb.toString(); } @@ -359,8 +324,7 @@ public interface CommandGroup { SetType set = (SetType) type; StringBuilder sb = new StringBuilder(); sb.append("Set<"); - sb.append(thriftTypeToJavaType( - set.getElementType(), false)); + sb.append(thriftTypeToJavaType(set.getElementType(), false)); sb.append(">"); return sb.toString(); } @@ -368,16 +332,13 @@ public interface CommandGroup { ListType list = (ListType) type; StringBuilder sb = new StringBuilder(); sb.append("List<"); - sb.append(thriftTypeToJavaType( - list.getElementType(), false)); + sb.append(thriftTypeToJavaType(list.getElementType(), false)); sb.append(">"); return sb.toString(); } else if(type instanceof IdentifierType) { - IdentifierType identifier = - (IdentifierType) type; - String[] parts = - identifier.getName().split("\\."); + IdentifierType identifier = (IdentifierType) type; + String[] parts = identifier.getName().split("\\."); return parts[parts.length - 1]; } else { diff --git a/utils/codegen/StatefulConcourseServiceGenerator.groovy b/utils/codegen/StatefulConcourseServiceGenerator.groovy index b3ea97cb7..545ac0f1d 100644 --- a/utils/codegen/StatefulConcourseServiceGenerator.groovy +++ b/utils/codegen/StatefulConcourseServiceGenerator.groovy @@ -238,8 +238,7 @@ abstract class StatefulConcourseService { ++pos; } if(sb.length() > 1) { - sb.delete(sb.length() - 2, - sb.length()); + sb.setLength(sb.length() - 2); } String params = sb.toString(); String signature = "${ret} ${name}(${params})"; From 4cb2feca7012e648be278f0779af1e5c6c5e042b Mon Sep 17 00:00:00 2001 From: Jeff Nelson Date: Sun, 15 Mar 2026 21:17:36 -0400 Subject: [PATCH 11/13] more review feedback --- .../com/cinchapi/concourse/Concourse.java | 434 ++++++------- .../concourse/ConcourseThriftDriver.java | 152 ++--- .../concourse/ForwardingConcourse.java | 190 +++--- .../com/cinchapi/concourse/NoOpConcourse.java | 164 ++--- .../concourse/lang/command/Command.java | 25 +- .../lang/command/CommandSerializer.java | 7 +- .../concourse/lang/command/ParsedCommand.java | 15 +- .../concourse/thrift/JavaThriftBridge.java | 3 +- .../lang/command/CommandCompilationTest.java | 24 - .../command/CommandSerializationTest.java | 253 ++++---- .../concourse/server/ConcourseServer.java | 5 +- .../server/ops/CommandTreeConverter.java | 592 +++++++++--------- .../concourse/shell/ConcourseShell.java | 214 ++++--- 13 files changed, 1014 insertions(+), 1064 deletions(-) diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/Concourse.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/Concourse.java index 8dc9d70f3..c9c1bdda1 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/Concourse.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/Concourse.java @@ -281,6 +281,121 @@ public abstract Map add(String key, T value, */ public abstract boolean add(String key, T value, long record); + /** + * Return a list of all the changes ever made to {@code record}. + * + * @param record the record id + * @return a {@link Map} from the {@link Timestamp} of each commit to a list + * of descriptions for each change made within the commit + */ + public abstract Map> audit(long record); + + /** + * Return a list of all the changes made to {@code record} since + * {@code start} (inclusive). + * + * @param record the record id + * @param start an inclusive {@link Timestamp} of the oldest change that + * should possibly be included in the audit - created from either + * a {@link Timestamp#fromString(String) natural language + * description} of a point in time (i.e. two weeks ago), OR the + * {@link Timestamp#fromMicros(long) number of microseconds} + * since the Unix epoch, OR a + * {@link Timestamp#fromJoda(org.joda.time.DateTime) Joda + * DateTime} object + * @return a {@link Map} from the {@link Timestamp} of each commit to a list + * of descriptions for each change made within the commit + */ + public abstract Map> audit(long record, + Timestamp start); + + /** + * Return a list of all the changes made to {@code record} between + * {@code start} (inclusive) and {@code end} (non-inclusive). + * + * @param record the record id + * @param start an inclusive {@link Timestamp} for the oldest change that + * should possibly be included in the audit - created from either + * a {@link Timestamp#fromString(String) natural language + * description} of a point in time (i.e. two weeks ago), OR the + * {@link Timestamp#fromMicros(long) number of microseconds} + * since the Unix epoch, OR a + * {@link Timestamp#fromJoda(org.joda.time.DateTime) Joda + * DateTime} object + * @param end a non-inclusive {@link Timestamp} for the most recent change + * that should possibly be included in the audit - created from + * either a {@link Timestamp#fromString(String) natural language + * description} of a point in time (i.e. two weeks ago), OR the + * {@link Timestamp#fromMicros(long) number of microseconds} + * since the Unix epoch, OR a + * {@link Timestamp#fromJoda(org.joda.time.DateTime) Joda + * DateTime} object + * @return a {@link Map} from the {@link Timestamp} of each commit to a list + * of descriptions for each change made within the commit + */ + public abstract Map> audit(long record, + Timestamp start, Timestamp end); + + /** + * Return a list of all the changes ever made to the {@code key} field in + * {@code record}. + * + * @param key the field name + * @param record the record id + * @return a {@link Map} from the {@link Timestamp} of each commit to a list + * of descriptions for each change made within the commit + */ + public abstract Map> audit(String key, long record); + + /** + * Return a list of all the changes made to the {@code key} field in + * {@code record} since {@code start} (inclusive). + * + * @param key the field name + * @param record the record id + * @param start an inclusive {@link Timestamp} for the oldest change that + * should possibly be included in the audit - created from either + * a {@link Timestamp#fromString(String) natural language + * description} of a point in time (i.e. two weeks ago), OR the + * {@link Timestamp#fromMicros(long) number of microseconds} + * since the Unix epoch, OR a + * {@link Timestamp#fromJoda(org.joda.time.DateTime) Joda + * DateTime} object + * @return a {@link Map} from the {@link Timestamp} of each commit to a list + * of descriptions for each change made within the commit + */ + public abstract Map> audit(String key, long record, + Timestamp start); + + /** + * Return a list of all the changes made to the {@code key} field in + * {@code record} between {@code start} (inclusive) and {@code end} + * (non-inclusive). + * + * @param key the field name + * @param record the record id + * @param start an inclusive {@link Timestamp} for the oldest change that + * should possibly be included in the audit - created from either + * a {@link Timestamp#fromString(String) natural language + * description} of a point in time (i.e. two weeks ago), OR the + * {@link Timestamp#fromMicros(long) number of microseconds} + * since the Unix epoch, OR a + * {@link Timestamp#fromJoda(org.joda.time.DateTime) Joda + * DateTime} object + * @param end a non-inclusive {@link Timestamp} for the most recent change + * that should possibly be included in the audit - created from + * either a {@link Timestamp#fromString(String) natural language + * description} of a point in time (i.e. two weeks ago), OR the + * {@link Timestamp#fromMicros(long) number of microseconds} + * since the Unix epoch, OR a + * {@link Timestamp#fromJoda(org.joda.time.DateTime) Joda + * DateTime} object + * @return a {@link Map} from the {@link Timestamp} of each commit to a list + * of descriptions for each change made within the commit + */ + public abstract Map> audit(String key, long record, + Timestamp start, Timestamp end); + /** * Return a view of the values from all records that are currently stored * for each of the {@code keys}. @@ -807,6 +922,60 @@ public abstract Map>> diff(String key, public abstract Map>> diff(String key, Timestamp start, Timestamp end); + /** + * Execute a single {@link Command} and return its result. + *

      + * If the {@link Command} fails, the exception is propagated immediately. + *

      + * + * @param command the {@link Command} to execute + * @return the result of the {@link Command} + */ + public abstract Object exec(Command command); + + /** + * Execute two or more {@link Command Commands} and return the result of the + * last one. + *

      + * {@link Command Commands} are executed sequentially. If any + * {@link Command} fails, execution stops and the exception is propagated + * immediately. + *

      + * + * @param command the first {@link Command} to execute + * @param more additional {@link Command Commands} to execute + * @return the result of the last {@link Command} + */ + public abstract Object exec(Command command, Command... more); + + /** + * Execute a list of {@link Command Commands} and return the result of the + * last one. + *

      + * {@link Command Commands} are executed sequentially. If any + * {@link Command} fails, execution stops and the exception is propagated + * immediately. + *

      + * + * @param commands the {@link Command Commands} to execute + * @return the result of the last {@link Command} + */ + public abstract Object exec(List commands); + + /** + * Execute CCL text containing one or more commands and return the result of + * the last command. + *

      + * The {@code ccl} text is validated and compiled on the server. Multiple + * commands may be separated by semicolons or newlines. If any command + * fails, execution stops and the exception is propagated immediately. + *

      + * + * @param ccl the CCL text to execute + * @return the result of the last command + */ + public abstract Object exec(String ccl); + /** * Terminate the client's session and close this connection. */ @@ -4142,6 +4311,26 @@ public final Map> get(String ccl, */ public abstract String getServerVersion(); + /** + * Atomically check to see if each of the {@code records} currently contains + * any data. + * + * @param records a collection of record ids + * @return a {@link Map} associating each of the {@code records} to a + * boolean that indicates whether that record currently contains any + * data. + */ + public abstract Map holds(Collection records); + + /** + * Check to see if {@code record} currently contains any data. + * + * @param record the record id + * @return {@code true} if {@code record} currently contains any data, + * otherwise {@code false} + */ + public abstract boolean holds(long record); + /** * Atomically insert the key/value associations from each of the * {@link Multimap maps} in {@code data} into new and distinct records. @@ -5055,24 +5244,17 @@ public abstract Map> navigate(String key, String ccl, public abstract boolean ping(); /** - * Atomically check to see if each of the {@code records} currently contains - * any data. - * - * @param records a collection of record ids - * @return a {@link Map} associating each of the {@code records} to a - * boolean that indicates whether that record currently contains any - * data. - */ - public abstract Map holds(Collection records); - - /** - * Check to see if {@code record} currently contains any data. + * Return a new {@link CommandGroup} that can be used to collect + * {@link Command Commands} for batch submission. + *

      + * Call methods on the returned {@link CommandGroup} to record operations. + * Then pass the {@link CommandGroup} to {@link #submit(CommandGroup)} to + * execute all the recorded operations in a single round trip. + *

      * - * @param record the record id - * @return {@code true} if {@code record} currently contains any data, - * otherwise {@code false} + * @return a new {@link CommandGroup} */ - public abstract boolean holds(long record); + public abstract CommandGroup prepare(); /** * Make the necessary changes to the data stored for {@code key} in @@ -5203,121 +5385,6 @@ public abstract void revert(String key, Collection records, */ public abstract void revert(String key, long record, Timestamp timestamp); - /** - * Return a list of all the changes ever made to {@code record}. - * - * @param record the record id - * @return a {@link Map} from the {@link Timestamp} of each commit to a list - * of descriptions for each change made within the commit - */ - public abstract Map> audit(long record); - - /** - * Return a list of all the changes made to {@code record} since - * {@code start} (inclusive). - * - * @param record the record id - * @param start an inclusive {@link Timestamp} of the oldest change that - * should possibly be included in the audit - created from either - * a {@link Timestamp#fromString(String) natural language - * description} of a point in time (i.e. two weeks ago), OR the - * {@link Timestamp#fromMicros(long) number of microseconds} - * since the Unix epoch, OR a - * {@link Timestamp#fromJoda(org.joda.time.DateTime) Joda - * DateTime} object - * @return a {@link Map} from the {@link Timestamp} of each commit to a list - * of descriptions for each change made within the commit - */ - public abstract Map> audit(long record, - Timestamp start); - - /** - * Return a list of all the changes made to {@code record} between - * {@code start} (inclusive) and {@code end} (non-inclusive). - * - * @param record the record id - * @param start an inclusive {@link Timestamp} for the oldest change that - * should possibly be included in the audit - created from either - * a {@link Timestamp#fromString(String) natural language - * description} of a point in time (i.e. two weeks ago), OR the - * {@link Timestamp#fromMicros(long) number of microseconds} - * since the Unix epoch, OR a - * {@link Timestamp#fromJoda(org.joda.time.DateTime) Joda - * DateTime} object - * @param end a non-inclusive {@link Timestamp} for the most recent change - * that should possibly be included in the audit - created from - * either a {@link Timestamp#fromString(String) natural language - * description} of a point in time (i.e. two weeks ago), OR the - * {@link Timestamp#fromMicros(long) number of microseconds} - * since the Unix epoch, OR a - * {@link Timestamp#fromJoda(org.joda.time.DateTime) Joda - * DateTime} object - * @return a {@link Map} from the {@link Timestamp} of each commit to a list - * of descriptions for each change made within the commit - */ - public abstract Map> audit(long record, - Timestamp start, Timestamp end); - - /** - * Return a list of all the changes ever made to the {@code key} field in - * {@code record}. - * - * @param key the field name - * @param record the record id - * @return a {@link Map} from the {@link Timestamp} of each commit to a list - * of descriptions for each change made within the commit - */ - public abstract Map> audit(String key, long record); - - /** - * Return a list of all the changes made to the {@code key} field in - * {@code record} since {@code start} (inclusive). - * - * @param key the field name - * @param record the record id - * @param start an inclusive {@link Timestamp} for the oldest change that - * should possibly be included in the audit - created from either - * a {@link Timestamp#fromString(String) natural language - * description} of a point in time (i.e. two weeks ago), OR the - * {@link Timestamp#fromMicros(long) number of microseconds} - * since the Unix epoch, OR a - * {@link Timestamp#fromJoda(org.joda.time.DateTime) Joda - * DateTime} object - * @return a {@link Map} from the {@link Timestamp} of each commit to a list - * of descriptions for each change made within the commit - */ - public abstract Map> audit(String key, long record, - Timestamp start); - - /** - * Return a list of all the changes made to the {@code key} field in - * {@code record} between {@code start} (inclusive) and {@code end} - * (non-inclusive). - * - * @param key the field name - * @param record the record id - * @param start an inclusive {@link Timestamp} for the oldest change that - * should possibly be included in the audit - created from either - * a {@link Timestamp#fromString(String) natural language - * description} of a point in time (i.e. two weeks ago), OR the - * {@link Timestamp#fromMicros(long) number of microseconds} - * since the Unix epoch, OR a - * {@link Timestamp#fromJoda(org.joda.time.DateTime) Joda - * DateTime} object - * @param end a non-inclusive {@link Timestamp} for the most recent change - * that should possibly be included in the audit - created from - * either a {@link Timestamp#fromString(String) natural language - * description} of a point in time (i.e. two weeks ago), OR the - * {@link Timestamp#fromMicros(long) number of microseconds} - * since the Unix epoch, OR a - * {@link Timestamp#fromJoda(org.joda.time.DateTime) Joda - * DateTime} object - * @return a {@link Map} from the {@link Timestamp} of each commit to a list - * of descriptions for each change made within the commit - */ - public abstract Map> audit(String key, long record, - Timestamp start, Timestamp end); - /** * Perform a full text search for {@code query} against the {@code key} * field and return the records that contain a {@link String} or {@link Tag} @@ -7447,46 +7514,6 @@ public final boolean stage(Runnable task) throws TransactionException { } } - /** - * Execute a single {@link Command} and return its result. - *

      - * If the {@link Command} fails, the exception is propagated immediately. - *

      - * - * @param command the {@link Command} to execute - * @return the result of the {@link Command} - */ - public abstract Object exec(Command command); - - /** - * Execute two or more {@link Command Commands} and return the result of the - * last one. - *

      - * {@link Command Commands} are executed sequentially. If any - * {@link Command} fails, execution stops and the exception is propagated - * immediately. - *

      - * - * @param command the first {@link Command} to execute - * @param more additional {@link Command Commands} to execute - * @return the result of the last {@link Command} - */ - public abstract Object exec(Command command, Command... more); - - /** - * Execute a list of {@link Command Commands} and return the result of the - * last one. - *

      - * {@link Command Commands} are executed sequentially. If any - * {@link Command} fails, execution stops and the exception is propagated - * immediately. - *

      - * - * @param commands the {@link Command Commands} to execute - * @return the result of the last {@link Command} - */ - public abstract Object exec(List commands); - /** * Submit a single {@link Command} and return a {@link List} containing its * result. @@ -7514,20 +7541,6 @@ public final boolean stage(Runnable task) throws TransactionException { */ public abstract List submit(Command command, Command... more); - /** - * Submit a list of {@link Command Commands} and return a {@link List} of - * results corresponding to each {@link Command}. - *

      - * {@link Command Commands} are executed sequentially on the server in a - * single round trip. If any {@link Command} fails, execution stops and the - * exception is propagated. - *

      - * - * @param commands the {@link Command Commands} to submit - * @return a {@link List} of results, one per {@link Command} - */ - public abstract List submit(List commands); - /** * Submit all the {@link Command Commands} that have been prepared in the * {@code group} and return a {@link List} of results corresponding to each @@ -7545,31 +7558,18 @@ public final boolean stage(Runnable task) throws TransactionException { public abstract List submit(CommandGroup group); /** - * Return a new {@link CommandGroup} that can be used to collect - * {@link Command Commands} for batch submission. - *

      - * Call methods on the returned {@link CommandGroup} to record operations. - * Then pass the {@link CommandGroup} to {@link #submit(CommandGroup)} to - * execute all the recorded operations in a single round trip. - *

      - * - * @return a new {@link CommandGroup} - */ - public abstract CommandGroup prepare(); - - /** - * Execute CCL text containing one or more commands and return the result of - * the last command. + * Submit a list of {@link Command Commands} and return a {@link List} of + * results corresponding to each {@link Command}. *

      - * The {@code ccl} text is validated and compiled on the server. Multiple - * commands may be separated by semicolons or newlines. If any command - * fails, execution stops and the exception is propagated immediately. + * {@link Command Commands} are executed sequentially on the server in a + * single round trip. If any {@link Command} fails, execution stops and the + * exception is propagated. *

      * - * @param ccl the CCL text to execute - * @return the result of the last command + * @param commands the {@link Command Commands} to submit + * @return a {@link List} of results, one per {@link Command} */ - public abstract Object exec(String ccl); + public abstract List submit(List commands); /** * Submit CCL text containing one or more commands and return a {@link List} @@ -7805,17 +7805,6 @@ public abstract boolean verify(String key, Object value, long record, public abstract boolean verifyAndSwap(String key, Object expected, long record, Object replacement); - /** - * Return {@code true} if this client is known to be in a non-transient - * failed state where the server is still operational for other clients, but - * this one cannot further interact. - * - * @return {@code true} if this client has failed - */ - boolean failed() { - return false; - } - /** * Atomically verify that {@code key} equals {@code expected} in * {@code record} or set it as such. @@ -7855,6 +7844,17 @@ boolean failed() { */ protected abstract Concourse copyConnection(); + /** + * Return {@code true} if this client is known to be in a non-transient + * failed state where the server is still operational for other clients, but + * this one cannot further interact. + * + * @return {@code true} if this client has failed + */ + boolean failed() { + return false; + } + /** * An iterative builder for {@link Concourse} connections. * diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/ConcourseThriftDriver.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/ConcourseThriftDriver.java index 824c003f8..6aa83b887 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/ConcourseThriftDriver.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/ConcourseThriftDriver.java @@ -19,7 +19,6 @@ import java.nio.ByteBuffer; import java.util.Arrays; import java.util.Collection; -import java.util.EnumSet; import java.util.List; import java.util.Map; import java.util.Map.Entry; @@ -243,32 +242,6 @@ static boolean isLegacyServerVersion(@Nullable String version) { */ private boolean usePrettyCollections = false; - /** - * {@link TCommandVerb TCommandVerbs} whose results are never {@link Map - * Maps} and therefore never need pretty-printing. - */ - // @formatter:off - private static final EnumSet NON_MAP_VERBS = - EnumSet.of( - TCommandVerb.ADD, TCommandVerb.SET, - TCommandVerb.REMOVE, TCommandVerb.CLEAR, - TCommandVerb.INSERT, TCommandVerb.LINK, - TCommandVerb.UNLINK, TCommandVerb.REVERT, - TCommandVerb.RECONCILE, - TCommandVerb.CONSOLIDATE, - TCommandVerb.VERIFY, - TCommandVerb.VERIFY_AND_SWAP, - TCommandVerb.VERIFY_OR_SET, - TCommandVerb.HOLDS, TCommandVerb.PING, - TCommandVerb.STAGE, TCommandVerb.COMMIT, - TCommandVerb.ABORT, TCommandVerb.FIND, - TCommandVerb.SEARCH, TCommandVerb.INVENTORY, - TCommandVerb.CALCULATE, TCommandVerb.JSONIFY, - TCommandVerb.FIND_OR_ADD, - TCommandVerb.FIND_OR_INSERT - ); - // @formatter:on - /** * Create a new Client connection to the environment of the Concourse Server * described in the client configuration (e.g., @@ -914,6 +887,41 @@ public Map>> diff(String key, Timestamp start, }); } + @Override + public Object exec(Command command) { + return exec(ImmutableList.of(command)); + } + + @Override + public Object exec(Command command, Command... more) { + List commands = ImmutableList. builder().add(command) + .add(more).build(); + return exec(commands); + } + + @Override + public Object exec(List commands) { + return execute(() -> { + List tcommands = JavaThriftBridge.convert(commands); + TCommandVerb verb = usePrettyCollections && !tcommands.isEmpty() + ? Iterables.getLast(tcommands).getVerb() + : null; + return prettify( + core.exec(tcommands, creds, transaction, environment) + .getJavaObject(), + verb); + }); + } + + @Override + public Object exec(String ccl) { + return execute(() -> { + List verbs = extractCommandVerbsIfNecessary(ccl); + return prettify(core.execCcl(ccl, creds, transaction, environment) + .getJavaObject(), Iterables.getLast(verbs, null)); + }); + } + @Override public void exit() { try { @@ -2718,6 +2726,11 @@ public boolean ping() { } } + @Override + public CommandGroup prepare() { + return new DefaultCommandGroup(); + } + @Override public void reconcile(String key, long record, Collection values) { execute(() -> { @@ -4101,32 +4114,6 @@ public void stage() throws TransactionException { }); } - @Override - public Object exec(Command command) { - return exec(ImmutableList.of(command)); - } - - @Override - public Object exec(Command command, Command... more) { - List commands = ImmutableList. builder().add(command) - .add(more).build(); - return exec(commands); - } - - @Override - public Object exec(List commands) { - return execute(() -> { - List tcommands = JavaThriftBridge.convert(commands); - TCommandVerb verb = usePrettyCollections && !tcommands.isEmpty() - ? tcommands.get(tcommands.size() - 1).getVerb() - : null; - return prettify( - core.exec(tcommands, creds, transaction, environment) - .getJavaObject(), - verb); - }); - } - @Override public List submit(Command command) { return submit(Lists.newArrayList(command)); @@ -4139,6 +4126,11 @@ public List submit(Command command, Command... more) { return submit(commands); } + @Override + public List submit(CommandGroup group) { + return submit(group.commands()); + } + @Override public List submit(List commands) { return execute(() -> { @@ -4157,25 +4149,6 @@ public List submit(List commands) { }); } - @Override - public List submit(CommandGroup group) { - return submit(group.commands()); - } - - @Override - public CommandGroup prepare() { - return new DefaultCommandGroup(); - } - - @Override - public Object exec(String ccl) { - return execute(() -> { - List verbs = extractCommandVerbsIfNecessary(ccl); - return prettify(core.execCcl(ccl, creds, transaction, environment) - .getJavaObject(), Iterables.getLast(verbs, null)); - }); - } - @Override public List submit(String ccl) { return execute(() -> { @@ -4745,22 +4718,6 @@ private Set executeFind(final Timestamp timestamp, final String key, }); } - /** - * Determine whether the connected server uses legacy core RPC method names. - * - * @return {@code true} if the server is pre-1.0.0 - */ - private boolean isConnectedToLegacyServer() { - boolean legacy = false; - try { - legacy = isLegacyServerVersion(core.getServerVersion()); - } - catch (Exception e) { - legacy = false; - } - return legacy; - } - /** * Extract the {@link TCommandVerb} for each command in a CCL string, in * order. If pretty collections are disabled, return an empty {@link List} @@ -4801,6 +4758,22 @@ private List extractCommandVerbsIfNecessary(String ccl) { } } + /** + * Determine whether the connected server uses legacy core RPC method names. + * + * @return {@code true} if the server is pre-1.0.0 + */ + private boolean isConnectedToLegacyServer() { + boolean legacy = false; + try { + legacy = isLegacyServerVersion(core.getServerVersion()); + } + catch (Exception e) { + legacy = false; + } + return legacy; + } + /** * Wrap a raw result from command execution in the appropriate * pretty-printing container so that its {@link Object#toString()} output @@ -4818,9 +4791,6 @@ private Object prettify(Object value, @Nullable TCommandVerb verb) { if(!usePrettyCollections) { return value; } - else if(verb != null && NON_MAP_VERBS.contains(verb)) { - return value; - } else if(!(value instanceof Map)) { return value; } diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/ForwardingConcourse.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/ForwardingConcourse.java index d6dd6951d..ef92eef02 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/ForwardingConcourse.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/ForwardingConcourse.java @@ -78,6 +78,39 @@ public boolean add(String key, T value, long record) { return concourse.add(key, value, record); } + @Override + public Map> audit(long record) { + return concourse.audit(record); + } + + @Override + public Map> audit(long record, Timestamp start) { + return concourse.audit(record, start); + } + + @Override + public Map> audit(long record, Timestamp start, + Timestamp end) { + return concourse.audit(record, start, end); + } + + @Override + public Map> audit(String key, long record) { + return concourse.audit(key, record); + } + + @Override + public Map> audit(String key, long record, + Timestamp start) { + return concourse.audit(key, record, start); + } + + @Override + public Map> audit(String key, long record, + Timestamp start, Timestamp end) { + return concourse.audit(key, record, start, end); + } + @Override public Map>> browse(Collection keys) { return concourse.browse(keys); @@ -222,6 +255,26 @@ public Map>> diff(String key, Timestamp start, return concourse.diff(key, start, end); } + @Override + public Object exec(Command command) { + return concourse.exec(command); + } + + @Override + public Object exec(Command command, Command... more) { + return concourse.exec(command, more); + } + + @Override + public Object exec(List commands) { + return concourse.exec(commands); + } + + @Override + public Object exec(String ccl) { + return concourse.exec(ccl); + } + @Override public void exit() { concourse.exit(); @@ -921,6 +974,16 @@ public String getServerVersion() { return concourse.getServerVersion(); } + @Override + public Map holds(Collection records) { + return concourse.holds(records); + } + + @Override + public boolean holds(long record) { + return concourse.holds(record); + } + @Override public Set insert(String json) { return concourse.insert(json); @@ -1098,13 +1161,8 @@ public boolean ping() { } @Override - public Map holds(Collection records) { - return concourse.holds(records); - } - - @Override - public boolean holds(long record) { - return concourse.holds(record); + public CommandGroup prepare() { + return concourse.prepare(); } @Override @@ -1146,39 +1204,6 @@ public void revert(String key, long record, Timestamp timestamp) { concourse.revert(key, record, timestamp); } - @Override - public Map> audit(long record) { - return concourse.audit(record); - } - - @Override - public Map> audit(long record, Timestamp start) { - return concourse.audit(record, start); - } - - @Override - public Map> audit(long record, Timestamp start, - Timestamp end) { - return concourse.audit(record, start, end); - } - - @Override - public Map> audit(String key, long record) { - return concourse.audit(key, record); - } - - @Override - public Map> audit(String key, long record, - Timestamp start) { - return concourse.audit(key, record, start); - } - - @Override - public Map> audit(String key, long record, - Timestamp start, Timestamp end) { - return concourse.audit(key, record, start, end); - } - @Override public Set search(String key, String query) { return concourse.search(key, query); @@ -1654,6 +1679,31 @@ public void stage() throws TransactionException { concourse.stage(); } + @Override + public List submit(Command command) { + return concourse.submit(command); + } + + @Override + public List submit(Command command, Command... more) { + return concourse.submit(command, more); + } + + @Override + public List submit(CommandGroup group) { + return concourse.submit(group); + } + + @Override + public List submit(List commands) { + return concourse.submit(commands); + } + + @Override + public List submit(String ccl) { + return concourse.submit(ccl); + } + @Override public Timestamp time() { return concourse.time(); @@ -1712,61 +1762,6 @@ public void verifyOrSet(String key, Object value, long record) { concourse.verifyOrSet(key, value, record); } - @Override - public Object exec(Command command) { - return concourse.exec(command); - } - - @Override - public Object exec(Command command, Command... more) { - return concourse.exec(command, more); - } - - @Override - public Object exec(List commands) { - return concourse.exec(commands); - } - - @Override - public List submit(Command command) { - return concourse.submit(command); - } - - @Override - public List submit(Command command, Command... more) { - return concourse.submit(command, more); - } - - @Override - public List submit(List commands) { - return concourse.submit(commands); - } - - @Override - public List submit(CommandGroup group) { - return concourse.submit(group); - } - - @Override - public CommandGroup prepare() { - return concourse.prepare(); - } - - @Override - public Object exec(String ccl) { - return concourse.exec(ccl); - } - - @Override - public List submit(String ccl) { - return concourse.submit(ccl); - } - - @Override - boolean failed() { - return concourse.failed(); - } - /** * Construct an instance of this {@link ForwardingConcourse} using the * provided {@code concourse} connection as the proxied handle. @@ -1781,4 +1776,9 @@ protected final Concourse copyConnection() { return $this(concourse.copyConnection()); } + @Override + boolean failed() { + return concourse.failed(); + } + } diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/NoOpConcourse.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/NoOpConcourse.java index 4d519e89b..29aa713c9 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/NoOpConcourse.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/NoOpConcourse.java @@ -58,6 +58,39 @@ public boolean add(String key, T value, long record) { throw new UnsupportedOperationException(); } + @Override + public Map> audit(long record) { + throw new UnsupportedOperationException(); + } + + @Override + public Map> audit(long record, Timestamp start) { + throw new UnsupportedOperationException(); + } + + @Override + public Map> audit(long record, Timestamp start, + Timestamp end) { + throw new UnsupportedOperationException(); + } + + @Override + public Map> audit(String key, long record) { + throw new UnsupportedOperationException(); + } + + @Override + public Map> audit(String key, long record, + Timestamp start) { + throw new UnsupportedOperationException(); + } + + @Override + public Map> audit(String key, long record, + Timestamp start, Timestamp end) { + throw new UnsupportedOperationException(); + } + @Override public Map>> browse(Collection keys) { throw new UnsupportedOperationException(); @@ -202,6 +235,26 @@ public Map>> diff(String key, Timestamp start, throw new UnsupportedOperationException(); } + @Override + public Object exec(Command command) { + throw new UnsupportedOperationException(); + } + + @Override + public Object exec(Command command, Command... more) { + throw new UnsupportedOperationException(); + } + + @Override + public Object exec(List commands) { + throw new UnsupportedOperationException(); + } + + @Override + public Object exec(String ccl) { + throw new UnsupportedOperationException(); + } + @Override public void exit() { throw new UnsupportedOperationException(); @@ -899,6 +952,16 @@ public String getServerVersion() { throw new UnsupportedOperationException(); } + @Override + public Map holds(Collection records) { + throw new UnsupportedOperationException(); + } + + @Override + public boolean holds(long record) { + throw new UnsupportedOperationException(); + } + @Override public Set insert(String json) { throw new UnsupportedOperationException(); @@ -1076,12 +1139,7 @@ public boolean ping() { } @Override - public Map holds(Collection records) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean holds(long record) { + public CommandGroup prepare() { throw new UnsupportedOperationException(); } @@ -1129,39 +1187,6 @@ public void revert(String key, long record, Timestamp timestamp) { } - @Override - public Map> audit(long record) { - throw new UnsupportedOperationException(); - } - - @Override - public Map> audit(long record, Timestamp start) { - throw new UnsupportedOperationException(); - } - - @Override - public Map> audit(long record, Timestamp start, - Timestamp end) { - throw new UnsupportedOperationException(); - } - - @Override - public Map> audit(String key, long record) { - throw new UnsupportedOperationException(); - } - - @Override - public Map> audit(String key, long record, - Timestamp start) { - throw new UnsupportedOperationException(); - } - - @Override - public Map> audit(String key, long record, - Timestamp start, Timestamp end) { - throw new UnsupportedOperationException(); - } - @Override public Set search(String key, String query) { throw new UnsupportedOperationException(); @@ -1641,110 +1666,85 @@ public void stage() throws TransactionException { } @Override - public Timestamp time() { + public List submit(Command command) { throw new UnsupportedOperationException(); } @Override - public Timestamp time(String phrase) { + public List submit(Command command, Command... more) { throw new UnsupportedOperationException(); } @Override - public Map>> trace(Collection records) { + public List submit(CommandGroup group) { throw new UnsupportedOperationException(); } @Override - public Map>> trace(Collection records, - Timestamp timestamp) { + public List submit(List commands) { throw new UnsupportedOperationException(); } @Override - public Map> trace(long record) { + public List submit(String ccl) { throw new UnsupportedOperationException(); } @Override - public Map> trace(long record, Timestamp timestamp) { + public Timestamp time() { throw new UnsupportedOperationException(); } @Override - public boolean unlink(String key, long destination, long source) { + public Timestamp time(String phrase) { throw new UnsupportedOperationException(); } @Override - public boolean verify(String key, Object value, long record) { + public Map>> trace(Collection records) { throw new UnsupportedOperationException(); } @Override - public boolean verify(String key, Object value, long record, + public Map>> trace(Collection records, Timestamp timestamp) { throw new UnsupportedOperationException(); } @Override - public boolean verifyAndSwap(String key, Object expected, long record, - Object replacement) { - throw new UnsupportedOperationException(); - } - - @Override - public void verifyOrSet(String key, Object value, long record) { - throw new UnsupportedOperationException(); - } - - @Override - public Object exec(Command command) { - throw new UnsupportedOperationException(); - } - - @Override - public Object exec(Command command, Command... more) { - throw new UnsupportedOperationException(); - } - - @Override - public Object exec(List commands) { - throw new UnsupportedOperationException(); - } - - @Override - public List submit(Command command) { + public Map> trace(long record) { throw new UnsupportedOperationException(); } @Override - public List submit(Command command, Command... more) { + public Map> trace(long record, Timestamp timestamp) { throw new UnsupportedOperationException(); } @Override - public List submit(List commands) { + public boolean unlink(String key, long destination, long source) { throw new UnsupportedOperationException(); } @Override - public List submit(CommandGroup group) { + public boolean verify(String key, Object value, long record) { throw new UnsupportedOperationException(); } @Override - public CommandGroup prepare() { + public boolean verify(String key, Object value, long record, + Timestamp timestamp) { throw new UnsupportedOperationException(); } @Override - public Object exec(String ccl) { + public boolean verifyAndSwap(String key, Object expected, long record, + Object replacement) { throw new UnsupportedOperationException(); } @Override - public List submit(String ccl) { + public void verifyOrSet(String key, Object value, long record) { throw new UnsupportedOperationException(); } diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/Command.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/Command.java index 7a34065f0..8ab0f4f51 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/Command.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/Command.java @@ -23,13 +23,11 @@ import com.cinchapi.common.base.CheckedExceptions; import com.cinchapi.concourse.ParseException; import com.cinchapi.concourse.lang.ConcourseCompiler; -import com.cinchapi.concourse.thrift.TCommand; import com.google.common.base.Preconditions; /** * A {@link Command} encapsulates a complete CCL (Concourse Command Language) - * statement that can be rendered as a CCL string or serialized as a - * {@link TCommand} for wire transport. + * statement that can be rendered as a CCL string. *

      * {@link Command Commands} are constructed using the fluent builder methods * available from the {@link CommandBuilder} returned by {@link #to()}, @@ -71,16 +69,6 @@ public interface Command { */ public String ccl(); - /** - * Return a {@link TCommand} Thrift representation of this {@link Command} - * suitable for wire transport. - * - * @return the {@link TCommand} - */ - public default TCommand toThrift() { - return CommandSerializer.toThrift(this); - } - /** * Parse a CCL command string into a {@link Command}. *

      @@ -122,17 +110,6 @@ public static Command parse(String ccl) { } } - /** - * Reconstruct a {@link Command} from a {@link TCommand} received over the - * wire. - * - * @param tc the {@link TCommand} to deserialize - * @return the {@link Command} - */ - public static Command fromThrift(TCommand tc) { - return CommandSerializer.fromThrift(tc); - } - /** * Return a {@link CommandBuilder} for constructing {@link Command * Commands}. diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/CommandSerializer.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/CommandSerializer.java index 9a45ac255..1a79869ef 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/CommandSerializer.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/CommandSerializer.java @@ -38,7 +38,7 @@ * * @author Jeff Nelson */ -final class CommandSerializer { +public final class CommandSerializer { /** * Convert a {@link Command} to a {@link TCommand} suitable for wire @@ -50,7 +50,10 @@ final class CommandSerializer { * recognized */ public static TCommand toThrift(Command command) { - if(command instanceof BuiltCommand) { + if(command instanceof ParsedCommand) { + return ((ParsedCommand) command).serialize(); + } + else if(command instanceof BuiltCommand) { return serializeBuiltCommand((BuiltCommand) command); } else if(command instanceof FindCommand.ConditionState) { diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/ParsedCommand.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/ParsedCommand.java index 32efe40aa..a358f0586 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/ParsedCommand.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/ParsedCommand.java @@ -69,9 +69,9 @@ *

      * Unlike the builder-pattern {@link Command Commands} constructed via the * fluent API, a {@link ParsedCommand} stores the raw CCL string and the parsed - * {@link CommandTree}. It overrides {@link #toThrift()} to build a - * {@link TCommand} directly from the parsed tree, avoiding the need to - * reconstruct intermediate builder states. + * {@link CommandTree}. Serialization to {@link TCommand} is handled by the + * package-private {@link #serialize()} method, which builds the wire + * representation directly from the parsed tree. *

      * * @author Jeff Nelson @@ -104,8 +104,13 @@ public String ccl() { return ccl; } - @Override - public TCommand toThrift() { + /** + * Serialize this {@link ParsedCommand} to a {@link TCommand} by walking the + * parsed {@link CommandTree}. + * + * @return the {@link TCommand} + */ + /* package */ TCommand serialize() { CommandSymbol symbol = (CommandSymbol) tree.root(); TCommand tc = new TCommand(TCommandVerb.valueOf(symbol.type())); populateFromSymbol(tc, symbol); diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/thrift/JavaThriftBridge.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/thrift/JavaThriftBridge.java index 01fbf54bd..9d817990e 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/thrift/JavaThriftBridge.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/thrift/JavaThriftBridge.java @@ -21,6 +21,7 @@ import com.cinchapi.ccl.util.NaturalLanguage; import com.cinchapi.concourse.Timestamp; import com.cinchapi.concourse.lang.command.Command; +import com.cinchapi.concourse.lang.command.CommandSerializer; import com.cinchapi.concourse.lang.paginate.Page; import com.cinchapi.concourse.lang.sort.Direction; import com.cinchapi.concourse.lang.sort.Order; @@ -159,7 +160,7 @@ public static Page convert(TPage tpage) { * @return the equivalent {@link TCommand TCommands} */ public static List convert(List commands) { - return commands.stream().map(Command::toThrift) + return commands.stream().map(CommandSerializer::toThrift) .collect(Collectors.toList()); } diff --git a/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/CommandCompilationTest.java b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/CommandCompilationTest.java index 1ccc1640b..ef7a3cef1 100644 --- a/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/CommandCompilationTest.java +++ b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/CommandCompilationTest.java @@ -37,8 +37,6 @@ */ public class CommandCompilationTest { - // ========== Query Commands ========== - /** * Goal: Verify that a {@code find} command compiles to a * {@code FIND} {@link CommandTree}. @@ -278,8 +276,6 @@ public void testNavigateWhereCompiles() { .where("active = true").ccl(), "NAVIGATE"); } - // ========== Write Commands ========== - /** * Goal: Verify that an {@code add} command without a * target record compiles to an {@code ADD} {@link CommandTree}. @@ -471,8 +467,6 @@ public void testInsertInRecordCompiles() { "INSERT"); } - // ========== Link Commands ========== - /** * Goal: Verify that a {@code link} command compiles to a * {@code LINK} {@link CommandTree}. @@ -517,8 +511,6 @@ public void testUnlinkCompiles() { "UNLINK"); } - // ========== Verify Commands ========== - /** * Goal: Verify that a {@code verify} command compiles to a * {@code VERIFY} {@link CommandTree}. @@ -652,8 +644,6 @@ public void testFindOrInsertCompiles() { .json("{\"name\":\"jeff\"}").ccl(), "FIND_OR_INSERT"); } - // ========== Inspection Commands ========== - /** * Goal: Verify that a {@code browse} command compiles to a * {@code BROWSE} {@link CommandTree}. @@ -819,8 +809,6 @@ public void testJsonifyCompiles() { assertCompiles(Command.to().jsonify(1).ccl(), "JSONIFY"); } - // ========== Utility Commands ========== - /** * Goal: Verify that the {@code ping} command compiles to a * {@code PING} {@link CommandTree}. @@ -921,8 +909,6 @@ public void testInventoryCompiles() { assertCompiles(Command.to().inventory().ccl(), "INVENTORY"); } - // ========== Temporal Commands ========== - /** * Goal: Verify that a {@code chronicle} command compiles * to a {@code CHRONICLE} {@link CommandTree}. @@ -1318,8 +1304,6 @@ public void testDescribeAllWithTimestampCompiles() { .at(Timestamp.fromMicros(12345)).ccl(), "DESCRIBE"); } - // ========== Temporal Variant Coverage ========== - /** * Goal: Verify that a {@code diff} command for a record * with a start and end timestamp compiles. @@ -1589,8 +1573,6 @@ public void testJsonifyWithTimestampCompiles() { "JSONIFY"); } - // ========== Order/Page Variant Coverage ========== - /** * Goal: Verify that a {@code select} command with * {@link Order} compiles. @@ -1657,8 +1639,6 @@ public void testSelectFromRecordWithTimestampCompiles() { .at(Timestamp.fromMicros(12345)).ccl(), "SELECT"); } - // ========== Multi-Value Variant Coverage ========== - /** * Goal: Verify that an {@code add} command targeting * multiple records compiles. @@ -1745,8 +1725,6 @@ public void testRevertMultipleKeysAndRecordsCompiles() { .to(Timestamp.fromMicros(12345)).ccl(), "REVERT"); } - // ========== All-Keys Variant Coverage ========== - /** * Goal: Verify that a {@code select} all-keys command with * a condition compiles. @@ -1831,8 +1809,6 @@ public void testGetAllWhereCompiles() { "GET"); } - // ========== Helper ========== - /** * Compile the given CCL string using the {@link ConcourseCompiler} and * assert that it produces a {@link CommandTree} with the expected command diff --git a/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/CommandSerializationTest.java b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/CommandSerializationTest.java index 8c9b00c77..b9f60d506 100644 --- a/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/CommandSerializationTest.java +++ b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/CommandSerializationTest.java @@ -66,9 +66,10 @@ public void testNullaryCommandsRoundTrip() { Command.to().commit(), Command.to().abort(), Command.to().inventory() }; for (Command cmd : commands) { - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertEquals(cmd.ccl(), tc.getVerb().name().toLowerCase()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), + CommandSerializer.fromThrift(tc).ccl()); } } @@ -91,9 +92,9 @@ public void testNullaryCommandsRoundTrip() { @Test public void testFindWithConditionRoundTrip() { Command cmd = Command.to().find("age > 30"); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertEquals(TCommandVerb.FIND, tc.getVerb()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -117,10 +118,10 @@ public void testFindWithConditionRoundTrip() { public void testFindWithTimestampRoundTrip() { Command cmd = Command.to().find("age > 30") .at(Timestamp.fromMicros(12345)); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertTrue(tc.isSetTimestamp()); Assert.assertEquals(12345, tc.getTimestamp()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -143,10 +144,10 @@ public void testFindWithTimestampRoundTrip() { public void testFindWithOrderAndPageRoundTrip() { Command cmd = Command.to().find("age > 30") .order(Order.by("name").build()).page(Page.sized(10)); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertTrue(tc.isSetOrder()); Assert.assertTrue(tc.isSetPage()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -174,11 +175,11 @@ public void testFindWithCriteriaRoundTrip() { Criteria criteria = Criteria.where().key("age") .operator(Operator.GREATER_THAN).value(30).build(); Command cmd = Command.to().find(criteria); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertEquals(TCommandVerb.FIND, tc.getVerb()); Assert.assertTrue(tc.isSetCriteria()); Assert.assertFalse(tc.isSetCondition()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -201,11 +202,11 @@ public void testFindWithCriteriaRoundTrip() { @Test public void testSelectKeysFromRecordsRoundTrip() { Command cmd = Command.to().select("name", "age").from(1, 2, 3); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertEquals(TCommandVerb.SELECT, tc.getVerb()); Assert.assertEquals(Arrays.asList("name", "age"), tc.getKeys()); Assert.assertEquals(Arrays.asList(1L, 2L, 3L), tc.getRecords()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -226,9 +227,9 @@ public void testSelectKeysFromRecordsRoundTrip() { @Test public void testSelectAllFromRecordRoundTrip() { Command cmd = Command.to().selectAll().from(1); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertFalse(tc.isSetKeys()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -251,9 +252,9 @@ public void testSelectAllFromRecordRoundTrip() { @Test public void testSelectWithConditionRoundTrip() { Command cmd = Command.to().select("name").where("status = active"); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertTrue(tc.isSetCondition()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -278,11 +279,11 @@ public void testSelectWithAllOptionsRoundTrip() { Command cmd = Command.to().select("name").from(1) .at(Timestamp.fromMicros(5000)).order(Order.by("name").build()) .page(Page.sized(5)); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertTrue(tc.isSetTimestamp()); Assert.assertTrue(tc.isSetOrder()); Assert.assertTrue(tc.isSetPage()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -305,9 +306,9 @@ public void testSelectWithAllOptionsRoundTrip() { @Test public void testGetFromRecordRoundTrip() { Command cmd = Command.to().get("name").from(1); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertEquals(TCommandVerb.GET, tc.getVerb()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -330,10 +331,10 @@ public void testGetFromRecordRoundTrip() { @Test public void testGetAllWithConditionRoundTrip() { Command cmd = Command.to().getAll().where("active = true"); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertTrue(tc.isSetCondition()); Assert.assertFalse(tc.isSetKeys()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -357,10 +358,10 @@ public void testGetAllWithConditionRoundTrip() { public void testGetWithTimestampRoundTrip() { Command cmd = Command.to().get("name").from(1) .at(Timestamp.fromMicros(5000)); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertTrue(tc.isSetTimestamp()); Assert.assertEquals(5000, tc.getTimestamp()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -385,11 +386,11 @@ public void testGetWithAllOptionsRoundTrip() { Command cmd = Command.to().get("name").from(1) .at(Timestamp.fromMicros(5000)).order(Order.by("name").build()) .page(Page.sized(5)); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertTrue(tc.isSetTimestamp()); Assert.assertTrue(tc.isSetOrder()); Assert.assertTrue(tc.isSetPage()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -412,9 +413,9 @@ public void testGetWithAllOptionsRoundTrip() { @Test public void testNavigateFromRecordRoundTrip() { Command cmd = Command.to().navigate("friends.name").from(1); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertEquals(TCommandVerb.NAVIGATE, tc.getVerb()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -438,11 +439,11 @@ public void testNavigateFromRecordRoundTrip() { public void testNavigateWithConditionAndTimestampRoundTrip() { Command cmd = Command.to().navigate("friends.name") .where("active = true").at(Timestamp.fromMicros(9999)); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertTrue(tc.isSetCondition()); Assert.assertTrue(tc.isSetTimestamp()); Assert.assertEquals(9999, tc.getTimestamp()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -465,10 +466,10 @@ public void testNavigateWithConditionAndTimestampRoundTrip() { @Test public void testAddKeyValueRoundTrip() { Command cmd = Command.to().add("name").as("jeff"); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertEquals(TCommandVerb.ADD, tc.getVerb()); Assert.assertFalse(tc.isSetRecords()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -491,9 +492,9 @@ public void testAddKeyValueRoundTrip() { @Test public void testAddKeyValueInRecordsRoundTrip() { Command cmd = Command.to().add("name").as("jeff").in(1, 2); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertTrue(tc.isSetRecords()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -516,9 +517,9 @@ public void testAddKeyValueInRecordsRoundTrip() { @Test public void testSetRoundTrip() { Command cmd = Command.to().set("name").as("jeff").in(1); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertEquals(TCommandVerb.SET, tc.getVerb()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -541,12 +542,12 @@ public void testSetRoundTrip() { @Test public void testRemoveRoundTrip() { Command cmd = Command.to().remove("name").as("jeff").from(1); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertEquals(TCommandVerb.REMOVE, tc.getVerb()); Assert.assertTrue(tc.isSetValue()); Assert.assertEquals(Arrays.asList("name"), tc.getKeys()); Assert.assertEquals(Arrays.asList(1L), tc.getRecords()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -569,9 +570,9 @@ public void testRemoveRoundTrip() { @Test public void testClearKeysFromRecordsRoundTrip() { Command cmd = Command.to().clear("name", "age").from(1, 2); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertEquals(TCommandVerb.CLEAR, tc.getVerb()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -594,9 +595,9 @@ public void testClearKeysFromRecordsRoundTrip() { @Test public void testClearRecordsOnlyRoundTrip() { Command cmd = Command.to().clear(1, 2); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertFalse(tc.isSetKeys()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -618,10 +619,10 @@ public void testClearRecordsOnlyRoundTrip() { @Test public void testInsertJsonRoundTrip() { Command cmd = Command.to().insert("{\"name\":\"jeff\"}"); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertEquals(TCommandVerb.INSERT, tc.getVerb()); Assert.assertFalse(tc.isSetRecords()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -643,9 +644,9 @@ public void testInsertJsonRoundTrip() { @Test public void testInsertJsonInRecordRoundTrip() { Command cmd = Command.to().insert("{\"name\":\"jeff\"}").in(1); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertTrue(tc.isSetRecords()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -667,10 +668,10 @@ public void testInsertJsonInRecordRoundTrip() { @Test public void testLinkRoundTrip() { Command cmd = Command.to().link("friends").from(1).to(2); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertEquals(TCommandVerb.LINK, tc.getVerb()); Assert.assertEquals(1, tc.getSourceRecord()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -693,11 +694,11 @@ public void testLinkRoundTrip() { @Test public void testUnlinkRoundTrip() { Command cmd = Command.to().unlink("friends").from(1).to(2); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertEquals(TCommandVerb.UNLINK, tc.getVerb()); Assert.assertEquals(1, tc.getSourceRecord()); Assert.assertEquals(Arrays.asList(2L), tc.getRecords()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -719,10 +720,10 @@ public void testUnlinkRoundTrip() { @Test public void testVerifyRoundTrip() { Command cmd = Command.to().verify("name").as("jeff").in(1); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertEquals(TCommandVerb.VERIFY, tc.getVerb()); Assert.assertFalse(tc.isSetTimestamp()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -745,9 +746,9 @@ public void testVerifyRoundTrip() { public void testVerifyWithTimestampRoundTrip() { Command cmd = Command.to().verify("name").as("jeff").in(1) .at(Timestamp.fromMicros(5000)); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertTrue(tc.isSetTimestamp()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -771,10 +772,10 @@ public void testVerifyWithTimestampRoundTrip() { public void testVerifyAndSwapRoundTrip() { Command cmd = Command.to().verifyAndSwap("name").as("jeff").in(1) .with("bob"); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertEquals(TCommandVerb.VERIFY_AND_SWAP, tc.getVerb()); Assert.assertTrue(tc.isSetReplacement()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -797,11 +798,11 @@ public void testVerifyAndSwapRoundTrip() { @Test public void testVerifyOrSetRoundTrip() { Command cmd = Command.to().verifyOrSet("name").as("jeff").in(1); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertEquals(TCommandVerb.VERIFY_OR_SET, tc.getVerb()); Assert.assertTrue(tc.isSetValue()); Assert.assertEquals(Arrays.asList(1L), tc.getRecords()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -824,12 +825,12 @@ public void testVerifyOrSetRoundTrip() { @Test public void testFindOrAddRoundTrip() { Command cmd = Command.to().findOrAdd("name").as("jeff"); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertEquals(TCommandVerb.FIND_OR_ADD, tc.getVerb()); Assert.assertTrue(tc.isSetValue()); Assert.assertEquals(Arrays.asList("name"), tc.getKeys()); Assert.assertFalse(tc.isSetRecords()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -853,11 +854,11 @@ public void testFindOrAddRoundTrip() { public void testFindOrInsertRoundTrip() { Command cmd = Command.to().findOrInsert("name = jeff") .json("{\"name\":\"jeff\"}"); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertEquals(TCommandVerb.FIND_OR_INSERT, tc.getVerb()); Assert.assertTrue(tc.isSetCondition()); Assert.assertTrue(tc.isSetJson()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -879,10 +880,10 @@ public void testFindOrInsertRoundTrip() { @Test public void testSearchRoundTrip() { Command cmd = Command.to().search("name").forQuery("jeff"); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertEquals(TCommandVerb.SEARCH, tc.getVerb()); Assert.assertEquals("jeff", tc.getQuery()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -903,9 +904,9 @@ public void testSearchRoundTrip() { @Test public void testBrowseRoundTrip() { Command cmd = Command.to().browse("name"); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertEquals(TCommandVerb.BROWSE, tc.getVerb()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -928,9 +929,9 @@ public void testBrowseRoundTrip() { public void testBrowseWithTimestampRoundTrip() { Command cmd = Command.to().browse("name") .at(Timestamp.fromMicros(5000)); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertTrue(tc.isSetTimestamp()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -952,9 +953,9 @@ public void testBrowseWithTimestampRoundTrip() { @Test public void testDescribeRecordsRoundTrip() { Command cmd = Command.to().describe(1, 2); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertEquals(TCommandVerb.DESCRIBE, tc.getVerb()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -975,9 +976,9 @@ public void testDescribeRecordsRoundTrip() { @Test public void testDescribeAllRoundTrip() { Command cmd = Command.to().describeAll(); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertFalse(tc.isSetRecords()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -999,10 +1000,10 @@ public void testDescribeAllRoundTrip() { @Test public void testDescribeAllWithTimestampRoundTrip() { Command cmd = Command.to().describeAll().at(Timestamp.fromMicros(5000)); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertTrue(tc.isSetTimestamp()); Assert.assertFalse(tc.isSetRecords()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -1025,11 +1026,11 @@ public void testDescribeAllWithTimestampRoundTrip() { @Test public void testTraceRoundTrip() { Command cmd = Command.to().trace(1, 2); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertEquals(TCommandVerb.TRACE, tc.getVerb()); Assert.assertEquals(Arrays.asList(1L, 2L), tc.getRecords()); Assert.assertFalse(tc.isSetTimestamp()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -1051,10 +1052,10 @@ public void testTraceRoundTrip() { @Test public void testTraceWithTimestampRoundTrip() { Command cmd = Command.to().trace(1).at(Timestamp.fromMicros(5000)); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertTrue(tc.isSetTimestamp()); Assert.assertEquals(5000, tc.getTimestamp()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -1076,9 +1077,9 @@ public void testTraceWithTimestampRoundTrip() { @Test public void testHoldsRoundTrip() { Command cmd = Command.to().holds(1, 2); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertEquals(TCommandVerb.HOLDS, tc.getVerb()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -1099,9 +1100,9 @@ public void testHoldsRoundTrip() { @Test public void testJsonifyRoundTrip() { Command cmd = Command.to().jsonify(1); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertEquals(TCommandVerb.JSONIFY, tc.getVerb()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -1123,10 +1124,10 @@ public void testJsonifyRoundTrip() { @Test public void testJsonifyWithTimestampRoundTrip() { Command cmd = Command.to().jsonify(1).at(Timestamp.fromMicros(5000)); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertTrue(tc.isSetTimestamp()); Assert.assertEquals(5000, tc.getTimestamp()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -1148,10 +1149,10 @@ public void testJsonifyWithTimestampRoundTrip() { @Test public void testChronicleRoundTrip() { Command cmd = Command.to().chronicle("name").in(1); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertEquals(TCommandVerb.CHRONICLE, tc.getVerb()); Assert.assertFalse(tc.isSetTimestamp()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -1174,10 +1175,10 @@ public void testChronicleRoundTrip() { public void testChronicleWithTimestampRoundTrip() { Command cmd = Command.to().chronicle("name").in(1) .at(Timestamp.fromMicros(5000)); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertTrue(tc.isSetTimestamp()); Assert.assertFalse(tc.isSetEndTimestamp()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -1201,10 +1202,10 @@ public void testChronicleWithTimestampRoundTrip() { public void testChronicleWithRangeRoundTrip() { Command cmd = Command.to().chronicle("name").in(1) .at(Timestamp.fromMicros(1000)).at(Timestamp.fromMicros(2000)); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertTrue(tc.isSetTimestamp()); Assert.assertTrue(tc.isSetEndTimestamp()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -1226,13 +1227,13 @@ public void testChronicleWithRangeRoundTrip() { @Test public void testDiffRecordTimestampRoundTrip() { Command cmd = Command.to().diff(1).at(Timestamp.fromMicros(5000)); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertEquals(TCommandVerb.DIFF, tc.getVerb()); Assert.assertTrue(tc.isSetRecords()); Assert.assertTrue(tc.isSetTimestamp()); Assert.assertFalse(tc.isSetEndTimestamp()); Assert.assertFalse(tc.isSetKeys()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -1256,14 +1257,14 @@ public void testDiffRecordTimestampRoundTrip() { public void testDiffRecordRangeRoundTrip() { Command cmd = Command.to().diff(1).at(Timestamp.fromMicros(1000)) .at(Timestamp.fromMicros(2000)); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertTrue(tc.isSetRecords()); Assert.assertFalse(tc.isSetKeys()); Assert.assertTrue(tc.isSetTimestamp()); Assert.assertEquals(1000, tc.getTimestamp()); Assert.assertTrue(tc.isSetEndTimestamp()); Assert.assertEquals(2000, tc.getEndTimestamp()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -1285,12 +1286,12 @@ public void testDiffRecordRangeRoundTrip() { @Test public void testDiffKeyTimestampRoundTrip() { Command cmd = Command.to().diff("name").at(Timestamp.fromMicros(5000)); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertTrue(tc.isSetKeys()); Assert.assertFalse(tc.isSetRecords()); Assert.assertTrue(tc.isSetTimestamp()); Assert.assertFalse(tc.isSetEndTimestamp()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -1315,12 +1316,12 @@ public void testDiffKeyTimestampRoundTrip() { public void testDiffKeyRangeRoundTrip() { Command cmd = Command.to().diff("name").at(Timestamp.fromMicros(1000)) .at(Timestamp.fromMicros(2000)); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertTrue(tc.isSetKeys()); Assert.assertFalse(tc.isSetRecords()); Assert.assertTrue(tc.isSetTimestamp()); Assert.assertTrue(tc.isSetEndTimestamp()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -1343,12 +1344,12 @@ public void testDiffKeyRangeRoundTrip() { public void testDiffKeyRecordTimestampRoundTrip() { Command cmd = Command.to().diff("name").in(1) .at(Timestamp.fromMicros(5000)); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertTrue(tc.isSetKeys()); Assert.assertTrue(tc.isSetRecords()); Assert.assertTrue(tc.isSetTimestamp()); Assert.assertFalse(tc.isSetEndTimestamp()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -1372,13 +1373,13 @@ public void testDiffKeyRecordTimestampRoundTrip() { public void testDiffKeyRecordRangeRoundTrip() { Command cmd = Command.to().diff("name").in(1) .at(Timestamp.fromMicros(1000)).at(Timestamp.fromMicros(2000)); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertTrue(tc.isSetKeys()); Assert.assertTrue(tc.isSetRecords()); Assert.assertTrue(tc.isSetEndTimestamp()); Assert.assertEquals(1000, tc.getTimestamp()); Assert.assertEquals(2000, tc.getEndTimestamp()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -1399,9 +1400,9 @@ public void testDiffKeyRecordRangeRoundTrip() { @Test public void testAuditRecordRoundTrip() { Command cmd = Command.to().audit(1); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertEquals(TCommandVerb.AUDIT, tc.getVerb()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -1424,10 +1425,10 @@ public void testAuditRecordRoundTrip() { @Test public void testAuditRecordTimestampRoundTrip() { Command cmd = Command.to().audit(1).at(Timestamp.fromMicros(5000)); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertTrue(tc.isSetTimestamp()); Assert.assertFalse(tc.isSetKeys()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -1451,12 +1452,12 @@ public void testAuditRecordTimestampRoundTrip() { public void testAuditRecordRangeRoundTrip() { Command cmd = Command.to().audit(1).at(Timestamp.fromMicros(1000)) .at(Timestamp.fromMicros(2000)); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertTrue(tc.isSetTimestamp()); Assert.assertEquals(1000, tc.getTimestamp()); Assert.assertTrue(tc.isSetEndTimestamp()); Assert.assertEquals(2000, tc.getEndTimestamp()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -1478,11 +1479,11 @@ public void testAuditRecordRangeRoundTrip() { @Test public void testAuditKeyRecordRoundTrip() { Command cmd = Command.to().audit("name").in(1); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertTrue(tc.isSetKeys()); Assert.assertEquals(Arrays.asList("name"), tc.getKeys()); Assert.assertFalse(tc.isSetTimestamp()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -1506,11 +1507,11 @@ public void testAuditKeyRecordRoundTrip() { public void testAuditKeyRecordTimestampRoundTrip() { Command cmd = Command.to().audit("name").in(1) .at(Timestamp.fromMicros(5000)); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertTrue(tc.isSetKeys()); Assert.assertTrue(tc.isSetTimestamp()); Assert.assertFalse(tc.isSetEndTimestamp()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -1534,11 +1535,11 @@ public void testAuditKeyRecordTimestampRoundTrip() { public void testAuditKeyRecordRangeRoundTrip() { Command cmd = Command.to().audit("name").in(1) .at(Timestamp.fromMicros(1000)).at(Timestamp.fromMicros(2000)); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertTrue(tc.isSetKeys()); Assert.assertTrue(tc.isSetTimestamp()); Assert.assertTrue(tc.isSetEndTimestamp()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -1561,13 +1562,13 @@ public void testAuditKeyRecordRangeRoundTrip() { public void testRevertRoundTrip() { Command cmd = Command.to().revert("name").in(1) .to(Timestamp.fromMicros(5000)); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertEquals(TCommandVerb.REVERT, tc.getVerb()); Assert.assertTrue(tc.isSetKeys()); Assert.assertTrue(tc.isSetRecords()); Assert.assertTrue(tc.isSetTimestamp()); Assert.assertEquals(5000, tc.getTimestamp()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -1589,11 +1590,11 @@ public void testRevertRoundTrip() { @Test public void testReconcileRoundTrip() { Command cmd = Command.to().reconcile("name").in(1).with("jeff", "bob"); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertEquals(TCommandVerb.RECONCILE, tc.getVerb()); Assert.assertTrue(tc.isSetValues()); Assert.assertEquals(2, tc.getValues().size()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -1615,10 +1616,10 @@ public void testReconcileRoundTrip() { @Test public void testConsolidateRoundTrip() { Command cmd = Command.to().consolidate(1, 2, 3); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertEquals(TCommandVerb.CONSOLIDATE, tc.getVerb()); Assert.assertEquals(Arrays.asList(1L, 2L, 3L), tc.getRecords()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -1640,10 +1641,10 @@ public void testConsolidateRoundTrip() { @Test public void testCalculateWithRecordsRoundTrip() { Command cmd = Command.to().calculate("count", "name").in(1, 2); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertEquals(TCommandVerb.CALCULATE, tc.getVerb()); Assert.assertEquals("count", tc.getFunction()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -1666,9 +1667,9 @@ public void testCalculateWithRecordsRoundTrip() { public void testCalculateWithConditionRoundTrip() { Command cmd = Command.to().calculate("count", "name") .where("active = true"); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertTrue(tc.isSetCondition()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } /** @@ -1692,11 +1693,11 @@ public void testCalculateWithConditionRoundTrip() { public void testCalculateWithConditionAndTimestampRoundTrip() { Command cmd = Command.to().calculate("count", "name") .where("active = true").at(Timestamp.fromMicros(5000)); - TCommand tc = cmd.toThrift(); + TCommand tc = CommandSerializer.toThrift(cmd); Assert.assertTrue(tc.isSetCondition()); Assert.assertTrue(tc.isSetTimestamp()); Assert.assertEquals(5000, tc.getTimestamp()); - Assert.assertEquals(cmd.ccl(), Command.fromThrift(tc).ccl()); + Assert.assertEquals(cmd.ccl(), CommandSerializer.fromThrift(tc).ccl()); } } diff --git a/concourse-server/src/main/java/com/cinchapi/concourse/server/ConcourseServer.java b/concourse-server/src/main/java/com/cinchapi/concourse/server/ConcourseServer.java index e46ed692d..dffce24ba 100644 --- a/concourse-server/src/main/java/com/cinchapi/concourse/server/ConcourseServer.java +++ b/concourse-server/src/main/java/com/cinchapi/concourse/server/ConcourseServer.java @@ -6108,9 +6108,8 @@ public List submit(List commands, try { for (TCommand command : commands) { Object result; - // NOTE: Transaction commands are handled - // explicitly (not via CommandDispatcher) - // because we must block attempts to start + // NOTE: Transaction commands are handled explicitly (not via + // CommandDispatcher) because we must block attempts to start // nested transactions. switch (command.getVerb()) { case STAGE: diff --git a/concourse-server/src/main/java/com/cinchapi/concourse/server/ops/CommandTreeConverter.java b/concourse-server/src/main/java/com/cinchapi/concourse/server/ops/CommandTreeConverter.java index 76584846f..fcb9cfc86 100644 --- a/concourse-server/src/main/java/com/cinchapi/concourse/server/ops/CommandTreeConverter.java +++ b/concourse-server/src/main/java/com/cinchapi/concourse/server/ops/CommandTreeConverter.java @@ -214,7 +214,7 @@ else if(symbol instanceof InventorySymbol) { * @param tree the {@link ConditionTree} to render * @return the CCL condition string */ - /* package */ static String renderCondition(ConditionTree tree) { + static String renderCondition(ConditionTree tree) { if(tree instanceof ExpressionTree) { ExpressionSymbol expr = (ExpressionSymbol) tree.root(); StringBuilder sb = new StringBuilder(); @@ -244,40 +244,6 @@ else if(tree instanceof ConjunctionTree) { } } - /** - * Convert an {@link OrderTree} to a {@link TOrder}. - * - * @param tree the {@link OrderTree} to convert - * @return the equivalent {@link TOrder} - */ - private static TOrder convertOrder(OrderTree tree) { - OrderSymbol sym = (OrderSymbol) tree.root(); - List spec = new ArrayList<>(); - for (OrderComponentSymbol comp : sym.components()) { - TOrderComponent toc = new TOrderComponent( - comp.key().key().toString(), - comp.direction() == DirectionSymbol.ASCENDING ? 0 : 1); - if(comp.timestamp() != null - && comp.timestamp() != TimestampSymbol.PRESENT) { - toc.setTimestamp( - Convert.javaToThrift(comp.timestamp().timestamp())); - } - spec.add(toc); - } - return new TOrder(spec); - } - - /** - * Convert a {@link PageTree} to a {@link TPage}. - * - * @param tree the {@link PageTree} to convert - * @return the equivalent {@link TPage} - */ - private static TPage convertPage(PageTree tree) { - PageSymbol sym = (PageSymbol) tree.root(); - return new TPage(sym.skip(), sym.limit()); - } - /** * Apply the optional condition from a {@link CommandTree} to a * {@link TCommand}. @@ -319,33 +285,6 @@ private static void applyPage(TCommand tc, CommandTree tree) { } } - /** - * Set the timestamp on a {@link TCommand} if the given - * {@link TimestampSymbol} is not {@code null} and not - * {@link TimestampSymbol#PRESENT}. - * - * @param tc the {@link TCommand} to modify - * @param ts the {@link TimestampSymbol}, or {@code null} - */ - private static void setTimestamp(TCommand tc, TimestampSymbol ts) { - if(ts != null && ts != TimestampSymbol.PRESENT) { - tc.setTimestamp(ts.timestamp()); - } - } - - /** - * Extract key strings from a collection of {@link KeyTokenSymbol - * KeyTokenSymbols}. - * - * @param keys the key symbols - * @return a list of key strings - */ - private static List extractKeys( - Collection> keys) { - return keys.stream().map(k -> k.key().toString()) - .collect(Collectors.toList()); - } - /** * Collect a single record and an optional collection of records into a * single list. @@ -368,145 +307,83 @@ else if(record != null) { } /** - * Convert a value from a {@link ValueTokenSymbol} to a {@link TObject}. - * - * @param value the value symbol - * @return the {@link TObject} - */ - private static TObject convertValue(ValueTokenSymbol value) { - return Convert.javaToThrift(value.value()); - } - - // ---- Individual command conversions ---- - - /** - * Convert a {@link FindSymbol}. - */ - private static TCommand convertFind(FindSymbol sym, CommandTree tree) { - TCommand tc = new TCommand(TCommandVerb.FIND); - applyCondition(tc, tree); - setTimestamp(tc, sym.timestamp()); - applyOrder(tc, tree); - applyPage(tc, tree); - return tc; - } - - /** - * Convert a {@link SelectSymbol}. + * Convert an {@link AddSymbol}. */ - private static TCommand convertSelect(SelectSymbol sym, CommandTree tree) { - TCommand tc = new TCommand(TCommandVerb.SELECT); - if(sym.keys() != null && !sym.keys().isEmpty()) { - tc.setKeys(extractKeys(sym.keys())); - } + private static TCommand convertAdd(AddSymbol sym) { + TCommand tc = new TCommand(TCommandVerb.ADD); + tc.setKeys(Collections.singletonList(sym.key().key().toString())); + tc.setValue(convertValue(sym.value())); List records = collectRecords(sym.record(), sym.records()); if(records != null) { tc.setRecords(records); } - applyCondition(tc, tree); - setTimestamp(tc, sym.timestamp()); - applyOrder(tc, tree); - applyPage(tc, tree); return tc; } /** - * Convert a {@link GetSymbol}. + * Convert an {@link AuditSymbol}. */ - private static TCommand convertGet(GetSymbol sym, CommandTree tree) { - TCommand tc = new TCommand(TCommandVerb.GET); + private static TCommand convertAudit(AuditSymbol sym) { + TCommand tc = new TCommand(TCommandVerb.AUDIT); if(sym.key() != null) { tc.setKeys(Collections.singletonList(sym.key().key().toString())); } - else if(sym.keys() != null && !sym.keys().isEmpty()) { - tc.setKeys(extractKeys(sym.keys())); - } - if(sym.record() >= 0) { - tc.setRecords(Collections.singletonList(sym.record())); + tc.setRecords(Collections.singletonList(sym.record())); + if(sym.start() != null && sym.start() != TimestampSymbol.PRESENT) { + tc.setTimestamp(sym.start().timestamp()); } - else if(sym.records() != null) { - tc.setRecords(new ArrayList<>(sym.records())); + if(sym.end() != null && sym.end() != TimestampSymbol.PRESENT) { + tc.setEndTimestamp(sym.end().timestamp()); } - applyCondition(tc, tree); - setTimestamp(tc, sym.timestamp()); - applyOrder(tc, tree); - applyPage(tc, tree); return tc; } /** - * Convert a {@link NavigateSymbol}. + * Convert a {@link BrowseSymbol}. */ - private static TCommand convertNavigate(NavigateSymbol sym, - CommandTree tree) { - TCommand tc = new TCommand(TCommandVerb.NAVIGATE); + private static TCommand convertBrowse(BrowseSymbol sym) { + TCommand tc = new TCommand(TCommandVerb.BROWSE); if(sym.keys() != null && !sym.keys().isEmpty()) { tc.setKeys(extractKeys(sym.keys())); } - Long record = sym.record(); - Collection records = sym.records(); - if(record != null) { - tc.setRecords(Collections.singletonList(record)); - } - else if(records != null) { - tc.setRecords(new ArrayList<>(records)); - } - // NOTE: NavigateSymbol may carry its own ccl() condition - // string, but we prefer the ConditionTree from the - // CommandTree since it's more reliable. - applyCondition(tc, tree); setTimestamp(tc, sym.timestamp()); return tc; } /** - * Convert an {@link AddSymbol}. - */ - private static TCommand convertAdd(AddSymbol sym) { - TCommand tc = new TCommand(TCommandVerb.ADD); - tc.setKeys(Collections.singletonList(sym.key().key().toString())); - tc.setValue(convertValue(sym.value())); - List records = collectRecords(sym.record(), sym.records()); - if(records != null) { - tc.setRecords(records); - } - return tc; - } - - /** - * Convert a {@link SetSymbol}. + * Convert a {@link CalculateSymbol}. */ - private static TCommand convertSet(SetSymbol sym) { - TCommand tc = new TCommand(TCommandVerb.SET); + private static TCommand convertCalculate(CalculateSymbol sym, + CommandTree tree) { + TCommand tc = new TCommand(TCommandVerb.CALCULATE); + tc.setFunction(sym.function()); tc.setKeys(Collections.singletonList(sym.key().key().toString())); - tc.setValue(convertValue(sym.value())); if(sym.records() != null) { tc.setRecords(new ArrayList<>(sym.records())); } - else if(sym.record() >= 0) { - tc.setRecords(Collections.singletonList(sym.record())); - } + applyCondition(tc, tree); + setTimestamp(tc, sym.timestamp()); return tc; } /** - * Convert a {@link RemoveSymbol}. + * Convert a {@link ChronicleSymbol}. */ - private static TCommand convertRemove(RemoveSymbol sym) { - TCommand tc = new TCommand(TCommandVerb.REMOVE); + private static TCommand convertChronicle(ChronicleSymbol sym) { + TCommand tc = new TCommand(TCommandVerb.CHRONICLE); tc.setKeys(Collections.singletonList(sym.key().key().toString())); - if(sym.value() != null) { - tc.setValue(convertValue(sym.value())); - } - if(sym.records() != null) { - tc.setRecords(new ArrayList<>(sym.records())); + tc.setRecords(Collections.singletonList(sym.record())); + if(sym.start() != null && sym.start() != TimestampSymbol.PRESENT) { + tc.setTimestamp(sym.start().timestamp()); } - else if(sym.record() >= 0) { - tc.setRecords(Collections.singletonList(sym.record())); + if(sym.end() != null && sym.end() != TimestampSymbol.PRESENT) { + tc.setEndTimestamp(sym.end().timestamp()); } return tc; } + // ---- Individual command conversions ---- + /** * Convert a {@link ClearSymbol}. */ @@ -528,88 +405,73 @@ else if(sym.record() >= 0) { } /** - * Convert an {@link InsertSymbol}. + * Convert a {@link ConsolidateSymbol}. */ - private static TCommand convertInsert(InsertSymbol sym) { - TCommand tc = new TCommand(TCommandVerb.INSERT); - tc.setJson(sym.json()); + private static TCommand convertConsolidate(ConsolidateSymbol sym) { + TCommand tc = new TCommand(TCommandVerb.CONSOLIDATE); + List records = new ArrayList<>(); + records.add(sym.first()); + records.addAll(sym.remaining()); + tc.setRecords(records); + return tc; + } + + /** + * Convert a {@link DescribeSymbol}. + */ + private static TCommand convertDescribe(DescribeSymbol sym) { + TCommand tc = new TCommand(TCommandVerb.DESCRIBE); List records = collectRecords(sym.record(), sym.records()); if(records != null) { tc.setRecords(records); } + setTimestamp(tc, sym.timestamp()); return tc; } /** - * Convert a {@link LinkSymbol}. + * Convert a {@link DiffSymbol}. */ - private static TCommand convertLink(LinkSymbol sym) { - TCommand tc = new TCommand(TCommandVerb.LINK); - tc.setKeys(Collections.singletonList(sym.key().key().toString())); - tc.setSourceRecord(sym.source()); - tc.setRecords(new ArrayList<>(sym.destinations())); + private static TCommand convertDiff(DiffSymbol sym) { + TCommand tc = new TCommand(TCommandVerb.DIFF); + if(sym.key() != null) { + tc.setKeys(Collections.singletonList(sym.key().key().toString())); + } + if(sym.record() != null) { + tc.setRecords(Collections.singletonList(sym.record())); + } + tc.setTimestamp(sym.start().timestamp()); + if(sym.end() != null && sym.end() != TimestampSymbol.PRESENT) { + tc.setEndTimestamp(sym.end().timestamp()); + } return tc; } /** - * Convert an {@link UnlinkSymbol}. + * Convert a {@link FindSymbol}. */ - private static TCommand convertUnlink(UnlinkSymbol sym) { - TCommand tc = new TCommand(TCommandVerb.UNLINK); - tc.setKeys(Collections.singletonList(sym.key().key().toString())); - tc.setSourceRecord(sym.source()); - tc.setRecords(Collections.singletonList(sym.destination())); + private static TCommand convertFind(FindSymbol sym, CommandTree tree) { + TCommand tc = new TCommand(TCommandVerb.FIND); + applyCondition(tc, tree); + setTimestamp(tc, sym.timestamp()); + applyOrder(tc, tree); + applyPage(tc, tree); return tc; } /** - * Convert a {@link VerifySymbol}. + * Convert a {@link FindOrAddSymbol}. */ - private static TCommand convertVerify(VerifySymbol sym) { - TCommand tc = new TCommand(TCommandVerb.VERIFY); + private static TCommand convertFindOrAdd(FindOrAddSymbol sym, + CommandTree tree) { + TCommand tc = new TCommand(TCommandVerb.FIND_OR_ADD); tc.setKeys(Collections.singletonList(sym.key().key().toString())); tc.setValue(convertValue(sym.value())); - tc.setRecords(Collections.singletonList(sym.record())); - setTimestamp(tc, sym.timestamp()); return tc; } /** - * Convert a {@link VerifyAndSwapSymbol}. - */ - private static TCommand convertVerifyAndSwap(VerifyAndSwapSymbol sym) { - TCommand tc = new TCommand(TCommandVerb.VERIFY_AND_SWAP); - tc.setKeys(Collections.singletonList(sym.key().key().toString())); - tc.setValue(convertValue(sym.expected())); - tc.setReplacement(convertValue(sym.replacement())); - tc.setRecords(Collections.singletonList(sym.record())); - return tc; - } - - /** - * Convert a {@link VerifyOrSetSymbol}. - */ - private static TCommand convertVerifyOrSet(VerifyOrSetSymbol sym) { - TCommand tc = new TCommand(TCommandVerb.VERIFY_OR_SET); - tc.setKeys(Collections.singletonList(sym.key().key().toString())); - tc.setValue(convertValue(sym.value())); - tc.setRecords(Collections.singletonList(sym.record())); - return tc; - } - - /** - * Convert a {@link FindOrAddSymbol}. - */ - private static TCommand convertFindOrAdd(FindOrAddSymbol sym, - CommandTree tree) { - TCommand tc = new TCommand(TCommandVerb.FIND_OR_ADD); - tc.setKeys(Collections.singletonList(sym.key().key().toString())); - tc.setValue(convertValue(sym.value())); - return tc; - } - - /** - * Convert a {@link FindOrInsertSymbol}. + * Convert a {@link FindOrInsertSymbol}. */ private static TCommand convertFindOrInsert(FindOrInsertSymbol sym, CommandTree tree) { @@ -621,58 +483,47 @@ private static TCommand convertFindOrInsert(FindOrInsertSymbol sym, } /** - * Convert a {@link SearchSymbol}. - */ - private static TCommand convertSearch(SearchSymbol sym) { - TCommand tc = new TCommand(TCommandVerb.SEARCH); - tc.setKeys(Collections.singletonList(sym.key().key().toString())); - tc.setQuery(sym.query()); - return tc; - } - - /** - * Convert a {@link BrowseSymbol}. + * Convert a {@link GetSymbol}. */ - private static TCommand convertBrowse(BrowseSymbol sym) { - TCommand tc = new TCommand(TCommandVerb.BROWSE); - if(sym.keys() != null && !sym.keys().isEmpty()) { + private static TCommand convertGet(GetSymbol sym, CommandTree tree) { + TCommand tc = new TCommand(TCommandVerb.GET); + if(sym.key() != null) { + tc.setKeys(Collections.singletonList(sym.key().key().toString())); + } + else if(sym.keys() != null && !sym.keys().isEmpty()) { tc.setKeys(extractKeys(sym.keys())); } - setTimestamp(tc, sym.timestamp()); - return tc; - } - - /** - * Convert a {@link DescribeSymbol}. - */ - private static TCommand convertDescribe(DescribeSymbol sym) { - TCommand tc = new TCommand(TCommandVerb.DESCRIBE); - List records = collectRecords(sym.record(), sym.records()); - if(records != null) { - tc.setRecords(records); + if(sym.record() >= 0) { + tc.setRecords(Collections.singletonList(sym.record())); + } + else if(sym.records() != null) { + tc.setRecords(new ArrayList<>(sym.records())); } + applyCondition(tc, tree); setTimestamp(tc, sym.timestamp()); + applyOrder(tc, tree); + applyPage(tc, tree); return tc; } /** - * Convert a {@link TraceSymbol}. + * Convert a {@link HoldsSymbol}. */ - private static TCommand convertTrace(TraceSymbol sym) { - TCommand tc = new TCommand(TCommandVerb.TRACE); + private static TCommand convertHolds(HoldsSymbol sym) { + TCommand tc = new TCommand(TCommandVerb.HOLDS); List records = collectRecords(sym.record(), sym.records()); if(records != null) { tc.setRecords(records); } - setTimestamp(tc, sym.timestamp()); return tc; } /** - * Convert a {@link HoldsSymbol}. + * Convert an {@link InsertSymbol}. */ - private static TCommand convertHolds(HoldsSymbol sym) { - TCommand tc = new TCommand(TCommandVerb.HOLDS); + private static TCommand convertInsert(InsertSymbol sym) { + TCommand tc = new TCommand(TCommandVerb.INSERT); + tc.setJson(sym.json()); List records = collectRecords(sym.record(), sym.records()); if(records != null) { tc.setRecords(records); @@ -694,53 +545,103 @@ private static TCommand convertJsonify(JsonifySymbol sym) { } /** - * Convert a {@link ChronicleSymbol}. + * Convert a {@link LinkSymbol}. */ - private static TCommand convertChronicle(ChronicleSymbol sym) { - TCommand tc = new TCommand(TCommandVerb.CHRONICLE); + private static TCommand convertLink(LinkSymbol sym) { + TCommand tc = new TCommand(TCommandVerb.LINK); tc.setKeys(Collections.singletonList(sym.key().key().toString())); - tc.setRecords(Collections.singletonList(sym.record())); - if(sym.start() != null && sym.start() != TimestampSymbol.PRESENT) { - tc.setTimestamp(sym.start().timestamp()); - } - if(sym.end() != null && sym.end() != TimestampSymbol.PRESENT) { - tc.setEndTimestamp(sym.end().timestamp()); - } + tc.setSourceRecord(sym.source()); + tc.setRecords(new ArrayList<>(sym.destinations())); return tc; } /** - * Convert a {@link DiffSymbol}. + * Convert a {@link NavigateSymbol}. */ - private static TCommand convertDiff(DiffSymbol sym) { - TCommand tc = new TCommand(TCommandVerb.DIFF); - if(sym.key() != null) { - tc.setKeys(Collections.singletonList(sym.key().key().toString())); + private static TCommand convertNavigate(NavigateSymbol sym, + CommandTree tree) { + TCommand tc = new TCommand(TCommandVerb.NAVIGATE); + if(sym.keys() != null && !sym.keys().isEmpty()) { + tc.setKeys(extractKeys(sym.keys())); } - if(sym.record() != null) { - tc.setRecords(Collections.singletonList(sym.record())); + Long record = sym.record(); + Collection records = sym.records(); + if(record != null) { + tc.setRecords(Collections.singletonList(record)); } - tc.setTimestamp(sym.start().timestamp()); - if(sym.end() != null && sym.end() != TimestampSymbol.PRESENT) { - tc.setEndTimestamp(sym.end().timestamp()); + else if(records != null) { + tc.setRecords(new ArrayList<>(records)); } + // NOTE: NavigateSymbol may carry its own ccl() condition + // string, but we prefer the ConditionTree from the + // CommandTree since it's more reliable. + applyCondition(tc, tree); + setTimestamp(tc, sym.timestamp()); return tc; } /** - * Convert an {@link AuditSymbol}. + * Convert an {@link OrderTree} to a {@link TOrder}. + * + * @param tree the {@link OrderTree} to convert + * @return the equivalent {@link TOrder} */ - private static TCommand convertAudit(AuditSymbol sym) { - TCommand tc = new TCommand(TCommandVerb.AUDIT); - if(sym.key() != null) { - tc.setKeys(Collections.singletonList(sym.key().key().toString())); + private static TOrder convertOrder(OrderTree tree) { + OrderSymbol sym = (OrderSymbol) tree.root(); + List spec = new ArrayList<>(); + for (OrderComponentSymbol comp : sym.components()) { + TOrderComponent toc = new TOrderComponent( + comp.key().key().toString(), + comp.direction() == DirectionSymbol.ASCENDING ? 0 : 1); + if(comp.timestamp() != null + && comp.timestamp() != TimestampSymbol.PRESENT) { + toc.setTimestamp( + Convert.javaToThrift(comp.timestamp().timestamp())); + } + spec.add(toc); } + return new TOrder(spec); + } + + /** + * Convert a {@link PageTree} to a {@link TPage}. + * + * @param tree the {@link PageTree} to convert + * @return the equivalent {@link TPage} + */ + private static TPage convertPage(PageTree tree) { + PageSymbol sym = (PageSymbol) tree.root(); + return new TPage(sym.skip(), sym.limit()); + } + + /** + * Convert a {@link ReconcileSymbol}. + */ + private static TCommand convertReconcile(ReconcileSymbol sym) { + TCommand tc = new TCommand(TCommandVerb.RECONCILE); + tc.setKeys(Collections.singletonList(sym.key().key().toString())); tc.setRecords(Collections.singletonList(sym.record())); - if(sym.start() != null && sym.start() != TimestampSymbol.PRESENT) { - tc.setTimestamp(sym.start().timestamp()); + List values = sym.values().stream() + .map(CommandTreeConverter::convertValue) + .collect(Collectors.toList()); + tc.setValues(values); + return tc; + } + + /** + * Convert a {@link RemoveSymbol}. + */ + private static TCommand convertRemove(RemoveSymbol sym) { + TCommand tc = new TCommand(TCommandVerb.REMOVE); + tc.setKeys(Collections.singletonList(sym.key().key().toString())); + if(sym.value() != null) { + tc.setValue(convertValue(sym.value())); } - if(sym.end() != null && sym.end() != TimestampSymbol.PRESENT) { - tc.setEndTimestamp(sym.end().timestamp()); + if(sym.records() != null) { + tc.setRecords(new ArrayList<>(sym.records())); + } + else if(sym.record() >= 0) { + tc.setRecords(Collections.singletonList(sym.record())); } return tc; } @@ -767,47 +668,146 @@ else if(sym.record() >= 0) { } /** - * Convert a {@link ReconcileSymbol}. + * Convert a {@link SearchSymbol}. */ - private static TCommand convertReconcile(ReconcileSymbol sym) { - TCommand tc = new TCommand(TCommandVerb.RECONCILE); + private static TCommand convertSearch(SearchSymbol sym) { + TCommand tc = new TCommand(TCommandVerb.SEARCH); tc.setKeys(Collections.singletonList(sym.key().key().toString())); - tc.setRecords(Collections.singletonList(sym.record())); - List values = sym.values().stream() - .map(CommandTreeConverter::convertValue) - .collect(Collectors.toList()); - tc.setValues(values); + tc.setQuery(sym.query()); return tc; } /** - * Convert a {@link ConsolidateSymbol}. + * Convert a {@link SelectSymbol}. */ - private static TCommand convertConsolidate(ConsolidateSymbol sym) { - TCommand tc = new TCommand(TCommandVerb.CONSOLIDATE); - List records = new ArrayList<>(); - records.add(sym.first()); - records.addAll(sym.remaining()); - tc.setRecords(records); + private static TCommand convertSelect(SelectSymbol sym, CommandTree tree) { + TCommand tc = new TCommand(TCommandVerb.SELECT); + if(sym.keys() != null && !sym.keys().isEmpty()) { + tc.setKeys(extractKeys(sym.keys())); + } + List records = collectRecords(sym.record(), sym.records()); + if(records != null) { + tc.setRecords(records); + } + applyCondition(tc, tree); + setTimestamp(tc, sym.timestamp()); + applyOrder(tc, tree); + applyPage(tc, tree); return tc; } /** - * Convert a {@link CalculateSymbol}. + * Convert a {@link SetSymbol}. */ - private static TCommand convertCalculate(CalculateSymbol sym, - CommandTree tree) { - TCommand tc = new TCommand(TCommandVerb.CALCULATE); - tc.setFunction(sym.function()); + private static TCommand convertSet(SetSymbol sym) { + TCommand tc = new TCommand(TCommandVerb.SET); tc.setKeys(Collections.singletonList(sym.key().key().toString())); + tc.setValue(convertValue(sym.value())); if(sym.records() != null) { tc.setRecords(new ArrayList<>(sym.records())); } - applyCondition(tc, tree); + else if(sym.record() >= 0) { + tc.setRecords(Collections.singletonList(sym.record())); + } + return tc; + } + + /** + * Convert a {@link TraceSymbol}. + */ + private static TCommand convertTrace(TraceSymbol sym) { + TCommand tc = new TCommand(TCommandVerb.TRACE); + List records = collectRecords(sym.record(), sym.records()); + if(records != null) { + tc.setRecords(records); + } setTimestamp(tc, sym.timestamp()); return tc; } + /** + * Convert an {@link UnlinkSymbol}. + */ + private static TCommand convertUnlink(UnlinkSymbol sym) { + TCommand tc = new TCommand(TCommandVerb.UNLINK); + tc.setKeys(Collections.singletonList(sym.key().key().toString())); + tc.setSourceRecord(sym.source()); + tc.setRecords(Collections.singletonList(sym.destination())); + return tc; + } + + /** + * Convert a value from a {@link ValueTokenSymbol} to a {@link TObject}. + * + * @param value the value symbol + * @return the {@link TObject} + */ + private static TObject convertValue(ValueTokenSymbol value) { + return Convert.javaToThrift(value.value()); + } + + /** + * Convert a {@link VerifySymbol}. + */ + private static TCommand convertVerify(VerifySymbol sym) { + TCommand tc = new TCommand(TCommandVerb.VERIFY); + tc.setKeys(Collections.singletonList(sym.key().key().toString())); + tc.setValue(convertValue(sym.value())); + tc.setRecords(Collections.singletonList(sym.record())); + setTimestamp(tc, sym.timestamp()); + return tc; + } + + /** + * Convert a {@link VerifyAndSwapSymbol}. + */ + private static TCommand convertVerifyAndSwap(VerifyAndSwapSymbol sym) { + TCommand tc = new TCommand(TCommandVerb.VERIFY_AND_SWAP); + tc.setKeys(Collections.singletonList(sym.key().key().toString())); + tc.setValue(convertValue(sym.expected())); + tc.setReplacement(convertValue(sym.replacement())); + tc.setRecords(Collections.singletonList(sym.record())); + return tc; + } + + /** + * Convert a {@link VerifyOrSetSymbol}. + */ + private static TCommand convertVerifyOrSet(VerifyOrSetSymbol sym) { + TCommand tc = new TCommand(TCommandVerb.VERIFY_OR_SET); + tc.setKeys(Collections.singletonList(sym.key().key().toString())); + tc.setValue(convertValue(sym.value())); + tc.setRecords(Collections.singletonList(sym.record())); + return tc; + } + + /** + * Extract key strings from a collection of {@link KeyTokenSymbol + * KeyTokenSymbols}. + * + * @param keys the key symbols + * @return a list of key strings + */ + private static List extractKeys( + Collection> keys) { + return keys.stream().map(k -> k.key().toString()) + .collect(Collectors.toList()); + } + + /** + * Set the timestamp on a {@link TCommand} if the given + * {@link TimestampSymbol} is not {@code null} and not + * {@link TimestampSymbol#PRESENT}. + * + * @param tc the {@link TCommand} to modify + * @param ts the {@link TimestampSymbol}, or {@code null} + */ + private static void setTimestamp(TCommand tc, TimestampSymbol ts) { + if(ts != null && ts != TimestampSymbol.PRESENT) { + tc.setTimestamp(ts.timestamp()); + } + } + private CommandTreeConverter() {/* no-init */} } diff --git a/concourse-shell/src/main/java/com/cinchapi/concourse/shell/ConcourseShell.java b/concourse-shell/src/main/java/com/cinchapi/concourse/shell/ConcourseShell.java index 8abde9ff0..e0a242740 100644 --- a/concourse-shell/src/main/java/com/cinchapi/concourse/shell/ConcourseShell.java +++ b/concourse-shell/src/main/java/com/cinchapi/concourse/shell/ConcourseShell.java @@ -316,10 +316,6 @@ private static String[] getAccessibleApiMethodsUsingShortSyntax() { for (Showable showable : Showable.values()) { methods.add("show " + showable.getName()); } - // Add CCL syntax words and shell meta-commands - methods.addAll(ImmutableList.of("where", "from", "in", "at", "as", "to", - "for", "order", "by", "page", "size", "prepare", "submit", - "discard")); return methods.toArray(new String[methods.size()]); } @@ -498,6 +494,20 @@ public StartState call() { }; + /** + * Sentinel indicating that the input has not yet been evaluated by any + * processing path (CCL or submit). When this value remains after dispatch, + * the input falls through to Groovy evaluation. + */ + private static final Object UNPROCESSED = new Object(); + + /** + * Sentinel indicating that the input was a valid CCL command queued during + * prepare mode rather than executed. Used to distinguish queued commands + * from evaluated results when formatting output. + */ + private static final Object SKIPPED = new Object(); + /** * The client connection to Concourse. */ @@ -597,13 +607,13 @@ public Object call(Object arg) { private static final long serialVersionUID = 1L; @Override - public Timestamp call(Object arg) { - return concourse.time(arg.toString()); + public Timestamp call() { + return concourse.time(); } @Override - public Timestamp call() { - return concourse.time(); + public Timestamp call(Object arg) { + return concourse.time(arg.toString()); } }; @@ -630,9 +640,9 @@ protected ConcourseShell() throws Exception { * @return the result of the evaluation * @throws IrregularEvaluationResult */ - @SuppressWarnings("serial") + @SuppressWarnings({ "serial", "unchecked", "rawtypes" }) public String evaluate(String input) throws IrregularEvaluationResult { - String rawInput = input; + String program = input; input = SyntaxTools.handleShortSyntax(input, methods); String inputLowerCase = input.toLowerCase(); @@ -724,74 +734,81 @@ else if(inputLowerCase.equals("discard")) { throw new EvaluationException("ERROR: Not in prepare mode"); } } - else if(inputLowerCase.equals("submit")) { - if(inPrepareMode) { - String ccl = String.join("; ", pendingPreparedCommands); - int count = pendingPreparedCommands.size(); - inPrepareMode = false; - pendingPreparedCommands = null; - setDefaultPrompt(); + else { + StringBuilder result = new StringBuilder(); + try { watch.reset().start(); - List results = concourse.submit(ccl); - watch.stop(); - long elapsed = watch.elapsed(TimeUnit.MILLISECONDS); - double seconds = elapsed / 1000.0; - StringBuilder sb = new StringBuilder(); - for (int i = 0; i < results.size(); ++i) { - Object value = results.get(i); - if(value != null) { - sb.append(" [").append(i + 1).append("] Returned '") - .append(value).append("'"); + Object value = UNPROCESSED; + Integer count = null; + if("submit".equalsIgnoreCase(inputLowerCase)) { + if(inPrepareMode) { + String ccl = String.join("; ", pendingPreparedCommands); + count = pendingPreparedCommands.size(); + inPrepareMode = false; + pendingPreparedCommands = null; + setDefaultPrompt(); + value = concourse.submit(ccl); } else { - sb.append(" [").append(i + 1).append("] Completed"); + throw new EvaluationException( + "ERROR: Not in prepare mode"); } - sb.append('\n'); } - sb.append("Submitted ").append(count) - .append(count == 1 ? " command" : " commands") - .append(" in ").append(seconds).append(" sec"); - return sb.toString(); - } - else { - throw new EvaluationException("ERROR: Not in prepare mode"); - } - } - else { - StringBuilder result = new StringBuilder(); - try { - watch.reset().start(); - Object value; - if(looksLikeCcl(rawInput)) { + else if(looksLikeCcl(program)) { try { - ConcourseCompiler.get().compile(rawInput); + ConcourseCompiler.get().compile(program); if(inPrepareMode) { - watch.stop(); - pendingPreparedCommands.add(rawInput); + pendingPreparedCommands.add(program); + count = pendingPreparedCommands.size(); setDefaultPrompt(); - return " [" + pendingPreparedCommands.size() + "] " - + rawInput; + value = SKIPPED; + } + else { + value = concourse.exec(program); } - value = concourse.exec(rawInput); } catch (Exception e) { - // Fall through to Groovy - value = groovy.evaluate(input, "ConcourseShell"); + // NOTE: Input that looks like CCL but fails to compile + // or execute may still be valid Groovy, so let it fall + // through to Groovy evaluation via the UNPROCESSED + // sentinel. } } - else { + if(value == UNPROCESSED) { value = groovy.evaluate(input, "ConcourseShell"); } watch.stop(); long elapsed = watch.elapsed(TimeUnit.MILLISECONDS); double seconds = elapsed / 1000.0; - if(value != null) { - result.append( - "Returned '" + value + "' in " + seconds + " sec"); + if(value == SKIPPED) { + result.append(" [" + count + "] " + program); } - else { + else if(value == null) { result.append("Completed in " + seconds + " sec"); } + else if(count != null && value instanceof List) { + List results = (List) value; + for (int i = 0; i < results.size(); ++i) { + Object v = results.get(i); + if(v != null) { + result.append(" [").append(i + 1) + .append("] Returned '").append(v) + .append("'"); + } + else { + result.append(" [").append(i + 1) + .append("] Completed"); + } + result.append(System.lineSeparator()); + } + result.append("Submitted ").append(count) + .append(count == 1 ? " command" : " commands") + .append(" in ").append(seconds).append(" sec"); + } + else { + result.append( + "Returned '" + value + "' in " + seconds + " sec"); + } return result.toString(); } catch (CompilationFailedException e) { @@ -1056,6 +1073,38 @@ private void setDefaultPrompt() { this.defaultPrompt = sb.toString(); } + /** + * An enum that summarizes the cause of an error based on the message. + *

      + * Retrieve an instance by calling {@link ErrorCause#determine(String)} on + * an error message returned from an exception/ + *

      + * + * @author Jeff Nelson + */ + private enum ErrorCause { + MISSING_CASH_METHOD, MISSING_EXTERNAL_METHOD, UNDEFINED; + + /** + * Examine an error message to determine the {@link ErrorCause}. + * + * @param message - the error message from an Exception + * @return the {@link ErrorCause} that summarizes the reason the + * Exception occurred + */ + public static ErrorCause determine(String message) { + if(message.startsWith("No signature of method: ConcourseShell.")) { + return MISSING_CASH_METHOD; + } + else if(message.startsWith("No signature of method: ext.")) { + return MISSING_EXTERNAL_METHOD; + } + else { + return UNDEFINED; + } + } + } + /** * The options that can be passed to the main method of this script. * @@ -1111,38 +1160,6 @@ private static class Options { } - /** - * An enum that summarizes the cause of an error based on the message. - *

      - * Retrieve an instance by calling {@link ErrorCause#determine(String)} on - * an error message returned from an exception/ - *

      - * - * @author Jeff Nelson - */ - private enum ErrorCause { - MISSING_CASH_METHOD, MISSING_EXTERNAL_METHOD, UNDEFINED; - - /** - * Examine an error message to determine the {@link ErrorCause}. - * - * @param message - the error message from an Exception - * @return the {@link ErrorCause} that summarizes the reason the - * Exception occurred - */ - public static ErrorCause determine(String message) { - if(message.startsWith("No signature of method: ConcourseShell.")) { - return MISSING_CASH_METHOD; - } - else if(message.startsWith("No signature of method: ext.")) { - return MISSING_EXTERNAL_METHOD; - } - else { - return UNDEFINED; - } - } - } - /** * An enum containing the types of things that can be listed using the * 'show' function. @@ -1152,20 +1169,12 @@ else if(message.startsWith("No signature of method: ext.")) { private enum Showable { RECORDS; - /** - * Return the name of this Showable. - * - * @return the name - */ - public String getName() { - return name().toLowerCase(); - } - /** * Valid options for the 'show' function based on the values defined in * this enum. */ private static String OPTIONS; + static { StringBuilder sb = new StringBuilder(); for (Showable showable : values()) { @@ -1175,6 +1184,15 @@ public String getName() { OPTIONS = sb.toString(); } + /** + * Return the name of this Showable. + * + * @return the name + */ + public String getName() { + return name().toLowerCase(); + } + } } \ No newline at end of file From 4e471f90c7c7e9b8cbed40fea1faaf9891010dda Mon Sep 17 00:00:00 2001 From: Jeff Nelson Date: Mon, 16 Mar 2026 09:32:20 -0400 Subject: [PATCH 12/13] refinements --- CHANGELOG.md | 45 ++++++++++++++ .../concourse/ConcourseThriftDriver.java | 12 +++- ...CommandGroup.java => CCLCommandGroup.java} | 6 +- ...roupTest.java => CCLCommandGroupTest.java} | 52 +++++++---------- .../concourse/server/ConcourseServer.java | 11 +++- .../concourse/shell/ConcourseShell.java | 58 ++++++++++++++----- 6 files changed, 131 insertions(+), 53 deletions(-) rename concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/{DefaultCommandGroup.java => CCLCommandGroup.java} (99%) rename concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/{DefaultCommandGroupTest.java => CCLCommandGroupTest.java} (81%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ad90eb74..5b3fd3db4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,51 @@ ##### Bug Fixes * Fixed a bug in `ManagedConcourseServer` where the `review/audit(long record, Timestamp start, Timestamp end)` method omitted the `record` argument when delegating, causing incorrect results. +##### Command API + +We've upgraded to CCL 4.0 which adds support for all Concourse operations as first-class commands in the language grammar. This release introduces the `Command` construct, fluent builders for creating `Command` objects that can be converted to CCL (and vice versa), and new APIs for executing commands directly as an alternative to the standard API methods. + +* **Command Construct**: A `Command` is a type-safe representation of a single Concourse operation. Commands can be created programmatically via fluent builders or parsed from CCL text. Every `Command` can render itself as a CCL string via the `ccl()` method, and CCL strings can be parsed into `Command` objects via `Command.parse(String)`. + * Fluent builders use a state-machine pattern that guides valid parameter sequences: + ```java + Command.to().add("name").as("Jeff").in(1) + Command.to().find(criteria).order(order) + Command.to().select("name", "age").from(record) + Command.is().holds(1) + Command.go().ping() + ``` +* **`exec()` and `submit()` Methods**: Two new families of methods provide direct command execution as an alternative to the standard API methods (which remain fully supported). + * `exec()` executes one or more commands and returns the result of the **last** command. This is useful for command chains where only the final outcome matters. + * `submit()` executes one or more commands and returns a **list** containing one result per command. This is useful when the result of every command in the batch is needed. + * Both methods execute commands sequentially in a single server round trip. If any command fails, execution stops and the exception is propagated immediately. + * Commands can be submitted as `Command` objects or as raw CCL text strings: + ```java + // Execute a single command + Object result = concourse.exec( + Command.to().add("name").as("Jeff").in(1)); + + // Submit multiple commands and get all results + List results = concourse.submit( + Command.to().add("name").as("Jeff").in(1), + Command.to().select("name").from(1)); + + // Submit commands as CCL text + List results = concourse.submit( + "add name as Jeff in 1; select name from 1"); + ``` +* **`prepare()` and `CommandGroup`**: The `prepare()` method returns a `CommandGroup` that mirrors the Concourse API with void-returning methods. Call methods on the group to accumulate operations, then pass the group to `submit()` to execute all recorded operations at once: + ```java + CommandGroup group = concourse.prepare(); + group.add("name", "Jeff", 1); + group.add("age", 30, 1); + group.select("name", 1); + List results = concourse.submit(group); + ``` +* **Concourse Shell Enhancements**: CaSH now recognizes CCL commands directly, alongside traditional Groovy method calls. + * Type `prepare` to enter prepare mode, where CCL commands are validated and queued with indexed output. + * Type `submit` to execute all queued commands in a single batch and display the results. + * Type `discard` to cancel prepare mode and clear all queued commands. + #### Version 0.12.1 (March 10, 2026) * Fixed a bug that caused `search` operations to deadlock subsequent writes and commits by leaving Buffer page read locks held after the search completed. This affected code paths that invoke `search` directly and query paths that delegate to `search` for `CONTAINS`/`NOT_CONTAINS` evaluations. * Fixed a bug that could deadlock subsequent operations when an `AtomicOperation` encountered an unexpected exception while applying writes to the durable store because commit-time locks were not guaranteed to be released on that failure path. diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/ConcourseThriftDriver.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/ConcourseThriftDriver.java index 6aa83b887..50a4cf9b0 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/ConcourseThriftDriver.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/ConcourseThriftDriver.java @@ -48,9 +48,9 @@ import com.cinchapi.concourse.data.transform.DataTable; import com.cinchapi.concourse.lang.Criteria; import com.cinchapi.concourse.lang.Language; +import com.cinchapi.concourse.lang.command.CCLCommandGroup; import com.cinchapi.concourse.lang.command.Command; import com.cinchapi.concourse.lang.command.CommandGroup; -import com.cinchapi.concourse.lang.command.DefaultCommandGroup; import com.cinchapi.concourse.lang.paginate.Page; import com.cinchapi.concourse.lang.sort.Order; import com.cinchapi.concourse.security.ClientSecurity; @@ -2728,7 +2728,7 @@ public boolean ping() { @Override public CommandGroup prepare() { - return new DefaultCommandGroup(); + return new CCLCommandGroup(); } @Override @@ -4813,6 +4813,10 @@ else if(!(value instanceof Map)) { && firstVal instanceof Map) { return DataTable.multiValued((Map) value); } + else if(firstKey instanceof Long) { + return DataColumn.multiValued("Values", + (Map) value); + } else { return DataRow.multiValued((Map) value); } @@ -4821,6 +4825,10 @@ else if(!(value instanceof Map)) { && firstVal instanceof Map) { return DataTable.singleValued((Map) value); } + else if(firstKey instanceof Long) { + return DataColumn.singleValued("Value", + (Map) value); + } else { return DataRow.singleValued((Map) value); } diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/DefaultCommandGroup.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/CCLCommandGroup.java similarity index 99% rename from concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/DefaultCommandGroup.java rename to concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/CCLCommandGroup.java index 45de3c309..323441f81 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/DefaultCommandGroup.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/command/CCLCommandGroup.java @@ -27,8 +27,8 @@ import com.google.common.collect.Lists; /** - * The default {@link CommandGroup} implementation that collects {@link Command - * Commands} for batch submission. + * A {@link CommandGroup} that collects {@link Command Commands} as CCL language + * representations for batch submission. *

      * Each method call records a {@link Command} in an internal list. The * accumulated {@link Command Commands} are retrieved via {@link #commands()} @@ -37,7 +37,7 @@ * * @author Jeff Nelson */ -public class DefaultCommandGroup implements CommandGroup { +public class CCLCommandGroup implements CommandGroup { /** * The collected {@link Command Commands}. diff --git a/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/DefaultCommandGroupTest.java b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/CCLCommandGroupTest.java similarity index 81% rename from concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/DefaultCommandGroupTest.java rename to concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/CCLCommandGroupTest.java index 8823d8031..6e84ff001 100644 --- a/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/DefaultCommandGroupTest.java +++ b/concourse-driver-java/src/test/java/com/cinchapi/concourse/lang/command/CCLCommandGroupTest.java @@ -21,23 +21,22 @@ import org.junit.Test; /** - * Unit tests for {@link DefaultCommandGroup}. + * Unit tests for {@link CCLCommandGroup}. * * @author Jeff Nelson */ -public class DefaultCommandGroupTest { +public class CCLCommandGroupTest { /** * Goal: Verify that calling - * {@code add(key, value, record)} on a {@link DefaultCommandGroup} produces - * a {@link Command} with the correct CCL. + * {@code add(key, value, record)} on a {@link CCLCommandGroup} produces a + * {@link Command} with the correct CCL. *

      - * Start state: A freshly created - * {@link DefaultCommandGroup}. + * Start state: A freshly created {@link CCLCommandGroup}. *

      * Workflow: *

        - *
      • Create a {@link DefaultCommandGroup}.
      • + *
      • Create a {@link CCLCommandGroup}.
      • *
      • Call {@code add("name", "Alice", 1)}.
      • *
      • Retrieve the commands list.
      • *
      @@ -47,7 +46,7 @@ public class DefaultCommandGroupTest { */ @Test public void testAddKeyValueRecord() { - DefaultCommandGroup group = new DefaultCommandGroup(); + CCLCommandGroup group = new CCLCommandGroup(); group.add("name", "Alice", 1); List commands = group.commands(); Assert.assertEquals(1, commands.size()); @@ -59,12 +58,11 @@ public void testAddKeyValueRecord() { * Goal: Verify that calling {@code add(key, value)} * without a record produces the correct CCL. *

      - * Start state: A freshly created - * {@link DefaultCommandGroup}. + * Start state: A freshly created {@link CCLCommandGroup}. *

      * Workflow: *

        - *
      • Create a {@link DefaultCommandGroup}.
      • + *
      • Create a {@link CCLCommandGroup}.
      • *
      • Call {@code add("name", "Bob")}.
      • *
      • Retrieve the commands list.
      • *
      @@ -74,7 +72,7 @@ public void testAddKeyValueRecord() { */ @Test public void testAddKeyValue() { - DefaultCommandGroup group = new DefaultCommandGroup(); + CCLCommandGroup group = new CCLCommandGroup(); group.add("name", "Bob"); List commands = group.commands(); Assert.assertEquals(1, commands.size()); @@ -85,8 +83,7 @@ public void testAddKeyValue() { * Goal: Verify that multiple operations accumulate in the * command list in order. *

      - * Start state: A freshly created - * {@link DefaultCommandGroup}. + * Start state: A freshly created {@link CCLCommandGroup}. *

      * Workflow: *

        @@ -99,7 +96,7 @@ public void testAddKeyValue() { */ @Test public void testMultipleCommandsAccumulate() { - DefaultCommandGroup group = new DefaultCommandGroup(); + CCLCommandGroup group = new CCLCommandGroup(); group.add("a", 1, 10); group.remove("a", 1, 10); group.set("b", 2, 10); @@ -114,8 +111,7 @@ public void testMultipleCommandsAccumulate() { * Goal: Verify that the commands list returned by * {@code commands()} is unmodifiable. *

        - * Start state: A {@link DefaultCommandGroup} with one - * command. + * Start state: A {@link CCLCommandGroup} with one command. *

        * Workflow: *

          @@ -129,7 +125,7 @@ public void testMultipleCommandsAccumulate() { */ @Test(expected = UnsupportedOperationException.class) public void testCommandsListIsUnmodifiable() { - DefaultCommandGroup group = new DefaultCommandGroup(); + CCLCommandGroup group = new CCLCommandGroup(); group.add("x", 1, 1); group.commands().clear(); } @@ -138,8 +134,7 @@ public void testCommandsListIsUnmodifiable() { * Goal: Verify that {@code ping()} produces a ping * command. *

          - * Start state: A freshly created - * {@link DefaultCommandGroup}. + * Start state: A freshly created {@link CCLCommandGroup}. *

          * Workflow: *

            @@ -151,7 +146,7 @@ public void testCommandsListIsUnmodifiable() { */ @Test public void testPingCommand() { - DefaultCommandGroup group = new DefaultCommandGroup(); + CCLCommandGroup group = new CCLCommandGroup(); group.ping(); List commands = group.commands(); Assert.assertEquals(1, commands.size()); @@ -162,8 +157,7 @@ public void testPingCommand() { * Goal: Verify that {@code stage()} and {@code commit()} * produce the correct commands. *

            - * Start state: A freshly created - * {@link DefaultCommandGroup}. + * Start state: A freshly created {@link CCLCommandGroup}. *

            * Workflow: *

              @@ -177,7 +171,7 @@ public void testPingCommand() { */ @Test public void testStageAndCommitCommands() { - DefaultCommandGroup group = new DefaultCommandGroup(); + CCLCommandGroup group = new CCLCommandGroup(); group.stage(); group.add("key", "value", 1); group.commit(); @@ -192,8 +186,7 @@ public void testStageAndCommitCommands() { * Goal: Verify that {@code select(long record)} produces * the correct command. *

              - * Start state: A freshly created - * {@link DefaultCommandGroup}. + * Start state: A freshly created {@link CCLCommandGroup}. *

              * Workflow: *

                @@ -205,7 +198,7 @@ public void testStageAndCommitCommands() { */ @Test public void testSelectRecord() { - DefaultCommandGroup group = new DefaultCommandGroup(); + CCLCommandGroup group = new CCLCommandGroup(); group.select(42); List commands = group.commands(); Assert.assertEquals(1, commands.size()); @@ -216,8 +209,7 @@ public void testSelectRecord() { * Goal: Verify that * {@code select(String key, long record)} produces the correct command. *

                - * Start state: A freshly created - * {@link DefaultCommandGroup}. + * Start state: A freshly created {@link CCLCommandGroup}. *

                * Workflow: *

                  @@ -230,7 +222,7 @@ public void testSelectRecord() { */ @Test public void testSelectKeyRecord() { - DefaultCommandGroup group = new DefaultCommandGroup(); + CCLCommandGroup group = new CCLCommandGroup(); group.select("name", 1); List commands = group.commands(); Assert.assertEquals(1, commands.size()); diff --git a/concourse-server/src/main/java/com/cinchapi/concourse/server/ConcourseServer.java b/concourse-server/src/main/java/com/cinchapi/concourse/server/ConcourseServer.java index dffce24ba..8d171248f 100644 --- a/concourse-server/src/main/java/com/cinchapi/concourse/server/ConcourseServer.java +++ b/concourse-server/src/main/java/com/cinchapi/concourse/server/ConcourseServer.java @@ -6123,11 +6123,18 @@ public List submit(List commands, } break; case COMMIT: - result = commit(creds, active, environment); + if(active != null) { + result = commit(creds, active, environment); + } + else { + result = false; + } active = transaction; break; case ABORT: - abort(creds, active, environment); + if(active != null) { + abort(creds, active, environment); + } result = null; active = transaction; break; diff --git a/concourse-shell/src/main/java/com/cinchapi/concourse/shell/ConcourseShell.java b/concourse-shell/src/main/java/com/cinchapi/concourse/shell/ConcourseShell.java index e0a242740..6ae36e83a 100644 --- a/concourse-shell/src/main/java/com/cinchapi/concourse/shell/ConcourseShell.java +++ b/concourse-shell/src/main/java/com/cinchapi/concourse/shell/ConcourseShell.java @@ -29,6 +29,7 @@ import java.nio.file.Paths; import java.util.ArrayList; import java.util.Arrays; +import java.util.EnumSet; import java.util.List; import java.util.Set; import java.util.concurrent.TimeUnit; @@ -419,16 +420,38 @@ private static String tryGetCorrectApiMethod(String alias) { .collect(Collectors.toList()); /** - * The set of verbs recognized as CCL command prefixes. Input that begins - * with one of these words (and is not followed by an open parenthesis) is - * treated as CCL. Derived from the {@link TCommandVerb} enum so that it - * stays in sync with the Thrift IDL automatically. + * Verbs that manage client-side transaction state and must be routed + * through Groovy (i.e., {@code concourse.stage()}) rather than CCL + * execution. Sending these through {@code exec()} would start or end a + * transaction on the server without updating the client's transaction + * token, causing subsequent commands to execute outside the intended + * transaction context. + */ + private static final Set CLIENT_STATE_VERBS = EnumSet + .of(TCommandVerb.STAGE, TCommandVerb.COMMIT, TCommandVerb.ABORT); + + /** + * The set of recognized CCL verb strings used by + * {@link #looksLikeCcl(String)} to distinguish CCL commands from Groovy + * expressions. Excludes {@link #CLIENT_STATE_VERBS} because those must be + * handled by the client driver to properly manage transaction state. */ private static final Set CCL_VERBS = Arrays - .stream(TCommandVerb.values()).map(v -> { + .stream(TCommandVerb.values()) + .filter(v -> !CLIENT_STATE_VERBS.contains(v)).flatMap(v -> { String name = v.name().toLowerCase(); int underscore = name.indexOf('_'); - return underscore > 0 ? name.substring(0, underscore) : name; + if(underscore > 0) { + // For compound verbs like VERIFY_OR_SET, + // include both "verify" (short form) and + // "verifyorset" (camelCase form the user + // would type). + return Stream.of(name.substring(0, underscore), + name.replace("_", "")); + } + else { + return Stream.of(name); + } }).collect(Collectors.toSet()); /** @@ -713,7 +736,7 @@ else if(containsBannedCharSequence(input)) { else if(Strings.isNullOrEmpty(input)) { // CON-170 throw new NewLineRequest(); } - else if(inputLowerCase.equals("prepare")) { + else if("prepare".equalsIgnoreCase(program)) { inPrepareMode = true; pendingPreparedCommands = new ArrayList<>(); setDefaultPrompt(); @@ -721,7 +744,7 @@ else if(inputLowerCase.equals("prepare")) { + "to queue them. Use 'submit' to " + "execute or 'discard' to cancel."; } - else if(inputLowerCase.equals("discard")) { + else if("discard".equalsIgnoreCase(program)) { if(inPrepareMode) { int count = pendingPreparedCommands.size(); inPrepareMode = false; @@ -740,7 +763,7 @@ else if(inputLowerCase.equals("discard")) { watch.reset().start(); Object value = UNPROCESSED; Integer count = null; - if("submit".equalsIgnoreCase(inputLowerCase)) { + if("submit".equalsIgnoreCase(program)) { if(inPrepareMode) { String ccl = String.join("; ", pendingPreparedCommands); count = pendingPreparedCommands.size(); @@ -755,8 +778,17 @@ else if(inputLowerCase.equals("discard")) { } } else if(looksLikeCcl(program)) { + boolean compiled = false; try { ConcourseCompiler.get().compile(program); + compiled = true; + } + catch (Exception e) { + // NOTE: Input that looks like CCL but fails to compile + // may still be valid Groovy, so let it fall through to + // Groovy evaluation via the UNPROCESSED sentinel. + } + if(compiled) { if(inPrepareMode) { pendingPreparedCommands.add(program); count = pendingPreparedCommands.size(); @@ -767,12 +799,6 @@ else if(looksLikeCcl(program)) { value = concourse.exec(program); } } - catch (Exception e) { - // NOTE: Input that looks like CCL but fails to compile - // or execute may still be valid Groovy, so let it fall - // through to Groovy evaluation via the UNPROCESSED - // sentinel. - } } if(value == UNPROCESSED) { value = groovy.evaluate(input, "ConcourseShell"); @@ -1042,7 +1068,7 @@ private boolean looksLikeCcl(String input) { return false; } else if(space < 0) { - // Bare command (e.g., ping, stage, commit) + // Bare command (e.g., ping, inventory) return true; } else { From ddbb9e1905023b530f7cb89cb87ca5346c9c0539 Mon Sep 17 00:00:00 2001 From: Jeff Nelson Date: Mon, 16 Mar 2026 09:34:55 -0400 Subject: [PATCH 13/13] update changelog --- CHANGELOG.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b3fd3db4..c125a352c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,16 +2,6 @@ #### Version 1.0.0 (TBD) -##### API Breaks and Deprecations -* Renamed `chronologize(...)` to `chronicle(...)` -* Renamed `review(...)` back to `audit(...)`, and standardized the API to return grouped commit history as `Map>` instead of the deprecated flattened `Map` shape. -* The record-presence methods formerly named `ping(record)` and `ping(records)` are now named `holds(record)` and - `holds(records)`. - * The zero-argument `ping()` method remains the liveness check for client/server responsiveness. - -##### Bug Fixes -* Fixed a bug in `ManagedConcourseServer` where the `review/audit(long record, Timestamp start, Timestamp end)` method omitted the `record` argument when delegating, causing incorrect results. - ##### Command API We've upgraded to CCL 4.0 which adds support for all Concourse operations as first-class commands in the language grammar. This release introduces the `Command` construct, fluent builders for creating `Command` objects that can be converted to CCL (and vice versa), and new APIs for executing commands directly as an alternative to the standard API methods. @@ -57,6 +47,16 @@ We've upgraded to CCL 4.0 which adds support for all Concourse operations as fir * Type `submit` to execute all queued commands in a single batch and display the results. * Type `discard` to cancel prepare mode and clear all queued commands. +##### API Breaks and Deprecations +* Renamed `chronologize(...)` to `chronicle(...)` +* Renamed `review(...)` back to `audit(...)`, and standardized the API to return grouped commit history as `Map>` instead of the deprecated flattened `Map` shape. +* The record-presence methods formerly named `ping(record)` and `ping(records)` are now named `holds(record)` and + `holds(records)`. + * The zero-argument `ping()` method remains the liveness check for client/server responsiveness. + +##### Bug Fixes +* Fixed a bug in `ManagedConcourseServer` where the `review/audit(long record, Timestamp start, Timestamp end)` method omitted the `record` argument when delegating, causing incorrect results. + #### Version 0.12.1 (March 10, 2026) * Fixed a bug that caused `search` operations to deadlock subsequent writes and commits by leaving Buffer page read locks held after the search completed. This affected code paths that invoke `search` directly and query paths that delegate to `search` for `CONTAINS`/`NOT_CONTAINS` evaluations. * Fixed a bug that could deadlock subsequent operations when an `AtomicOperation` encountered an unexpected exception while applying writes to the durable store because commit-time locks were not guaranteed to be released on that failure path.