diff --git a/.gitattributes b/.gitattributes index a6a28fa4e83..b01b58a6e96 100644 --- a/.gitattributes +++ b/.gitattributes @@ -8,6 +8,6 @@ *.xml text *.sh text -# Files that should keep CLRF line endings +# Files that should keep CRLF line endings *.bat text eol=crlf diff --git a/clients/streaming/src/main/java/com/emc/pravega/state/Update.java b/clients/streaming/src/main/java/com/emc/pravega/state/Update.java index ef0f23c6470..d2464783e62 100644 --- a/clients/streaming/src/main/java/com/emc/pravega/state/Update.java +++ b/clients/streaming/src/main/java/com/emc/pravega/state/Update.java @@ -1,38 +1,38 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.emc.pravega.state; - -/** - * An update to a StateT object coordinated via a {@link StateSynchronizer}. - * - * @param the type of the object being updated - */ -public interface Update { - - /** - * Return an object of type StateT that is the same as oldState with this update applied to it. - * Invoking {@link Revisioned#getRevision()} on the result should return newRevision. - * - * @param oldState the state to which should be used as the basis for the new state. - * @param newRevision the revision for the new state. - * @return A state that represents a state with this update applied to it. (If StateT is mutable - * and the update is done in-place this is the same object as oldState) - */ - StateT applyTo(StateT oldState, Revision newRevision); - -} +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.emc.pravega.state; + +/** + * An update to a StateT object coordinated via a {@link StateSynchronizer}. + * + * @param the type of the object being updated + */ +public interface Update { + + /** + * Return an object of type StateT that is the same as oldState with this update applied to it. + * Invoking {@link Revisioned#getRevision()} on the result should return newRevision. + * + * @param oldState the state to which should be used as the basis for the new state. + * @param newRevision the revision for the new state. + * @return A state that represents a state with this update applied to it. (If StateT is mutable + * and the update is done in-place this is the same object as oldState) + */ + StateT applyTo(StateT oldState, Revision newRevision); + +} diff --git a/clients/streaming/src/main/java/com/emc/pravega/stream/impl/ModelHelper.java b/clients/streaming/src/main/java/com/emc/pravega/stream/impl/ModelHelper.java index 6e5ca282bae..d370537f88f 100644 --- a/clients/streaming/src/main/java/com/emc/pravega/stream/impl/ModelHelper.java +++ b/clients/streaming/src/main/java/com/emc/pravega/stream/impl/ModelHelper.java @@ -1,171 +1,171 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.emc.pravega.stream.impl; - -import com.emc.pravega.common.netty.PravegaNodeUri; -import com.emc.pravega.controller.stream.api.v1.NodeUri; -import com.emc.pravega.controller.stream.api.v1.Position; -import com.emc.pravega.controller.stream.api.v1.ScalingPolicyType; -import com.emc.pravega.controller.stream.api.v1.SegmentId; -import com.emc.pravega.controller.stream.api.v1.StreamConfig; -import com.emc.pravega.controller.stream.api.v1.TxnId; -import com.emc.pravega.controller.stream.api.v1.TxnState; -import com.emc.pravega.stream.ScalingPolicy; -import com.emc.pravega.stream.Segment; -import com.emc.pravega.stream.StreamConfiguration; -import com.emc.pravega.stream.Transaction; -import com.google.common.base.Preconditions; - -import java.util.AbstractMap; -import java.util.AbstractMap.SimpleEntry; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.UUID; -import java.util.stream.Collectors; - -/** - * Provides translation (encode/decode) between the Model classes and its Thrift representation. - */ -public final class ModelHelper { - - public static final UUID encode(TxnId txnId) { - Preconditions.checkNotNull(txnId, "txnId"); - return new UUID(txnId.getHighBits(), txnId.getLowBits()); - } - - public static final TxnStatus encode(TxnState txnState) { - Preconditions.checkNotNull(txnState, "txnState"); - return TxnStatus.valueOf(txnState.name()); - } - - public static final Segment encode(final SegmentId segment) { - Preconditions.checkNotNull(segment, "Segment"); - return new Segment(segment.getScope(), segment.getStreamName(), segment.getNumber()); - } - - public static final ScalingPolicy encode(final com.emc.pravega.controller.stream.api.v1.ScalingPolicy policy) { - Preconditions.checkNotNull(policy, "ScalingPolicy"); - return new ScalingPolicy(ScalingPolicy.Type.valueOf(policy.getType().name()), policy.getTargetRate(), policy.getScaleFactor(), - policy.getMinNumSegments()); - } - - public static final StreamConfiguration encode(final StreamConfig config) { - Preconditions.checkNotNull(config, "StreamConfig"); - return new StreamConfigurationImpl(config.getScope(), - config.getName(), - encode(config.getPolicy())); - } - - public static final PositionImpl encode(final Position position) { - Preconditions.checkNotNull(position, "Position"); - return new PositionImpl(encodeSegmentMap(position.getOwnedSegments())); - } - - public static com.emc.pravega.common.netty.PravegaNodeUri encode(NodeUri uri) { - return new com.emc.pravega.common.netty.PravegaNodeUri(uri.getEndpoint(), uri.getPort()); - } - - public static List> encode(Map keyRanges) { - return keyRanges - .entrySet() - .stream() - .map(x -> new AbstractMap.SimpleEntry<>(x.getKey(), x.getValue())) - .collect(Collectors.toList()); - } - - public static Transaction.Status encode(TxnState status, String logString) { - switch (status) { - case COMMITTED: - return Transaction.Status.COMMITTED; - case ABORTED: - return Transaction.Status.ABORTED; - case OPEN: - return Transaction.Status.OPEN; - case SEALED: - return Transaction.Status.SEALED; - case UNKNOWN: - throw new RuntimeException("Unknown transaction: " + logString); - default: - throw new IllegalStateException("Unknown status: " + status); - } - } - - public static final TxnId decode(UUID txnId) { - Preconditions.checkNotNull(txnId, "txnId"); - return new TxnId(txnId.getMostSignificantBits(), txnId.getLeastSignificantBits()); - } - - public static final TxnState decode(TxnStatus txnStatus) { - Preconditions.checkNotNull(txnStatus, "txnStatus"); - return TxnState.valueOf(txnStatus.name()); - } - - public static final SegmentId decode(final Segment segment) { - Preconditions.checkNotNull(segment, "Segment"); - return new SegmentId().setScope(segment.getScope()).setStreamName(segment.getStreamName()) - .setNumber(segment.getSegmentNumber()); - - } - - public static final com.emc.pravega.controller.stream.api.v1.ScalingPolicy decode(final ScalingPolicy policyModel) { - Preconditions.checkNotNull(policyModel, "Policy"); - return new com.emc.pravega.controller.stream.api.v1.ScalingPolicy() - .setType(ScalingPolicyType.valueOf(policyModel.getType().name())).setTargetRate(policyModel.getTargetRate()) - .setScaleFactor(policyModel.getScaleFactor()).setMinNumSegments(policyModel.getMinNumSegments()); - } - - public static final StreamConfig decode(final StreamConfiguration configModel) { - Preconditions.checkNotNull(configModel, "StreamConfiguration"); - return new StreamConfig(configModel.getScope(), - configModel.getName(), - decode(configModel.getScalingPolicy())); - } - - public static final Position decode(final PositionInternal position) { - Preconditions.checkNotNull(position, "Position"); - return new Position(decodeSegmentMap(position.getOwnedSegmentsWithOffsets())); - } - - public static NodeUri decode(PravegaNodeUri uri) { - return new NodeUri(uri.getEndpoint(), uri.getPort()); - } - - public static final Map toSegmentOffsetMap(PositionInternal position) { - return position.getOwnedSegmentsWithOffsets() - .entrySet() - .stream() - .map(e -> new SimpleEntry<>(e.getKey().getSegmentNumber(), e.getValue())) - .collect(Collectors.toMap(Entry::getKey, Entry::getValue)); - } - - private static Map encodeSegmentMap(final Map map) { - Preconditions.checkNotNull(map); - HashMap result = new HashMap<>(); - for (Entry entry : map.entrySet()) { - result.put(encode(entry.getKey()), entry.getValue()); - } - return result; - } - - private static Map decodeSegmentMap(final Map map) { - Preconditions.checkNotNull(map); - return map.entrySet().stream().collect(Collectors.toMap(e -> decode(e.getKey()), Map.Entry::getValue)); - } -} +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.emc.pravega.stream.impl; + +import com.emc.pravega.common.netty.PravegaNodeUri; +import com.emc.pravega.controller.stream.api.v1.NodeUri; +import com.emc.pravega.controller.stream.api.v1.Position; +import com.emc.pravega.controller.stream.api.v1.ScalingPolicyType; +import com.emc.pravega.controller.stream.api.v1.SegmentId; +import com.emc.pravega.controller.stream.api.v1.StreamConfig; +import com.emc.pravega.controller.stream.api.v1.TxnId; +import com.emc.pravega.controller.stream.api.v1.TxnState; +import com.emc.pravega.stream.ScalingPolicy; +import com.emc.pravega.stream.Segment; +import com.emc.pravega.stream.StreamConfiguration; +import com.emc.pravega.stream.Transaction; +import com.google.common.base.Preconditions; + +import java.util.AbstractMap; +import java.util.AbstractMap.SimpleEntry; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.UUID; +import java.util.stream.Collectors; + +/** + * Provides translation (encode/decode) between the Model classes and its Thrift representation. + */ +public final class ModelHelper { + + public static final UUID encode(TxnId txnId) { + Preconditions.checkNotNull(txnId, "txnId"); + return new UUID(txnId.getHighBits(), txnId.getLowBits()); + } + + public static final TxnStatus encode(TxnState txnState) { + Preconditions.checkNotNull(txnState, "txnState"); + return TxnStatus.valueOf(txnState.name()); + } + + public static final Segment encode(final SegmentId segment) { + Preconditions.checkNotNull(segment, "Segment"); + return new Segment(segment.getScope(), segment.getStreamName(), segment.getNumber()); + } + + public static final ScalingPolicy encode(final com.emc.pravega.controller.stream.api.v1.ScalingPolicy policy) { + Preconditions.checkNotNull(policy, "ScalingPolicy"); + return new ScalingPolicy(ScalingPolicy.Type.valueOf(policy.getType().name()), policy.getTargetRate(), policy.getScaleFactor(), + policy.getMinNumSegments()); + } + + public static final StreamConfiguration encode(final StreamConfig config) { + Preconditions.checkNotNull(config, "StreamConfig"); + return new StreamConfigurationImpl(config.getScope(), + config.getName(), + encode(config.getPolicy())); + } + + public static final PositionImpl encode(final Position position) { + Preconditions.checkNotNull(position, "Position"); + return new PositionImpl(encodeSegmentMap(position.getOwnedSegments())); + } + + public static com.emc.pravega.common.netty.PravegaNodeUri encode(NodeUri uri) { + return new com.emc.pravega.common.netty.PravegaNodeUri(uri.getEndpoint(), uri.getPort()); + } + + public static List> encode(Map keyRanges) { + return keyRanges + .entrySet() + .stream() + .map(x -> new AbstractMap.SimpleEntry<>(x.getKey(), x.getValue())) + .collect(Collectors.toList()); + } + + public static Transaction.Status encode(TxnState status, String logString) { + switch (status) { + case COMMITTED: + return Transaction.Status.COMMITTED; + case ABORTED: + return Transaction.Status.ABORTED; + case OPEN: + return Transaction.Status.OPEN; + case SEALED: + return Transaction.Status.SEALED; + case UNKNOWN: + throw new RuntimeException("Unknown transaction: " + logString); + default: + throw new IllegalStateException("Unknown status: " + status); + } + } + + public static final TxnId decode(UUID txnId) { + Preconditions.checkNotNull(txnId, "txnId"); + return new TxnId(txnId.getMostSignificantBits(), txnId.getLeastSignificantBits()); + } + + public static final TxnState decode(TxnStatus txnStatus) { + Preconditions.checkNotNull(txnStatus, "txnStatus"); + return TxnState.valueOf(txnStatus.name()); + } + + public static final SegmentId decode(final Segment segment) { + Preconditions.checkNotNull(segment, "Segment"); + return new SegmentId().setScope(segment.getScope()).setStreamName(segment.getStreamName()) + .setNumber(segment.getSegmentNumber()); + + } + + public static final com.emc.pravega.controller.stream.api.v1.ScalingPolicy decode(final ScalingPolicy policyModel) { + Preconditions.checkNotNull(policyModel, "Policy"); + return new com.emc.pravega.controller.stream.api.v1.ScalingPolicy() + .setType(ScalingPolicyType.valueOf(policyModel.getType().name())).setTargetRate(policyModel.getTargetRate()) + .setScaleFactor(policyModel.getScaleFactor()).setMinNumSegments(policyModel.getMinNumSegments()); + } + + public static final StreamConfig decode(final StreamConfiguration configModel) { + Preconditions.checkNotNull(configModel, "StreamConfiguration"); + return new StreamConfig(configModel.getScope(), + configModel.getName(), + decode(configModel.getScalingPolicy())); + } + + public static final Position decode(final PositionInternal position) { + Preconditions.checkNotNull(position, "Position"); + return new Position(decodeSegmentMap(position.getOwnedSegmentsWithOffsets())); + } + + public static NodeUri decode(PravegaNodeUri uri) { + return new NodeUri(uri.getEndpoint(), uri.getPort()); + } + + public static final Map toSegmentOffsetMap(PositionInternal position) { + return position.getOwnedSegmentsWithOffsets() + .entrySet() + .stream() + .map(e -> new SimpleEntry<>(e.getKey().getSegmentNumber(), e.getValue())) + .collect(Collectors.toMap(Entry::getKey, Entry::getValue)); + } + + private static Map encodeSegmentMap(final Map map) { + Preconditions.checkNotNull(map); + HashMap result = new HashMap<>(); + for (Entry entry : map.entrySet()) { + result.put(encode(entry.getKey()), entry.getValue()); + } + return result; + } + + private static Map decodeSegmentMap(final Map map) { + Preconditions.checkNotNull(map); + return map.entrySet().stream().collect(Collectors.toMap(e -> decode(e.getKey()), Map.Entry::getValue)); + } +} diff --git a/clients/streaming/src/test/java/com/emc/pravega/state/examples/MembershipSynchronizer.java b/clients/streaming/src/test/java/com/emc/pravega/state/examples/MembershipSynchronizer.java index f07064928cd..4dfebe79471 100644 --- a/clients/streaming/src/test/java/com/emc/pravega/state/examples/MembershipSynchronizer.java +++ b/clients/streaming/src/test/java/com/emc/pravega/state/examples/MembershipSynchronizer.java @@ -1,247 +1,247 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more contributor license - * agreements. See the NOTICE file distributed with this work for additional information regarding - * copyright ownership. The ASF licenses this file to you 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.emc.pravega.state.examples; - -import com.emc.pravega.ClientFactory; -import com.emc.pravega.state.InitialUpdate; -import com.emc.pravega.state.Revision; -import com.emc.pravega.state.Revisioned; -import com.emc.pravega.state.StateSynchronizer; -import com.emc.pravega.state.Update; -import com.emc.pravega.stream.impl.JavaSerializer; -import com.google.common.base.Preconditions; -import com.google.common.util.concurrent.AbstractService; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.UUID; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.ScheduledFuture; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.stream.Collectors; - -import lombok.Data; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; - -@Slf4j -public class MembershipSynchronizer extends AbstractService { - - /** - * How frequently to update the segment using a heartbeat. - */ - private static final int UPDATE_INTERVAL_MILLIS = 1000; - - /** - * Number of intervals behind before switching to unconditional updates. - */ - private static final int UNCONDITIONAL_UPDATE_THRESHOLD = 3; - - /** - * Number of intervals behind before we should stop executing for safety. - */ - private static final int UNHEALTHY_THRESHOLD = 5; - - /** - * Number of intervals behind before another host should be considered dead. - */ - private static final int DEATH_THRESHOLD = 10; - - private final String instanceId = UUID.randomUUID().toString(); - - private final AtomicBoolean healthy = new AtomicBoolean(); - - private final ScheduledExecutorService executor; - - private final StateSynchronizer stateSync; - private final MembershipListener listener; - private ScheduledFuture task; - - MembershipSynchronizer(String streamName, ClientFactory manager, ScheduledExecutorService executor, - MembershipListener listener) { - Preconditions.checkNotNull(streamName); - Preconditions.checkNotNull(manager); - Preconditions.checkNotNull(listener); - this.executor = executor; - this.listener = listener; - stateSync = manager.createStateSynchronizer(streamName, - new JavaSerializer(), - new JavaSerializer(), - null); - } - - @Data - private static class LiveInstances - implements Revisioned, Comparable, Serializable, InitialUpdate { - private final String scopedStreamName; - private final Revision revision; - private final Map liveInstances; - private final long vectorTime; - - @Override - public int compareTo(LiveInstances o) { - return revision.compareTo(o.revision); - } - - @Override - public LiveInstances create(String scopedStreamName, Revision revision) { - return new LiveInstances(scopedStreamName, revision, liveInstances, vectorTime); - } - - public boolean isHealthy(String instance) { - long unhealthyThreshold = vectorTime - UNHEALTHY_THRESHOLD * liveInstances.size(); - Long time = liveInstances.get(instance); - return time == null || time >= unhealthyThreshold; - } - - /** - * If a host is behind in it's heartbeating it does not want to become unhealthy as it might - * need to halt execution. So it can use unconditional writes to updates itself more quickly - * by avoiding contention. - */ - public boolean isOverUnconditionalThreshold(String instance) { - long updateThreshold = vectorTime - UNCONDITIONAL_UPDATE_THRESHOLD * liveInstances.size(); - Long time = liveInstances.get(instance); - return time == null || time < updateThreshold; - } - - public List findInstancesThatWillDieBy(long vectorTime) { - long deathThreshold = vectorTime - DEATH_THRESHOLD * liveInstances.size(); - return liveInstances.entrySet() - .stream() - .filter(entry -> entry.getValue() < deathThreshold) - .map(entry -> entry.getKey()) - .collect(Collectors.toList()); - } - - public Set getLiveInstances() { - return liveInstances.keySet(); - } - } - - private class HeartBeater implements Runnable { - @Override - public void run() { - try { - stateSync.fetchUpdates(); - notifyListener(); - if (stateSync.getState().isOverUnconditionalThreshold(instanceId)) { - stateSync.updateState(state -> { - List result = new ArrayList<>(2); - long vectorTime = state.getVectorTime() + 1; - result.add(new HeartBeat(instanceId, vectorTime)); - for (String id : state.findInstancesThatWillDieBy(vectorTime)) { - if (!id.equals(instanceId)) { - result.add(new DeclareDead(id)); - } - } - return result; - }); - } else { - stateSync.updateStateUnconditionally(new HeartBeat(instanceId, stateSync.getState().vectorTime)); - stateSync.fetchUpdates(); - } - notifyListener(); - } catch (Exception e) { - log.warn("Encountered an error while heartbeating: " + e); - if (healthy.compareAndSet(true, false)) { - listener.unhealthy(); - } - } - } - } - - private abstract class HeartbeatUpdate implements Update, Serializable { - } - - @RequiredArgsConstructor - private final class HeartBeat extends HeartbeatUpdate { - private final String name; - private final long timestamp; - - @Override - public LiveInstances applyTo(LiveInstances state, Revision newRevision) { - Map timestamps = new HashMap<>(state.liveInstances); - long vectorTime = Long.max(timestamps.values().stream().max(Long::compare).get(), timestamp); - timestamps.put(name, timestamp); - return new LiveInstances(state.scopedStreamName, - newRevision, - Collections.unmodifiableMap(timestamps), - vectorTime); - } - } - - @RequiredArgsConstructor - private final class DeclareDead extends HeartbeatUpdate { - private final String name; - - @Override - public LiveInstances applyTo(LiveInstances state, Revision newRevision) { - Map timestamps = new HashMap<>(state.liveInstances); - timestamps.remove(name); - return new LiveInstances(state.scopedStreamName, - newRevision, - Collections.unmodifiableMap(timestamps), - state.vectorTime); - } - } - - public void notifyListener() { - LiveInstances currentState = stateSync.getState(); - if (currentState.isHealthy(instanceId)) { - if (healthy.compareAndSet(false, true)) { - listener.healthy(); - } - } else { - if (healthy.compareAndSet(true, false)) { - listener.unhealthy(); - } - } - } - - public boolean isCurrentlyHealthy() { - return healthy.get(); - } - - public Set getCurrentMembers() { - return stateSync.getState().getLiveInstances(); - } - - public interface MembershipListener { - void healthy(); - - void unhealthy(); - } - - @Override - protected void doStart() { - task = executor.scheduleAtFixedRate(new HeartBeater(), - UPDATE_INTERVAL_MILLIS, - UPDATE_INTERVAL_MILLIS, - TimeUnit.MILLISECONDS); - } - - @Override - protected void doStop() { - task.cancel(false); - } - -} +/** + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you 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.emc.pravega.state.examples; + +import com.emc.pravega.ClientFactory; +import com.emc.pravega.state.InitialUpdate; +import com.emc.pravega.state.Revision; +import com.emc.pravega.state.Revisioned; +import com.emc.pravega.state.StateSynchronizer; +import com.emc.pravega.state.Update; +import com.emc.pravega.stream.impl.JavaSerializer; +import com.google.common.base.Preconditions; +import com.google.common.util.concurrent.AbstractService; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.UUID; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.stream.Collectors; + +import lombok.Data; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; + +@Slf4j +public class MembershipSynchronizer extends AbstractService { + + /** + * How frequently to update the segment using a heartbeat. + */ + private static final int UPDATE_INTERVAL_MILLIS = 1000; + + /** + * Number of intervals behind before switching to unconditional updates. + */ + private static final int UNCONDITIONAL_UPDATE_THRESHOLD = 3; + + /** + * Number of intervals behind before we should stop executing for safety. + */ + private static final int UNHEALTHY_THRESHOLD = 5; + + /** + * Number of intervals behind before another host should be considered dead. + */ + private static final int DEATH_THRESHOLD = 10; + + private final String instanceId = UUID.randomUUID().toString(); + + private final AtomicBoolean healthy = new AtomicBoolean(); + + private final ScheduledExecutorService executor; + + private final StateSynchronizer stateSync; + private final MembershipListener listener; + private ScheduledFuture task; + + MembershipSynchronizer(String streamName, ClientFactory manager, ScheduledExecutorService executor, + MembershipListener listener) { + Preconditions.checkNotNull(streamName); + Preconditions.checkNotNull(manager); + Preconditions.checkNotNull(listener); + this.executor = executor; + this.listener = listener; + stateSync = manager.createStateSynchronizer(streamName, + new JavaSerializer(), + new JavaSerializer(), + null); + } + + @Data + private static class LiveInstances + implements Revisioned, Comparable, Serializable, InitialUpdate { + private final String scopedStreamName; + private final Revision revision; + private final Map liveInstances; + private final long vectorTime; + + @Override + public int compareTo(LiveInstances o) { + return revision.compareTo(o.revision); + } + + @Override + public LiveInstances create(String scopedStreamName, Revision revision) { + return new LiveInstances(scopedStreamName, revision, liveInstances, vectorTime); + } + + public boolean isHealthy(String instance) { + long unhealthyThreshold = vectorTime - UNHEALTHY_THRESHOLD * liveInstances.size(); + Long time = liveInstances.get(instance); + return time == null || time >= unhealthyThreshold; + } + + /** + * If a host is behind in it's heartbeating it does not want to become unhealthy as it might + * need to halt execution. So it can use unconditional writes to updates itself more quickly + * by avoiding contention. + */ + public boolean isOverUnconditionalThreshold(String instance) { + long updateThreshold = vectorTime - UNCONDITIONAL_UPDATE_THRESHOLD * liveInstances.size(); + Long time = liveInstances.get(instance); + return time == null || time < updateThreshold; + } + + public List findInstancesThatWillDieBy(long vectorTime) { + long deathThreshold = vectorTime - DEATH_THRESHOLD * liveInstances.size(); + return liveInstances.entrySet() + .stream() + .filter(entry -> entry.getValue() < deathThreshold) + .map(entry -> entry.getKey()) + .collect(Collectors.toList()); + } + + public Set getLiveInstances() { + return liveInstances.keySet(); + } + } + + private class HeartBeater implements Runnable { + @Override + public void run() { + try { + stateSync.fetchUpdates(); + notifyListener(); + if (stateSync.getState().isOverUnconditionalThreshold(instanceId)) { + stateSync.updateState(state -> { + List result = new ArrayList<>(2); + long vectorTime = state.getVectorTime() + 1; + result.add(new HeartBeat(instanceId, vectorTime)); + for (String id : state.findInstancesThatWillDieBy(vectorTime)) { + if (!id.equals(instanceId)) { + result.add(new DeclareDead(id)); + } + } + return result; + }); + } else { + stateSync.updateStateUnconditionally(new HeartBeat(instanceId, stateSync.getState().vectorTime)); + stateSync.fetchUpdates(); + } + notifyListener(); + } catch (Exception e) { + log.warn("Encountered an error while heartbeating: " + e); + if (healthy.compareAndSet(true, false)) { + listener.unhealthy(); + } + } + } + } + + private abstract class HeartbeatUpdate implements Update, Serializable { + } + + @RequiredArgsConstructor + private final class HeartBeat extends HeartbeatUpdate { + private final String name; + private final long timestamp; + + @Override + public LiveInstances applyTo(LiveInstances state, Revision newRevision) { + Map timestamps = new HashMap<>(state.liveInstances); + long vectorTime = Long.max(timestamps.values().stream().max(Long::compare).get(), timestamp); + timestamps.put(name, timestamp); + return new LiveInstances(state.scopedStreamName, + newRevision, + Collections.unmodifiableMap(timestamps), + vectorTime); + } + } + + @RequiredArgsConstructor + private final class DeclareDead extends HeartbeatUpdate { + private final String name; + + @Override + public LiveInstances applyTo(LiveInstances state, Revision newRevision) { + Map timestamps = new HashMap<>(state.liveInstances); + timestamps.remove(name); + return new LiveInstances(state.scopedStreamName, + newRevision, + Collections.unmodifiableMap(timestamps), + state.vectorTime); + } + } + + public void notifyListener() { + LiveInstances currentState = stateSync.getState(); + if (currentState.isHealthy(instanceId)) { + if (healthy.compareAndSet(false, true)) { + listener.healthy(); + } + } else { + if (healthy.compareAndSet(true, false)) { + listener.unhealthy(); + } + } + } + + public boolean isCurrentlyHealthy() { + return healthy.get(); + } + + public Set getCurrentMembers() { + return stateSync.getState().getLiveInstances(); + } + + public interface MembershipListener { + void healthy(); + + void unhealthy(); + } + + @Override + protected void doStart() { + task = executor.scheduleAtFixedRate(new HeartBeater(), + UPDATE_INTERVAL_MILLIS, + UPDATE_INTERVAL_MILLIS, + TimeUnit.MILLISECONDS); + } + + @Override + protected void doStop() { + task.cancel(false); + } + +} diff --git a/controller/contract/src/generated/gen-java/com/emc/pravega/controller/stream/api/v1/ControllerService.java b/controller/contract/src/generated/gen-java/com/emc/pravega/controller/stream/api/v1/ControllerService.java index e126ef3d4fb..a665c72bf8c 100644 --- a/controller/contract/src/generated/gen-java/com/emc/pravega/controller/stream/api/v1/ControllerService.java +++ b/controller/contract/src/generated/gen-java/com/emc/pravega/controller/stream/api/v1/ControllerService.java @@ -1,13603 +1,13603 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package com.emc.pravega.controller.stream.api.v1; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2017-01-28") -public class ControllerService { - - public interface Iface { - - public CreateStreamStatus createStream(StreamConfig streamConfig) throws org.apache.thrift.TException; - - public UpdateStreamStatus alterStream(StreamConfig streamConfig) throws org.apache.thrift.TException; - - public UpdateStreamStatus sealStream(String scope, String stream) throws org.apache.thrift.TException; - - public List getCurrentSegments(String scope, String stream) throws org.apache.thrift.TException; - - public List getPositions(String scope, String stream, long timestamp, int count) throws org.apache.thrift.TException; - - public Map> getSegmentsImmediatlyFollowing(SegmentId segment) throws org.apache.thrift.TException; - - public ScaleResponse scale(String scope, String stream, List sealedSegments, Map newKeyRanges, long scaleTimestamp) throws org.apache.thrift.TException; - - public NodeUri getURI(SegmentId segment) throws org.apache.thrift.TException; - - public boolean isSegmentValid(String scope, String stream, int segmentNumber) throws org.apache.thrift.TException; - - public TxnId createTransaction(String scope, String stream) throws org.apache.thrift.TException; - - public TxnStatus commitTransaction(String scope, String stream, TxnId txnid) throws org.apache.thrift.TException; - - public TxnStatus abortTransaction(String scope, String stream, TxnId txnid) throws org.apache.thrift.TException; - - public TxnState checkTransactionStatus(String scope, String stream, TxnId txnid) throws org.apache.thrift.TException; - - } - - public interface AsyncIface { - - public void createStream(StreamConfig streamConfig, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void alterStream(StreamConfig streamConfig, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void sealStream(String scope, String stream, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void getCurrentSegments(String scope, String stream, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void getPositions(String scope, String stream, long timestamp, int count, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void getSegmentsImmediatlyFollowing(SegmentId segment, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void scale(String scope, String stream, List sealedSegments, Map newKeyRanges, long scaleTimestamp, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void getURI(SegmentId segment, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void isSegmentValid(String scope, String stream, int segmentNumber, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void createTransaction(String scope, String stream, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void commitTransaction(String scope, String stream, TxnId txnid, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void abortTransaction(String scope, String stream, TxnId txnid, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void checkTransactionStatus(String scope, String stream, TxnId txnid, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - } - - public static class Client extends org.apache.thrift.TServiceClient implements Iface { - public static class Factory implements org.apache.thrift.TServiceClientFactory { - public Factory() {} - public Client getClient(org.apache.thrift.protocol.TProtocol prot) { - return new Client(prot); - } - public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { - return new Client(iprot, oprot); - } - } - - public Client(org.apache.thrift.protocol.TProtocol prot) - { - super(prot, prot); - } - - public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { - super(iprot, oprot); - } - - public CreateStreamStatus createStream(StreamConfig streamConfig) throws org.apache.thrift.TException - { - send_createStream(streamConfig); - return recv_createStream(); - } - - public void send_createStream(StreamConfig streamConfig) throws org.apache.thrift.TException - { - createStream_args args = new createStream_args(); - args.setStreamConfig(streamConfig); - sendBase("createStream", args); - } - - public CreateStreamStatus recv_createStream() throws org.apache.thrift.TException - { - createStream_result result = new createStream_result(); - receiveBase(result, "createStream"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "createStream failed: unknown result"); - } - - public UpdateStreamStatus alterStream(StreamConfig streamConfig) throws org.apache.thrift.TException - { - send_alterStream(streamConfig); - return recv_alterStream(); - } - - public void send_alterStream(StreamConfig streamConfig) throws org.apache.thrift.TException - { - alterStream_args args = new alterStream_args(); - args.setStreamConfig(streamConfig); - sendBase("alterStream", args); - } - - public UpdateStreamStatus recv_alterStream() throws org.apache.thrift.TException - { - alterStream_result result = new alterStream_result(); - receiveBase(result, "alterStream"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "alterStream failed: unknown result"); - } - - public UpdateStreamStatus sealStream(String scope, String stream) throws org.apache.thrift.TException - { - send_sealStream(scope, stream); - return recv_sealStream(); - } - - public void send_sealStream(String scope, String stream) throws org.apache.thrift.TException - { - sealStream_args args = new sealStream_args(); - args.setScope(scope); - args.setStream(stream); - sendBase("sealStream", args); - } - - public UpdateStreamStatus recv_sealStream() throws org.apache.thrift.TException - { - sealStream_result result = new sealStream_result(); - receiveBase(result, "sealStream"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "sealStream failed: unknown result"); - } - - public List getCurrentSegments(String scope, String stream) throws org.apache.thrift.TException - { - send_getCurrentSegments(scope, stream); - return recv_getCurrentSegments(); - } - - public void send_getCurrentSegments(String scope, String stream) throws org.apache.thrift.TException - { - getCurrentSegments_args args = new getCurrentSegments_args(); - args.setScope(scope); - args.setStream(stream); - sendBase("getCurrentSegments", args); - } - - public List recv_getCurrentSegments() throws org.apache.thrift.TException - { - getCurrentSegments_result result = new getCurrentSegments_result(); - receiveBase(result, "getCurrentSegments"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCurrentSegments failed: unknown result"); - } - - public List getPositions(String scope, String stream, long timestamp, int count) throws org.apache.thrift.TException - { - send_getPositions(scope, stream, timestamp, count); - return recv_getPositions(); - } - - public void send_getPositions(String scope, String stream, long timestamp, int count) throws org.apache.thrift.TException - { - getPositions_args args = new getPositions_args(); - args.setScope(scope); - args.setStream(stream); - args.setTimestamp(timestamp); - args.setCount(count); - sendBase("getPositions", args); - } - - public List recv_getPositions() throws org.apache.thrift.TException - { - getPositions_result result = new getPositions_result(); - receiveBase(result, "getPositions"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPositions failed: unknown result"); - } - - public Map> getSegmentsImmediatlyFollowing(SegmentId segment) throws org.apache.thrift.TException - { - send_getSegmentsImmediatlyFollowing(segment); - return recv_getSegmentsImmediatlyFollowing(); - } - - public void send_getSegmentsImmediatlyFollowing(SegmentId segment) throws org.apache.thrift.TException - { - getSegmentsImmediatlyFollowing_args args = new getSegmentsImmediatlyFollowing_args(); - args.setSegment(segment); - sendBase("getSegmentsImmediatlyFollowing", args); - } - - public Map> recv_getSegmentsImmediatlyFollowing() throws org.apache.thrift.TException - { - getSegmentsImmediatlyFollowing_result result = new getSegmentsImmediatlyFollowing_result(); - receiveBase(result, "getSegmentsImmediatlyFollowing"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getSegmentsImmediatlyFollowing failed: unknown result"); - } - - public ScaleResponse scale(String scope, String stream, List sealedSegments, Map newKeyRanges, long scaleTimestamp) throws org.apache.thrift.TException - { - send_scale(scope, stream, sealedSegments, newKeyRanges, scaleTimestamp); - return recv_scale(); - } - - public void send_scale(String scope, String stream, List sealedSegments, Map newKeyRanges, long scaleTimestamp) throws org.apache.thrift.TException - { - scale_args args = new scale_args(); - args.setScope(scope); - args.setStream(stream); - args.setSealedSegments(sealedSegments); - args.setNewKeyRanges(newKeyRanges); - args.setScaleTimestamp(scaleTimestamp); - sendBase("scale", args); - } - - public ScaleResponse recv_scale() throws org.apache.thrift.TException - { - scale_result result = new scale_result(); - receiveBase(result, "scale"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "scale failed: unknown result"); - } - - public NodeUri getURI(SegmentId segment) throws org.apache.thrift.TException - { - send_getURI(segment); - return recv_getURI(); - } - - public void send_getURI(SegmentId segment) throws org.apache.thrift.TException - { - getURI_args args = new getURI_args(); - args.setSegment(segment); - sendBase("getURI", args); - } - - public NodeUri recv_getURI() throws org.apache.thrift.TException - { - getURI_result result = new getURI_result(); - receiveBase(result, "getURI"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getURI failed: unknown result"); - } - - public boolean isSegmentValid(String scope, String stream, int segmentNumber) throws org.apache.thrift.TException - { - send_isSegmentValid(scope, stream, segmentNumber); - return recv_isSegmentValid(); - } - - public void send_isSegmentValid(String scope, String stream, int segmentNumber) throws org.apache.thrift.TException - { - isSegmentValid_args args = new isSegmentValid_args(); - args.setScope(scope); - args.setStream(stream); - args.setSegmentNumber(segmentNumber); - sendBase("isSegmentValid", args); - } - - public boolean recv_isSegmentValid() throws org.apache.thrift.TException - { - isSegmentValid_result result = new isSegmentValid_result(); - receiveBase(result, "isSegmentValid"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "isSegmentValid failed: unknown result"); - } - - public TxnId createTransaction(String scope, String stream) throws org.apache.thrift.TException - { - send_createTransaction(scope, stream); - return recv_createTransaction(); - } - - public void send_createTransaction(String scope, String stream) throws org.apache.thrift.TException - { - createTransaction_args args = new createTransaction_args(); - args.setScope(scope); - args.setStream(stream); - sendBase("createTransaction", args); - } - - public TxnId recv_createTransaction() throws org.apache.thrift.TException - { - createTransaction_result result = new createTransaction_result(); - receiveBase(result, "createTransaction"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "createTransaction failed: unknown result"); - } - - public TxnStatus commitTransaction(String scope, String stream, TxnId txnid) throws org.apache.thrift.TException - { - send_commitTransaction(scope, stream, txnid); - return recv_commitTransaction(); - } - - public void send_commitTransaction(String scope, String stream, TxnId txnid) throws org.apache.thrift.TException - { - commitTransaction_args args = new commitTransaction_args(); - args.setScope(scope); - args.setStream(stream); - args.setTxnid(txnid); - sendBase("commitTransaction", args); - } - - public TxnStatus recv_commitTransaction() throws org.apache.thrift.TException - { - commitTransaction_result result = new commitTransaction_result(); - receiveBase(result, "commitTransaction"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "commitTransaction failed: unknown result"); - } - - public TxnStatus abortTransaction(String scope, String stream, TxnId txnid) throws org.apache.thrift.TException - { - send_abortTransaction(scope, stream, txnid); - return recv_abortTransaction(); - } - - public void send_abortTransaction(String scope, String stream, TxnId txnid) throws org.apache.thrift.TException - { - abortTransaction_args args = new abortTransaction_args(); - args.setScope(scope); - args.setStream(stream); - args.setTxnid(txnid); - sendBase("abortTransaction", args); - } - - public TxnStatus recv_abortTransaction() throws org.apache.thrift.TException - { - abortTransaction_result result = new abortTransaction_result(); - receiveBase(result, "abortTransaction"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "abortTransaction failed: unknown result"); - } - - public TxnState checkTransactionStatus(String scope, String stream, TxnId txnid) throws org.apache.thrift.TException - { - send_checkTransactionStatus(scope, stream, txnid); - return recv_checkTransactionStatus(); - } - - public void send_checkTransactionStatus(String scope, String stream, TxnId txnid) throws org.apache.thrift.TException - { - checkTransactionStatus_args args = new checkTransactionStatus_args(); - args.setScope(scope); - args.setStream(stream); - args.setTxnid(txnid); - sendBase("checkTransactionStatus", args); - } - - public TxnState recv_checkTransactionStatus() throws org.apache.thrift.TException - { - checkTransactionStatus_result result = new checkTransactionStatus_result(); - receiveBase(result, "checkTransactionStatus"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "checkTransactionStatus failed: unknown result"); - } - - } - public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface { - public static class Factory implements org.apache.thrift.async.TAsyncClientFactory { - private org.apache.thrift.async.TAsyncClientManager clientManager; - private org.apache.thrift.protocol.TProtocolFactory protocolFactory; - public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) { - this.clientManager = clientManager; - this.protocolFactory = protocolFactory; - } - public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) { - return new AsyncClient(protocolFactory, clientManager, transport); - } - } - - public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) { - super(protocolFactory, clientManager, transport); - } - - public void createStream(StreamConfig streamConfig, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - createStream_call method_call = new createStream_call(streamConfig, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class createStream_call extends org.apache.thrift.async.TAsyncMethodCall { - private StreamConfig streamConfig; - public createStream_call(StreamConfig streamConfig, 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.streamConfig = streamConfig; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createStream", org.apache.thrift.protocol.TMessageType.CALL, 0)); - createStream_args args = new createStream_args(); - args.setStreamConfig(streamConfig); - args.write(prot); - prot.writeMessageEnd(); - } - - public CreateStreamStatus getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new 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_createStream(); - } - } - - public void alterStream(StreamConfig streamConfig, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - alterStream_call method_call = new alterStream_call(streamConfig, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class alterStream_call extends org.apache.thrift.async.TAsyncMethodCall { - private StreamConfig streamConfig; - public alterStream_call(StreamConfig streamConfig, 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.streamConfig = streamConfig; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("alterStream", org.apache.thrift.protocol.TMessageType.CALL, 0)); - alterStream_args args = new alterStream_args(); - args.setStreamConfig(streamConfig); - args.write(prot); - prot.writeMessageEnd(); - } - - public UpdateStreamStatus getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new 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_alterStream(); - } - } - - public void sealStream(String scope, String stream, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - sealStream_call method_call = new sealStream_call(scope, stream, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class sealStream_call extends org.apache.thrift.async.TAsyncMethodCall { - private String scope; - private String stream; - public sealStream_call(String scope, String stream, 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.scope = scope; - this.stream = stream; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("sealStream", org.apache.thrift.protocol.TMessageType.CALL, 0)); - sealStream_args args = new sealStream_args(); - args.setScope(scope); - args.setStream(stream); - args.write(prot); - prot.writeMessageEnd(); - } - - public UpdateStreamStatus getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new 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_sealStream(); - } - } - - public void getCurrentSegments(String scope, String stream, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - getCurrentSegments_call method_call = new getCurrentSegments_call(scope, stream, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class getCurrentSegments_call extends org.apache.thrift.async.TAsyncMethodCall { - private String scope; - private String stream; - public getCurrentSegments_call(String scope, String stream, 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.scope = scope; - this.stream = stream; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCurrentSegments", org.apache.thrift.protocol.TMessageType.CALL, 0)); - getCurrentSegments_args args = new getCurrentSegments_args(); - args.setScope(scope); - args.setStream(stream); - args.write(prot); - prot.writeMessageEnd(); - } - - public List getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new 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_getCurrentSegments(); - } - } - - public void getPositions(String scope, String stream, long timestamp, int count, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - getPositions_call method_call = new getPositions_call(scope, stream, timestamp, count, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class getPositions_call extends org.apache.thrift.async.TAsyncMethodCall { - private String scope; - private String stream; - private long timestamp; - private int count; - public getPositions_call(String scope, String stream, long timestamp, int count, 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.scope = scope; - this.stream = stream; - this.timestamp = timestamp; - this.count = count; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPositions", org.apache.thrift.protocol.TMessageType.CALL, 0)); - getPositions_args args = new getPositions_args(); - args.setScope(scope); - args.setStream(stream); - args.setTimestamp(timestamp); - args.setCount(count); - args.write(prot); - prot.writeMessageEnd(); - } - - public List getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new 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_getPositions(); - } - } - - public void getSegmentsImmediatlyFollowing(SegmentId segment, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - getSegmentsImmediatlyFollowing_call method_call = new getSegmentsImmediatlyFollowing_call(segment, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class getSegmentsImmediatlyFollowing_call extends org.apache.thrift.async.TAsyncMethodCall { - private SegmentId segment; - public getSegmentsImmediatlyFollowing_call(SegmentId segment, 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.segment = segment; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getSegmentsImmediatlyFollowing", org.apache.thrift.protocol.TMessageType.CALL, 0)); - getSegmentsImmediatlyFollowing_args args = new getSegmentsImmediatlyFollowing_args(); - args.setSegment(segment); - args.write(prot); - prot.writeMessageEnd(); - } - - public Map> getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new 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_getSegmentsImmediatlyFollowing(); - } - } - - public void scale(String scope, String stream, List sealedSegments, Map newKeyRanges, long scaleTimestamp, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - scale_call method_call = new scale_call(scope, stream, sealedSegments, newKeyRanges, scaleTimestamp, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class scale_call extends org.apache.thrift.async.TAsyncMethodCall { - private String scope; - private String stream; - private List sealedSegments; - private Map newKeyRanges; - private long scaleTimestamp; - public scale_call(String scope, String stream, List sealedSegments, Map newKeyRanges, long scaleTimestamp, 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.scope = scope; - this.stream = stream; - this.sealedSegments = sealedSegments; - this.newKeyRanges = newKeyRanges; - this.scaleTimestamp = scaleTimestamp; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("scale", org.apache.thrift.protocol.TMessageType.CALL, 0)); - scale_args args = new scale_args(); - args.setScope(scope); - args.setStream(stream); - args.setSealedSegments(sealedSegments); - args.setNewKeyRanges(newKeyRanges); - args.setScaleTimestamp(scaleTimestamp); - args.write(prot); - prot.writeMessageEnd(); - } - - public ScaleResponse getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new 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_scale(); - } - } - - public void getURI(SegmentId segment, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - getURI_call method_call = new getURI_call(segment, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class getURI_call extends org.apache.thrift.async.TAsyncMethodCall { - private SegmentId segment; - public getURI_call(SegmentId segment, 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.segment = segment; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getURI", org.apache.thrift.protocol.TMessageType.CALL, 0)); - getURI_args args = new getURI_args(); - args.setSegment(segment); - args.write(prot); - prot.writeMessageEnd(); - } - - public NodeUri getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new 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_getURI(); - } - } - - public void isSegmentValid(String scope, String stream, int segmentNumber, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - isSegmentValid_call method_call = new isSegmentValid_call(scope, stream, segmentNumber, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class isSegmentValid_call extends org.apache.thrift.async.TAsyncMethodCall { - private String scope; - private String stream; - private int segmentNumber; - public isSegmentValid_call(String scope, String stream, int segmentNumber, 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.scope = scope; - this.stream = stream; - this.segmentNumber = segmentNumber; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("isSegmentValid", org.apache.thrift.protocol.TMessageType.CALL, 0)); - isSegmentValid_args args = new isSegmentValid_args(); - args.setScope(scope); - args.setStream(stream); - args.setSegmentNumber(segmentNumber); - args.write(prot); - prot.writeMessageEnd(); - } - - public boolean getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new 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_isSegmentValid(); - } - } - - public void createTransaction(String scope, String stream, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - createTransaction_call method_call = new createTransaction_call(scope, stream, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class createTransaction_call extends org.apache.thrift.async.TAsyncMethodCall { - private String scope; - private String stream; - public createTransaction_call(String scope, String stream, 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.scope = scope; - this.stream = stream; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createTransaction", org.apache.thrift.protocol.TMessageType.CALL, 0)); - createTransaction_args args = new createTransaction_args(); - args.setScope(scope); - args.setStream(stream); - args.write(prot); - prot.writeMessageEnd(); - } - - public TxnId getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new 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_createTransaction(); - } - } - - public void commitTransaction(String scope, String stream, TxnId txnid, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - commitTransaction_call method_call = new commitTransaction_call(scope, stream, txnid, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class commitTransaction_call extends org.apache.thrift.async.TAsyncMethodCall { - private String scope; - private String stream; - private TxnId txnid; - public commitTransaction_call(String scope, String stream, TxnId txnid, 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.scope = scope; - this.stream = stream; - this.txnid = txnid; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("commitTransaction", org.apache.thrift.protocol.TMessageType.CALL, 0)); - commitTransaction_args args = new commitTransaction_args(); - args.setScope(scope); - args.setStream(stream); - args.setTxnid(txnid); - args.write(prot); - prot.writeMessageEnd(); - } - - public TxnStatus getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new 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_commitTransaction(); - } - } - - public void abortTransaction(String scope, String stream, TxnId txnid, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - abortTransaction_call method_call = new abortTransaction_call(scope, stream, txnid, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class abortTransaction_call extends org.apache.thrift.async.TAsyncMethodCall { - private String scope; - private String stream; - private TxnId txnid; - public abortTransaction_call(String scope, String stream, TxnId txnid, 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.scope = scope; - this.stream = stream; - this.txnid = txnid; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("abortTransaction", org.apache.thrift.protocol.TMessageType.CALL, 0)); - abortTransaction_args args = new abortTransaction_args(); - args.setScope(scope); - args.setStream(stream); - args.setTxnid(txnid); - args.write(prot); - prot.writeMessageEnd(); - } - - public TxnStatus getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new 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_abortTransaction(); - } - } - - public void checkTransactionStatus(String scope, String stream, TxnId txnid, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - checkTransactionStatus_call method_call = new checkTransactionStatus_call(scope, stream, txnid, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class checkTransactionStatus_call extends org.apache.thrift.async.TAsyncMethodCall { - private String scope; - private String stream; - private TxnId txnid; - public checkTransactionStatus_call(String scope, String stream, TxnId txnid, 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.scope = scope; - this.stream = stream; - this.txnid = txnid; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("checkTransactionStatus", org.apache.thrift.protocol.TMessageType.CALL, 0)); - checkTransactionStatus_args args = new checkTransactionStatus_args(); - args.setScope(scope); - args.setStream(stream); - args.setTxnid(txnid); - args.write(prot); - prot.writeMessageEnd(); - } - - public TxnState getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new 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_checkTransactionStatus(); - } - } - - } - - public static class Processor extends org.apache.thrift.TBaseProcessor implements org.apache.thrift.TProcessor { - private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName()); - public Processor(I iface) { - super(iface, getProcessMap(new HashMap>())); - } - - protected Processor(I iface, Map> processMap) { - super(iface, getProcessMap(processMap)); - } - - private static Map> getProcessMap(Map> processMap) { - processMap.put("createStream", new createStream()); - processMap.put("alterStream", new alterStream()); - processMap.put("sealStream", new sealStream()); - processMap.put("getCurrentSegments", new getCurrentSegments()); - processMap.put("getPositions", new getPositions()); - processMap.put("getSegmentsImmediatlyFollowing", new getSegmentsImmediatlyFollowing()); - processMap.put("scale", new scale()); - processMap.put("getURI", new getURI()); - processMap.put("isSegmentValid", new isSegmentValid()); - processMap.put("createTransaction", new createTransaction()); - processMap.put("commitTransaction", new commitTransaction()); - processMap.put("abortTransaction", new abortTransaction()); - processMap.put("checkTransactionStatus", new checkTransactionStatus()); - return processMap; - } - - public static class createStream extends org.apache.thrift.ProcessFunction { - public createStream() { - super("createStream"); - } - - public createStream_args getEmptyArgsInstance() { - return new createStream_args(); - } - - protected boolean isOneway() { - return false; - } - - public createStream_result getResult(I iface, createStream_args args) throws org.apache.thrift.TException { - createStream_result result = new createStream_result(); - result.success = iface.createStream(args.streamConfig); - return result; - } - } - - public static class alterStream extends org.apache.thrift.ProcessFunction { - public alterStream() { - super("alterStream"); - } - - public alterStream_args getEmptyArgsInstance() { - return new alterStream_args(); - } - - protected boolean isOneway() { - return false; - } - - public alterStream_result getResult(I iface, alterStream_args args) throws org.apache.thrift.TException { - alterStream_result result = new alterStream_result(); - result.success = iface.alterStream(args.streamConfig); - return result; - } - } - - public static class sealStream extends org.apache.thrift.ProcessFunction { - public sealStream() { - super("sealStream"); - } - - public sealStream_args getEmptyArgsInstance() { - return new sealStream_args(); - } - - protected boolean isOneway() { - return false; - } - - public sealStream_result getResult(I iface, sealStream_args args) throws org.apache.thrift.TException { - sealStream_result result = new sealStream_result(); - result.success = iface.sealStream(args.scope, args.stream); - return result; - } - } - - public static class getCurrentSegments extends org.apache.thrift.ProcessFunction { - public getCurrentSegments() { - super("getCurrentSegments"); - } - - public getCurrentSegments_args getEmptyArgsInstance() { - return new getCurrentSegments_args(); - } - - protected boolean isOneway() { - return false; - } - - public getCurrentSegments_result getResult(I iface, getCurrentSegments_args args) throws org.apache.thrift.TException { - getCurrentSegments_result result = new getCurrentSegments_result(); - result.success = iface.getCurrentSegments(args.scope, args.stream); - return result; - } - } - - public static class getPositions extends org.apache.thrift.ProcessFunction { - public getPositions() { - super("getPositions"); - } - - public getPositions_args getEmptyArgsInstance() { - return new getPositions_args(); - } - - protected boolean isOneway() { - return false; - } - - public getPositions_result getResult(I iface, getPositions_args args) throws org.apache.thrift.TException { - getPositions_result result = new getPositions_result(); - result.success = iface.getPositions(args.scope, args.stream, args.timestamp, args.count); - return result; - } - } - - public static class getSegmentsImmediatlyFollowing extends org.apache.thrift.ProcessFunction { - public getSegmentsImmediatlyFollowing() { - super("getSegmentsImmediatlyFollowing"); - } - - public getSegmentsImmediatlyFollowing_args getEmptyArgsInstance() { - return new getSegmentsImmediatlyFollowing_args(); - } - - protected boolean isOneway() { - return false; - } - - public getSegmentsImmediatlyFollowing_result getResult(I iface, getSegmentsImmediatlyFollowing_args args) throws org.apache.thrift.TException { - getSegmentsImmediatlyFollowing_result result = new getSegmentsImmediatlyFollowing_result(); - result.success = iface.getSegmentsImmediatlyFollowing(args.segment); - return result; - } - } - - public static class scale extends org.apache.thrift.ProcessFunction { - public scale() { - super("scale"); - } - - public scale_args getEmptyArgsInstance() { - return new scale_args(); - } - - protected boolean isOneway() { - return false; - } - - public scale_result getResult(I iface, scale_args args) throws org.apache.thrift.TException { - scale_result result = new scale_result(); - result.success = iface.scale(args.scope, args.stream, args.sealedSegments, args.newKeyRanges, args.scaleTimestamp); - return result; - } - } - - public static class getURI extends org.apache.thrift.ProcessFunction { - public getURI() { - super("getURI"); - } - - public getURI_args getEmptyArgsInstance() { - return new getURI_args(); - } - - protected boolean isOneway() { - return false; - } - - public getURI_result getResult(I iface, getURI_args args) throws org.apache.thrift.TException { - getURI_result result = new getURI_result(); - result.success = iface.getURI(args.segment); - return result; - } - } - - public static class isSegmentValid extends org.apache.thrift.ProcessFunction { - public isSegmentValid() { - super("isSegmentValid"); - } - - public isSegmentValid_args getEmptyArgsInstance() { - return new isSegmentValid_args(); - } - - protected boolean isOneway() { - return false; - } - - public isSegmentValid_result getResult(I iface, isSegmentValid_args args) throws org.apache.thrift.TException { - isSegmentValid_result result = new isSegmentValid_result(); - result.success = iface.isSegmentValid(args.scope, args.stream, args.segmentNumber); - result.setSuccessIsSet(true); - return result; - } - } - - public static class createTransaction extends org.apache.thrift.ProcessFunction { - public createTransaction() { - super("createTransaction"); - } - - public createTransaction_args getEmptyArgsInstance() { - return new createTransaction_args(); - } - - protected boolean isOneway() { - return false; - } - - public createTransaction_result getResult(I iface, createTransaction_args args) throws org.apache.thrift.TException { - createTransaction_result result = new createTransaction_result(); - result.success = iface.createTransaction(args.scope, args.stream); - return result; - } - } - - public static class commitTransaction extends org.apache.thrift.ProcessFunction { - public commitTransaction() { - super("commitTransaction"); - } - - public commitTransaction_args getEmptyArgsInstance() { - return new commitTransaction_args(); - } - - protected boolean isOneway() { - return false; - } - - public commitTransaction_result getResult(I iface, commitTransaction_args args) throws org.apache.thrift.TException { - commitTransaction_result result = new commitTransaction_result(); - result.success = iface.commitTransaction(args.scope, args.stream, args.txnid); - return result; - } - } - - public static class abortTransaction extends org.apache.thrift.ProcessFunction { - public abortTransaction() { - super("abortTransaction"); - } - - public abortTransaction_args getEmptyArgsInstance() { - return new abortTransaction_args(); - } - - protected boolean isOneway() { - return false; - } - - public abortTransaction_result getResult(I iface, abortTransaction_args args) throws org.apache.thrift.TException { - abortTransaction_result result = new abortTransaction_result(); - result.success = iface.abortTransaction(args.scope, args.stream, args.txnid); - return result; - } - } - - public static class checkTransactionStatus extends org.apache.thrift.ProcessFunction { - public checkTransactionStatus() { - super("checkTransactionStatus"); - } - - public checkTransactionStatus_args getEmptyArgsInstance() { - return new checkTransactionStatus_args(); - } - - protected boolean isOneway() { - return false; - } - - public checkTransactionStatus_result getResult(I iface, checkTransactionStatus_args args) throws org.apache.thrift.TException { - checkTransactionStatus_result result = new checkTransactionStatus_result(); - result.success = iface.checkTransactionStatus(args.scope, args.stream, args.txnid); - return result; - } - } - - } - - public static class AsyncProcessor extends org.apache.thrift.TBaseAsyncProcessor { - private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName()); - public AsyncProcessor(I iface) { - super(iface, getProcessMap(new HashMap>())); - } - - protected AsyncProcessor(I iface, Map> processMap) { - super(iface, getProcessMap(processMap)); - } - - private static Map> getProcessMap(Map> processMap) { - processMap.put("createStream", new createStream()); - processMap.put("alterStream", new alterStream()); - processMap.put("sealStream", new sealStream()); - processMap.put("getCurrentSegments", new getCurrentSegments()); - processMap.put("getPositions", new getPositions()); - processMap.put("getSegmentsImmediatlyFollowing", new getSegmentsImmediatlyFollowing()); - processMap.put("scale", new scale()); - processMap.put("getURI", new getURI()); - processMap.put("isSegmentValid", new isSegmentValid()); - processMap.put("createTransaction", new createTransaction()); - processMap.put("commitTransaction", new commitTransaction()); - processMap.put("abortTransaction", new abortTransaction()); - processMap.put("checkTransactionStatus", new checkTransactionStatus()); - return processMap; - } - - public static class createStream extends org.apache.thrift.AsyncProcessFunction { - public createStream() { - super("createStream"); - } - - public createStream_args getEmptyArgsInstance() { - return new createStream_args(); - } - - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(CreateStreamStatus o) { - createStream_result result = new createStream_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - createStream_result result = new createStream_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, createStream_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.createStream(args.streamConfig,resultHandler); - } - } - - public static class alterStream extends org.apache.thrift.AsyncProcessFunction { - public alterStream() { - super("alterStream"); - } - - public alterStream_args getEmptyArgsInstance() { - return new alterStream_args(); - } - - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(UpdateStreamStatus o) { - alterStream_result result = new alterStream_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - alterStream_result result = new alterStream_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, alterStream_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.alterStream(args.streamConfig,resultHandler); - } - } - - public static class sealStream extends org.apache.thrift.AsyncProcessFunction { - public sealStream() { - super("sealStream"); - } - - public sealStream_args getEmptyArgsInstance() { - return new sealStream_args(); - } - - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(UpdateStreamStatus o) { - sealStream_result result = new sealStream_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - sealStream_result result = new sealStream_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, sealStream_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.sealStream(args.scope, args.stream,resultHandler); - } - } - - public static class getCurrentSegments extends org.apache.thrift.AsyncProcessFunction> { - public getCurrentSegments() { - super("getCurrentSegments"); - } - - public getCurrentSegments_args getEmptyArgsInstance() { - return new getCurrentSegments_args(); - } - - public AsyncMethodCallback> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback>() { - public void onComplete(List o) { - getCurrentSegments_result result = new getCurrentSegments_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - getCurrentSegments_result result = new getCurrentSegments_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, getCurrentSegments_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws TException { - iface.getCurrentSegments(args.scope, args.stream,resultHandler); - } - } - - public static class getPositions extends org.apache.thrift.AsyncProcessFunction> { - public getPositions() { - super("getPositions"); - } - - public getPositions_args getEmptyArgsInstance() { - return new getPositions_args(); - } - - public AsyncMethodCallback> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback>() { - public void onComplete(List o) { - getPositions_result result = new getPositions_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - getPositions_result result = new getPositions_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, getPositions_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws TException { - iface.getPositions(args.scope, args.stream, args.timestamp, args.count,resultHandler); - } - } - - public static class getSegmentsImmediatlyFollowing extends org.apache.thrift.AsyncProcessFunction>> { - public getSegmentsImmediatlyFollowing() { - super("getSegmentsImmediatlyFollowing"); - } - - public getSegmentsImmediatlyFollowing_args getEmptyArgsInstance() { - return new getSegmentsImmediatlyFollowing_args(); - } - - public AsyncMethodCallback>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback>>() { - public void onComplete(Map> o) { - getSegmentsImmediatlyFollowing_result result = new getSegmentsImmediatlyFollowing_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - getSegmentsImmediatlyFollowing_result result = new getSegmentsImmediatlyFollowing_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, getSegmentsImmediatlyFollowing_args args, org.apache.thrift.async.AsyncMethodCallback>> resultHandler) throws TException { - iface.getSegmentsImmediatlyFollowing(args.segment,resultHandler); - } - } - - public static class scale extends org.apache.thrift.AsyncProcessFunction { - public scale() { - super("scale"); - } - - public scale_args getEmptyArgsInstance() { - return new scale_args(); - } - - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(ScaleResponse o) { - scale_result result = new scale_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - scale_result result = new scale_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, scale_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.scale(args.scope, args.stream, args.sealedSegments, args.newKeyRanges, args.scaleTimestamp,resultHandler); - } - } - - public static class getURI extends org.apache.thrift.AsyncProcessFunction { - public getURI() { - super("getURI"); - } - - public getURI_args getEmptyArgsInstance() { - return new getURI_args(); - } - - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(NodeUri o) { - getURI_result result = new getURI_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - getURI_result result = new getURI_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, getURI_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.getURI(args.segment,resultHandler); - } - } - - public static class isSegmentValid extends org.apache.thrift.AsyncProcessFunction { - public isSegmentValid() { - super("isSegmentValid"); - } - - public isSegmentValid_args getEmptyArgsInstance() { - return new isSegmentValid_args(); - } - - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(Boolean o) { - isSegmentValid_result result = new isSegmentValid_result(); - result.success = o; - result.setSuccessIsSet(true); - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - isSegmentValid_result result = new isSegmentValid_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, isSegmentValid_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.isSegmentValid(args.scope, args.stream, args.segmentNumber,resultHandler); - } - } - - public static class createTransaction extends org.apache.thrift.AsyncProcessFunction { - public createTransaction() { - super("createTransaction"); - } - - public createTransaction_args getEmptyArgsInstance() { - return new createTransaction_args(); - } - - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(TxnId o) { - createTransaction_result result = new createTransaction_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - createTransaction_result result = new createTransaction_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, createTransaction_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.createTransaction(args.scope, args.stream,resultHandler); - } - } - - public static class commitTransaction extends org.apache.thrift.AsyncProcessFunction { - public commitTransaction() { - super("commitTransaction"); - } - - public commitTransaction_args getEmptyArgsInstance() { - return new commitTransaction_args(); - } - - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(TxnStatus o) { - commitTransaction_result result = new commitTransaction_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - commitTransaction_result result = new commitTransaction_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, commitTransaction_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.commitTransaction(args.scope, args.stream, args.txnid,resultHandler); - } - } - - public static class abortTransaction extends org.apache.thrift.AsyncProcessFunction { - public abortTransaction() { - super("abortTransaction"); - } - - public abortTransaction_args getEmptyArgsInstance() { - return new abortTransaction_args(); - } - - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(TxnStatus o) { - abortTransaction_result result = new abortTransaction_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - abortTransaction_result result = new abortTransaction_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, abortTransaction_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.abortTransaction(args.scope, args.stream, args.txnid,resultHandler); - } - } - - public static class checkTransactionStatus extends org.apache.thrift.AsyncProcessFunction { - public checkTransactionStatus() { - super("checkTransactionStatus"); - } - - public checkTransactionStatus_args getEmptyArgsInstance() { - return new checkTransactionStatus_args(); - } - - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(TxnState o) { - checkTransactionStatus_result result = new checkTransactionStatus_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - checkTransactionStatus_result result = new checkTransactionStatus_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, checkTransactionStatus_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.checkTransactionStatus(args.scope, args.stream, args.txnid,resultHandler); - } - } - - } - - public static class createStream_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("createStream_args"); - - private static final org.apache.thrift.protocol.TField STREAM_CONFIG_FIELD_DESC = new org.apache.thrift.protocol.TField("streamConfig", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new createStream_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new createStream_argsTupleSchemeFactory()); - } - - private StreamConfig streamConfig; // 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 { - STREAM_CONFIG((short)1, "streamConfig"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STREAM_CONFIG - return STREAM_CONFIG; - 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 IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.STREAM_CONFIG, new org.apache.thrift.meta_data.FieldMetaData("streamConfig", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, StreamConfig.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createStream_args.class, metaDataMap); - } - - public createStream_args() { - } - - public createStream_args( - StreamConfig streamConfig) - { - this(); - this.streamConfig = streamConfig; - } - - /** - * Performs a deep copy on other. - */ - public createStream_args(createStream_args other) { - if (other.isSetStreamConfig()) { - this.streamConfig = new StreamConfig(other.streamConfig); - } - } - - public createStream_args deepCopy() { - return new createStream_args(this); - } - - @Override - public void clear() { - this.streamConfig = null; - } - - public StreamConfig getStreamConfig() { - return this.streamConfig; - } - - public createStream_args setStreamConfig(StreamConfig streamConfig) { - this.streamConfig = streamConfig; - return this; - } - - public void unsetStreamConfig() { - this.streamConfig = null; - } - - /** Returns true if field streamConfig is set (has been assigned a value) and false otherwise */ - public boolean isSetStreamConfig() { - return this.streamConfig != null; - } - - public void setStreamConfigIsSet(boolean value) { - if (!value) { - this.streamConfig = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case STREAM_CONFIG: - if (value == null) { - unsetStreamConfig(); - } else { - setStreamConfig((StreamConfig)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case STREAM_CONFIG: - return getStreamConfig(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case STREAM_CONFIG: - return isSetStreamConfig(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof createStream_args) - return this.equals((createStream_args)that); - return false; - } - - public boolean equals(createStream_args that) { - if (that == null) - return false; - - boolean this_present_streamConfig = true && this.isSetStreamConfig(); - boolean that_present_streamConfig = true && that.isSetStreamConfig(); - if (this_present_streamConfig || that_present_streamConfig) { - if (!(this_present_streamConfig && that_present_streamConfig)) - return false; - if (!this.streamConfig.equals(that.streamConfig)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_streamConfig = true && (isSetStreamConfig()); - list.add(present_streamConfig); - if (present_streamConfig) - list.add(streamConfig); - - return list.hashCode(); - } - - @Override - public int compareTo(createStream_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetStreamConfig()).compareTo(other.isSetStreamConfig()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStreamConfig()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.streamConfig, other.streamConfig); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("createStream_args("); - boolean first = true; - - sb.append("streamConfig:"); - if (this.streamConfig == null) { - sb.append("null"); - } else { - sb.append(this.streamConfig); - } - 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 (streamConfig != null) { - streamConfig.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, 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 createStream_argsStandardSchemeFactory implements SchemeFactory { - public createStream_argsStandardScheme getScheme() { - return new createStream_argsStandardScheme(); - } - } - - private static class createStream_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, createStream_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: // STREAM_CONFIG - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.streamConfig = new StreamConfig(); - struct.streamConfig.read(iprot); - struct.setStreamConfigIsSet(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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, createStream_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.streamConfig != null) { - oprot.writeFieldBegin(STREAM_CONFIG_FIELD_DESC); - struct.streamConfig.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class createStream_argsTupleSchemeFactory implements SchemeFactory { - public createStream_argsTupleScheme getScheme() { - return new createStream_argsTupleScheme(); - } - } - - private static class createStream_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, createStream_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetStreamConfig()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetStreamConfig()) { - struct.streamConfig.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, createStream_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.streamConfig = new StreamConfig(); - struct.streamConfig.read(iprot); - struct.setStreamConfigIsSet(true); - } - } - } - - } - - public static class createStream_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("createStream_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new createStream_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new createStream_resultTupleSchemeFactory()); - } - - private CreateStreamStatus success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - /** - * - * @see CreateStreamStatus - */ - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new 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.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, CreateStreamStatus.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createStream_result.class, metaDataMap); - } - - public createStream_result() { - } - - public createStream_result( - CreateStreamStatus success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public createStream_result(createStream_result other) { - if (other.isSetSuccess()) { - this.success = other.success; - } - } - - public createStream_result deepCopy() { - return new createStream_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - /** - * - * @see CreateStreamStatus - */ - public CreateStreamStatus getSuccess() { - return this.success; - } - - /** - * - * @see CreateStreamStatus - */ - public createStream_result setSuccess(CreateStreamStatus 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; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((CreateStreamStatus)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof createStream_result) - return this.equals((createStream_result)that); - return false; - } - - public boolean equals(createStream_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success.getValue()); - - return list.hashCode(); - } - - @Override - public int compareTo(createStream_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("createStream_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, 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 createStream_resultStandardSchemeFactory implements SchemeFactory { - public createStream_resultStandardScheme getScheme() { - return new createStream_resultStandardScheme(); - } - } - - private static class createStream_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, createStream_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.I32) { - struct.success = com.emc.pravega.controller.stream.api.v1.CreateStreamStatus.findByValue(iprot.readI32()); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, createStream_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeI32(struct.success.getValue()); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class createStream_resultTupleSchemeFactory implements SchemeFactory { - public createStream_resultTupleScheme getScheme() { - return new createStream_resultTupleScheme(); - } - } - - private static class createStream_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, createStream_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - oprot.writeI32(struct.success.getValue()); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, createStream_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = com.emc.pravega.controller.stream.api.v1.CreateStreamStatus.findByValue(iprot.readI32()); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class alterStream_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("alterStream_args"); - - private static final org.apache.thrift.protocol.TField STREAM_CONFIG_FIELD_DESC = new org.apache.thrift.protocol.TField("streamConfig", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new alterStream_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new alterStream_argsTupleSchemeFactory()); - } - - private StreamConfig streamConfig; // 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 { - STREAM_CONFIG((short)1, "streamConfig"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STREAM_CONFIG - return STREAM_CONFIG; - 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 IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.STREAM_CONFIG, new org.apache.thrift.meta_data.FieldMetaData("streamConfig", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, StreamConfig.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(alterStream_args.class, metaDataMap); - } - - public alterStream_args() { - } - - public alterStream_args( - StreamConfig streamConfig) - { - this(); - this.streamConfig = streamConfig; - } - - /** - * Performs a deep copy on other. - */ - public alterStream_args(alterStream_args other) { - if (other.isSetStreamConfig()) { - this.streamConfig = new StreamConfig(other.streamConfig); - } - } - - public alterStream_args deepCopy() { - return new alterStream_args(this); - } - - @Override - public void clear() { - this.streamConfig = null; - } - - public StreamConfig getStreamConfig() { - return this.streamConfig; - } - - public alterStream_args setStreamConfig(StreamConfig streamConfig) { - this.streamConfig = streamConfig; - return this; - } - - public void unsetStreamConfig() { - this.streamConfig = null; - } - - /** Returns true if field streamConfig is set (has been assigned a value) and false otherwise */ - public boolean isSetStreamConfig() { - return this.streamConfig != null; - } - - public void setStreamConfigIsSet(boolean value) { - if (!value) { - this.streamConfig = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case STREAM_CONFIG: - if (value == null) { - unsetStreamConfig(); - } else { - setStreamConfig((StreamConfig)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case STREAM_CONFIG: - return getStreamConfig(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case STREAM_CONFIG: - return isSetStreamConfig(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof alterStream_args) - return this.equals((alterStream_args)that); - return false; - } - - public boolean equals(alterStream_args that) { - if (that == null) - return false; - - boolean this_present_streamConfig = true && this.isSetStreamConfig(); - boolean that_present_streamConfig = true && that.isSetStreamConfig(); - if (this_present_streamConfig || that_present_streamConfig) { - if (!(this_present_streamConfig && that_present_streamConfig)) - return false; - if (!this.streamConfig.equals(that.streamConfig)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_streamConfig = true && (isSetStreamConfig()); - list.add(present_streamConfig); - if (present_streamConfig) - list.add(streamConfig); - - return list.hashCode(); - } - - @Override - public int compareTo(alterStream_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetStreamConfig()).compareTo(other.isSetStreamConfig()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStreamConfig()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.streamConfig, other.streamConfig); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("alterStream_args("); - boolean first = true; - - sb.append("streamConfig:"); - if (this.streamConfig == null) { - sb.append("null"); - } else { - sb.append(this.streamConfig); - } - 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 (streamConfig != null) { - streamConfig.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, 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 alterStream_argsStandardSchemeFactory implements SchemeFactory { - public alterStream_argsStandardScheme getScheme() { - return new alterStream_argsStandardScheme(); - } - } - - private static class alterStream_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, alterStream_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: // STREAM_CONFIG - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.streamConfig = new StreamConfig(); - struct.streamConfig.read(iprot); - struct.setStreamConfigIsSet(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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, alterStream_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.streamConfig != null) { - oprot.writeFieldBegin(STREAM_CONFIG_FIELD_DESC); - struct.streamConfig.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class alterStream_argsTupleSchemeFactory implements SchemeFactory { - public alterStream_argsTupleScheme getScheme() { - return new alterStream_argsTupleScheme(); - } - } - - private static class alterStream_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, alterStream_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetStreamConfig()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetStreamConfig()) { - struct.streamConfig.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, alterStream_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.streamConfig = new StreamConfig(); - struct.streamConfig.read(iprot); - struct.setStreamConfigIsSet(true); - } - } - } - - } - - public static class alterStream_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("alterStream_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new alterStream_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new alterStream_resultTupleSchemeFactory()); - } - - private UpdateStreamStatus success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - /** - * - * @see UpdateStreamStatus - */ - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new 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.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, UpdateStreamStatus.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(alterStream_result.class, metaDataMap); - } - - public alterStream_result() { - } - - public alterStream_result( - UpdateStreamStatus success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public alterStream_result(alterStream_result other) { - if (other.isSetSuccess()) { - this.success = other.success; - } - } - - public alterStream_result deepCopy() { - return new alterStream_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - /** - * - * @see UpdateStreamStatus - */ - public UpdateStreamStatus getSuccess() { - return this.success; - } - - /** - * - * @see UpdateStreamStatus - */ - public alterStream_result setSuccess(UpdateStreamStatus 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; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((UpdateStreamStatus)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof alterStream_result) - return this.equals((alterStream_result)that); - return false; - } - - public boolean equals(alterStream_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success.getValue()); - - return list.hashCode(); - } - - @Override - public int compareTo(alterStream_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("alterStream_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, 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 alterStream_resultStandardSchemeFactory implements SchemeFactory { - public alterStream_resultStandardScheme getScheme() { - return new alterStream_resultStandardScheme(); - } - } - - private static class alterStream_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, alterStream_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.I32) { - struct.success = com.emc.pravega.controller.stream.api.v1.UpdateStreamStatus.findByValue(iprot.readI32()); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, alterStream_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeI32(struct.success.getValue()); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class alterStream_resultTupleSchemeFactory implements SchemeFactory { - public alterStream_resultTupleScheme getScheme() { - return new alterStream_resultTupleScheme(); - } - } - - private static class alterStream_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, alterStream_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - oprot.writeI32(struct.success.getValue()); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, alterStream_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = com.emc.pravega.controller.stream.api.v1.UpdateStreamStatus.findByValue(iprot.readI32()); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class sealStream_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("sealStream_args"); - - private static final org.apache.thrift.protocol.TField SCOPE_FIELD_DESC = new org.apache.thrift.protocol.TField("scope", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField STREAM_FIELD_DESC = new org.apache.thrift.protocol.TField("stream", org.apache.thrift.protocol.TType.STRING, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new sealStream_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new sealStream_argsTupleSchemeFactory()); - } - - private String scope; // required - private String stream; // 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 { - SCOPE((short)1, "scope"), - STREAM((short)2, "stream"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SCOPE - return SCOPE; - case 2: // STREAM - return STREAM; - 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 IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SCOPE, new org.apache.thrift.meta_data.FieldMetaData("scope", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.STREAM, new org.apache.thrift.meta_data.FieldMetaData("stream", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(sealStream_args.class, metaDataMap); - } - - public sealStream_args() { - } - - public sealStream_args( - String scope, - String stream) - { - this(); - this.scope = scope; - this.stream = stream; - } - - /** - * Performs a deep copy on other. - */ - public sealStream_args(sealStream_args other) { - if (other.isSetScope()) { - this.scope = other.scope; - } - if (other.isSetStream()) { - this.stream = other.stream; - } - } - - public sealStream_args deepCopy() { - return new sealStream_args(this); - } - - @Override - public void clear() { - this.scope = null; - this.stream = null; - } - - public String getScope() { - return this.scope; - } - - public sealStream_args setScope(String scope) { - this.scope = scope; - return this; - } - - public void unsetScope() { - this.scope = null; - } - - /** Returns true if field scope is set (has been assigned a value) and false otherwise */ - public boolean isSetScope() { - return this.scope != null; - } - - public void setScopeIsSet(boolean value) { - if (!value) { - this.scope = null; - } - } - - public String getStream() { - return this.stream; - } - - public sealStream_args setStream(String stream) { - this.stream = stream; - return this; - } - - public void unsetStream() { - this.stream = null; - } - - /** Returns true if field stream is set (has been assigned a value) and false otherwise */ - public boolean isSetStream() { - return this.stream != null; - } - - public void setStreamIsSet(boolean value) { - if (!value) { - this.stream = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SCOPE: - if (value == null) { - unsetScope(); - } else { - setScope((String)value); - } - break; - - case STREAM: - if (value == null) { - unsetStream(); - } else { - setStream((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SCOPE: - return getScope(); - - case STREAM: - return getStream(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SCOPE: - return isSetScope(); - case STREAM: - return isSetStream(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof sealStream_args) - return this.equals((sealStream_args)that); - return false; - } - - public boolean equals(sealStream_args that) { - if (that == null) - return false; - - boolean this_present_scope = true && this.isSetScope(); - boolean that_present_scope = true && that.isSetScope(); - if (this_present_scope || that_present_scope) { - if (!(this_present_scope && that_present_scope)) - return false; - if (!this.scope.equals(that.scope)) - return false; - } - - boolean this_present_stream = true && this.isSetStream(); - boolean that_present_stream = true && that.isSetStream(); - if (this_present_stream || that_present_stream) { - if (!(this_present_stream && that_present_stream)) - return false; - if (!this.stream.equals(that.stream)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_scope = true && (isSetScope()); - list.add(present_scope); - if (present_scope) - list.add(scope); - - boolean present_stream = true && (isSetStream()); - list.add(present_stream); - if (present_stream) - list.add(stream); - - return list.hashCode(); - } - - @Override - public int compareTo(sealStream_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetScope()).compareTo(other.isSetScope()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetScope()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scope, other.scope); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetStream()).compareTo(other.isSetStream()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStream()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stream, other.stream); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("sealStream_args("); - boolean first = true; - - sb.append("scope:"); - if (this.scope == null) { - sb.append("null"); - } else { - sb.append(this.scope); - } - first = false; - if (!first) sb.append(", "); - sb.append("stream:"); - if (this.stream == null) { - sb.append("null"); - } else { - sb.append(this.stream); - } - 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, 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 sealStream_argsStandardSchemeFactory implements SchemeFactory { - public sealStream_argsStandardScheme getScheme() { - return new sealStream_argsStandardScheme(); - } - } - - private static class sealStream_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, sealStream_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: // SCOPE - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.scope = iprot.readString(); - struct.setScopeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // STREAM - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.stream = iprot.readString(); - struct.setStreamIsSet(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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, sealStream_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.scope != null) { - oprot.writeFieldBegin(SCOPE_FIELD_DESC); - oprot.writeString(struct.scope); - oprot.writeFieldEnd(); - } - if (struct.stream != null) { - oprot.writeFieldBegin(STREAM_FIELD_DESC); - oprot.writeString(struct.stream); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class sealStream_argsTupleSchemeFactory implements SchemeFactory { - public sealStream_argsTupleScheme getScheme() { - return new sealStream_argsTupleScheme(); - } - } - - private static class sealStream_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, sealStream_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetScope()) { - optionals.set(0); - } - if (struct.isSetStream()) { - optionals.set(1); - } - oprot.writeBitSet(optionals, 2); - if (struct.isSetScope()) { - oprot.writeString(struct.scope); - } - if (struct.isSetStream()) { - oprot.writeString(struct.stream); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, sealStream_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(2); - if (incoming.get(0)) { - struct.scope = iprot.readString(); - struct.setScopeIsSet(true); - } - if (incoming.get(1)) { - struct.stream = iprot.readString(); - struct.setStreamIsSet(true); - } - } - } - - } - - public static class sealStream_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("sealStream_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new sealStream_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new sealStream_resultTupleSchemeFactory()); - } - - private UpdateStreamStatus success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - /** - * - * @see UpdateStreamStatus - */ - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new 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.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, UpdateStreamStatus.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(sealStream_result.class, metaDataMap); - } - - public sealStream_result() { - } - - public sealStream_result( - UpdateStreamStatus success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public sealStream_result(sealStream_result other) { - if (other.isSetSuccess()) { - this.success = other.success; - } - } - - public sealStream_result deepCopy() { - return new sealStream_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - /** - * - * @see UpdateStreamStatus - */ - public UpdateStreamStatus getSuccess() { - return this.success; - } - - /** - * - * @see UpdateStreamStatus - */ - public sealStream_result setSuccess(UpdateStreamStatus 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; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((UpdateStreamStatus)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof sealStream_result) - return this.equals((sealStream_result)that); - return false; - } - - public boolean equals(sealStream_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success.getValue()); - - return list.hashCode(); - } - - @Override - public int compareTo(sealStream_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("sealStream_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, 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 sealStream_resultStandardSchemeFactory implements SchemeFactory { - public sealStream_resultStandardScheme getScheme() { - return new sealStream_resultStandardScheme(); - } - } - - private static class sealStream_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, sealStream_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.I32) { - struct.success = com.emc.pravega.controller.stream.api.v1.UpdateStreamStatus.findByValue(iprot.readI32()); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, sealStream_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeI32(struct.success.getValue()); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class sealStream_resultTupleSchemeFactory implements SchemeFactory { - public sealStream_resultTupleScheme getScheme() { - return new sealStream_resultTupleScheme(); - } - } - - private static class sealStream_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, sealStream_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - oprot.writeI32(struct.success.getValue()); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, sealStream_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = com.emc.pravega.controller.stream.api.v1.UpdateStreamStatus.findByValue(iprot.readI32()); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class getCurrentSegments_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("getCurrentSegments_args"); - - private static final org.apache.thrift.protocol.TField SCOPE_FIELD_DESC = new org.apache.thrift.protocol.TField("scope", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField STREAM_FIELD_DESC = new org.apache.thrift.protocol.TField("stream", org.apache.thrift.protocol.TType.STRING, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new getCurrentSegments_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new getCurrentSegments_argsTupleSchemeFactory()); - } - - private String scope; // required - private String stream; // 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 { - SCOPE((short)1, "scope"), - STREAM((short)2, "stream"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SCOPE - return SCOPE; - case 2: // STREAM - return STREAM; - 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 IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SCOPE, new org.apache.thrift.meta_data.FieldMetaData("scope", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.STREAM, new org.apache.thrift.meta_data.FieldMetaData("stream", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCurrentSegments_args.class, metaDataMap); - } - - public getCurrentSegments_args() { - } - - public getCurrentSegments_args( - String scope, - String stream) - { - this(); - this.scope = scope; - this.stream = stream; - } - - /** - * Performs a deep copy on other. - */ - public getCurrentSegments_args(getCurrentSegments_args other) { - if (other.isSetScope()) { - this.scope = other.scope; - } - if (other.isSetStream()) { - this.stream = other.stream; - } - } - - public getCurrentSegments_args deepCopy() { - return new getCurrentSegments_args(this); - } - - @Override - public void clear() { - this.scope = null; - this.stream = null; - } - - public String getScope() { - return this.scope; - } - - public getCurrentSegments_args setScope(String scope) { - this.scope = scope; - return this; - } - - public void unsetScope() { - this.scope = null; - } - - /** Returns true if field scope is set (has been assigned a value) and false otherwise */ - public boolean isSetScope() { - return this.scope != null; - } - - public void setScopeIsSet(boolean value) { - if (!value) { - this.scope = null; - } - } - - public String getStream() { - return this.stream; - } - - public getCurrentSegments_args setStream(String stream) { - this.stream = stream; - return this; - } - - public void unsetStream() { - this.stream = null; - } - - /** Returns true if field stream is set (has been assigned a value) and false otherwise */ - public boolean isSetStream() { - return this.stream != null; - } - - public void setStreamIsSet(boolean value) { - if (!value) { - this.stream = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SCOPE: - if (value == null) { - unsetScope(); - } else { - setScope((String)value); - } - break; - - case STREAM: - if (value == null) { - unsetStream(); - } else { - setStream((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SCOPE: - return getScope(); - - case STREAM: - return getStream(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SCOPE: - return isSetScope(); - case STREAM: - return isSetStream(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getCurrentSegments_args) - return this.equals((getCurrentSegments_args)that); - return false; - } - - public boolean equals(getCurrentSegments_args that) { - if (that == null) - return false; - - boolean this_present_scope = true && this.isSetScope(); - boolean that_present_scope = true && that.isSetScope(); - if (this_present_scope || that_present_scope) { - if (!(this_present_scope && that_present_scope)) - return false; - if (!this.scope.equals(that.scope)) - return false; - } - - boolean this_present_stream = true && this.isSetStream(); - boolean that_present_stream = true && that.isSetStream(); - if (this_present_stream || that_present_stream) { - if (!(this_present_stream && that_present_stream)) - return false; - if (!this.stream.equals(that.stream)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_scope = true && (isSetScope()); - list.add(present_scope); - if (present_scope) - list.add(scope); - - boolean present_stream = true && (isSetStream()); - list.add(present_stream); - if (present_stream) - list.add(stream); - - return list.hashCode(); - } - - @Override - public int compareTo(getCurrentSegments_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetScope()).compareTo(other.isSetScope()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetScope()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scope, other.scope); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetStream()).compareTo(other.isSetStream()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStream()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stream, other.stream); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getCurrentSegments_args("); - boolean first = true; - - sb.append("scope:"); - if (this.scope == null) { - sb.append("null"); - } else { - sb.append(this.scope); - } - first = false; - if (!first) sb.append(", "); - sb.append("stream:"); - if (this.stream == null) { - sb.append("null"); - } else { - sb.append(this.stream); - } - 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, 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 getCurrentSegments_argsStandardSchemeFactory implements SchemeFactory { - public getCurrentSegments_argsStandardScheme getScheme() { - return new getCurrentSegments_argsStandardScheme(); - } - } - - private static class getCurrentSegments_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, getCurrentSegments_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: // SCOPE - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.scope = iprot.readString(); - struct.setScopeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // STREAM - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.stream = iprot.readString(); - struct.setStreamIsSet(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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, getCurrentSegments_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.scope != null) { - oprot.writeFieldBegin(SCOPE_FIELD_DESC); - oprot.writeString(struct.scope); - oprot.writeFieldEnd(); - } - if (struct.stream != null) { - oprot.writeFieldBegin(STREAM_FIELD_DESC); - oprot.writeString(struct.stream); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class getCurrentSegments_argsTupleSchemeFactory implements SchemeFactory { - public getCurrentSegments_argsTupleScheme getScheme() { - return new getCurrentSegments_argsTupleScheme(); - } - } - - private static class getCurrentSegments_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, getCurrentSegments_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetScope()) { - optionals.set(0); - } - if (struct.isSetStream()) { - optionals.set(1); - } - oprot.writeBitSet(optionals, 2); - if (struct.isSetScope()) { - oprot.writeString(struct.scope); - } - if (struct.isSetStream()) { - oprot.writeString(struct.stream); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, getCurrentSegments_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(2); - if (incoming.get(0)) { - struct.scope = iprot.readString(); - struct.setScopeIsSet(true); - } - if (incoming.get(1)) { - struct.stream = iprot.readString(); - struct.setStreamIsSet(true); - } - } - } - - } - - public static class getCurrentSegments_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("getCurrentSegments_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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new getCurrentSegments_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new getCurrentSegments_resultTupleSchemeFactory()); - } - - private List success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, SegmentRange.class)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCurrentSegments_result.class, metaDataMap); - } - - public getCurrentSegments_result() { - } - - public getCurrentSegments_result( - List success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public getCurrentSegments_result(getCurrentSegments_result other) { - if (other.isSetSuccess()) { - List __this__success = new ArrayList(other.success.size()); - for (SegmentRange other_element : other.success) { - __this__success.add(new SegmentRange(other_element)); - } - this.success = __this__success; - } - } - - public getCurrentSegments_result deepCopy() { - return new getCurrentSegments_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public int getSuccessSize() { - return (this.success == null) ? 0 : this.success.size(); - } - - public java.util.Iterator getSuccessIterator() { - return (this.success == null) ? null : this.success.iterator(); - } - - public void addToSuccess(SegmentRange elem) { - if (this.success == null) { - this.success = new ArrayList(); - } - this.success.add(elem); - } - - public List getSuccess() { - return this.success; - } - - public getCurrentSegments_result setSuccess(List success) { - this.success = success; - return this; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((List)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getCurrentSegments_result) - return this.equals((getCurrentSegments_result)that); - return false; - } - - public boolean equals(getCurrentSegments_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); - - return list.hashCode(); - } - - @Override - public int compareTo(getCurrentSegments_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getCurrentSegments_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, 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 getCurrentSegments_resultStandardSchemeFactory implements SchemeFactory { - public getCurrentSegments_resultStandardScheme getScheme() { - return new getCurrentSegments_resultStandardScheme(); - } - } - - private static class getCurrentSegments_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, getCurrentSegments_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list18 = iprot.readListBegin(); - struct.success = new ArrayList(_list18.size); - SegmentRange _elem19; - for (int _i20 = 0; _i20 < _list18.size; ++_i20) - { - _elem19 = new SegmentRange(); - _elem19.read(iprot); - struct.success.add(_elem19); - } - iprot.readListEnd(); - } - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, getCurrentSegments_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); - for (SegmentRange _iter21 : struct.success) - { - _iter21.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class getCurrentSegments_resultTupleSchemeFactory implements SchemeFactory { - public getCurrentSegments_resultTupleScheme getScheme() { - return new getCurrentSegments_resultTupleScheme(); - } - } - - private static class getCurrentSegments_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, getCurrentSegments_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - { - oprot.writeI32(struct.success.size()); - for (SegmentRange _iter22 : struct.success) - { - _iter22.write(oprot); - } - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, getCurrentSegments_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - { - org.apache.thrift.protocol.TList _list23 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.success = new ArrayList(_list23.size); - SegmentRange _elem24; - for (int _i25 = 0; _i25 < _list23.size; ++_i25) - { - _elem24 = new SegmentRange(); - _elem24.read(iprot); - struct.success.add(_elem24); - } - } - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class getPositions_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("getPositions_args"); - - private static final org.apache.thrift.protocol.TField SCOPE_FIELD_DESC = new org.apache.thrift.protocol.TField("scope", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField STREAM_FIELD_DESC = new org.apache.thrift.protocol.TField("stream", org.apache.thrift.protocol.TType.STRING, (short)2); - 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)3); - private static final org.apache.thrift.protocol.TField COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("count", org.apache.thrift.protocol.TType.I32, (short)4); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new getPositions_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new getPositions_argsTupleSchemeFactory()); - } - - private String scope; // required - private String stream; // required - private long timestamp; // required - private int count; // 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 { - SCOPE((short)1, "scope"), - STREAM((short)2, "stream"), - TIMESTAMP((short)3, "timestamp"), - COUNT((short)4, "count"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SCOPE - return SCOPE; - case 2: // STREAM - return STREAM; - case 3: // TIMESTAMP - return TIMESTAMP; - case 4: // COUNT - return COUNT; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __TIMESTAMP_ISSET_ID = 0; - private static final int __COUNT_ISSET_ID = 1; - private byte __isset_bitfield = 0; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SCOPE, new org.apache.thrift.meta_data.FieldMetaData("scope", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.STREAM, new org.apache.thrift.meta_data.FieldMetaData("stream", org.apache.thrift.TFieldRequirementType.DEFAULT, - 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.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.COUNT, new org.apache.thrift.meta_data.FieldMetaData("count", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPositions_args.class, metaDataMap); - } - - public getPositions_args() { - } - - public getPositions_args( - String scope, - String stream, - long timestamp, - int count) - { - this(); - this.scope = scope; - this.stream = stream; - this.timestamp = timestamp; - setTimestampIsSet(true); - this.count = count; - setCountIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public getPositions_args(getPositions_args other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetScope()) { - this.scope = other.scope; - } - if (other.isSetStream()) { - this.stream = other.stream; - } - this.timestamp = other.timestamp; - this.count = other.count; - } - - public getPositions_args deepCopy() { - return new getPositions_args(this); - } - - @Override - public void clear() { - this.scope = null; - this.stream = null; - setTimestampIsSet(false); - this.timestamp = 0; - setCountIsSet(false); - this.count = 0; - } - - public String getScope() { - return this.scope; - } - - public getPositions_args setScope(String scope) { - this.scope = scope; - return this; - } - - public void unsetScope() { - this.scope = null; - } - - /** Returns true if field scope is set (has been assigned a value) and false otherwise */ - public boolean isSetScope() { - return this.scope != null; - } - - public void setScopeIsSet(boolean value) { - if (!value) { - this.scope = null; - } - } - - public String getStream() { - return this.stream; - } - - public getPositions_args setStream(String stream) { - this.stream = stream; - return this; - } - - public void unsetStream() { - this.stream = null; - } - - /** Returns true if field stream is set (has been assigned a value) and false otherwise */ - public boolean isSetStream() { - return this.stream != null; - } - - public void setStreamIsSet(boolean value) { - if (!value) { - this.stream = null; - } - } - - public long getTimestamp() { - return this.timestamp; - } - - public getPositions_args setTimestamp(long timestamp) { - this.timestamp = timestamp; - setTimestampIsSet(true); - return this; - } - - public void unsetTimestamp() { - __isset_bitfield = 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 EncodingUtils.testBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); - } - - public void setTimestampIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIMESTAMP_ISSET_ID, value); - } - - public int getCount() { - return this.count; - } - - public getPositions_args setCount(int count) { - this.count = count; - setCountIsSet(true); - return this; - } - - public void unsetCount() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __COUNT_ISSET_ID); - } - - /** Returns true if field count is set (has been assigned a value) and false otherwise */ - public boolean isSetCount() { - return EncodingUtils.testBit(__isset_bitfield, __COUNT_ISSET_ID); - } - - public void setCountIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __COUNT_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SCOPE: - if (value == null) { - unsetScope(); - } else { - setScope((String)value); - } - break; - - case STREAM: - if (value == null) { - unsetStream(); - } else { - setStream((String)value); - } - break; - - case TIMESTAMP: - if (value == null) { - unsetTimestamp(); - } else { - setTimestamp((Long)value); - } - break; - - case COUNT: - if (value == null) { - unsetCount(); - } else { - setCount((Integer)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SCOPE: - return getScope(); - - case STREAM: - return getStream(); - - case TIMESTAMP: - return getTimestamp(); - - case COUNT: - return getCount(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SCOPE: - return isSetScope(); - case STREAM: - return isSetStream(); - case TIMESTAMP: - return isSetTimestamp(); - case COUNT: - return isSetCount(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getPositions_args) - return this.equals((getPositions_args)that); - return false; - } - - public boolean equals(getPositions_args that) { - if (that == null) - return false; - - boolean this_present_scope = true && this.isSetScope(); - boolean that_present_scope = true && that.isSetScope(); - if (this_present_scope || that_present_scope) { - if (!(this_present_scope && that_present_scope)) - return false; - if (!this.scope.equals(that.scope)) - return false; - } - - boolean this_present_stream = true && this.isSetStream(); - boolean that_present_stream = true && that.isSetStream(); - if (this_present_stream || that_present_stream) { - if (!(this_present_stream && that_present_stream)) - return false; - if (!this.stream.equals(that.stream)) - 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_count = true; - boolean that_present_count = true; - if (this_present_count || that_present_count) { - if (!(this_present_count && that_present_count)) - return false; - if (this.count != that.count) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_scope = true && (isSetScope()); - list.add(present_scope); - if (present_scope) - list.add(scope); - - boolean present_stream = true && (isSetStream()); - list.add(present_stream); - if (present_stream) - list.add(stream); - - boolean present_timestamp = true; - list.add(present_timestamp); - if (present_timestamp) - list.add(timestamp); - - boolean present_count = true; - list.add(present_count); - if (present_count) - list.add(count); - - return list.hashCode(); - } - - @Override - public int compareTo(getPositions_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetScope()).compareTo(other.isSetScope()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetScope()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scope, other.scope); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetStream()).compareTo(other.isSetStream()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStream()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stream, other.stream); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(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 = Boolean.valueOf(isSetCount()).compareTo(other.isSetCount()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetCount()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.count, other.count); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getPositions_args("); - boolean first = true; - - sb.append("scope:"); - if (this.scope == null) { - sb.append("null"); - } else { - sb.append(this.scope); - } - first = false; - if (!first) sb.append(", "); - sb.append("stream:"); - if (this.stream == null) { - sb.append("null"); - } else { - sb.append(this.stream); - } - first = false; - if (!first) sb.append(", "); - sb.append("timestamp:"); - sb.append(this.timestamp); - first = false; - if (!first) sb.append(", "); - sb.append("count:"); - sb.append(this.count); - 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, 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 getPositions_argsStandardSchemeFactory implements SchemeFactory { - public getPositions_argsStandardScheme getScheme() { - return new getPositions_argsStandardScheme(); - } - } - - private static class getPositions_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, getPositions_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: // SCOPE - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.scope = iprot.readString(); - struct.setScopeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // STREAM - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.stream = iprot.readString(); - struct.setStreamIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // 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 4: // COUNT - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.count = iprot.readI32(); - struct.setCountIsSet(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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, getPositions_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.scope != null) { - oprot.writeFieldBegin(SCOPE_FIELD_DESC); - oprot.writeString(struct.scope); - oprot.writeFieldEnd(); - } - if (struct.stream != null) { - oprot.writeFieldBegin(STREAM_FIELD_DESC); - oprot.writeString(struct.stream); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC); - oprot.writeI64(struct.timestamp); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(COUNT_FIELD_DESC); - oprot.writeI32(struct.count); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class getPositions_argsTupleSchemeFactory implements SchemeFactory { - public getPositions_argsTupleScheme getScheme() { - return new getPositions_argsTupleScheme(); - } - } - - private static class getPositions_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, getPositions_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetScope()) { - optionals.set(0); - } - if (struct.isSetStream()) { - optionals.set(1); - } - if (struct.isSetTimestamp()) { - optionals.set(2); - } - if (struct.isSetCount()) { - optionals.set(3); - } - oprot.writeBitSet(optionals, 4); - if (struct.isSetScope()) { - oprot.writeString(struct.scope); - } - if (struct.isSetStream()) { - oprot.writeString(struct.stream); - } - if (struct.isSetTimestamp()) { - oprot.writeI64(struct.timestamp); - } - if (struct.isSetCount()) { - oprot.writeI32(struct.count); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, getPositions_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(4); - if (incoming.get(0)) { - struct.scope = iprot.readString(); - struct.setScopeIsSet(true); - } - if (incoming.get(1)) { - struct.stream = iprot.readString(); - struct.setStreamIsSet(true); - } - if (incoming.get(2)) { - struct.timestamp = iprot.readI64(); - struct.setTimestampIsSet(true); - } - if (incoming.get(3)) { - struct.count = iprot.readI32(); - struct.setCountIsSet(true); - } - } - } - - } - - public static class getPositions_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("getPositions_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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new getPositions_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new getPositions_resultTupleSchemeFactory()); - } - - private List success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Position.class)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPositions_result.class, metaDataMap); - } - - public getPositions_result() { - } - - public getPositions_result( - List success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public getPositions_result(getPositions_result other) { - if (other.isSetSuccess()) { - List __this__success = new ArrayList(other.success.size()); - for (Position other_element : other.success) { - __this__success.add(new Position(other_element)); - } - this.success = __this__success; - } - } - - public getPositions_result deepCopy() { - return new getPositions_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public int getSuccessSize() { - return (this.success == null) ? 0 : this.success.size(); - } - - public java.util.Iterator getSuccessIterator() { - return (this.success == null) ? null : this.success.iterator(); - } - - public void addToSuccess(Position elem) { - if (this.success == null) { - this.success = new ArrayList(); - } - this.success.add(elem); - } - - public List getSuccess() { - return this.success; - } - - public getPositions_result setSuccess(List success) { - this.success = success; - return this; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((List)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getPositions_result) - return this.equals((getPositions_result)that); - return false; - } - - public boolean equals(getPositions_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); - - return list.hashCode(); - } - - @Override - public int compareTo(getPositions_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getPositions_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, 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 getPositions_resultStandardSchemeFactory implements SchemeFactory { - public getPositions_resultStandardScheme getScheme() { - return new getPositions_resultStandardScheme(); - } - } - - private static class getPositions_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, getPositions_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list26 = iprot.readListBegin(); - struct.success = new ArrayList(_list26.size); - Position _elem27; - for (int _i28 = 0; _i28 < _list26.size; ++_i28) - { - _elem27 = new Position(); - _elem27.read(iprot); - struct.success.add(_elem27); - } - iprot.readListEnd(); - } - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, getPositions_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); - for (Position _iter29 : struct.success) - { - _iter29.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class getPositions_resultTupleSchemeFactory implements SchemeFactory { - public getPositions_resultTupleScheme getScheme() { - return new getPositions_resultTupleScheme(); - } - } - - private static class getPositions_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, getPositions_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - { - oprot.writeI32(struct.success.size()); - for (Position _iter30 : struct.success) - { - _iter30.write(oprot); - } - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, getPositions_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - { - org.apache.thrift.protocol.TList _list31 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.success = new ArrayList(_list31.size); - Position _elem32; - for (int _i33 = 0; _i33 < _list31.size; ++_i33) - { - _elem32 = new Position(); - _elem32.read(iprot); - struct.success.add(_elem32); - } - } - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class getSegmentsImmediatlyFollowing_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("getSegmentsImmediatlyFollowing_args"); - - private static final org.apache.thrift.protocol.TField SEGMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("segment", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new getSegmentsImmediatlyFollowing_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new getSegmentsImmediatlyFollowing_argsTupleSchemeFactory()); - } - - private SegmentId segment; // 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 { - SEGMENT((short)1, "segment"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SEGMENT - return SEGMENT; - 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 IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SEGMENT, new org.apache.thrift.meta_data.FieldMetaData("segment", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, SegmentId.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSegmentsImmediatlyFollowing_args.class, metaDataMap); - } - - public getSegmentsImmediatlyFollowing_args() { - } - - public getSegmentsImmediatlyFollowing_args( - SegmentId segment) - { - this(); - this.segment = segment; - } - - /** - * Performs a deep copy on other. - */ - public getSegmentsImmediatlyFollowing_args(getSegmentsImmediatlyFollowing_args other) { - if (other.isSetSegment()) { - this.segment = new SegmentId(other.segment); - } - } - - public getSegmentsImmediatlyFollowing_args deepCopy() { - return new getSegmentsImmediatlyFollowing_args(this); - } - - @Override - public void clear() { - this.segment = null; - } - - public SegmentId getSegment() { - return this.segment; - } - - public getSegmentsImmediatlyFollowing_args setSegment(SegmentId segment) { - this.segment = segment; - return this; - } - - public void unsetSegment() { - this.segment = null; - } - - /** Returns true if field segment is set (has been assigned a value) and false otherwise */ - public boolean isSetSegment() { - return this.segment != null; - } - - public void setSegmentIsSet(boolean value) { - if (!value) { - this.segment = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SEGMENT: - if (value == null) { - unsetSegment(); - } else { - setSegment((SegmentId)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SEGMENT: - return getSegment(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SEGMENT: - return isSetSegment(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getSegmentsImmediatlyFollowing_args) - return this.equals((getSegmentsImmediatlyFollowing_args)that); - return false; - } - - public boolean equals(getSegmentsImmediatlyFollowing_args that) { - if (that == null) - return false; - - boolean this_present_segment = true && this.isSetSegment(); - boolean that_present_segment = true && that.isSetSegment(); - if (this_present_segment || that_present_segment) { - if (!(this_present_segment && that_present_segment)) - return false; - if (!this.segment.equals(that.segment)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_segment = true && (isSetSegment()); - list.add(present_segment); - if (present_segment) - list.add(segment); - - return list.hashCode(); - } - - @Override - public int compareTo(getSegmentsImmediatlyFollowing_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSegment()).compareTo(other.isSetSegment()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSegment()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.segment, other.segment); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getSegmentsImmediatlyFollowing_args("); - boolean first = true; - - sb.append("segment:"); - if (this.segment == null) { - sb.append("null"); - } else { - sb.append(this.segment); - } - 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 (segment != null) { - segment.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, 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 getSegmentsImmediatlyFollowing_argsStandardSchemeFactory implements SchemeFactory { - public getSegmentsImmediatlyFollowing_argsStandardScheme getScheme() { - return new getSegmentsImmediatlyFollowing_argsStandardScheme(); - } - } - - private static class getSegmentsImmediatlyFollowing_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, getSegmentsImmediatlyFollowing_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: // SEGMENT - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.segment = new SegmentId(); - struct.segment.read(iprot); - struct.setSegmentIsSet(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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, getSegmentsImmediatlyFollowing_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.segment != null) { - oprot.writeFieldBegin(SEGMENT_FIELD_DESC); - struct.segment.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class getSegmentsImmediatlyFollowing_argsTupleSchemeFactory implements SchemeFactory { - public getSegmentsImmediatlyFollowing_argsTupleScheme getScheme() { - return new getSegmentsImmediatlyFollowing_argsTupleScheme(); - } - } - - private static class getSegmentsImmediatlyFollowing_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, getSegmentsImmediatlyFollowing_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSegment()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSegment()) { - struct.segment.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, getSegmentsImmediatlyFollowing_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.segment = new SegmentId(); - struct.segment.read(iprot); - struct.setSegmentIsSet(true); - } - } - } - - } - - public static class getSegmentsImmediatlyFollowing_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("getSegmentsImmediatlyFollowing_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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new getSegmentsImmediatlyFollowing_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new getSegmentsImmediatlyFollowing_resultTupleSchemeFactory()); - } - - private Map> success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new 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.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, SegmentId.class), - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSegmentsImmediatlyFollowing_result.class, metaDataMap); - } - - public getSegmentsImmediatlyFollowing_result() { - } - - public getSegmentsImmediatlyFollowing_result( - Map> success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public getSegmentsImmediatlyFollowing_result(getSegmentsImmediatlyFollowing_result other) { - if (other.isSetSuccess()) { - Map> __this__success = new HashMap>(other.success.size()); - for (Map.Entry> other_element : other.success.entrySet()) { - - SegmentId other_element_key = other_element.getKey(); - List other_element_value = other_element.getValue(); - - SegmentId __this__success_copy_key = new SegmentId(other_element_key); - - List __this__success_copy_value = new ArrayList(other_element_value); - - __this__success.put(__this__success_copy_key, __this__success_copy_value); - } - this.success = __this__success; - } - } - - public getSegmentsImmediatlyFollowing_result deepCopy() { - return new getSegmentsImmediatlyFollowing_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public int getSuccessSize() { - return (this.success == null) ? 0 : this.success.size(); - } - - public void putToSuccess(SegmentId key, List val) { - if (this.success == null) { - this.success = new HashMap>(); - } - this.success.put(key, val); - } - - public Map> getSuccess() { - return this.success; - } - - public getSegmentsImmediatlyFollowing_result setSuccess(Map> 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; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((Map>)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getSegmentsImmediatlyFollowing_result) - return this.equals((getSegmentsImmediatlyFollowing_result)that); - return false; - } - - public boolean equals(getSegmentsImmediatlyFollowing_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); - - return list.hashCode(); - } - - @Override - public int compareTo(getSegmentsImmediatlyFollowing_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getSegmentsImmediatlyFollowing_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, 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 getSegmentsImmediatlyFollowing_resultStandardSchemeFactory implements SchemeFactory { - public getSegmentsImmediatlyFollowing_resultStandardScheme getScheme() { - return new getSegmentsImmediatlyFollowing_resultStandardScheme(); - } - } - - private static class getSegmentsImmediatlyFollowing_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, getSegmentsImmediatlyFollowing_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.MAP) { - { - org.apache.thrift.protocol.TMap _map34 = iprot.readMapBegin(); - struct.success = new HashMap>(2*_map34.size); - SegmentId _key35; - List _val36; - for (int _i37 = 0; _i37 < _map34.size; ++_i37) - { - _key35 = new SegmentId(); - _key35.read(iprot); - { - org.apache.thrift.protocol.TList _list38 = iprot.readListBegin(); - _val36 = new ArrayList(_list38.size); - int _elem39; - for (int _i40 = 0; _i40 < _list38.size; ++_i40) - { - _elem39 = iprot.readI32(); - _val36.add(_elem39); - } - iprot.readListEnd(); - } - struct.success.put(_key35, _val36); - } - iprot.readMapEnd(); - } - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, getSegmentsImmediatlyFollowing_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.STRUCT, org.apache.thrift.protocol.TType.LIST, struct.success.size())); - for (Map.Entry> _iter41 : struct.success.entrySet()) - { - _iter41.getKey().write(oprot); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, _iter41.getValue().size())); - for (int _iter42 : _iter41.getValue()) - { - oprot.writeI32(_iter42); - } - oprot.writeListEnd(); - } - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class getSegmentsImmediatlyFollowing_resultTupleSchemeFactory implements SchemeFactory { - public getSegmentsImmediatlyFollowing_resultTupleScheme getScheme() { - return new getSegmentsImmediatlyFollowing_resultTupleScheme(); - } - } - - private static class getSegmentsImmediatlyFollowing_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, getSegmentsImmediatlyFollowing_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - { - oprot.writeI32(struct.success.size()); - for (Map.Entry> _iter43 : struct.success.entrySet()) - { - _iter43.getKey().write(oprot); - { - oprot.writeI32(_iter43.getValue().size()); - for (int _iter44 : _iter43.getValue()) - { - oprot.writeI32(_iter44); - } - } - } - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, getSegmentsImmediatlyFollowing_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - { - org.apache.thrift.protocol.TMap _map45 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.LIST, iprot.readI32()); - struct.success = new HashMap>(2*_map45.size); - SegmentId _key46; - List _val47; - for (int _i48 = 0; _i48 < _map45.size; ++_i48) - { - _key46 = new SegmentId(); - _key46.read(iprot); - { - org.apache.thrift.protocol.TList _list49 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, iprot.readI32()); - _val47 = new ArrayList(_list49.size); - int _elem50; - for (int _i51 = 0; _i51 < _list49.size; ++_i51) - { - _elem50 = iprot.readI32(); - _val47.add(_elem50); - } - } - struct.success.put(_key46, _val47); - } - } - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class scale_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("scale_args"); - - private static final org.apache.thrift.protocol.TField SCOPE_FIELD_DESC = new org.apache.thrift.protocol.TField("scope", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField STREAM_FIELD_DESC = new org.apache.thrift.protocol.TField("stream", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField SEALED_SEGMENTS_FIELD_DESC = new org.apache.thrift.protocol.TField("sealedSegments", org.apache.thrift.protocol.TType.LIST, (short)3); - private static final org.apache.thrift.protocol.TField NEW_KEY_RANGES_FIELD_DESC = new org.apache.thrift.protocol.TField("newKeyRanges", org.apache.thrift.protocol.TType.MAP, (short)4); - private static final org.apache.thrift.protocol.TField SCALE_TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("scaleTimestamp", org.apache.thrift.protocol.TType.I64, (short)5); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new scale_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new scale_argsTupleSchemeFactory()); - } - - private String scope; // required - private String stream; // required - private List sealedSegments; // required - private Map newKeyRanges; // required - private long scaleTimestamp; // 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 { - SCOPE((short)1, "scope"), - STREAM((short)2, "stream"), - SEALED_SEGMENTS((short)3, "sealedSegments"), - NEW_KEY_RANGES((short)4, "newKeyRanges"), - SCALE_TIMESTAMP((short)5, "scaleTimestamp"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SCOPE - return SCOPE; - case 2: // STREAM - return STREAM; - case 3: // SEALED_SEGMENTS - return SEALED_SEGMENTS; - case 4: // NEW_KEY_RANGES - return NEW_KEY_RANGES; - case 5: // SCALE_TIMESTAMP - return SCALE_TIMESTAMP; - 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 IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __SCALETIMESTAMP_ISSET_ID = 0; - private byte __isset_bitfield = 0; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SCOPE, new org.apache.thrift.meta_data.FieldMetaData("scope", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.STREAM, new org.apache.thrift.meta_data.FieldMetaData("stream", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.SEALED_SEGMENTS, new org.apache.thrift.meta_data.FieldMetaData("sealedSegments", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)))); - tmpMap.put(_Fields.NEW_KEY_RANGES, new org.apache.thrift.meta_data.FieldMetaData("newKeyRanges", 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.DOUBLE), - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)))); - tmpMap.put(_Fields.SCALE_TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("scaleTimestamp", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scale_args.class, metaDataMap); - } - - public scale_args() { - } - - public scale_args( - String scope, - String stream, - List sealedSegments, - Map newKeyRanges, - long scaleTimestamp) - { - this(); - this.scope = scope; - this.stream = stream; - this.sealedSegments = sealedSegments; - this.newKeyRanges = newKeyRanges; - this.scaleTimestamp = scaleTimestamp; - setScaleTimestampIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public scale_args(scale_args other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetScope()) { - this.scope = other.scope; - } - if (other.isSetStream()) { - this.stream = other.stream; - } - if (other.isSetSealedSegments()) { - List __this__sealedSegments = new ArrayList(other.sealedSegments); - this.sealedSegments = __this__sealedSegments; - } - if (other.isSetNewKeyRanges()) { - Map __this__newKeyRanges = new HashMap(other.newKeyRanges); - this.newKeyRanges = __this__newKeyRanges; - } - this.scaleTimestamp = other.scaleTimestamp; - } - - public scale_args deepCopy() { - return new scale_args(this); - } - - @Override - public void clear() { - this.scope = null; - this.stream = null; - this.sealedSegments = null; - this.newKeyRanges = null; - setScaleTimestampIsSet(false); - this.scaleTimestamp = 0; - } - - public String getScope() { - return this.scope; - } - - public scale_args setScope(String scope) { - this.scope = scope; - return this; - } - - public void unsetScope() { - this.scope = null; - } - - /** Returns true if field scope is set (has been assigned a value) and false otherwise */ - public boolean isSetScope() { - return this.scope != null; - } - - public void setScopeIsSet(boolean value) { - if (!value) { - this.scope = null; - } - } - - public String getStream() { - return this.stream; - } - - public scale_args setStream(String stream) { - this.stream = stream; - return this; - } - - public void unsetStream() { - this.stream = null; - } - - /** Returns true if field stream is set (has been assigned a value) and false otherwise */ - public boolean isSetStream() { - return this.stream != null; - } - - public void setStreamIsSet(boolean value) { - if (!value) { - this.stream = null; - } - } - - public int getSealedSegmentsSize() { - return (this.sealedSegments == null) ? 0 : this.sealedSegments.size(); - } - - public java.util.Iterator getSealedSegmentsIterator() { - return (this.sealedSegments == null) ? null : this.sealedSegments.iterator(); - } - - public void addToSealedSegments(int elem) { - if (this.sealedSegments == null) { - this.sealedSegments = new ArrayList(); - } - this.sealedSegments.add(elem); - } - - public List getSealedSegments() { - return this.sealedSegments; - } - - public scale_args setSealedSegments(List sealedSegments) { - this.sealedSegments = sealedSegments; - return this; - } - - public void unsetSealedSegments() { - this.sealedSegments = null; - } - - /** Returns true if field sealedSegments is set (has been assigned a value) and false otherwise */ - public boolean isSetSealedSegments() { - return this.sealedSegments != null; - } - - public void setSealedSegmentsIsSet(boolean value) { - if (!value) { - this.sealedSegments = null; - } - } - - public int getNewKeyRangesSize() { - return (this.newKeyRanges == null) ? 0 : this.newKeyRanges.size(); - } - - public void putToNewKeyRanges(double key, double val) { - if (this.newKeyRanges == null) { - this.newKeyRanges = new HashMap(); - } - this.newKeyRanges.put(key, val); - } - - public Map getNewKeyRanges() { - return this.newKeyRanges; - } - - public scale_args setNewKeyRanges(Map newKeyRanges) { - this.newKeyRanges = newKeyRanges; - return this; - } - - public void unsetNewKeyRanges() { - this.newKeyRanges = null; - } - - /** Returns true if field newKeyRanges is set (has been assigned a value) and false otherwise */ - public boolean isSetNewKeyRanges() { - return this.newKeyRanges != null; - } - - public void setNewKeyRangesIsSet(boolean value) { - if (!value) { - this.newKeyRanges = null; - } - } - - public long getScaleTimestamp() { - return this.scaleTimestamp; - } - - public scale_args setScaleTimestamp(long scaleTimestamp) { - this.scaleTimestamp = scaleTimestamp; - setScaleTimestampIsSet(true); - return this; - } - - public void unsetScaleTimestamp() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SCALETIMESTAMP_ISSET_ID); - } - - /** Returns true if field scaleTimestamp is set (has been assigned a value) and false otherwise */ - public boolean isSetScaleTimestamp() { - return EncodingUtils.testBit(__isset_bitfield, __SCALETIMESTAMP_ISSET_ID); - } - - public void setScaleTimestampIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SCALETIMESTAMP_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SCOPE: - if (value == null) { - unsetScope(); - } else { - setScope((String)value); - } - break; - - case STREAM: - if (value == null) { - unsetStream(); - } else { - setStream((String)value); - } - break; - - case SEALED_SEGMENTS: - if (value == null) { - unsetSealedSegments(); - } else { - setSealedSegments((List)value); - } - break; - - case NEW_KEY_RANGES: - if (value == null) { - unsetNewKeyRanges(); - } else { - setNewKeyRanges((Map)value); - } - break; - - case SCALE_TIMESTAMP: - if (value == null) { - unsetScaleTimestamp(); - } else { - setScaleTimestamp((Long)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SCOPE: - return getScope(); - - case STREAM: - return getStream(); - - case SEALED_SEGMENTS: - return getSealedSegments(); - - case NEW_KEY_RANGES: - return getNewKeyRanges(); - - case SCALE_TIMESTAMP: - return getScaleTimestamp(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SCOPE: - return isSetScope(); - case STREAM: - return isSetStream(); - case SEALED_SEGMENTS: - return isSetSealedSegments(); - case NEW_KEY_RANGES: - return isSetNewKeyRanges(); - case SCALE_TIMESTAMP: - return isSetScaleTimestamp(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof scale_args) - return this.equals((scale_args)that); - return false; - } - - public boolean equals(scale_args that) { - if (that == null) - return false; - - boolean this_present_scope = true && this.isSetScope(); - boolean that_present_scope = true && that.isSetScope(); - if (this_present_scope || that_present_scope) { - if (!(this_present_scope && that_present_scope)) - return false; - if (!this.scope.equals(that.scope)) - return false; - } - - boolean this_present_stream = true && this.isSetStream(); - boolean that_present_stream = true && that.isSetStream(); - if (this_present_stream || that_present_stream) { - if (!(this_present_stream && that_present_stream)) - return false; - if (!this.stream.equals(that.stream)) - return false; - } - - boolean this_present_sealedSegments = true && this.isSetSealedSegments(); - boolean that_present_sealedSegments = true && that.isSetSealedSegments(); - if (this_present_sealedSegments || that_present_sealedSegments) { - if (!(this_present_sealedSegments && that_present_sealedSegments)) - return false; - if (!this.sealedSegments.equals(that.sealedSegments)) - return false; - } - - boolean this_present_newKeyRanges = true && this.isSetNewKeyRanges(); - boolean that_present_newKeyRanges = true && that.isSetNewKeyRanges(); - if (this_present_newKeyRanges || that_present_newKeyRanges) { - if (!(this_present_newKeyRanges && that_present_newKeyRanges)) - return false; - if (!this.newKeyRanges.equals(that.newKeyRanges)) - return false; - } - - boolean this_present_scaleTimestamp = true; - boolean that_present_scaleTimestamp = true; - if (this_present_scaleTimestamp || that_present_scaleTimestamp) { - if (!(this_present_scaleTimestamp && that_present_scaleTimestamp)) - return false; - if (this.scaleTimestamp != that.scaleTimestamp) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_scope = true && (isSetScope()); - list.add(present_scope); - if (present_scope) - list.add(scope); - - boolean present_stream = true && (isSetStream()); - list.add(present_stream); - if (present_stream) - list.add(stream); - - boolean present_sealedSegments = true && (isSetSealedSegments()); - list.add(present_sealedSegments); - if (present_sealedSegments) - list.add(sealedSegments); - - boolean present_newKeyRanges = true && (isSetNewKeyRanges()); - list.add(present_newKeyRanges); - if (present_newKeyRanges) - list.add(newKeyRanges); - - boolean present_scaleTimestamp = true; - list.add(present_scaleTimestamp); - if (present_scaleTimestamp) - list.add(scaleTimestamp); - - return list.hashCode(); - } - - @Override - public int compareTo(scale_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetScope()).compareTo(other.isSetScope()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetScope()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scope, other.scope); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetStream()).compareTo(other.isSetStream()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStream()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stream, other.stream); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetSealedSegments()).compareTo(other.isSetSealedSegments()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSealedSegments()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sealedSegments, other.sealedSegments); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetNewKeyRanges()).compareTo(other.isSetNewKeyRanges()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetNewKeyRanges()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.newKeyRanges, other.newKeyRanges); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetScaleTimestamp()).compareTo(other.isSetScaleTimestamp()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetScaleTimestamp()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scaleTimestamp, other.scaleTimestamp); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("scale_args("); - boolean first = true; - - sb.append("scope:"); - if (this.scope == null) { - sb.append("null"); - } else { - sb.append(this.scope); - } - first = false; - if (!first) sb.append(", "); - sb.append("stream:"); - if (this.stream == null) { - sb.append("null"); - } else { - sb.append(this.stream); - } - first = false; - if (!first) sb.append(", "); - sb.append("sealedSegments:"); - if (this.sealedSegments == null) { - sb.append("null"); - } else { - sb.append(this.sealedSegments); - } - first = false; - if (!first) sb.append(", "); - sb.append("newKeyRanges:"); - if (this.newKeyRanges == null) { - sb.append("null"); - } else { - sb.append(this.newKeyRanges); - } - first = false; - if (!first) sb.append(", "); - sb.append("scaleTimestamp:"); - sb.append(this.scaleTimestamp); - 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, 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 scale_argsStandardSchemeFactory implements SchemeFactory { - public scale_argsStandardScheme getScheme() { - return new scale_argsStandardScheme(); - } - } - - private static class scale_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, scale_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: // SCOPE - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.scope = iprot.readString(); - struct.setScopeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // STREAM - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.stream = iprot.readString(); - struct.setStreamIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // SEALED_SEGMENTS - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list52 = iprot.readListBegin(); - struct.sealedSegments = new ArrayList(_list52.size); - int _elem53; - for (int _i54 = 0; _i54 < _list52.size; ++_i54) - { - _elem53 = iprot.readI32(); - struct.sealedSegments.add(_elem53); - } - iprot.readListEnd(); - } - struct.setSealedSegmentsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // NEW_KEY_RANGES - if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map55 = iprot.readMapBegin(); - struct.newKeyRanges = new HashMap(2*_map55.size); - double _key56; - double _val57; - for (int _i58 = 0; _i58 < _map55.size; ++_i58) - { - _key56 = iprot.readDouble(); - _val57 = iprot.readDouble(); - struct.newKeyRanges.put(_key56, _val57); - } - iprot.readMapEnd(); - } - struct.setNewKeyRangesIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // SCALE_TIMESTAMP - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.scaleTimestamp = iprot.readI64(); - struct.setScaleTimestampIsSet(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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, scale_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.scope != null) { - oprot.writeFieldBegin(SCOPE_FIELD_DESC); - oprot.writeString(struct.scope); - oprot.writeFieldEnd(); - } - if (struct.stream != null) { - oprot.writeFieldBegin(STREAM_FIELD_DESC); - oprot.writeString(struct.stream); - oprot.writeFieldEnd(); - } - if (struct.sealedSegments != null) { - oprot.writeFieldBegin(SEALED_SEGMENTS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, struct.sealedSegments.size())); - for (int _iter59 : struct.sealedSegments) - { - oprot.writeI32(_iter59); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - if (struct.newKeyRanges != null) { - oprot.writeFieldBegin(NEW_KEY_RANGES_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.DOUBLE, org.apache.thrift.protocol.TType.DOUBLE, struct.newKeyRanges.size())); - for (Map.Entry _iter60 : struct.newKeyRanges.entrySet()) - { - oprot.writeDouble(_iter60.getKey()); - oprot.writeDouble(_iter60.getValue()); - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(SCALE_TIMESTAMP_FIELD_DESC); - oprot.writeI64(struct.scaleTimestamp); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class scale_argsTupleSchemeFactory implements SchemeFactory { - public scale_argsTupleScheme getScheme() { - return new scale_argsTupleScheme(); - } - } - - private static class scale_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, scale_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetScope()) { - optionals.set(0); - } - if (struct.isSetStream()) { - optionals.set(1); - } - if (struct.isSetSealedSegments()) { - optionals.set(2); - } - if (struct.isSetNewKeyRanges()) { - optionals.set(3); - } - if (struct.isSetScaleTimestamp()) { - optionals.set(4); - } - oprot.writeBitSet(optionals, 5); - if (struct.isSetScope()) { - oprot.writeString(struct.scope); - } - if (struct.isSetStream()) { - oprot.writeString(struct.stream); - } - if (struct.isSetSealedSegments()) { - { - oprot.writeI32(struct.sealedSegments.size()); - for (int _iter61 : struct.sealedSegments) - { - oprot.writeI32(_iter61); - } - } - } - if (struct.isSetNewKeyRanges()) { - { - oprot.writeI32(struct.newKeyRanges.size()); - for (Map.Entry _iter62 : struct.newKeyRanges.entrySet()) - { - oprot.writeDouble(_iter62.getKey()); - oprot.writeDouble(_iter62.getValue()); - } - } - } - if (struct.isSetScaleTimestamp()) { - oprot.writeI64(struct.scaleTimestamp); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, scale_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(5); - if (incoming.get(0)) { - struct.scope = iprot.readString(); - struct.setScopeIsSet(true); - } - if (incoming.get(1)) { - struct.stream = iprot.readString(); - struct.setStreamIsSet(true); - } - if (incoming.get(2)) { - { - org.apache.thrift.protocol.TList _list63 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, iprot.readI32()); - struct.sealedSegments = new ArrayList(_list63.size); - int _elem64; - for (int _i65 = 0; _i65 < _list63.size; ++_i65) - { - _elem64 = iprot.readI32(); - struct.sealedSegments.add(_elem64); - } - } - struct.setSealedSegmentsIsSet(true); - } - if (incoming.get(3)) { - { - org.apache.thrift.protocol.TMap _map66 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.DOUBLE, org.apache.thrift.protocol.TType.DOUBLE, iprot.readI32()); - struct.newKeyRanges = new HashMap(2*_map66.size); - double _key67; - double _val68; - for (int _i69 = 0; _i69 < _map66.size; ++_i69) - { - _key67 = iprot.readDouble(); - _val68 = iprot.readDouble(); - struct.newKeyRanges.put(_key67, _val68); - } - } - struct.setNewKeyRangesIsSet(true); - } - if (incoming.get(4)) { - struct.scaleTimestamp = iprot.readI64(); - struct.setScaleTimestampIsSet(true); - } - } - } - - } - - public static class scale_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("scale_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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new scale_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new scale_resultTupleSchemeFactory()); - } - - private ScaleResponse success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ScaleResponse.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scale_result.class, metaDataMap); - } - - public scale_result() { - } - - public scale_result( - ScaleResponse success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public scale_result(scale_result other) { - if (other.isSetSuccess()) { - this.success = new ScaleResponse(other.success); - } - } - - public scale_result deepCopy() { - return new scale_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public ScaleResponse getSuccess() { - return this.success; - } - - public scale_result setSuccess(ScaleResponse 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; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((ScaleResponse)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof scale_result) - return this.equals((scale_result)that); - return false; - } - - public boolean equals(scale_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); - - return list.hashCode(); - } - - @Override - public int compareTo(scale_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("scale_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, 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 scale_resultStandardSchemeFactory implements SchemeFactory { - public scale_resultStandardScheme getScheme() { - return new scale_resultStandardScheme(); - } - } - - private static class scale_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, scale_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new ScaleResponse(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, scale_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class scale_resultTupleSchemeFactory implements SchemeFactory { - public scale_resultTupleScheme getScheme() { - return new scale_resultTupleScheme(); - } - } - - private static class scale_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, scale_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, scale_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new ScaleResponse(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class getURI_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("getURI_args"); - - private static final org.apache.thrift.protocol.TField SEGMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("segment", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new getURI_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new getURI_argsTupleSchemeFactory()); - } - - private SegmentId segment; // 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 { - SEGMENT((short)1, "segment"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SEGMENT - return SEGMENT; - 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 IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SEGMENT, new org.apache.thrift.meta_data.FieldMetaData("segment", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, SegmentId.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getURI_args.class, metaDataMap); - } - - public getURI_args() { - } - - public getURI_args( - SegmentId segment) - { - this(); - this.segment = segment; - } - - /** - * Performs a deep copy on other. - */ - public getURI_args(getURI_args other) { - if (other.isSetSegment()) { - this.segment = new SegmentId(other.segment); - } - } - - public getURI_args deepCopy() { - return new getURI_args(this); - } - - @Override - public void clear() { - this.segment = null; - } - - public SegmentId getSegment() { - return this.segment; - } - - public getURI_args setSegment(SegmentId segment) { - this.segment = segment; - return this; - } - - public void unsetSegment() { - this.segment = null; - } - - /** Returns true if field segment is set (has been assigned a value) and false otherwise */ - public boolean isSetSegment() { - return this.segment != null; - } - - public void setSegmentIsSet(boolean value) { - if (!value) { - this.segment = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SEGMENT: - if (value == null) { - unsetSegment(); - } else { - setSegment((SegmentId)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SEGMENT: - return getSegment(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SEGMENT: - return isSetSegment(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getURI_args) - return this.equals((getURI_args)that); - return false; - } - - public boolean equals(getURI_args that) { - if (that == null) - return false; - - boolean this_present_segment = true && this.isSetSegment(); - boolean that_present_segment = true && that.isSetSegment(); - if (this_present_segment || that_present_segment) { - if (!(this_present_segment && that_present_segment)) - return false; - if (!this.segment.equals(that.segment)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_segment = true && (isSetSegment()); - list.add(present_segment); - if (present_segment) - list.add(segment); - - return list.hashCode(); - } - - @Override - public int compareTo(getURI_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSegment()).compareTo(other.isSetSegment()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSegment()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.segment, other.segment); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getURI_args("); - boolean first = true; - - sb.append("segment:"); - if (this.segment == null) { - sb.append("null"); - } else { - sb.append(this.segment); - } - 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 (segment != null) { - segment.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, 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 getURI_argsStandardSchemeFactory implements SchemeFactory { - public getURI_argsStandardScheme getScheme() { - return new getURI_argsStandardScheme(); - } - } - - private static class getURI_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, getURI_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: // SEGMENT - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.segment = new SegmentId(); - struct.segment.read(iprot); - struct.setSegmentIsSet(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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, getURI_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.segment != null) { - oprot.writeFieldBegin(SEGMENT_FIELD_DESC); - struct.segment.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class getURI_argsTupleSchemeFactory implements SchemeFactory { - public getURI_argsTupleScheme getScheme() { - return new getURI_argsTupleScheme(); - } - } - - private static class getURI_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, getURI_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSegment()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSegment()) { - struct.segment.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, getURI_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.segment = new SegmentId(); - struct.segment.read(iprot); - struct.setSegmentIsSet(true); - } - } - } - - } - - public static class getURI_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("getURI_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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new getURI_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new getURI_resultTupleSchemeFactory()); - } - - private NodeUri success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, NodeUri.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getURI_result.class, metaDataMap); - } - - public getURI_result() { - } - - public getURI_result( - NodeUri success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public getURI_result(getURI_result other) { - if (other.isSetSuccess()) { - this.success = new NodeUri(other.success); - } - } - - public getURI_result deepCopy() { - return new getURI_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public NodeUri getSuccess() { - return this.success; - } - - public getURI_result setSuccess(NodeUri 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; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((NodeUri)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getURI_result) - return this.equals((getURI_result)that); - return false; - } - - public boolean equals(getURI_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); - - return list.hashCode(); - } - - @Override - public int compareTo(getURI_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getURI_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, 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 getURI_resultStandardSchemeFactory implements SchemeFactory { - public getURI_resultStandardScheme getScheme() { - return new getURI_resultStandardScheme(); - } - } - - private static class getURI_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, getURI_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new NodeUri(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, getURI_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class getURI_resultTupleSchemeFactory implements SchemeFactory { - public getURI_resultTupleScheme getScheme() { - return new getURI_resultTupleScheme(); - } - } - - private static class getURI_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, getURI_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, getURI_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new NodeUri(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class isSegmentValid_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("isSegmentValid_args"); - - private static final org.apache.thrift.protocol.TField SCOPE_FIELD_DESC = new org.apache.thrift.protocol.TField("scope", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField STREAM_FIELD_DESC = new org.apache.thrift.protocol.TField("stream", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField SEGMENT_NUMBER_FIELD_DESC = new org.apache.thrift.protocol.TField("segmentNumber", org.apache.thrift.protocol.TType.I32, (short)3); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new isSegmentValid_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new isSegmentValid_argsTupleSchemeFactory()); - } - - private String scope; // required - private String stream; // required - private int segmentNumber; // 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 { - SCOPE((short)1, "scope"), - STREAM((short)2, "stream"), - SEGMENT_NUMBER((short)3, "segmentNumber"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SCOPE - return SCOPE; - case 2: // STREAM - return STREAM; - case 3: // SEGMENT_NUMBER - return SEGMENT_NUMBER; - 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 IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __SEGMENTNUMBER_ISSET_ID = 0; - private byte __isset_bitfield = 0; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SCOPE, new org.apache.thrift.meta_data.FieldMetaData("scope", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.STREAM, new org.apache.thrift.meta_data.FieldMetaData("stream", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.SEGMENT_NUMBER, new org.apache.thrift.meta_data.FieldMetaData("segmentNumber", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isSegmentValid_args.class, metaDataMap); - } - - public isSegmentValid_args() { - } - - public isSegmentValid_args( - String scope, - String stream, - int segmentNumber) - { - this(); - this.scope = scope; - this.stream = stream; - this.segmentNumber = segmentNumber; - setSegmentNumberIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public isSegmentValid_args(isSegmentValid_args other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetScope()) { - this.scope = other.scope; - } - if (other.isSetStream()) { - this.stream = other.stream; - } - this.segmentNumber = other.segmentNumber; - } - - public isSegmentValid_args deepCopy() { - return new isSegmentValid_args(this); - } - - @Override - public void clear() { - this.scope = null; - this.stream = null; - setSegmentNumberIsSet(false); - this.segmentNumber = 0; - } - - public String getScope() { - return this.scope; - } - - public isSegmentValid_args setScope(String scope) { - this.scope = scope; - return this; - } - - public void unsetScope() { - this.scope = null; - } - - /** Returns true if field scope is set (has been assigned a value) and false otherwise */ - public boolean isSetScope() { - return this.scope != null; - } - - public void setScopeIsSet(boolean value) { - if (!value) { - this.scope = null; - } - } - - public String getStream() { - return this.stream; - } - - public isSegmentValid_args setStream(String stream) { - this.stream = stream; - return this; - } - - public void unsetStream() { - this.stream = null; - } - - /** Returns true if field stream is set (has been assigned a value) and false otherwise */ - public boolean isSetStream() { - return this.stream != null; - } - - public void setStreamIsSet(boolean value) { - if (!value) { - this.stream = null; - } - } - - public int getSegmentNumber() { - return this.segmentNumber; - } - - public isSegmentValid_args setSegmentNumber(int segmentNumber) { - this.segmentNumber = segmentNumber; - setSegmentNumberIsSet(true); - return this; - } - - public void unsetSegmentNumber() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SEGMENTNUMBER_ISSET_ID); - } - - /** Returns true if field segmentNumber is set (has been assigned a value) and false otherwise */ - public boolean isSetSegmentNumber() { - return EncodingUtils.testBit(__isset_bitfield, __SEGMENTNUMBER_ISSET_ID); - } - - public void setSegmentNumberIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SEGMENTNUMBER_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SCOPE: - if (value == null) { - unsetScope(); - } else { - setScope((String)value); - } - break; - - case STREAM: - if (value == null) { - unsetStream(); - } else { - setStream((String)value); - } - break; - - case SEGMENT_NUMBER: - if (value == null) { - unsetSegmentNumber(); - } else { - setSegmentNumber((Integer)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SCOPE: - return getScope(); - - case STREAM: - return getStream(); - - case SEGMENT_NUMBER: - return getSegmentNumber(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SCOPE: - return isSetScope(); - case STREAM: - return isSetStream(); - case SEGMENT_NUMBER: - return isSetSegmentNumber(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof isSegmentValid_args) - return this.equals((isSegmentValid_args)that); - return false; - } - - public boolean equals(isSegmentValid_args that) { - if (that == null) - return false; - - boolean this_present_scope = true && this.isSetScope(); - boolean that_present_scope = true && that.isSetScope(); - if (this_present_scope || that_present_scope) { - if (!(this_present_scope && that_present_scope)) - return false; - if (!this.scope.equals(that.scope)) - return false; - } - - boolean this_present_stream = true && this.isSetStream(); - boolean that_present_stream = true && that.isSetStream(); - if (this_present_stream || that_present_stream) { - if (!(this_present_stream && that_present_stream)) - return false; - if (!this.stream.equals(that.stream)) - return false; - } - - boolean this_present_segmentNumber = true; - boolean that_present_segmentNumber = true; - if (this_present_segmentNumber || that_present_segmentNumber) { - if (!(this_present_segmentNumber && that_present_segmentNumber)) - return false; - if (this.segmentNumber != that.segmentNumber) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_scope = true && (isSetScope()); - list.add(present_scope); - if (present_scope) - list.add(scope); - - boolean present_stream = true && (isSetStream()); - list.add(present_stream); - if (present_stream) - list.add(stream); - - boolean present_segmentNumber = true; - list.add(present_segmentNumber); - if (present_segmentNumber) - list.add(segmentNumber); - - return list.hashCode(); - } - - @Override - public int compareTo(isSegmentValid_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetScope()).compareTo(other.isSetScope()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetScope()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scope, other.scope); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetStream()).compareTo(other.isSetStream()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStream()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stream, other.stream); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetSegmentNumber()).compareTo(other.isSetSegmentNumber()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSegmentNumber()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.segmentNumber, other.segmentNumber); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("isSegmentValid_args("); - boolean first = true; - - sb.append("scope:"); - if (this.scope == null) { - sb.append("null"); - } else { - sb.append(this.scope); - } - first = false; - if (!first) sb.append(", "); - sb.append("stream:"); - if (this.stream == null) { - sb.append("null"); - } else { - sb.append(this.stream); - } - first = false; - if (!first) sb.append(", "); - sb.append("segmentNumber:"); - sb.append(this.segmentNumber); - 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, 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 isSegmentValid_argsStandardSchemeFactory implements SchemeFactory { - public isSegmentValid_argsStandardScheme getScheme() { - return new isSegmentValid_argsStandardScheme(); - } - } - - private static class isSegmentValid_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, isSegmentValid_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: // SCOPE - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.scope = iprot.readString(); - struct.setScopeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // STREAM - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.stream = iprot.readString(); - struct.setStreamIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // SEGMENT_NUMBER - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.segmentNumber = iprot.readI32(); - struct.setSegmentNumberIsSet(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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, isSegmentValid_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.scope != null) { - oprot.writeFieldBegin(SCOPE_FIELD_DESC); - oprot.writeString(struct.scope); - oprot.writeFieldEnd(); - } - if (struct.stream != null) { - oprot.writeFieldBegin(STREAM_FIELD_DESC); - oprot.writeString(struct.stream); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(SEGMENT_NUMBER_FIELD_DESC); - oprot.writeI32(struct.segmentNumber); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class isSegmentValid_argsTupleSchemeFactory implements SchemeFactory { - public isSegmentValid_argsTupleScheme getScheme() { - return new isSegmentValid_argsTupleScheme(); - } - } - - private static class isSegmentValid_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, isSegmentValid_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetScope()) { - optionals.set(0); - } - if (struct.isSetStream()) { - optionals.set(1); - } - if (struct.isSetSegmentNumber()) { - optionals.set(2); - } - oprot.writeBitSet(optionals, 3); - if (struct.isSetScope()) { - oprot.writeString(struct.scope); - } - if (struct.isSetStream()) { - oprot.writeString(struct.stream); - } - if (struct.isSetSegmentNumber()) { - oprot.writeI32(struct.segmentNumber); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, isSegmentValid_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(3); - if (incoming.get(0)) { - struct.scope = iprot.readString(); - struct.setScopeIsSet(true); - } - if (incoming.get(1)) { - struct.stream = iprot.readString(); - struct.setStreamIsSet(true); - } - if (incoming.get(2)) { - struct.segmentNumber = iprot.readI32(); - struct.setSegmentNumberIsSet(true); - } - } - } - - } - - public static class isSegmentValid_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("isSegmentValid_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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new isSegmentValid_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new isSegmentValid_resultTupleSchemeFactory()); - } - - private boolean success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __SUCCESS_ISSET_ID = 0; - private byte __isset_bitfield = 0; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isSegmentValid_result.class, metaDataMap); - } - - public isSegmentValid_result() { - } - - public isSegmentValid_result( - boolean success) - { - this(); - this.success = success; - setSuccessIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public isSegmentValid_result(isSegmentValid_result other) { - __isset_bitfield = other.__isset_bitfield; - this.success = other.success; - } - - public isSegmentValid_result deepCopy() { - return new isSegmentValid_result(this); - } - - @Override - public void clear() { - setSuccessIsSet(false); - this.success = false; - } - - public boolean isSuccess() { - return this.success; - } - - public isSegmentValid_result setSuccess(boolean success) { - this.success = success; - setSuccessIsSet(true); - return this; - } - - public void unsetSuccess() { - __isset_bitfield = 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 EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); - } - - public void setSuccessIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((Boolean)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return isSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof isSegmentValid_result) - return this.equals((isSegmentValid_result)that); - return false; - } - - public boolean equals(isSegmentValid_result that) { - if (that == null) - return false; - - boolean this_present_success = true; - boolean that_present_success = true; - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (this.success != that.success) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_success = true; - list.add(present_success); - if (present_success) - list.add(success); - - return list.hashCode(); - } - - @Override - public int compareTo(isSegmentValid_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("isSegmentValid_result("); - boolean first = true; - - sb.append("success:"); - sb.append(this.success); - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, 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 isSegmentValid_resultStandardSchemeFactory implements SchemeFactory { - public isSegmentValid_resultStandardScheme getScheme() { - return new isSegmentValid_resultStandardScheme(); - } - } - - private static class isSegmentValid_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, isSegmentValid_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.success = iprot.readBool(); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, isSegmentValid_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeBool(struct.success); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class isSegmentValid_resultTupleSchemeFactory implements SchemeFactory { - public isSegmentValid_resultTupleScheme getScheme() { - return new isSegmentValid_resultTupleScheme(); - } - } - - private static class isSegmentValid_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, isSegmentValid_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - oprot.writeBool(struct.success); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, isSegmentValid_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = iprot.readBool(); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class createTransaction_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("createTransaction_args"); - - private static final org.apache.thrift.protocol.TField SCOPE_FIELD_DESC = new org.apache.thrift.protocol.TField("scope", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField STREAM_FIELD_DESC = new org.apache.thrift.protocol.TField("stream", org.apache.thrift.protocol.TType.STRING, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new createTransaction_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new createTransaction_argsTupleSchemeFactory()); - } - - private String scope; // required - private String stream; // 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 { - SCOPE((short)1, "scope"), - STREAM((short)2, "stream"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SCOPE - return SCOPE; - case 2: // STREAM - return STREAM; - 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 IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SCOPE, new org.apache.thrift.meta_data.FieldMetaData("scope", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.STREAM, new org.apache.thrift.meta_data.FieldMetaData("stream", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createTransaction_args.class, metaDataMap); - } - - public createTransaction_args() { - } - - public createTransaction_args( - String scope, - String stream) - { - this(); - this.scope = scope; - this.stream = stream; - } - - /** - * Performs a deep copy on other. - */ - public createTransaction_args(createTransaction_args other) { - if (other.isSetScope()) { - this.scope = other.scope; - } - if (other.isSetStream()) { - this.stream = other.stream; - } - } - - public createTransaction_args deepCopy() { - return new createTransaction_args(this); - } - - @Override - public void clear() { - this.scope = null; - this.stream = null; - } - - public String getScope() { - return this.scope; - } - - public createTransaction_args setScope(String scope) { - this.scope = scope; - return this; - } - - public void unsetScope() { - this.scope = null; - } - - /** Returns true if field scope is set (has been assigned a value) and false otherwise */ - public boolean isSetScope() { - return this.scope != null; - } - - public void setScopeIsSet(boolean value) { - if (!value) { - this.scope = null; - } - } - - public String getStream() { - return this.stream; - } - - public createTransaction_args setStream(String stream) { - this.stream = stream; - return this; - } - - public void unsetStream() { - this.stream = null; - } - - /** Returns true if field stream is set (has been assigned a value) and false otherwise */ - public boolean isSetStream() { - return this.stream != null; - } - - public void setStreamIsSet(boolean value) { - if (!value) { - this.stream = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SCOPE: - if (value == null) { - unsetScope(); - } else { - setScope((String)value); - } - break; - - case STREAM: - if (value == null) { - unsetStream(); - } else { - setStream((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SCOPE: - return getScope(); - - case STREAM: - return getStream(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SCOPE: - return isSetScope(); - case STREAM: - return isSetStream(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof createTransaction_args) - return this.equals((createTransaction_args)that); - return false; - } - - public boolean equals(createTransaction_args that) { - if (that == null) - return false; - - boolean this_present_scope = true && this.isSetScope(); - boolean that_present_scope = true && that.isSetScope(); - if (this_present_scope || that_present_scope) { - if (!(this_present_scope && that_present_scope)) - return false; - if (!this.scope.equals(that.scope)) - return false; - } - - boolean this_present_stream = true && this.isSetStream(); - boolean that_present_stream = true && that.isSetStream(); - if (this_present_stream || that_present_stream) { - if (!(this_present_stream && that_present_stream)) - return false; - if (!this.stream.equals(that.stream)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_scope = true && (isSetScope()); - list.add(present_scope); - if (present_scope) - list.add(scope); - - boolean present_stream = true && (isSetStream()); - list.add(present_stream); - if (present_stream) - list.add(stream); - - return list.hashCode(); - } - - @Override - public int compareTo(createTransaction_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetScope()).compareTo(other.isSetScope()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetScope()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scope, other.scope); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetStream()).compareTo(other.isSetStream()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStream()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stream, other.stream); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("createTransaction_args("); - boolean first = true; - - sb.append("scope:"); - if (this.scope == null) { - sb.append("null"); - } else { - sb.append(this.scope); - } - first = false; - if (!first) sb.append(", "); - sb.append("stream:"); - if (this.stream == null) { - sb.append("null"); - } else { - sb.append(this.stream); - } - 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, 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 createTransaction_argsStandardSchemeFactory implements SchemeFactory { - public createTransaction_argsStandardScheme getScheme() { - return new createTransaction_argsStandardScheme(); - } - } - - private static class createTransaction_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, createTransaction_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: // SCOPE - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.scope = iprot.readString(); - struct.setScopeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // STREAM - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.stream = iprot.readString(); - struct.setStreamIsSet(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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, createTransaction_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.scope != null) { - oprot.writeFieldBegin(SCOPE_FIELD_DESC); - oprot.writeString(struct.scope); - oprot.writeFieldEnd(); - } - if (struct.stream != null) { - oprot.writeFieldBegin(STREAM_FIELD_DESC); - oprot.writeString(struct.stream); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class createTransaction_argsTupleSchemeFactory implements SchemeFactory { - public createTransaction_argsTupleScheme getScheme() { - return new createTransaction_argsTupleScheme(); - } - } - - private static class createTransaction_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, createTransaction_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetScope()) { - optionals.set(0); - } - if (struct.isSetStream()) { - optionals.set(1); - } - oprot.writeBitSet(optionals, 2); - if (struct.isSetScope()) { - oprot.writeString(struct.scope); - } - if (struct.isSetStream()) { - oprot.writeString(struct.stream); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, createTransaction_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(2); - if (incoming.get(0)) { - struct.scope = iprot.readString(); - struct.setScopeIsSet(true); - } - if (incoming.get(1)) { - struct.stream = iprot.readString(); - struct.setStreamIsSet(true); - } - } - } - - } - - public static class createTransaction_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("createTransaction_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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new createTransaction_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new createTransaction_resultTupleSchemeFactory()); - } - - private TxnId success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TxnId.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createTransaction_result.class, metaDataMap); - } - - public createTransaction_result() { - } - - public createTransaction_result( - TxnId success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public createTransaction_result(createTransaction_result other) { - if (other.isSetSuccess()) { - this.success = new TxnId(other.success); - } - } - - public createTransaction_result deepCopy() { - return new createTransaction_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TxnId getSuccess() { - return this.success; - } - - public createTransaction_result setSuccess(TxnId 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; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TxnId)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof createTransaction_result) - return this.equals((createTransaction_result)that); - return false; - } - - public boolean equals(createTransaction_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); - - return list.hashCode(); - } - - @Override - public int compareTo(createTransaction_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("createTransaction_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, 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 createTransaction_resultStandardSchemeFactory implements SchemeFactory { - public createTransaction_resultStandardScheme getScheme() { - return new createTransaction_resultStandardScheme(); - } - } - - private static class createTransaction_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, createTransaction_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TxnId(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, createTransaction_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class createTransaction_resultTupleSchemeFactory implements SchemeFactory { - public createTransaction_resultTupleScheme getScheme() { - return new createTransaction_resultTupleScheme(); - } - } - - private static class createTransaction_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, createTransaction_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, createTransaction_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TxnId(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class commitTransaction_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("commitTransaction_args"); - - private static final org.apache.thrift.protocol.TField SCOPE_FIELD_DESC = new org.apache.thrift.protocol.TField("scope", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField STREAM_FIELD_DESC = new org.apache.thrift.protocol.TField("stream", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField TXNID_FIELD_DESC = new org.apache.thrift.protocol.TField("txnid", org.apache.thrift.protocol.TType.STRUCT, (short)3); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new commitTransaction_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new commitTransaction_argsTupleSchemeFactory()); - } - - private String scope; // required - private String stream; // required - private TxnId txnid; // 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 { - SCOPE((short)1, "scope"), - STREAM((short)2, "stream"), - TXNID((short)3, "txnid"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SCOPE - return SCOPE; - case 2: // STREAM - return STREAM; - case 3: // TXNID - return TXNID; - 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 IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SCOPE, new org.apache.thrift.meta_data.FieldMetaData("scope", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.STREAM, new org.apache.thrift.meta_data.FieldMetaData("stream", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.TXNID, new org.apache.thrift.meta_data.FieldMetaData("txnid", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TxnId.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(commitTransaction_args.class, metaDataMap); - } - - public commitTransaction_args() { - } - - public commitTransaction_args( - String scope, - String stream, - TxnId txnid) - { - this(); - this.scope = scope; - this.stream = stream; - this.txnid = txnid; - } - - /** - * Performs a deep copy on other. - */ - public commitTransaction_args(commitTransaction_args other) { - if (other.isSetScope()) { - this.scope = other.scope; - } - if (other.isSetStream()) { - this.stream = other.stream; - } - if (other.isSetTxnid()) { - this.txnid = new TxnId(other.txnid); - } - } - - public commitTransaction_args deepCopy() { - return new commitTransaction_args(this); - } - - @Override - public void clear() { - this.scope = null; - this.stream = null; - this.txnid = null; - } - - public String getScope() { - return this.scope; - } - - public commitTransaction_args setScope(String scope) { - this.scope = scope; - return this; - } - - public void unsetScope() { - this.scope = null; - } - - /** Returns true if field scope is set (has been assigned a value) and false otherwise */ - public boolean isSetScope() { - return this.scope != null; - } - - public void setScopeIsSet(boolean value) { - if (!value) { - this.scope = null; - } - } - - public String getStream() { - return this.stream; - } - - public commitTransaction_args setStream(String stream) { - this.stream = stream; - return this; - } - - public void unsetStream() { - this.stream = null; - } - - /** Returns true if field stream is set (has been assigned a value) and false otherwise */ - public boolean isSetStream() { - return this.stream != null; - } - - public void setStreamIsSet(boolean value) { - if (!value) { - this.stream = null; - } - } - - public TxnId getTxnid() { - return this.txnid; - } - - public commitTransaction_args setTxnid(TxnId txnid) { - this.txnid = txnid; - return this; - } - - public void unsetTxnid() { - this.txnid = null; - } - - /** Returns true if field txnid is set (has been assigned a value) and false otherwise */ - public boolean isSetTxnid() { - return this.txnid != null; - } - - public void setTxnidIsSet(boolean value) { - if (!value) { - this.txnid = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SCOPE: - if (value == null) { - unsetScope(); - } else { - setScope((String)value); - } - break; - - case STREAM: - if (value == null) { - unsetStream(); - } else { - setStream((String)value); - } - break; - - case TXNID: - if (value == null) { - unsetTxnid(); - } else { - setTxnid((TxnId)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SCOPE: - return getScope(); - - case STREAM: - return getStream(); - - case TXNID: - return getTxnid(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SCOPE: - return isSetScope(); - case STREAM: - return isSetStream(); - case TXNID: - return isSetTxnid(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof commitTransaction_args) - return this.equals((commitTransaction_args)that); - return false; - } - - public boolean equals(commitTransaction_args that) { - if (that == null) - return false; - - boolean this_present_scope = true && this.isSetScope(); - boolean that_present_scope = true && that.isSetScope(); - if (this_present_scope || that_present_scope) { - if (!(this_present_scope && that_present_scope)) - return false; - if (!this.scope.equals(that.scope)) - return false; - } - - boolean this_present_stream = true && this.isSetStream(); - boolean that_present_stream = true && that.isSetStream(); - if (this_present_stream || that_present_stream) { - if (!(this_present_stream && that_present_stream)) - return false; - if (!this.stream.equals(that.stream)) - return false; - } - - boolean this_present_txnid = true && this.isSetTxnid(); - boolean that_present_txnid = true && that.isSetTxnid(); - if (this_present_txnid || that_present_txnid) { - if (!(this_present_txnid && that_present_txnid)) - return false; - if (!this.txnid.equals(that.txnid)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_scope = true && (isSetScope()); - list.add(present_scope); - if (present_scope) - list.add(scope); - - boolean present_stream = true && (isSetStream()); - list.add(present_stream); - if (present_stream) - list.add(stream); - - boolean present_txnid = true && (isSetTxnid()); - list.add(present_txnid); - if (present_txnid) - list.add(txnid); - - return list.hashCode(); - } - - @Override - public int compareTo(commitTransaction_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetScope()).compareTo(other.isSetScope()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetScope()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scope, other.scope); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetStream()).compareTo(other.isSetStream()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStream()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stream, other.stream); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetTxnid()).compareTo(other.isSetTxnid()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTxnid()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.txnid, other.txnid); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("commitTransaction_args("); - boolean first = true; - - sb.append("scope:"); - if (this.scope == null) { - sb.append("null"); - } else { - sb.append(this.scope); - } - first = false; - if (!first) sb.append(", "); - sb.append("stream:"); - if (this.stream == null) { - sb.append("null"); - } else { - sb.append(this.stream); - } - first = false; - if (!first) sb.append(", "); - sb.append("txnid:"); - if (this.txnid == null) { - sb.append("null"); - } else { - sb.append(this.txnid); - } - 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 (txnid != null) { - txnid.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, 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 commitTransaction_argsStandardSchemeFactory implements SchemeFactory { - public commitTransaction_argsStandardScheme getScheme() { - return new commitTransaction_argsStandardScheme(); - } - } - - private static class commitTransaction_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, commitTransaction_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: // SCOPE - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.scope = iprot.readString(); - struct.setScopeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // STREAM - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.stream = iprot.readString(); - struct.setStreamIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // TXNID - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.txnid = new TxnId(); - struct.txnid.read(iprot); - struct.setTxnidIsSet(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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, commitTransaction_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.scope != null) { - oprot.writeFieldBegin(SCOPE_FIELD_DESC); - oprot.writeString(struct.scope); - oprot.writeFieldEnd(); - } - if (struct.stream != null) { - oprot.writeFieldBegin(STREAM_FIELD_DESC); - oprot.writeString(struct.stream); - oprot.writeFieldEnd(); - } - if (struct.txnid != null) { - oprot.writeFieldBegin(TXNID_FIELD_DESC); - struct.txnid.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class commitTransaction_argsTupleSchemeFactory implements SchemeFactory { - public commitTransaction_argsTupleScheme getScheme() { - return new commitTransaction_argsTupleScheme(); - } - } - - private static class commitTransaction_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, commitTransaction_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetScope()) { - optionals.set(0); - } - if (struct.isSetStream()) { - optionals.set(1); - } - if (struct.isSetTxnid()) { - optionals.set(2); - } - oprot.writeBitSet(optionals, 3); - if (struct.isSetScope()) { - oprot.writeString(struct.scope); - } - if (struct.isSetStream()) { - oprot.writeString(struct.stream); - } - if (struct.isSetTxnid()) { - struct.txnid.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, commitTransaction_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(3); - if (incoming.get(0)) { - struct.scope = iprot.readString(); - struct.setScopeIsSet(true); - } - if (incoming.get(1)) { - struct.stream = iprot.readString(); - struct.setStreamIsSet(true); - } - if (incoming.get(2)) { - struct.txnid = new TxnId(); - struct.txnid.read(iprot); - struct.setTxnidIsSet(true); - } - } - } - - } - - public static class commitTransaction_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("commitTransaction_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new commitTransaction_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new commitTransaction_resultTupleSchemeFactory()); - } - - private TxnStatus success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - /** - * - * @see TxnStatus - */ - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new 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.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TxnStatus.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(commitTransaction_result.class, metaDataMap); - } - - public commitTransaction_result() { - } - - public commitTransaction_result( - TxnStatus success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public commitTransaction_result(commitTransaction_result other) { - if (other.isSetSuccess()) { - this.success = other.success; - } - } - - public commitTransaction_result deepCopy() { - return new commitTransaction_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - /** - * - * @see TxnStatus - */ - public TxnStatus getSuccess() { - return this.success; - } - - /** - * - * @see TxnStatus - */ - public commitTransaction_result setSuccess(TxnStatus 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; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TxnStatus)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof commitTransaction_result) - return this.equals((commitTransaction_result)that); - return false; - } - - public boolean equals(commitTransaction_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success.getValue()); - - return list.hashCode(); - } - - @Override - public int compareTo(commitTransaction_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("commitTransaction_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, 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 commitTransaction_resultStandardSchemeFactory implements SchemeFactory { - public commitTransaction_resultStandardScheme getScheme() { - return new commitTransaction_resultStandardScheme(); - } - } - - private static class commitTransaction_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, commitTransaction_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.I32) { - struct.success = com.emc.pravega.controller.stream.api.v1.TxnStatus.findByValue(iprot.readI32()); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, commitTransaction_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeI32(struct.success.getValue()); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class commitTransaction_resultTupleSchemeFactory implements SchemeFactory { - public commitTransaction_resultTupleScheme getScheme() { - return new commitTransaction_resultTupleScheme(); - } - } - - private static class commitTransaction_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, commitTransaction_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - oprot.writeI32(struct.success.getValue()); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, commitTransaction_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = com.emc.pravega.controller.stream.api.v1.TxnStatus.findByValue(iprot.readI32()); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class abortTransaction_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("abortTransaction_args"); - - private static final org.apache.thrift.protocol.TField SCOPE_FIELD_DESC = new org.apache.thrift.protocol.TField("scope", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField STREAM_FIELD_DESC = new org.apache.thrift.protocol.TField("stream", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField TXNID_FIELD_DESC = new org.apache.thrift.protocol.TField("txnid", org.apache.thrift.protocol.TType.STRUCT, (short)3); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new abortTransaction_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new abortTransaction_argsTupleSchemeFactory()); - } - - private String scope; // required - private String stream; // required - private TxnId txnid; // 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 { - SCOPE((short)1, "scope"), - STREAM((short)2, "stream"), - TXNID((short)3, "txnid"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SCOPE - return SCOPE; - case 2: // STREAM - return STREAM; - case 3: // TXNID - return TXNID; - 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 IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SCOPE, new org.apache.thrift.meta_data.FieldMetaData("scope", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.STREAM, new org.apache.thrift.meta_data.FieldMetaData("stream", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.TXNID, new org.apache.thrift.meta_data.FieldMetaData("txnid", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TxnId.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(abortTransaction_args.class, metaDataMap); - } - - public abortTransaction_args() { - } - - public abortTransaction_args( - String scope, - String stream, - TxnId txnid) - { - this(); - this.scope = scope; - this.stream = stream; - this.txnid = txnid; - } - - /** - * Performs a deep copy on other. - */ - public abortTransaction_args(abortTransaction_args other) { - if (other.isSetScope()) { - this.scope = other.scope; - } - if (other.isSetStream()) { - this.stream = other.stream; - } - if (other.isSetTxnid()) { - this.txnid = new TxnId(other.txnid); - } - } - - public abortTransaction_args deepCopy() { - return new abortTransaction_args(this); - } - - @Override - public void clear() { - this.scope = null; - this.stream = null; - this.txnid = null; - } - - public String getScope() { - return this.scope; - } - - public abortTransaction_args setScope(String scope) { - this.scope = scope; - return this; - } - - public void unsetScope() { - this.scope = null; - } - - /** Returns true if field scope is set (has been assigned a value) and false otherwise */ - public boolean isSetScope() { - return this.scope != null; - } - - public void setScopeIsSet(boolean value) { - if (!value) { - this.scope = null; - } - } - - public String getStream() { - return this.stream; - } - - public abortTransaction_args setStream(String stream) { - this.stream = stream; - return this; - } - - public void unsetStream() { - this.stream = null; - } - - /** Returns true if field stream is set (has been assigned a value) and false otherwise */ - public boolean isSetStream() { - return this.stream != null; - } - - public void setStreamIsSet(boolean value) { - if (!value) { - this.stream = null; - } - } - - public TxnId getTxnid() { - return this.txnid; - } - - public abortTransaction_args setTxnid(TxnId txnid) { - this.txnid = txnid; - return this; - } - - public void unsetTxnid() { - this.txnid = null; - } - - /** Returns true if field txnid is set (has been assigned a value) and false otherwise */ - public boolean isSetTxnid() { - return this.txnid != null; - } - - public void setTxnidIsSet(boolean value) { - if (!value) { - this.txnid = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SCOPE: - if (value == null) { - unsetScope(); - } else { - setScope((String)value); - } - break; - - case STREAM: - if (value == null) { - unsetStream(); - } else { - setStream((String)value); - } - break; - - case TXNID: - if (value == null) { - unsetTxnid(); - } else { - setTxnid((TxnId)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SCOPE: - return getScope(); - - case STREAM: - return getStream(); - - case TXNID: - return getTxnid(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SCOPE: - return isSetScope(); - case STREAM: - return isSetStream(); - case TXNID: - return isSetTxnid(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof abortTransaction_args) - return this.equals((abortTransaction_args)that); - return false; - } - - public boolean equals(abortTransaction_args that) { - if (that == null) - return false; - - boolean this_present_scope = true && this.isSetScope(); - boolean that_present_scope = true && that.isSetScope(); - if (this_present_scope || that_present_scope) { - if (!(this_present_scope && that_present_scope)) - return false; - if (!this.scope.equals(that.scope)) - return false; - } - - boolean this_present_stream = true && this.isSetStream(); - boolean that_present_stream = true && that.isSetStream(); - if (this_present_stream || that_present_stream) { - if (!(this_present_stream && that_present_stream)) - return false; - if (!this.stream.equals(that.stream)) - return false; - } - - boolean this_present_txnid = true && this.isSetTxnid(); - boolean that_present_txnid = true && that.isSetTxnid(); - if (this_present_txnid || that_present_txnid) { - if (!(this_present_txnid && that_present_txnid)) - return false; - if (!this.txnid.equals(that.txnid)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_scope = true && (isSetScope()); - list.add(present_scope); - if (present_scope) - list.add(scope); - - boolean present_stream = true && (isSetStream()); - list.add(present_stream); - if (present_stream) - list.add(stream); - - boolean present_txnid = true && (isSetTxnid()); - list.add(present_txnid); - if (present_txnid) - list.add(txnid); - - return list.hashCode(); - } - - @Override - public int compareTo(abortTransaction_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetScope()).compareTo(other.isSetScope()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetScope()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scope, other.scope); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetStream()).compareTo(other.isSetStream()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStream()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stream, other.stream); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetTxnid()).compareTo(other.isSetTxnid()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTxnid()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.txnid, other.txnid); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("abortTransaction_args("); - boolean first = true; - - sb.append("scope:"); - if (this.scope == null) { - sb.append("null"); - } else { - sb.append(this.scope); - } - first = false; - if (!first) sb.append(", "); - sb.append("stream:"); - if (this.stream == null) { - sb.append("null"); - } else { - sb.append(this.stream); - } - first = false; - if (!first) sb.append(", "); - sb.append("txnid:"); - if (this.txnid == null) { - sb.append("null"); - } else { - sb.append(this.txnid); - } - 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 (txnid != null) { - txnid.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, 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 abortTransaction_argsStandardSchemeFactory implements SchemeFactory { - public abortTransaction_argsStandardScheme getScheme() { - return new abortTransaction_argsStandardScheme(); - } - } - - private static class abortTransaction_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, abortTransaction_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: // SCOPE - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.scope = iprot.readString(); - struct.setScopeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // STREAM - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.stream = iprot.readString(); - struct.setStreamIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // TXNID - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.txnid = new TxnId(); - struct.txnid.read(iprot); - struct.setTxnidIsSet(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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, abortTransaction_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.scope != null) { - oprot.writeFieldBegin(SCOPE_FIELD_DESC); - oprot.writeString(struct.scope); - oprot.writeFieldEnd(); - } - if (struct.stream != null) { - oprot.writeFieldBegin(STREAM_FIELD_DESC); - oprot.writeString(struct.stream); - oprot.writeFieldEnd(); - } - if (struct.txnid != null) { - oprot.writeFieldBegin(TXNID_FIELD_DESC); - struct.txnid.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class abortTransaction_argsTupleSchemeFactory implements SchemeFactory { - public abortTransaction_argsTupleScheme getScheme() { - return new abortTransaction_argsTupleScheme(); - } - } - - private static class abortTransaction_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, abortTransaction_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetScope()) { - optionals.set(0); - } - if (struct.isSetStream()) { - optionals.set(1); - } - if (struct.isSetTxnid()) { - optionals.set(2); - } - oprot.writeBitSet(optionals, 3); - if (struct.isSetScope()) { - oprot.writeString(struct.scope); - } - if (struct.isSetStream()) { - oprot.writeString(struct.stream); - } - if (struct.isSetTxnid()) { - struct.txnid.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, abortTransaction_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(3); - if (incoming.get(0)) { - struct.scope = iprot.readString(); - struct.setScopeIsSet(true); - } - if (incoming.get(1)) { - struct.stream = iprot.readString(); - struct.setStreamIsSet(true); - } - if (incoming.get(2)) { - struct.txnid = new TxnId(); - struct.txnid.read(iprot); - struct.setTxnidIsSet(true); - } - } - } - - } - - public static class abortTransaction_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("abortTransaction_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new abortTransaction_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new abortTransaction_resultTupleSchemeFactory()); - } - - private TxnStatus success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - /** - * - * @see TxnStatus - */ - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new 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.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TxnStatus.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(abortTransaction_result.class, metaDataMap); - } - - public abortTransaction_result() { - } - - public abortTransaction_result( - TxnStatus success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public abortTransaction_result(abortTransaction_result other) { - if (other.isSetSuccess()) { - this.success = other.success; - } - } - - public abortTransaction_result deepCopy() { - return new abortTransaction_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - /** - * - * @see TxnStatus - */ - public TxnStatus getSuccess() { - return this.success; - } - - /** - * - * @see TxnStatus - */ - public abortTransaction_result setSuccess(TxnStatus 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; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TxnStatus)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof abortTransaction_result) - return this.equals((abortTransaction_result)that); - return false; - } - - public boolean equals(abortTransaction_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success.getValue()); - - return list.hashCode(); - } - - @Override - public int compareTo(abortTransaction_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("abortTransaction_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, 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 abortTransaction_resultStandardSchemeFactory implements SchemeFactory { - public abortTransaction_resultStandardScheme getScheme() { - return new abortTransaction_resultStandardScheme(); - } - } - - private static class abortTransaction_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, abortTransaction_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.I32) { - struct.success = com.emc.pravega.controller.stream.api.v1.TxnStatus.findByValue(iprot.readI32()); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, abortTransaction_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeI32(struct.success.getValue()); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class abortTransaction_resultTupleSchemeFactory implements SchemeFactory { - public abortTransaction_resultTupleScheme getScheme() { - return new abortTransaction_resultTupleScheme(); - } - } - - private static class abortTransaction_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, abortTransaction_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - oprot.writeI32(struct.success.getValue()); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, abortTransaction_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = com.emc.pravega.controller.stream.api.v1.TxnStatus.findByValue(iprot.readI32()); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class checkTransactionStatus_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("checkTransactionStatus_args"); - - private static final org.apache.thrift.protocol.TField SCOPE_FIELD_DESC = new org.apache.thrift.protocol.TField("scope", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField STREAM_FIELD_DESC = new org.apache.thrift.protocol.TField("stream", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField TXNID_FIELD_DESC = new org.apache.thrift.protocol.TField("txnid", org.apache.thrift.protocol.TType.STRUCT, (short)3); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new checkTransactionStatus_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new checkTransactionStatus_argsTupleSchemeFactory()); - } - - private String scope; // required - private String stream; // required - private TxnId txnid; // 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 { - SCOPE((short)1, "scope"), - STREAM((short)2, "stream"), - TXNID((short)3, "txnid"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SCOPE - return SCOPE; - case 2: // STREAM - return STREAM; - case 3: // TXNID - return TXNID; - 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 IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SCOPE, new org.apache.thrift.meta_data.FieldMetaData("scope", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.STREAM, new org.apache.thrift.meta_data.FieldMetaData("stream", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.TXNID, new org.apache.thrift.meta_data.FieldMetaData("txnid", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TxnId.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(checkTransactionStatus_args.class, metaDataMap); - } - - public checkTransactionStatus_args() { - } - - public checkTransactionStatus_args( - String scope, - String stream, - TxnId txnid) - { - this(); - this.scope = scope; - this.stream = stream; - this.txnid = txnid; - } - - /** - * Performs a deep copy on other. - */ - public checkTransactionStatus_args(checkTransactionStatus_args other) { - if (other.isSetScope()) { - this.scope = other.scope; - } - if (other.isSetStream()) { - this.stream = other.stream; - } - if (other.isSetTxnid()) { - this.txnid = new TxnId(other.txnid); - } - } - - public checkTransactionStatus_args deepCopy() { - return new checkTransactionStatus_args(this); - } - - @Override - public void clear() { - this.scope = null; - this.stream = null; - this.txnid = null; - } - - public String getScope() { - return this.scope; - } - - public checkTransactionStatus_args setScope(String scope) { - this.scope = scope; - return this; - } - - public void unsetScope() { - this.scope = null; - } - - /** Returns true if field scope is set (has been assigned a value) and false otherwise */ - public boolean isSetScope() { - return this.scope != null; - } - - public void setScopeIsSet(boolean value) { - if (!value) { - this.scope = null; - } - } - - public String getStream() { - return this.stream; - } - - public checkTransactionStatus_args setStream(String stream) { - this.stream = stream; - return this; - } - - public void unsetStream() { - this.stream = null; - } - - /** Returns true if field stream is set (has been assigned a value) and false otherwise */ - public boolean isSetStream() { - return this.stream != null; - } - - public void setStreamIsSet(boolean value) { - if (!value) { - this.stream = null; - } - } - - public TxnId getTxnid() { - return this.txnid; - } - - public checkTransactionStatus_args setTxnid(TxnId txnid) { - this.txnid = txnid; - return this; - } - - public void unsetTxnid() { - this.txnid = null; - } - - /** Returns true if field txnid is set (has been assigned a value) and false otherwise */ - public boolean isSetTxnid() { - return this.txnid != null; - } - - public void setTxnidIsSet(boolean value) { - if (!value) { - this.txnid = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SCOPE: - if (value == null) { - unsetScope(); - } else { - setScope((String)value); - } - break; - - case STREAM: - if (value == null) { - unsetStream(); - } else { - setStream((String)value); - } - break; - - case TXNID: - if (value == null) { - unsetTxnid(); - } else { - setTxnid((TxnId)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SCOPE: - return getScope(); - - case STREAM: - return getStream(); - - case TXNID: - return getTxnid(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SCOPE: - return isSetScope(); - case STREAM: - return isSetStream(); - case TXNID: - return isSetTxnid(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof checkTransactionStatus_args) - return this.equals((checkTransactionStatus_args)that); - return false; - } - - public boolean equals(checkTransactionStatus_args that) { - if (that == null) - return false; - - boolean this_present_scope = true && this.isSetScope(); - boolean that_present_scope = true && that.isSetScope(); - if (this_present_scope || that_present_scope) { - if (!(this_present_scope && that_present_scope)) - return false; - if (!this.scope.equals(that.scope)) - return false; - } - - boolean this_present_stream = true && this.isSetStream(); - boolean that_present_stream = true && that.isSetStream(); - if (this_present_stream || that_present_stream) { - if (!(this_present_stream && that_present_stream)) - return false; - if (!this.stream.equals(that.stream)) - return false; - } - - boolean this_present_txnid = true && this.isSetTxnid(); - boolean that_present_txnid = true && that.isSetTxnid(); - if (this_present_txnid || that_present_txnid) { - if (!(this_present_txnid && that_present_txnid)) - return false; - if (!this.txnid.equals(that.txnid)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_scope = true && (isSetScope()); - list.add(present_scope); - if (present_scope) - list.add(scope); - - boolean present_stream = true && (isSetStream()); - list.add(present_stream); - if (present_stream) - list.add(stream); - - boolean present_txnid = true && (isSetTxnid()); - list.add(present_txnid); - if (present_txnid) - list.add(txnid); - - return list.hashCode(); - } - - @Override - public int compareTo(checkTransactionStatus_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetScope()).compareTo(other.isSetScope()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetScope()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scope, other.scope); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetStream()).compareTo(other.isSetStream()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStream()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stream, other.stream); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetTxnid()).compareTo(other.isSetTxnid()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTxnid()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.txnid, other.txnid); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("checkTransactionStatus_args("); - boolean first = true; - - sb.append("scope:"); - if (this.scope == null) { - sb.append("null"); - } else { - sb.append(this.scope); - } - first = false; - if (!first) sb.append(", "); - sb.append("stream:"); - if (this.stream == null) { - sb.append("null"); - } else { - sb.append(this.stream); - } - first = false; - if (!first) sb.append(", "); - sb.append("txnid:"); - if (this.txnid == null) { - sb.append("null"); - } else { - sb.append(this.txnid); - } - 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 (txnid != null) { - txnid.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, 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 checkTransactionStatus_argsStandardSchemeFactory implements SchemeFactory { - public checkTransactionStatus_argsStandardScheme getScheme() { - return new checkTransactionStatus_argsStandardScheme(); - } - } - - private static class checkTransactionStatus_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, checkTransactionStatus_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: // SCOPE - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.scope = iprot.readString(); - struct.setScopeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // STREAM - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.stream = iprot.readString(); - struct.setStreamIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // TXNID - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.txnid = new TxnId(); - struct.txnid.read(iprot); - struct.setTxnidIsSet(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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, checkTransactionStatus_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.scope != null) { - oprot.writeFieldBegin(SCOPE_FIELD_DESC); - oprot.writeString(struct.scope); - oprot.writeFieldEnd(); - } - if (struct.stream != null) { - oprot.writeFieldBegin(STREAM_FIELD_DESC); - oprot.writeString(struct.stream); - oprot.writeFieldEnd(); - } - if (struct.txnid != null) { - oprot.writeFieldBegin(TXNID_FIELD_DESC); - struct.txnid.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class checkTransactionStatus_argsTupleSchemeFactory implements SchemeFactory { - public checkTransactionStatus_argsTupleScheme getScheme() { - return new checkTransactionStatus_argsTupleScheme(); - } - } - - private static class checkTransactionStatus_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, checkTransactionStatus_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetScope()) { - optionals.set(0); - } - if (struct.isSetStream()) { - optionals.set(1); - } - if (struct.isSetTxnid()) { - optionals.set(2); - } - oprot.writeBitSet(optionals, 3); - if (struct.isSetScope()) { - oprot.writeString(struct.scope); - } - if (struct.isSetStream()) { - oprot.writeString(struct.stream); - } - if (struct.isSetTxnid()) { - struct.txnid.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, checkTransactionStatus_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(3); - if (incoming.get(0)) { - struct.scope = iprot.readString(); - struct.setScopeIsSet(true); - } - if (incoming.get(1)) { - struct.stream = iprot.readString(); - struct.setStreamIsSet(true); - } - if (incoming.get(2)) { - struct.txnid = new TxnId(); - struct.txnid.read(iprot); - struct.setTxnidIsSet(true); - } - } - } - - } - - public static class checkTransactionStatus_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("checkTransactionStatus_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new checkTransactionStatus_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new checkTransactionStatus_resultTupleSchemeFactory()); - } - - private TxnState success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - /** - * - * @see TxnState - */ - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new 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.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TxnState.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(checkTransactionStatus_result.class, metaDataMap); - } - - public checkTransactionStatus_result() { - } - - public checkTransactionStatus_result( - TxnState success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public checkTransactionStatus_result(checkTransactionStatus_result other) { - if (other.isSetSuccess()) { - this.success = other.success; - } - } - - public checkTransactionStatus_result deepCopy() { - return new checkTransactionStatus_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - /** - * - * @see TxnState - */ - public TxnState getSuccess() { - return this.success; - } - - /** - * - * @see TxnState - */ - public checkTransactionStatus_result setSuccess(TxnState 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; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TxnState)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof checkTransactionStatus_result) - return this.equals((checkTransactionStatus_result)that); - return false; - } - - public boolean equals(checkTransactionStatus_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success.getValue()); - - return list.hashCode(); - } - - @Override - public int compareTo(checkTransactionStatus_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("checkTransactionStatus_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, 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 checkTransactionStatus_resultStandardSchemeFactory implements SchemeFactory { - public checkTransactionStatus_resultStandardScheme getScheme() { - return new checkTransactionStatus_resultStandardScheme(); - } - } - - private static class checkTransactionStatus_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, checkTransactionStatus_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.I32) { - struct.success = com.emc.pravega.controller.stream.api.v1.TxnState.findByValue(iprot.readI32()); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, checkTransactionStatus_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeI32(struct.success.getValue()); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class checkTransactionStatus_resultTupleSchemeFactory implements SchemeFactory { - public checkTransactionStatus_resultTupleScheme getScheme() { - return new checkTransactionStatus_resultTupleScheme(); - } - } - - private static class checkTransactionStatus_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, checkTransactionStatus_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - oprot.writeI32(struct.success.getValue()); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, checkTransactionStatus_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = com.emc.pravega.controller.stream.api.v1.TxnState.findByValue(iprot.readI32()); - struct.setSuccessIsSet(true); - } - } - } - - } - -} +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package com.emc.pravega.controller.stream.api.v1; + +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2017-01-28") +public class ControllerService { + + public interface Iface { + + public CreateStreamStatus createStream(StreamConfig streamConfig) throws org.apache.thrift.TException; + + public UpdateStreamStatus alterStream(StreamConfig streamConfig) throws org.apache.thrift.TException; + + public UpdateStreamStatus sealStream(String scope, String stream) throws org.apache.thrift.TException; + + public List getCurrentSegments(String scope, String stream) throws org.apache.thrift.TException; + + public List getPositions(String scope, String stream, long timestamp, int count) throws org.apache.thrift.TException; + + public Map> getSegmentsImmediatlyFollowing(SegmentId segment) throws org.apache.thrift.TException; + + public ScaleResponse scale(String scope, String stream, List sealedSegments, Map newKeyRanges, long scaleTimestamp) throws org.apache.thrift.TException; + + public NodeUri getURI(SegmentId segment) throws org.apache.thrift.TException; + + public boolean isSegmentValid(String scope, String stream, int segmentNumber) throws org.apache.thrift.TException; + + public TxnId createTransaction(String scope, String stream) throws org.apache.thrift.TException; + + public TxnStatus commitTransaction(String scope, String stream, TxnId txnid) throws org.apache.thrift.TException; + + public TxnStatus abortTransaction(String scope, String stream, TxnId txnid) throws org.apache.thrift.TException; + + public TxnState checkTransactionStatus(String scope, String stream, TxnId txnid) throws org.apache.thrift.TException; + + } + + public interface AsyncIface { + + public void createStream(StreamConfig streamConfig, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void alterStream(StreamConfig streamConfig, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void sealStream(String scope, String stream, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void getCurrentSegments(String scope, String stream, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void getPositions(String scope, String stream, long timestamp, int count, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void getSegmentsImmediatlyFollowing(SegmentId segment, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void scale(String scope, String stream, List sealedSegments, Map newKeyRanges, long scaleTimestamp, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void getURI(SegmentId segment, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void isSegmentValid(String scope, String stream, int segmentNumber, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void createTransaction(String scope, String stream, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void commitTransaction(String scope, String stream, TxnId txnid, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void abortTransaction(String scope, String stream, TxnId txnid, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void checkTransactionStatus(String scope, String stream, TxnId txnid, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + } + + public static class Client extends org.apache.thrift.TServiceClient implements Iface { + public static class Factory implements org.apache.thrift.TServiceClientFactory { + public Factory() {} + public Client getClient(org.apache.thrift.protocol.TProtocol prot) { + return new Client(prot); + } + public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { + return new Client(iprot, oprot); + } + } + + public Client(org.apache.thrift.protocol.TProtocol prot) + { + super(prot, prot); + } + + public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { + super(iprot, oprot); + } + + public CreateStreamStatus createStream(StreamConfig streamConfig) throws org.apache.thrift.TException + { + send_createStream(streamConfig); + return recv_createStream(); + } + + public void send_createStream(StreamConfig streamConfig) throws org.apache.thrift.TException + { + createStream_args args = new createStream_args(); + args.setStreamConfig(streamConfig); + sendBase("createStream", args); + } + + public CreateStreamStatus recv_createStream() throws org.apache.thrift.TException + { + createStream_result result = new createStream_result(); + receiveBase(result, "createStream"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "createStream failed: unknown result"); + } + + public UpdateStreamStatus alterStream(StreamConfig streamConfig) throws org.apache.thrift.TException + { + send_alterStream(streamConfig); + return recv_alterStream(); + } + + public void send_alterStream(StreamConfig streamConfig) throws org.apache.thrift.TException + { + alterStream_args args = new alterStream_args(); + args.setStreamConfig(streamConfig); + sendBase("alterStream", args); + } + + public UpdateStreamStatus recv_alterStream() throws org.apache.thrift.TException + { + alterStream_result result = new alterStream_result(); + receiveBase(result, "alterStream"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "alterStream failed: unknown result"); + } + + public UpdateStreamStatus sealStream(String scope, String stream) throws org.apache.thrift.TException + { + send_sealStream(scope, stream); + return recv_sealStream(); + } + + public void send_sealStream(String scope, String stream) throws org.apache.thrift.TException + { + sealStream_args args = new sealStream_args(); + args.setScope(scope); + args.setStream(stream); + sendBase("sealStream", args); + } + + public UpdateStreamStatus recv_sealStream() throws org.apache.thrift.TException + { + sealStream_result result = new sealStream_result(); + receiveBase(result, "sealStream"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "sealStream failed: unknown result"); + } + + public List getCurrentSegments(String scope, String stream) throws org.apache.thrift.TException + { + send_getCurrentSegments(scope, stream); + return recv_getCurrentSegments(); + } + + public void send_getCurrentSegments(String scope, String stream) throws org.apache.thrift.TException + { + getCurrentSegments_args args = new getCurrentSegments_args(); + args.setScope(scope); + args.setStream(stream); + sendBase("getCurrentSegments", args); + } + + public List recv_getCurrentSegments() throws org.apache.thrift.TException + { + getCurrentSegments_result result = new getCurrentSegments_result(); + receiveBase(result, "getCurrentSegments"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCurrentSegments failed: unknown result"); + } + + public List getPositions(String scope, String stream, long timestamp, int count) throws org.apache.thrift.TException + { + send_getPositions(scope, stream, timestamp, count); + return recv_getPositions(); + } + + public void send_getPositions(String scope, String stream, long timestamp, int count) throws org.apache.thrift.TException + { + getPositions_args args = new getPositions_args(); + args.setScope(scope); + args.setStream(stream); + args.setTimestamp(timestamp); + args.setCount(count); + sendBase("getPositions", args); + } + + public List recv_getPositions() throws org.apache.thrift.TException + { + getPositions_result result = new getPositions_result(); + receiveBase(result, "getPositions"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPositions failed: unknown result"); + } + + public Map> getSegmentsImmediatlyFollowing(SegmentId segment) throws org.apache.thrift.TException + { + send_getSegmentsImmediatlyFollowing(segment); + return recv_getSegmentsImmediatlyFollowing(); + } + + public void send_getSegmentsImmediatlyFollowing(SegmentId segment) throws org.apache.thrift.TException + { + getSegmentsImmediatlyFollowing_args args = new getSegmentsImmediatlyFollowing_args(); + args.setSegment(segment); + sendBase("getSegmentsImmediatlyFollowing", args); + } + + public Map> recv_getSegmentsImmediatlyFollowing() throws org.apache.thrift.TException + { + getSegmentsImmediatlyFollowing_result result = new getSegmentsImmediatlyFollowing_result(); + receiveBase(result, "getSegmentsImmediatlyFollowing"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getSegmentsImmediatlyFollowing failed: unknown result"); + } + + public ScaleResponse scale(String scope, String stream, List sealedSegments, Map newKeyRanges, long scaleTimestamp) throws org.apache.thrift.TException + { + send_scale(scope, stream, sealedSegments, newKeyRanges, scaleTimestamp); + return recv_scale(); + } + + public void send_scale(String scope, String stream, List sealedSegments, Map newKeyRanges, long scaleTimestamp) throws org.apache.thrift.TException + { + scale_args args = new scale_args(); + args.setScope(scope); + args.setStream(stream); + args.setSealedSegments(sealedSegments); + args.setNewKeyRanges(newKeyRanges); + args.setScaleTimestamp(scaleTimestamp); + sendBase("scale", args); + } + + public ScaleResponse recv_scale() throws org.apache.thrift.TException + { + scale_result result = new scale_result(); + receiveBase(result, "scale"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "scale failed: unknown result"); + } + + public NodeUri getURI(SegmentId segment) throws org.apache.thrift.TException + { + send_getURI(segment); + return recv_getURI(); + } + + public void send_getURI(SegmentId segment) throws org.apache.thrift.TException + { + getURI_args args = new getURI_args(); + args.setSegment(segment); + sendBase("getURI", args); + } + + public NodeUri recv_getURI() throws org.apache.thrift.TException + { + getURI_result result = new getURI_result(); + receiveBase(result, "getURI"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getURI failed: unknown result"); + } + + public boolean isSegmentValid(String scope, String stream, int segmentNumber) throws org.apache.thrift.TException + { + send_isSegmentValid(scope, stream, segmentNumber); + return recv_isSegmentValid(); + } + + public void send_isSegmentValid(String scope, String stream, int segmentNumber) throws org.apache.thrift.TException + { + isSegmentValid_args args = new isSegmentValid_args(); + args.setScope(scope); + args.setStream(stream); + args.setSegmentNumber(segmentNumber); + sendBase("isSegmentValid", args); + } + + public boolean recv_isSegmentValid() throws org.apache.thrift.TException + { + isSegmentValid_result result = new isSegmentValid_result(); + receiveBase(result, "isSegmentValid"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "isSegmentValid failed: unknown result"); + } + + public TxnId createTransaction(String scope, String stream) throws org.apache.thrift.TException + { + send_createTransaction(scope, stream); + return recv_createTransaction(); + } + + public void send_createTransaction(String scope, String stream) throws org.apache.thrift.TException + { + createTransaction_args args = new createTransaction_args(); + args.setScope(scope); + args.setStream(stream); + sendBase("createTransaction", args); + } + + public TxnId recv_createTransaction() throws org.apache.thrift.TException + { + createTransaction_result result = new createTransaction_result(); + receiveBase(result, "createTransaction"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "createTransaction failed: unknown result"); + } + + public TxnStatus commitTransaction(String scope, String stream, TxnId txnid) throws org.apache.thrift.TException + { + send_commitTransaction(scope, stream, txnid); + return recv_commitTransaction(); + } + + public void send_commitTransaction(String scope, String stream, TxnId txnid) throws org.apache.thrift.TException + { + commitTransaction_args args = new commitTransaction_args(); + args.setScope(scope); + args.setStream(stream); + args.setTxnid(txnid); + sendBase("commitTransaction", args); + } + + public TxnStatus recv_commitTransaction() throws org.apache.thrift.TException + { + commitTransaction_result result = new commitTransaction_result(); + receiveBase(result, "commitTransaction"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "commitTransaction failed: unknown result"); + } + + public TxnStatus abortTransaction(String scope, String stream, TxnId txnid) throws org.apache.thrift.TException + { + send_abortTransaction(scope, stream, txnid); + return recv_abortTransaction(); + } + + public void send_abortTransaction(String scope, String stream, TxnId txnid) throws org.apache.thrift.TException + { + abortTransaction_args args = new abortTransaction_args(); + args.setScope(scope); + args.setStream(stream); + args.setTxnid(txnid); + sendBase("abortTransaction", args); + } + + public TxnStatus recv_abortTransaction() throws org.apache.thrift.TException + { + abortTransaction_result result = new abortTransaction_result(); + receiveBase(result, "abortTransaction"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "abortTransaction failed: unknown result"); + } + + public TxnState checkTransactionStatus(String scope, String stream, TxnId txnid) throws org.apache.thrift.TException + { + send_checkTransactionStatus(scope, stream, txnid); + return recv_checkTransactionStatus(); + } + + public void send_checkTransactionStatus(String scope, String stream, TxnId txnid) throws org.apache.thrift.TException + { + checkTransactionStatus_args args = new checkTransactionStatus_args(); + args.setScope(scope); + args.setStream(stream); + args.setTxnid(txnid); + sendBase("checkTransactionStatus", args); + } + + public TxnState recv_checkTransactionStatus() throws org.apache.thrift.TException + { + checkTransactionStatus_result result = new checkTransactionStatus_result(); + receiveBase(result, "checkTransactionStatus"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "checkTransactionStatus failed: unknown result"); + } + + } + public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface { + public static class Factory implements org.apache.thrift.async.TAsyncClientFactory { + private org.apache.thrift.async.TAsyncClientManager clientManager; + private org.apache.thrift.protocol.TProtocolFactory protocolFactory; + public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) { + this.clientManager = clientManager; + this.protocolFactory = protocolFactory; + } + public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) { + return new AsyncClient(protocolFactory, clientManager, transport); + } + } + + public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) { + super(protocolFactory, clientManager, transport); + } + + public void createStream(StreamConfig streamConfig, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + createStream_call method_call = new createStream_call(streamConfig, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class createStream_call extends org.apache.thrift.async.TAsyncMethodCall { + private StreamConfig streamConfig; + public createStream_call(StreamConfig streamConfig, 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.streamConfig = streamConfig; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createStream", org.apache.thrift.protocol.TMessageType.CALL, 0)); + createStream_args args = new createStream_args(); + args.setStreamConfig(streamConfig); + args.write(prot); + prot.writeMessageEnd(); + } + + public CreateStreamStatus getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new 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_createStream(); + } + } + + public void alterStream(StreamConfig streamConfig, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + alterStream_call method_call = new alterStream_call(streamConfig, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class alterStream_call extends org.apache.thrift.async.TAsyncMethodCall { + private StreamConfig streamConfig; + public alterStream_call(StreamConfig streamConfig, 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.streamConfig = streamConfig; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("alterStream", org.apache.thrift.protocol.TMessageType.CALL, 0)); + alterStream_args args = new alterStream_args(); + args.setStreamConfig(streamConfig); + args.write(prot); + prot.writeMessageEnd(); + } + + public UpdateStreamStatus getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new 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_alterStream(); + } + } + + public void sealStream(String scope, String stream, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + sealStream_call method_call = new sealStream_call(scope, stream, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class sealStream_call extends org.apache.thrift.async.TAsyncMethodCall { + private String scope; + private String stream; + public sealStream_call(String scope, String stream, 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.scope = scope; + this.stream = stream; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("sealStream", org.apache.thrift.protocol.TMessageType.CALL, 0)); + sealStream_args args = new sealStream_args(); + args.setScope(scope); + args.setStream(stream); + args.write(prot); + prot.writeMessageEnd(); + } + + public UpdateStreamStatus getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new 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_sealStream(); + } + } + + public void getCurrentSegments(String scope, String stream, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getCurrentSegments_call method_call = new getCurrentSegments_call(scope, stream, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getCurrentSegments_call extends org.apache.thrift.async.TAsyncMethodCall { + private String scope; + private String stream; + public getCurrentSegments_call(String scope, String stream, 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.scope = scope; + this.stream = stream; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCurrentSegments", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getCurrentSegments_args args = new getCurrentSegments_args(); + args.setScope(scope); + args.setStream(stream); + args.write(prot); + prot.writeMessageEnd(); + } + + public List getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new 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_getCurrentSegments(); + } + } + + public void getPositions(String scope, String stream, long timestamp, int count, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getPositions_call method_call = new getPositions_call(scope, stream, timestamp, count, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getPositions_call extends org.apache.thrift.async.TAsyncMethodCall { + private String scope; + private String stream; + private long timestamp; + private int count; + public getPositions_call(String scope, String stream, long timestamp, int count, 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.scope = scope; + this.stream = stream; + this.timestamp = timestamp; + this.count = count; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPositions", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getPositions_args args = new getPositions_args(); + args.setScope(scope); + args.setStream(stream); + args.setTimestamp(timestamp); + args.setCount(count); + args.write(prot); + prot.writeMessageEnd(); + } + + public List getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new 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_getPositions(); + } + } + + public void getSegmentsImmediatlyFollowing(SegmentId segment, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getSegmentsImmediatlyFollowing_call method_call = new getSegmentsImmediatlyFollowing_call(segment, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getSegmentsImmediatlyFollowing_call extends org.apache.thrift.async.TAsyncMethodCall { + private SegmentId segment; + public getSegmentsImmediatlyFollowing_call(SegmentId segment, 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.segment = segment; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getSegmentsImmediatlyFollowing", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getSegmentsImmediatlyFollowing_args args = new getSegmentsImmediatlyFollowing_args(); + args.setSegment(segment); + args.write(prot); + prot.writeMessageEnd(); + } + + public Map> getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new 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_getSegmentsImmediatlyFollowing(); + } + } + + public void scale(String scope, String stream, List sealedSegments, Map newKeyRanges, long scaleTimestamp, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + scale_call method_call = new scale_call(scope, stream, sealedSegments, newKeyRanges, scaleTimestamp, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class scale_call extends org.apache.thrift.async.TAsyncMethodCall { + private String scope; + private String stream; + private List sealedSegments; + private Map newKeyRanges; + private long scaleTimestamp; + public scale_call(String scope, String stream, List sealedSegments, Map newKeyRanges, long scaleTimestamp, 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.scope = scope; + this.stream = stream; + this.sealedSegments = sealedSegments; + this.newKeyRanges = newKeyRanges; + this.scaleTimestamp = scaleTimestamp; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("scale", org.apache.thrift.protocol.TMessageType.CALL, 0)); + scale_args args = new scale_args(); + args.setScope(scope); + args.setStream(stream); + args.setSealedSegments(sealedSegments); + args.setNewKeyRanges(newKeyRanges); + args.setScaleTimestamp(scaleTimestamp); + args.write(prot); + prot.writeMessageEnd(); + } + + public ScaleResponse getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new 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_scale(); + } + } + + public void getURI(SegmentId segment, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getURI_call method_call = new getURI_call(segment, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getURI_call extends org.apache.thrift.async.TAsyncMethodCall { + private SegmentId segment; + public getURI_call(SegmentId segment, 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.segment = segment; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getURI", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getURI_args args = new getURI_args(); + args.setSegment(segment); + args.write(prot); + prot.writeMessageEnd(); + } + + public NodeUri getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new 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_getURI(); + } + } + + public void isSegmentValid(String scope, String stream, int segmentNumber, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + isSegmentValid_call method_call = new isSegmentValid_call(scope, stream, segmentNumber, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class isSegmentValid_call extends org.apache.thrift.async.TAsyncMethodCall { + private String scope; + private String stream; + private int segmentNumber; + public isSegmentValid_call(String scope, String stream, int segmentNumber, 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.scope = scope; + this.stream = stream; + this.segmentNumber = segmentNumber; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("isSegmentValid", org.apache.thrift.protocol.TMessageType.CALL, 0)); + isSegmentValid_args args = new isSegmentValid_args(); + args.setScope(scope); + args.setStream(stream); + args.setSegmentNumber(segmentNumber); + args.write(prot); + prot.writeMessageEnd(); + } + + public boolean getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new 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_isSegmentValid(); + } + } + + public void createTransaction(String scope, String stream, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + createTransaction_call method_call = new createTransaction_call(scope, stream, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class createTransaction_call extends org.apache.thrift.async.TAsyncMethodCall { + private String scope; + private String stream; + public createTransaction_call(String scope, String stream, 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.scope = scope; + this.stream = stream; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createTransaction", org.apache.thrift.protocol.TMessageType.CALL, 0)); + createTransaction_args args = new createTransaction_args(); + args.setScope(scope); + args.setStream(stream); + args.write(prot); + prot.writeMessageEnd(); + } + + public TxnId getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new 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_createTransaction(); + } + } + + public void commitTransaction(String scope, String stream, TxnId txnid, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + commitTransaction_call method_call = new commitTransaction_call(scope, stream, txnid, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class commitTransaction_call extends org.apache.thrift.async.TAsyncMethodCall { + private String scope; + private String stream; + private TxnId txnid; + public commitTransaction_call(String scope, String stream, TxnId txnid, 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.scope = scope; + this.stream = stream; + this.txnid = txnid; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("commitTransaction", org.apache.thrift.protocol.TMessageType.CALL, 0)); + commitTransaction_args args = new commitTransaction_args(); + args.setScope(scope); + args.setStream(stream); + args.setTxnid(txnid); + args.write(prot); + prot.writeMessageEnd(); + } + + public TxnStatus getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new 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_commitTransaction(); + } + } + + public void abortTransaction(String scope, String stream, TxnId txnid, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + abortTransaction_call method_call = new abortTransaction_call(scope, stream, txnid, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class abortTransaction_call extends org.apache.thrift.async.TAsyncMethodCall { + private String scope; + private String stream; + private TxnId txnid; + public abortTransaction_call(String scope, String stream, TxnId txnid, 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.scope = scope; + this.stream = stream; + this.txnid = txnid; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("abortTransaction", org.apache.thrift.protocol.TMessageType.CALL, 0)); + abortTransaction_args args = new abortTransaction_args(); + args.setScope(scope); + args.setStream(stream); + args.setTxnid(txnid); + args.write(prot); + prot.writeMessageEnd(); + } + + public TxnStatus getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new 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_abortTransaction(); + } + } + + public void checkTransactionStatus(String scope, String stream, TxnId txnid, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + checkTransactionStatus_call method_call = new checkTransactionStatus_call(scope, stream, txnid, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class checkTransactionStatus_call extends org.apache.thrift.async.TAsyncMethodCall { + private String scope; + private String stream; + private TxnId txnid; + public checkTransactionStatus_call(String scope, String stream, TxnId txnid, 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.scope = scope; + this.stream = stream; + this.txnid = txnid; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("checkTransactionStatus", org.apache.thrift.protocol.TMessageType.CALL, 0)); + checkTransactionStatus_args args = new checkTransactionStatus_args(); + args.setScope(scope); + args.setStream(stream); + args.setTxnid(txnid); + args.write(prot); + prot.writeMessageEnd(); + } + + public TxnState getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new 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_checkTransactionStatus(); + } + } + + } + + public static class Processor extends org.apache.thrift.TBaseProcessor implements org.apache.thrift.TProcessor { + private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName()); + public Processor(I iface) { + super(iface, getProcessMap(new HashMap>())); + } + + protected Processor(I iface, Map> processMap) { + super(iface, getProcessMap(processMap)); + } + + private static Map> getProcessMap(Map> processMap) { + processMap.put("createStream", new createStream()); + processMap.put("alterStream", new alterStream()); + processMap.put("sealStream", new sealStream()); + processMap.put("getCurrentSegments", new getCurrentSegments()); + processMap.put("getPositions", new getPositions()); + processMap.put("getSegmentsImmediatlyFollowing", new getSegmentsImmediatlyFollowing()); + processMap.put("scale", new scale()); + processMap.put("getURI", new getURI()); + processMap.put("isSegmentValid", new isSegmentValid()); + processMap.put("createTransaction", new createTransaction()); + processMap.put("commitTransaction", new commitTransaction()); + processMap.put("abortTransaction", new abortTransaction()); + processMap.put("checkTransactionStatus", new checkTransactionStatus()); + return processMap; + } + + public static class createStream extends org.apache.thrift.ProcessFunction { + public createStream() { + super("createStream"); + } + + public createStream_args getEmptyArgsInstance() { + return new createStream_args(); + } + + protected boolean isOneway() { + return false; + } + + public createStream_result getResult(I iface, createStream_args args) throws org.apache.thrift.TException { + createStream_result result = new createStream_result(); + result.success = iface.createStream(args.streamConfig); + return result; + } + } + + public static class alterStream extends org.apache.thrift.ProcessFunction { + public alterStream() { + super("alterStream"); + } + + public alterStream_args getEmptyArgsInstance() { + return new alterStream_args(); + } + + protected boolean isOneway() { + return false; + } + + public alterStream_result getResult(I iface, alterStream_args args) throws org.apache.thrift.TException { + alterStream_result result = new alterStream_result(); + result.success = iface.alterStream(args.streamConfig); + return result; + } + } + + public static class sealStream extends org.apache.thrift.ProcessFunction { + public sealStream() { + super("sealStream"); + } + + public sealStream_args getEmptyArgsInstance() { + return new sealStream_args(); + } + + protected boolean isOneway() { + return false; + } + + public sealStream_result getResult(I iface, sealStream_args args) throws org.apache.thrift.TException { + sealStream_result result = new sealStream_result(); + result.success = iface.sealStream(args.scope, args.stream); + return result; + } + } + + public static class getCurrentSegments extends org.apache.thrift.ProcessFunction { + public getCurrentSegments() { + super("getCurrentSegments"); + } + + public getCurrentSegments_args getEmptyArgsInstance() { + return new getCurrentSegments_args(); + } + + protected boolean isOneway() { + return false; + } + + public getCurrentSegments_result getResult(I iface, getCurrentSegments_args args) throws org.apache.thrift.TException { + getCurrentSegments_result result = new getCurrentSegments_result(); + result.success = iface.getCurrentSegments(args.scope, args.stream); + return result; + } + } + + public static class getPositions extends org.apache.thrift.ProcessFunction { + public getPositions() { + super("getPositions"); + } + + public getPositions_args getEmptyArgsInstance() { + return new getPositions_args(); + } + + protected boolean isOneway() { + return false; + } + + public getPositions_result getResult(I iface, getPositions_args args) throws org.apache.thrift.TException { + getPositions_result result = new getPositions_result(); + result.success = iface.getPositions(args.scope, args.stream, args.timestamp, args.count); + return result; + } + } + + public static class getSegmentsImmediatlyFollowing extends org.apache.thrift.ProcessFunction { + public getSegmentsImmediatlyFollowing() { + super("getSegmentsImmediatlyFollowing"); + } + + public getSegmentsImmediatlyFollowing_args getEmptyArgsInstance() { + return new getSegmentsImmediatlyFollowing_args(); + } + + protected boolean isOneway() { + return false; + } + + public getSegmentsImmediatlyFollowing_result getResult(I iface, getSegmentsImmediatlyFollowing_args args) throws org.apache.thrift.TException { + getSegmentsImmediatlyFollowing_result result = new getSegmentsImmediatlyFollowing_result(); + result.success = iface.getSegmentsImmediatlyFollowing(args.segment); + return result; + } + } + + public static class scale extends org.apache.thrift.ProcessFunction { + public scale() { + super("scale"); + } + + public scale_args getEmptyArgsInstance() { + return new scale_args(); + } + + protected boolean isOneway() { + return false; + } + + public scale_result getResult(I iface, scale_args args) throws org.apache.thrift.TException { + scale_result result = new scale_result(); + result.success = iface.scale(args.scope, args.stream, args.sealedSegments, args.newKeyRanges, args.scaleTimestamp); + return result; + } + } + + public static class getURI extends org.apache.thrift.ProcessFunction { + public getURI() { + super("getURI"); + } + + public getURI_args getEmptyArgsInstance() { + return new getURI_args(); + } + + protected boolean isOneway() { + return false; + } + + public getURI_result getResult(I iface, getURI_args args) throws org.apache.thrift.TException { + getURI_result result = new getURI_result(); + result.success = iface.getURI(args.segment); + return result; + } + } + + public static class isSegmentValid extends org.apache.thrift.ProcessFunction { + public isSegmentValid() { + super("isSegmentValid"); + } + + public isSegmentValid_args getEmptyArgsInstance() { + return new isSegmentValid_args(); + } + + protected boolean isOneway() { + return false; + } + + public isSegmentValid_result getResult(I iface, isSegmentValid_args args) throws org.apache.thrift.TException { + isSegmentValid_result result = new isSegmentValid_result(); + result.success = iface.isSegmentValid(args.scope, args.stream, args.segmentNumber); + result.setSuccessIsSet(true); + return result; + } + } + + public static class createTransaction extends org.apache.thrift.ProcessFunction { + public createTransaction() { + super("createTransaction"); + } + + public createTransaction_args getEmptyArgsInstance() { + return new createTransaction_args(); + } + + protected boolean isOneway() { + return false; + } + + public createTransaction_result getResult(I iface, createTransaction_args args) throws org.apache.thrift.TException { + createTransaction_result result = new createTransaction_result(); + result.success = iface.createTransaction(args.scope, args.stream); + return result; + } + } + + public static class commitTransaction extends org.apache.thrift.ProcessFunction { + public commitTransaction() { + super("commitTransaction"); + } + + public commitTransaction_args getEmptyArgsInstance() { + return new commitTransaction_args(); + } + + protected boolean isOneway() { + return false; + } + + public commitTransaction_result getResult(I iface, commitTransaction_args args) throws org.apache.thrift.TException { + commitTransaction_result result = new commitTransaction_result(); + result.success = iface.commitTransaction(args.scope, args.stream, args.txnid); + return result; + } + } + + public static class abortTransaction extends org.apache.thrift.ProcessFunction { + public abortTransaction() { + super("abortTransaction"); + } + + public abortTransaction_args getEmptyArgsInstance() { + return new abortTransaction_args(); + } + + protected boolean isOneway() { + return false; + } + + public abortTransaction_result getResult(I iface, abortTransaction_args args) throws org.apache.thrift.TException { + abortTransaction_result result = new abortTransaction_result(); + result.success = iface.abortTransaction(args.scope, args.stream, args.txnid); + return result; + } + } + + public static class checkTransactionStatus extends org.apache.thrift.ProcessFunction { + public checkTransactionStatus() { + super("checkTransactionStatus"); + } + + public checkTransactionStatus_args getEmptyArgsInstance() { + return new checkTransactionStatus_args(); + } + + protected boolean isOneway() { + return false; + } + + public checkTransactionStatus_result getResult(I iface, checkTransactionStatus_args args) throws org.apache.thrift.TException { + checkTransactionStatus_result result = new checkTransactionStatus_result(); + result.success = iface.checkTransactionStatus(args.scope, args.stream, args.txnid); + return result; + } + } + + } + + public static class AsyncProcessor extends org.apache.thrift.TBaseAsyncProcessor { + private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName()); + public AsyncProcessor(I iface) { + super(iface, getProcessMap(new HashMap>())); + } + + protected AsyncProcessor(I iface, Map> processMap) { + super(iface, getProcessMap(processMap)); + } + + private static Map> getProcessMap(Map> processMap) { + processMap.put("createStream", new createStream()); + processMap.put("alterStream", new alterStream()); + processMap.put("sealStream", new sealStream()); + processMap.put("getCurrentSegments", new getCurrentSegments()); + processMap.put("getPositions", new getPositions()); + processMap.put("getSegmentsImmediatlyFollowing", new getSegmentsImmediatlyFollowing()); + processMap.put("scale", new scale()); + processMap.put("getURI", new getURI()); + processMap.put("isSegmentValid", new isSegmentValid()); + processMap.put("createTransaction", new createTransaction()); + processMap.put("commitTransaction", new commitTransaction()); + processMap.put("abortTransaction", new abortTransaction()); + processMap.put("checkTransactionStatus", new checkTransactionStatus()); + return processMap; + } + + public static class createStream extends org.apache.thrift.AsyncProcessFunction { + public createStream() { + super("createStream"); + } + + public createStream_args getEmptyArgsInstance() { + return new createStream_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(CreateStreamStatus o) { + createStream_result result = new createStream_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + createStream_result result = new createStream_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, createStream_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.createStream(args.streamConfig,resultHandler); + } + } + + public static class alterStream extends org.apache.thrift.AsyncProcessFunction { + public alterStream() { + super("alterStream"); + } + + public alterStream_args getEmptyArgsInstance() { + return new alterStream_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(UpdateStreamStatus o) { + alterStream_result result = new alterStream_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + alterStream_result result = new alterStream_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, alterStream_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.alterStream(args.streamConfig,resultHandler); + } + } + + public static class sealStream extends org.apache.thrift.AsyncProcessFunction { + public sealStream() { + super("sealStream"); + } + + public sealStream_args getEmptyArgsInstance() { + return new sealStream_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(UpdateStreamStatus o) { + sealStream_result result = new sealStream_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + sealStream_result result = new sealStream_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, sealStream_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.sealStream(args.scope, args.stream,resultHandler); + } + } + + public static class getCurrentSegments extends org.apache.thrift.AsyncProcessFunction> { + public getCurrentSegments() { + super("getCurrentSegments"); + } + + public getCurrentSegments_args getEmptyArgsInstance() { + return new getCurrentSegments_args(); + } + + public AsyncMethodCallback> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback>() { + public void onComplete(List o) { + getCurrentSegments_result result = new getCurrentSegments_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + getCurrentSegments_result result = new getCurrentSegments_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, getCurrentSegments_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws TException { + iface.getCurrentSegments(args.scope, args.stream,resultHandler); + } + } + + public static class getPositions extends org.apache.thrift.AsyncProcessFunction> { + public getPositions() { + super("getPositions"); + } + + public getPositions_args getEmptyArgsInstance() { + return new getPositions_args(); + } + + public AsyncMethodCallback> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback>() { + public void onComplete(List o) { + getPositions_result result = new getPositions_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + getPositions_result result = new getPositions_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, getPositions_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws TException { + iface.getPositions(args.scope, args.stream, args.timestamp, args.count,resultHandler); + } + } + + public static class getSegmentsImmediatlyFollowing extends org.apache.thrift.AsyncProcessFunction>> { + public getSegmentsImmediatlyFollowing() { + super("getSegmentsImmediatlyFollowing"); + } + + public getSegmentsImmediatlyFollowing_args getEmptyArgsInstance() { + return new getSegmentsImmediatlyFollowing_args(); + } + + public AsyncMethodCallback>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback>>() { + public void onComplete(Map> o) { + getSegmentsImmediatlyFollowing_result result = new getSegmentsImmediatlyFollowing_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + getSegmentsImmediatlyFollowing_result result = new getSegmentsImmediatlyFollowing_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, getSegmentsImmediatlyFollowing_args args, org.apache.thrift.async.AsyncMethodCallback>> resultHandler) throws TException { + iface.getSegmentsImmediatlyFollowing(args.segment,resultHandler); + } + } + + public static class scale extends org.apache.thrift.AsyncProcessFunction { + public scale() { + super("scale"); + } + + public scale_args getEmptyArgsInstance() { + return new scale_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(ScaleResponse o) { + scale_result result = new scale_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + scale_result result = new scale_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, scale_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.scale(args.scope, args.stream, args.sealedSegments, args.newKeyRanges, args.scaleTimestamp,resultHandler); + } + } + + public static class getURI extends org.apache.thrift.AsyncProcessFunction { + public getURI() { + super("getURI"); + } + + public getURI_args getEmptyArgsInstance() { + return new getURI_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(NodeUri o) { + getURI_result result = new getURI_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + getURI_result result = new getURI_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, getURI_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.getURI(args.segment,resultHandler); + } + } + + public static class isSegmentValid extends org.apache.thrift.AsyncProcessFunction { + public isSegmentValid() { + super("isSegmentValid"); + } + + public isSegmentValid_args getEmptyArgsInstance() { + return new isSegmentValid_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Boolean o) { + isSegmentValid_result result = new isSegmentValid_result(); + result.success = o; + result.setSuccessIsSet(true); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + isSegmentValid_result result = new isSegmentValid_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, isSegmentValid_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.isSegmentValid(args.scope, args.stream, args.segmentNumber,resultHandler); + } + } + + public static class createTransaction extends org.apache.thrift.AsyncProcessFunction { + public createTransaction() { + super("createTransaction"); + } + + public createTransaction_args getEmptyArgsInstance() { + return new createTransaction_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(TxnId o) { + createTransaction_result result = new createTransaction_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + createTransaction_result result = new createTransaction_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, createTransaction_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.createTransaction(args.scope, args.stream,resultHandler); + } + } + + public static class commitTransaction extends org.apache.thrift.AsyncProcessFunction { + public commitTransaction() { + super("commitTransaction"); + } + + public commitTransaction_args getEmptyArgsInstance() { + return new commitTransaction_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(TxnStatus o) { + commitTransaction_result result = new commitTransaction_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + commitTransaction_result result = new commitTransaction_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, commitTransaction_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.commitTransaction(args.scope, args.stream, args.txnid,resultHandler); + } + } + + public static class abortTransaction extends org.apache.thrift.AsyncProcessFunction { + public abortTransaction() { + super("abortTransaction"); + } + + public abortTransaction_args getEmptyArgsInstance() { + return new abortTransaction_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(TxnStatus o) { + abortTransaction_result result = new abortTransaction_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + abortTransaction_result result = new abortTransaction_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, abortTransaction_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.abortTransaction(args.scope, args.stream, args.txnid,resultHandler); + } + } + + public static class checkTransactionStatus extends org.apache.thrift.AsyncProcessFunction { + public checkTransactionStatus() { + super("checkTransactionStatus"); + } + + public checkTransactionStatus_args getEmptyArgsInstance() { + return new checkTransactionStatus_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(TxnState o) { + checkTransactionStatus_result result = new checkTransactionStatus_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + checkTransactionStatus_result result = new checkTransactionStatus_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, checkTransactionStatus_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.checkTransactionStatus(args.scope, args.stream, args.txnid,resultHandler); + } + } + + } + + public static class createStream_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("createStream_args"); + + private static final org.apache.thrift.protocol.TField STREAM_CONFIG_FIELD_DESC = new org.apache.thrift.protocol.TField("streamConfig", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new createStream_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new createStream_argsTupleSchemeFactory()); + } + + private StreamConfig streamConfig; // 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 { + STREAM_CONFIG((short)1, "streamConfig"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // STREAM_CONFIG + return STREAM_CONFIG; + 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 IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.STREAM_CONFIG, new org.apache.thrift.meta_data.FieldMetaData("streamConfig", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, StreamConfig.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createStream_args.class, metaDataMap); + } + + public createStream_args() { + } + + public createStream_args( + StreamConfig streamConfig) + { + this(); + this.streamConfig = streamConfig; + } + + /** + * Performs a deep copy on other. + */ + public createStream_args(createStream_args other) { + if (other.isSetStreamConfig()) { + this.streamConfig = new StreamConfig(other.streamConfig); + } + } + + public createStream_args deepCopy() { + return new createStream_args(this); + } + + @Override + public void clear() { + this.streamConfig = null; + } + + public StreamConfig getStreamConfig() { + return this.streamConfig; + } + + public createStream_args setStreamConfig(StreamConfig streamConfig) { + this.streamConfig = streamConfig; + return this; + } + + public void unsetStreamConfig() { + this.streamConfig = null; + } + + /** Returns true if field streamConfig is set (has been assigned a value) and false otherwise */ + public boolean isSetStreamConfig() { + return this.streamConfig != null; + } + + public void setStreamConfigIsSet(boolean value) { + if (!value) { + this.streamConfig = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case STREAM_CONFIG: + if (value == null) { + unsetStreamConfig(); + } else { + setStreamConfig((StreamConfig)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case STREAM_CONFIG: + return getStreamConfig(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case STREAM_CONFIG: + return isSetStreamConfig(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof createStream_args) + return this.equals((createStream_args)that); + return false; + } + + public boolean equals(createStream_args that) { + if (that == null) + return false; + + boolean this_present_streamConfig = true && this.isSetStreamConfig(); + boolean that_present_streamConfig = true && that.isSetStreamConfig(); + if (this_present_streamConfig || that_present_streamConfig) { + if (!(this_present_streamConfig && that_present_streamConfig)) + return false; + if (!this.streamConfig.equals(that.streamConfig)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_streamConfig = true && (isSetStreamConfig()); + list.add(present_streamConfig); + if (present_streamConfig) + list.add(streamConfig); + + return list.hashCode(); + } + + @Override + public int compareTo(createStream_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetStreamConfig()).compareTo(other.isSetStreamConfig()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStreamConfig()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.streamConfig, other.streamConfig); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("createStream_args("); + boolean first = true; + + sb.append("streamConfig:"); + if (this.streamConfig == null) { + sb.append("null"); + } else { + sb.append(this.streamConfig); + } + 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 (streamConfig != null) { + streamConfig.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, 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 createStream_argsStandardSchemeFactory implements SchemeFactory { + public createStream_argsStandardScheme getScheme() { + return new createStream_argsStandardScheme(); + } + } + + private static class createStream_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, createStream_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: // STREAM_CONFIG + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.streamConfig = new StreamConfig(); + struct.streamConfig.read(iprot); + struct.setStreamConfigIsSet(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(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, createStream_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.streamConfig != null) { + oprot.writeFieldBegin(STREAM_CONFIG_FIELD_DESC); + struct.streamConfig.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class createStream_argsTupleSchemeFactory implements SchemeFactory { + public createStream_argsTupleScheme getScheme() { + return new createStream_argsTupleScheme(); + } + } + + private static class createStream_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, createStream_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetStreamConfig()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetStreamConfig()) { + struct.streamConfig.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, createStream_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.streamConfig = new StreamConfig(); + struct.streamConfig.read(iprot); + struct.setStreamConfigIsSet(true); + } + } + } + + } + + public static class createStream_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("createStream_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new createStream_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new createStream_resultTupleSchemeFactory()); + } + + private CreateStreamStatus success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + /** + * + * @see CreateStreamStatus + */ + SUCCESS((short)0, "success"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new 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.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, CreateStreamStatus.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createStream_result.class, metaDataMap); + } + + public createStream_result() { + } + + public createStream_result( + CreateStreamStatus success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public createStream_result(createStream_result other) { + if (other.isSetSuccess()) { + this.success = other.success; + } + } + + public createStream_result deepCopy() { + return new createStream_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + /** + * + * @see CreateStreamStatus + */ + public CreateStreamStatus getSuccess() { + return this.success; + } + + /** + * + * @see CreateStreamStatus + */ + public createStream_result setSuccess(CreateStreamStatus 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; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((CreateStreamStatus)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof createStream_result) + return this.equals((createStream_result)that); + return false; + } + + public boolean equals(createStream_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success.getValue()); + + return list.hashCode(); + } + + @Override + public int compareTo(createStream_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("createStream_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, 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 createStream_resultStandardSchemeFactory implements SchemeFactory { + public createStream_resultStandardScheme getScheme() { + return new createStream_resultStandardScheme(); + } + } + + private static class createStream_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, createStream_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.I32) { + struct.success = com.emc.pravega.controller.stream.api.v1.CreateStreamStatus.findByValue(iprot.readI32()); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, createStream_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeI32(struct.success.getValue()); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class createStream_resultTupleSchemeFactory implements SchemeFactory { + public createStream_resultTupleScheme getScheme() { + return new createStream_resultTupleScheme(); + } + } + + private static class createStream_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, createStream_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + oprot.writeI32(struct.success.getValue()); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, createStream_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = com.emc.pravega.controller.stream.api.v1.CreateStreamStatus.findByValue(iprot.readI32()); + struct.setSuccessIsSet(true); + } + } + } + + } + + public static class alterStream_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("alterStream_args"); + + private static final org.apache.thrift.protocol.TField STREAM_CONFIG_FIELD_DESC = new org.apache.thrift.protocol.TField("streamConfig", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new alterStream_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new alterStream_argsTupleSchemeFactory()); + } + + private StreamConfig streamConfig; // 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 { + STREAM_CONFIG((short)1, "streamConfig"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // STREAM_CONFIG + return STREAM_CONFIG; + 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 IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.STREAM_CONFIG, new org.apache.thrift.meta_data.FieldMetaData("streamConfig", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, StreamConfig.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(alterStream_args.class, metaDataMap); + } + + public alterStream_args() { + } + + public alterStream_args( + StreamConfig streamConfig) + { + this(); + this.streamConfig = streamConfig; + } + + /** + * Performs a deep copy on other. + */ + public alterStream_args(alterStream_args other) { + if (other.isSetStreamConfig()) { + this.streamConfig = new StreamConfig(other.streamConfig); + } + } + + public alterStream_args deepCopy() { + return new alterStream_args(this); + } + + @Override + public void clear() { + this.streamConfig = null; + } + + public StreamConfig getStreamConfig() { + return this.streamConfig; + } + + public alterStream_args setStreamConfig(StreamConfig streamConfig) { + this.streamConfig = streamConfig; + return this; + } + + public void unsetStreamConfig() { + this.streamConfig = null; + } + + /** Returns true if field streamConfig is set (has been assigned a value) and false otherwise */ + public boolean isSetStreamConfig() { + return this.streamConfig != null; + } + + public void setStreamConfigIsSet(boolean value) { + if (!value) { + this.streamConfig = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case STREAM_CONFIG: + if (value == null) { + unsetStreamConfig(); + } else { + setStreamConfig((StreamConfig)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case STREAM_CONFIG: + return getStreamConfig(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case STREAM_CONFIG: + return isSetStreamConfig(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof alterStream_args) + return this.equals((alterStream_args)that); + return false; + } + + public boolean equals(alterStream_args that) { + if (that == null) + return false; + + boolean this_present_streamConfig = true && this.isSetStreamConfig(); + boolean that_present_streamConfig = true && that.isSetStreamConfig(); + if (this_present_streamConfig || that_present_streamConfig) { + if (!(this_present_streamConfig && that_present_streamConfig)) + return false; + if (!this.streamConfig.equals(that.streamConfig)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_streamConfig = true && (isSetStreamConfig()); + list.add(present_streamConfig); + if (present_streamConfig) + list.add(streamConfig); + + return list.hashCode(); + } + + @Override + public int compareTo(alterStream_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetStreamConfig()).compareTo(other.isSetStreamConfig()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStreamConfig()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.streamConfig, other.streamConfig); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("alterStream_args("); + boolean first = true; + + sb.append("streamConfig:"); + if (this.streamConfig == null) { + sb.append("null"); + } else { + sb.append(this.streamConfig); + } + 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 (streamConfig != null) { + streamConfig.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, 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 alterStream_argsStandardSchemeFactory implements SchemeFactory { + public alterStream_argsStandardScheme getScheme() { + return new alterStream_argsStandardScheme(); + } + } + + private static class alterStream_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, alterStream_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: // STREAM_CONFIG + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.streamConfig = new StreamConfig(); + struct.streamConfig.read(iprot); + struct.setStreamConfigIsSet(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(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, alterStream_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.streamConfig != null) { + oprot.writeFieldBegin(STREAM_CONFIG_FIELD_DESC); + struct.streamConfig.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class alterStream_argsTupleSchemeFactory implements SchemeFactory { + public alterStream_argsTupleScheme getScheme() { + return new alterStream_argsTupleScheme(); + } + } + + private static class alterStream_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, alterStream_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetStreamConfig()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetStreamConfig()) { + struct.streamConfig.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, alterStream_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.streamConfig = new StreamConfig(); + struct.streamConfig.read(iprot); + struct.setStreamConfigIsSet(true); + } + } + } + + } + + public static class alterStream_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("alterStream_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new alterStream_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new alterStream_resultTupleSchemeFactory()); + } + + private UpdateStreamStatus success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + /** + * + * @see UpdateStreamStatus + */ + SUCCESS((short)0, "success"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new 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.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, UpdateStreamStatus.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(alterStream_result.class, metaDataMap); + } + + public alterStream_result() { + } + + public alterStream_result( + UpdateStreamStatus success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public alterStream_result(alterStream_result other) { + if (other.isSetSuccess()) { + this.success = other.success; + } + } + + public alterStream_result deepCopy() { + return new alterStream_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + /** + * + * @see UpdateStreamStatus + */ + public UpdateStreamStatus getSuccess() { + return this.success; + } + + /** + * + * @see UpdateStreamStatus + */ + public alterStream_result setSuccess(UpdateStreamStatus 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; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((UpdateStreamStatus)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof alterStream_result) + return this.equals((alterStream_result)that); + return false; + } + + public boolean equals(alterStream_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success.getValue()); + + return list.hashCode(); + } + + @Override + public int compareTo(alterStream_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("alterStream_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, 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 alterStream_resultStandardSchemeFactory implements SchemeFactory { + public alterStream_resultStandardScheme getScheme() { + return new alterStream_resultStandardScheme(); + } + } + + private static class alterStream_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, alterStream_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.I32) { + struct.success = com.emc.pravega.controller.stream.api.v1.UpdateStreamStatus.findByValue(iprot.readI32()); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, alterStream_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeI32(struct.success.getValue()); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class alterStream_resultTupleSchemeFactory implements SchemeFactory { + public alterStream_resultTupleScheme getScheme() { + return new alterStream_resultTupleScheme(); + } + } + + private static class alterStream_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, alterStream_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + oprot.writeI32(struct.success.getValue()); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, alterStream_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = com.emc.pravega.controller.stream.api.v1.UpdateStreamStatus.findByValue(iprot.readI32()); + struct.setSuccessIsSet(true); + } + } + } + + } + + public static class sealStream_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("sealStream_args"); + + private static final org.apache.thrift.protocol.TField SCOPE_FIELD_DESC = new org.apache.thrift.protocol.TField("scope", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField STREAM_FIELD_DESC = new org.apache.thrift.protocol.TField("stream", org.apache.thrift.protocol.TType.STRING, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new sealStream_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new sealStream_argsTupleSchemeFactory()); + } + + private String scope; // required + private String stream; // 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 { + SCOPE((short)1, "scope"), + STREAM((short)2, "stream"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // SCOPE + return SCOPE; + case 2: // STREAM + return STREAM; + 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 IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SCOPE, new org.apache.thrift.meta_data.FieldMetaData("scope", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.STREAM, new org.apache.thrift.meta_data.FieldMetaData("stream", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(sealStream_args.class, metaDataMap); + } + + public sealStream_args() { + } + + public sealStream_args( + String scope, + String stream) + { + this(); + this.scope = scope; + this.stream = stream; + } + + /** + * Performs a deep copy on other. + */ + public sealStream_args(sealStream_args other) { + if (other.isSetScope()) { + this.scope = other.scope; + } + if (other.isSetStream()) { + this.stream = other.stream; + } + } + + public sealStream_args deepCopy() { + return new sealStream_args(this); + } + + @Override + public void clear() { + this.scope = null; + this.stream = null; + } + + public String getScope() { + return this.scope; + } + + public sealStream_args setScope(String scope) { + this.scope = scope; + return this; + } + + public void unsetScope() { + this.scope = null; + } + + /** Returns true if field scope is set (has been assigned a value) and false otherwise */ + public boolean isSetScope() { + return this.scope != null; + } + + public void setScopeIsSet(boolean value) { + if (!value) { + this.scope = null; + } + } + + public String getStream() { + return this.stream; + } + + public sealStream_args setStream(String stream) { + this.stream = stream; + return this; + } + + public void unsetStream() { + this.stream = null; + } + + /** Returns true if field stream is set (has been assigned a value) and false otherwise */ + public boolean isSetStream() { + return this.stream != null; + } + + public void setStreamIsSet(boolean value) { + if (!value) { + this.stream = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SCOPE: + if (value == null) { + unsetScope(); + } else { + setScope((String)value); + } + break; + + case STREAM: + if (value == null) { + unsetStream(); + } else { + setStream((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SCOPE: + return getScope(); + + case STREAM: + return getStream(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SCOPE: + return isSetScope(); + case STREAM: + return isSetStream(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof sealStream_args) + return this.equals((sealStream_args)that); + return false; + } + + public boolean equals(sealStream_args that) { + if (that == null) + return false; + + boolean this_present_scope = true && this.isSetScope(); + boolean that_present_scope = true && that.isSetScope(); + if (this_present_scope || that_present_scope) { + if (!(this_present_scope && that_present_scope)) + return false; + if (!this.scope.equals(that.scope)) + return false; + } + + boolean this_present_stream = true && this.isSetStream(); + boolean that_present_stream = true && that.isSetStream(); + if (this_present_stream || that_present_stream) { + if (!(this_present_stream && that_present_stream)) + return false; + if (!this.stream.equals(that.stream)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_scope = true && (isSetScope()); + list.add(present_scope); + if (present_scope) + list.add(scope); + + boolean present_stream = true && (isSetStream()); + list.add(present_stream); + if (present_stream) + list.add(stream); + + return list.hashCode(); + } + + @Override + public int compareTo(sealStream_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetScope()).compareTo(other.isSetScope()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetScope()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scope, other.scope); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetStream()).compareTo(other.isSetStream()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStream()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stream, other.stream); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("sealStream_args("); + boolean first = true; + + sb.append("scope:"); + if (this.scope == null) { + sb.append("null"); + } else { + sb.append(this.scope); + } + first = false; + if (!first) sb.append(", "); + sb.append("stream:"); + if (this.stream == null) { + sb.append("null"); + } else { + sb.append(this.stream); + } + 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, 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 sealStream_argsStandardSchemeFactory implements SchemeFactory { + public sealStream_argsStandardScheme getScheme() { + return new sealStream_argsStandardScheme(); + } + } + + private static class sealStream_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, sealStream_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: // SCOPE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.scope = iprot.readString(); + struct.setScopeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // STREAM + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.stream = iprot.readString(); + struct.setStreamIsSet(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(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, sealStream_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.scope != null) { + oprot.writeFieldBegin(SCOPE_FIELD_DESC); + oprot.writeString(struct.scope); + oprot.writeFieldEnd(); + } + if (struct.stream != null) { + oprot.writeFieldBegin(STREAM_FIELD_DESC); + oprot.writeString(struct.stream); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class sealStream_argsTupleSchemeFactory implements SchemeFactory { + public sealStream_argsTupleScheme getScheme() { + return new sealStream_argsTupleScheme(); + } + } + + private static class sealStream_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, sealStream_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetScope()) { + optionals.set(0); + } + if (struct.isSetStream()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetScope()) { + oprot.writeString(struct.scope); + } + if (struct.isSetStream()) { + oprot.writeString(struct.stream); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, sealStream_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.scope = iprot.readString(); + struct.setScopeIsSet(true); + } + if (incoming.get(1)) { + struct.stream = iprot.readString(); + struct.setStreamIsSet(true); + } + } + } + + } + + public static class sealStream_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("sealStream_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new sealStream_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new sealStream_resultTupleSchemeFactory()); + } + + private UpdateStreamStatus success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + /** + * + * @see UpdateStreamStatus + */ + SUCCESS((short)0, "success"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new 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.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, UpdateStreamStatus.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(sealStream_result.class, metaDataMap); + } + + public sealStream_result() { + } + + public sealStream_result( + UpdateStreamStatus success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public sealStream_result(sealStream_result other) { + if (other.isSetSuccess()) { + this.success = other.success; + } + } + + public sealStream_result deepCopy() { + return new sealStream_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + /** + * + * @see UpdateStreamStatus + */ + public UpdateStreamStatus getSuccess() { + return this.success; + } + + /** + * + * @see UpdateStreamStatus + */ + public sealStream_result setSuccess(UpdateStreamStatus 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; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((UpdateStreamStatus)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof sealStream_result) + return this.equals((sealStream_result)that); + return false; + } + + public boolean equals(sealStream_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success.getValue()); + + return list.hashCode(); + } + + @Override + public int compareTo(sealStream_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("sealStream_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, 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 sealStream_resultStandardSchemeFactory implements SchemeFactory { + public sealStream_resultStandardScheme getScheme() { + return new sealStream_resultStandardScheme(); + } + } + + private static class sealStream_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, sealStream_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.I32) { + struct.success = com.emc.pravega.controller.stream.api.v1.UpdateStreamStatus.findByValue(iprot.readI32()); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, sealStream_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeI32(struct.success.getValue()); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class sealStream_resultTupleSchemeFactory implements SchemeFactory { + public sealStream_resultTupleScheme getScheme() { + return new sealStream_resultTupleScheme(); + } + } + + private static class sealStream_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, sealStream_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + oprot.writeI32(struct.success.getValue()); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, sealStream_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = com.emc.pravega.controller.stream.api.v1.UpdateStreamStatus.findByValue(iprot.readI32()); + struct.setSuccessIsSet(true); + } + } + } + + } + + public static class getCurrentSegments_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("getCurrentSegments_args"); + + private static final org.apache.thrift.protocol.TField SCOPE_FIELD_DESC = new org.apache.thrift.protocol.TField("scope", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField STREAM_FIELD_DESC = new org.apache.thrift.protocol.TField("stream", org.apache.thrift.protocol.TType.STRING, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getCurrentSegments_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getCurrentSegments_argsTupleSchemeFactory()); + } + + private String scope; // required + private String stream; // 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 { + SCOPE((short)1, "scope"), + STREAM((short)2, "stream"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // SCOPE + return SCOPE; + case 2: // STREAM + return STREAM; + 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 IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SCOPE, new org.apache.thrift.meta_data.FieldMetaData("scope", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.STREAM, new org.apache.thrift.meta_data.FieldMetaData("stream", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCurrentSegments_args.class, metaDataMap); + } + + public getCurrentSegments_args() { + } + + public getCurrentSegments_args( + String scope, + String stream) + { + this(); + this.scope = scope; + this.stream = stream; + } + + /** + * Performs a deep copy on other. + */ + public getCurrentSegments_args(getCurrentSegments_args other) { + if (other.isSetScope()) { + this.scope = other.scope; + } + if (other.isSetStream()) { + this.stream = other.stream; + } + } + + public getCurrentSegments_args deepCopy() { + return new getCurrentSegments_args(this); + } + + @Override + public void clear() { + this.scope = null; + this.stream = null; + } + + public String getScope() { + return this.scope; + } + + public getCurrentSegments_args setScope(String scope) { + this.scope = scope; + return this; + } + + public void unsetScope() { + this.scope = null; + } + + /** Returns true if field scope is set (has been assigned a value) and false otherwise */ + public boolean isSetScope() { + return this.scope != null; + } + + public void setScopeIsSet(boolean value) { + if (!value) { + this.scope = null; + } + } + + public String getStream() { + return this.stream; + } + + public getCurrentSegments_args setStream(String stream) { + this.stream = stream; + return this; + } + + public void unsetStream() { + this.stream = null; + } + + /** Returns true if field stream is set (has been assigned a value) and false otherwise */ + public boolean isSetStream() { + return this.stream != null; + } + + public void setStreamIsSet(boolean value) { + if (!value) { + this.stream = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SCOPE: + if (value == null) { + unsetScope(); + } else { + setScope((String)value); + } + break; + + case STREAM: + if (value == null) { + unsetStream(); + } else { + setStream((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SCOPE: + return getScope(); + + case STREAM: + return getStream(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SCOPE: + return isSetScope(); + case STREAM: + return isSetStream(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getCurrentSegments_args) + return this.equals((getCurrentSegments_args)that); + return false; + } + + public boolean equals(getCurrentSegments_args that) { + if (that == null) + return false; + + boolean this_present_scope = true && this.isSetScope(); + boolean that_present_scope = true && that.isSetScope(); + if (this_present_scope || that_present_scope) { + if (!(this_present_scope && that_present_scope)) + return false; + if (!this.scope.equals(that.scope)) + return false; + } + + boolean this_present_stream = true && this.isSetStream(); + boolean that_present_stream = true && that.isSetStream(); + if (this_present_stream || that_present_stream) { + if (!(this_present_stream && that_present_stream)) + return false; + if (!this.stream.equals(that.stream)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_scope = true && (isSetScope()); + list.add(present_scope); + if (present_scope) + list.add(scope); + + boolean present_stream = true && (isSetStream()); + list.add(present_stream); + if (present_stream) + list.add(stream); + + return list.hashCode(); + } + + @Override + public int compareTo(getCurrentSegments_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetScope()).compareTo(other.isSetScope()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetScope()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scope, other.scope); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetStream()).compareTo(other.isSetStream()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStream()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stream, other.stream); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getCurrentSegments_args("); + boolean first = true; + + sb.append("scope:"); + if (this.scope == null) { + sb.append("null"); + } else { + sb.append(this.scope); + } + first = false; + if (!first) sb.append(", "); + sb.append("stream:"); + if (this.stream == null) { + sb.append("null"); + } else { + sb.append(this.stream); + } + 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, 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 getCurrentSegments_argsStandardSchemeFactory implements SchemeFactory { + public getCurrentSegments_argsStandardScheme getScheme() { + return new getCurrentSegments_argsStandardScheme(); + } + } + + private static class getCurrentSegments_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getCurrentSegments_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: // SCOPE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.scope = iprot.readString(); + struct.setScopeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // STREAM + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.stream = iprot.readString(); + struct.setStreamIsSet(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(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getCurrentSegments_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.scope != null) { + oprot.writeFieldBegin(SCOPE_FIELD_DESC); + oprot.writeString(struct.scope); + oprot.writeFieldEnd(); + } + if (struct.stream != null) { + oprot.writeFieldBegin(STREAM_FIELD_DESC); + oprot.writeString(struct.stream); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getCurrentSegments_argsTupleSchemeFactory implements SchemeFactory { + public getCurrentSegments_argsTupleScheme getScheme() { + return new getCurrentSegments_argsTupleScheme(); + } + } + + private static class getCurrentSegments_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getCurrentSegments_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetScope()) { + optionals.set(0); + } + if (struct.isSetStream()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetScope()) { + oprot.writeString(struct.scope); + } + if (struct.isSetStream()) { + oprot.writeString(struct.stream); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getCurrentSegments_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.scope = iprot.readString(); + struct.setScopeIsSet(true); + } + if (incoming.get(1)) { + struct.stream = iprot.readString(); + struct.setStreamIsSet(true); + } + } + } + + } + + public static class getCurrentSegments_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("getCurrentSegments_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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getCurrentSegments_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getCurrentSegments_resultTupleSchemeFactory()); + } + + private List success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, SegmentRange.class)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCurrentSegments_result.class, metaDataMap); + } + + public getCurrentSegments_result() { + } + + public getCurrentSegments_result( + List success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public getCurrentSegments_result(getCurrentSegments_result other) { + if (other.isSetSuccess()) { + List __this__success = new ArrayList(other.success.size()); + for (SegmentRange other_element : other.success) { + __this__success.add(new SegmentRange(other_element)); + } + this.success = __this__success; + } + } + + public getCurrentSegments_result deepCopy() { + return new getCurrentSegments_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(SegmentRange elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); + } + + public List getSuccess() { + return this.success; + } + + public getCurrentSegments_result setSuccess(List success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((List)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getCurrentSegments_result) + return this.equals((getCurrentSegments_result)that); + return false; + } + + public boolean equals(getCurrentSegments_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + return list.hashCode(); + } + + @Override + public int compareTo(getCurrentSegments_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getCurrentSegments_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, 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 getCurrentSegments_resultStandardSchemeFactory implements SchemeFactory { + public getCurrentSegments_resultStandardScheme getScheme() { + return new getCurrentSegments_resultStandardScheme(); + } + } + + private static class getCurrentSegments_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getCurrentSegments_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list18 = iprot.readListBegin(); + struct.success = new ArrayList(_list18.size); + SegmentRange _elem19; + for (int _i20 = 0; _i20 < _list18.size; ++_i20) + { + _elem19 = new SegmentRange(); + _elem19.read(iprot); + struct.success.add(_elem19); + } + iprot.readListEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getCurrentSegments_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); + for (SegmentRange _iter21 : struct.success) + { + _iter21.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getCurrentSegments_resultTupleSchemeFactory implements SchemeFactory { + public getCurrentSegments_resultTupleScheme getScheme() { + return new getCurrentSegments_resultTupleScheme(); + } + } + + private static class getCurrentSegments_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getCurrentSegments_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (SegmentRange _iter22 : struct.success) + { + _iter22.write(oprot); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getCurrentSegments_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list23 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList(_list23.size); + SegmentRange _elem24; + for (int _i25 = 0; _i25 < _list23.size; ++_i25) + { + _elem24 = new SegmentRange(); + _elem24.read(iprot); + struct.success.add(_elem24); + } + } + struct.setSuccessIsSet(true); + } + } + } + + } + + public static class getPositions_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("getPositions_args"); + + private static final org.apache.thrift.protocol.TField SCOPE_FIELD_DESC = new org.apache.thrift.protocol.TField("scope", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField STREAM_FIELD_DESC = new org.apache.thrift.protocol.TField("stream", org.apache.thrift.protocol.TType.STRING, (short)2); + 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)3); + private static final org.apache.thrift.protocol.TField COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("count", org.apache.thrift.protocol.TType.I32, (short)4); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getPositions_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getPositions_argsTupleSchemeFactory()); + } + + private String scope; // required + private String stream; // required + private long timestamp; // required + private int count; // 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 { + SCOPE((short)1, "scope"), + STREAM((short)2, "stream"), + TIMESTAMP((short)3, "timestamp"), + COUNT((short)4, "count"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // SCOPE + return SCOPE; + case 2: // STREAM + return STREAM; + case 3: // TIMESTAMP + return TIMESTAMP; + case 4: // COUNT + return COUNT; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __TIMESTAMP_ISSET_ID = 0; + private static final int __COUNT_ISSET_ID = 1; + private byte __isset_bitfield = 0; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SCOPE, new org.apache.thrift.meta_data.FieldMetaData("scope", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.STREAM, new org.apache.thrift.meta_data.FieldMetaData("stream", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.COUNT, new org.apache.thrift.meta_data.FieldMetaData("count", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPositions_args.class, metaDataMap); + } + + public getPositions_args() { + } + + public getPositions_args( + String scope, + String stream, + long timestamp, + int count) + { + this(); + this.scope = scope; + this.stream = stream; + this.timestamp = timestamp; + setTimestampIsSet(true); + this.count = count; + setCountIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public getPositions_args(getPositions_args other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetScope()) { + this.scope = other.scope; + } + if (other.isSetStream()) { + this.stream = other.stream; + } + this.timestamp = other.timestamp; + this.count = other.count; + } + + public getPositions_args deepCopy() { + return new getPositions_args(this); + } + + @Override + public void clear() { + this.scope = null; + this.stream = null; + setTimestampIsSet(false); + this.timestamp = 0; + setCountIsSet(false); + this.count = 0; + } + + public String getScope() { + return this.scope; + } + + public getPositions_args setScope(String scope) { + this.scope = scope; + return this; + } + + public void unsetScope() { + this.scope = null; + } + + /** Returns true if field scope is set (has been assigned a value) and false otherwise */ + public boolean isSetScope() { + return this.scope != null; + } + + public void setScopeIsSet(boolean value) { + if (!value) { + this.scope = null; + } + } + + public String getStream() { + return this.stream; + } + + public getPositions_args setStream(String stream) { + this.stream = stream; + return this; + } + + public void unsetStream() { + this.stream = null; + } + + /** Returns true if field stream is set (has been assigned a value) and false otherwise */ + public boolean isSetStream() { + return this.stream != null; + } + + public void setStreamIsSet(boolean value) { + if (!value) { + this.stream = null; + } + } + + public long getTimestamp() { + return this.timestamp; + } + + public getPositions_args setTimestamp(long timestamp) { + this.timestamp = timestamp; + setTimestampIsSet(true); + return this; + } + + public void unsetTimestamp() { + __isset_bitfield = 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 EncodingUtils.testBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + } + + public void setTimestampIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIMESTAMP_ISSET_ID, value); + } + + public int getCount() { + return this.count; + } + + public getPositions_args setCount(int count) { + this.count = count; + setCountIsSet(true); + return this; + } + + public void unsetCount() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __COUNT_ISSET_ID); + } + + /** Returns true if field count is set (has been assigned a value) and false otherwise */ + public boolean isSetCount() { + return EncodingUtils.testBit(__isset_bitfield, __COUNT_ISSET_ID); + } + + public void setCountIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __COUNT_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SCOPE: + if (value == null) { + unsetScope(); + } else { + setScope((String)value); + } + break; + + case STREAM: + if (value == null) { + unsetStream(); + } else { + setStream((String)value); + } + break; + + case TIMESTAMP: + if (value == null) { + unsetTimestamp(); + } else { + setTimestamp((Long)value); + } + break; + + case COUNT: + if (value == null) { + unsetCount(); + } else { + setCount((Integer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SCOPE: + return getScope(); + + case STREAM: + return getStream(); + + case TIMESTAMP: + return getTimestamp(); + + case COUNT: + return getCount(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SCOPE: + return isSetScope(); + case STREAM: + return isSetStream(); + case TIMESTAMP: + return isSetTimestamp(); + case COUNT: + return isSetCount(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getPositions_args) + return this.equals((getPositions_args)that); + return false; + } + + public boolean equals(getPositions_args that) { + if (that == null) + return false; + + boolean this_present_scope = true && this.isSetScope(); + boolean that_present_scope = true && that.isSetScope(); + if (this_present_scope || that_present_scope) { + if (!(this_present_scope && that_present_scope)) + return false; + if (!this.scope.equals(that.scope)) + return false; + } + + boolean this_present_stream = true && this.isSetStream(); + boolean that_present_stream = true && that.isSetStream(); + if (this_present_stream || that_present_stream) { + if (!(this_present_stream && that_present_stream)) + return false; + if (!this.stream.equals(that.stream)) + 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_count = true; + boolean that_present_count = true; + if (this_present_count || that_present_count) { + if (!(this_present_count && that_present_count)) + return false; + if (this.count != that.count) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_scope = true && (isSetScope()); + list.add(present_scope); + if (present_scope) + list.add(scope); + + boolean present_stream = true && (isSetStream()); + list.add(present_stream); + if (present_stream) + list.add(stream); + + boolean present_timestamp = true; + list.add(present_timestamp); + if (present_timestamp) + list.add(timestamp); + + boolean present_count = true; + list.add(present_count); + if (present_count) + list.add(count); + + return list.hashCode(); + } + + @Override + public int compareTo(getPositions_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetScope()).compareTo(other.isSetScope()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetScope()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scope, other.scope); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetStream()).compareTo(other.isSetStream()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStream()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stream, other.stream); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(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 = Boolean.valueOf(isSetCount()).compareTo(other.isSetCount()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetCount()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.count, other.count); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getPositions_args("); + boolean first = true; + + sb.append("scope:"); + if (this.scope == null) { + sb.append("null"); + } else { + sb.append(this.scope); + } + first = false; + if (!first) sb.append(", "); + sb.append("stream:"); + if (this.stream == null) { + sb.append("null"); + } else { + sb.append(this.stream); + } + first = false; + if (!first) sb.append(", "); + sb.append("timestamp:"); + sb.append(this.timestamp); + first = false; + if (!first) sb.append(", "); + sb.append("count:"); + sb.append(this.count); + 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, 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 getPositions_argsStandardSchemeFactory implements SchemeFactory { + public getPositions_argsStandardScheme getScheme() { + return new getPositions_argsStandardScheme(); + } + } + + private static class getPositions_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getPositions_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: // SCOPE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.scope = iprot.readString(); + struct.setScopeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // STREAM + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.stream = iprot.readString(); + struct.setStreamIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // 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 4: // COUNT + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.count = iprot.readI32(); + struct.setCountIsSet(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(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getPositions_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.scope != null) { + oprot.writeFieldBegin(SCOPE_FIELD_DESC); + oprot.writeString(struct.scope); + oprot.writeFieldEnd(); + } + if (struct.stream != null) { + oprot.writeFieldBegin(STREAM_FIELD_DESC); + oprot.writeString(struct.stream); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC); + oprot.writeI64(struct.timestamp); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(COUNT_FIELD_DESC); + oprot.writeI32(struct.count); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getPositions_argsTupleSchemeFactory implements SchemeFactory { + public getPositions_argsTupleScheme getScheme() { + return new getPositions_argsTupleScheme(); + } + } + + private static class getPositions_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getPositions_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetScope()) { + optionals.set(0); + } + if (struct.isSetStream()) { + optionals.set(1); + } + if (struct.isSetTimestamp()) { + optionals.set(2); + } + if (struct.isSetCount()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.isSetScope()) { + oprot.writeString(struct.scope); + } + if (struct.isSetStream()) { + oprot.writeString(struct.stream); + } + if (struct.isSetTimestamp()) { + oprot.writeI64(struct.timestamp); + } + if (struct.isSetCount()) { + oprot.writeI32(struct.count); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getPositions_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(4); + if (incoming.get(0)) { + struct.scope = iprot.readString(); + struct.setScopeIsSet(true); + } + if (incoming.get(1)) { + struct.stream = iprot.readString(); + struct.setStreamIsSet(true); + } + if (incoming.get(2)) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + } + if (incoming.get(3)) { + struct.count = iprot.readI32(); + struct.setCountIsSet(true); + } + } + } + + } + + public static class getPositions_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("getPositions_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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getPositions_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getPositions_resultTupleSchemeFactory()); + } + + private List success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Position.class)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPositions_result.class, metaDataMap); + } + + public getPositions_result() { + } + + public getPositions_result( + List success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public getPositions_result(getPositions_result other) { + if (other.isSetSuccess()) { + List __this__success = new ArrayList(other.success.size()); + for (Position other_element : other.success) { + __this__success.add(new Position(other_element)); + } + this.success = __this__success; + } + } + + public getPositions_result deepCopy() { + return new getPositions_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(Position elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); + } + + public List getSuccess() { + return this.success; + } + + public getPositions_result setSuccess(List success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((List)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getPositions_result) + return this.equals((getPositions_result)that); + return false; + } + + public boolean equals(getPositions_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + return list.hashCode(); + } + + @Override + public int compareTo(getPositions_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getPositions_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, 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 getPositions_resultStandardSchemeFactory implements SchemeFactory { + public getPositions_resultStandardScheme getScheme() { + return new getPositions_resultStandardScheme(); + } + } + + private static class getPositions_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getPositions_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list26 = iprot.readListBegin(); + struct.success = new ArrayList(_list26.size); + Position _elem27; + for (int _i28 = 0; _i28 < _list26.size; ++_i28) + { + _elem27 = new Position(); + _elem27.read(iprot); + struct.success.add(_elem27); + } + iprot.readListEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getPositions_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); + for (Position _iter29 : struct.success) + { + _iter29.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getPositions_resultTupleSchemeFactory implements SchemeFactory { + public getPositions_resultTupleScheme getScheme() { + return new getPositions_resultTupleScheme(); + } + } + + private static class getPositions_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getPositions_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (Position _iter30 : struct.success) + { + _iter30.write(oprot); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getPositions_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list31 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList(_list31.size); + Position _elem32; + for (int _i33 = 0; _i33 < _list31.size; ++_i33) + { + _elem32 = new Position(); + _elem32.read(iprot); + struct.success.add(_elem32); + } + } + struct.setSuccessIsSet(true); + } + } + } + + } + + public static class getSegmentsImmediatlyFollowing_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("getSegmentsImmediatlyFollowing_args"); + + private static final org.apache.thrift.protocol.TField SEGMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("segment", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getSegmentsImmediatlyFollowing_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getSegmentsImmediatlyFollowing_argsTupleSchemeFactory()); + } + + private SegmentId segment; // 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 { + SEGMENT((short)1, "segment"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // SEGMENT + return SEGMENT; + 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 IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SEGMENT, new org.apache.thrift.meta_data.FieldMetaData("segment", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, SegmentId.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSegmentsImmediatlyFollowing_args.class, metaDataMap); + } + + public getSegmentsImmediatlyFollowing_args() { + } + + public getSegmentsImmediatlyFollowing_args( + SegmentId segment) + { + this(); + this.segment = segment; + } + + /** + * Performs a deep copy on other. + */ + public getSegmentsImmediatlyFollowing_args(getSegmentsImmediatlyFollowing_args other) { + if (other.isSetSegment()) { + this.segment = new SegmentId(other.segment); + } + } + + public getSegmentsImmediatlyFollowing_args deepCopy() { + return new getSegmentsImmediatlyFollowing_args(this); + } + + @Override + public void clear() { + this.segment = null; + } + + public SegmentId getSegment() { + return this.segment; + } + + public getSegmentsImmediatlyFollowing_args setSegment(SegmentId segment) { + this.segment = segment; + return this; + } + + public void unsetSegment() { + this.segment = null; + } + + /** Returns true if field segment is set (has been assigned a value) and false otherwise */ + public boolean isSetSegment() { + return this.segment != null; + } + + public void setSegmentIsSet(boolean value) { + if (!value) { + this.segment = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SEGMENT: + if (value == null) { + unsetSegment(); + } else { + setSegment((SegmentId)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SEGMENT: + return getSegment(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SEGMENT: + return isSetSegment(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getSegmentsImmediatlyFollowing_args) + return this.equals((getSegmentsImmediatlyFollowing_args)that); + return false; + } + + public boolean equals(getSegmentsImmediatlyFollowing_args that) { + if (that == null) + return false; + + boolean this_present_segment = true && this.isSetSegment(); + boolean that_present_segment = true && that.isSetSegment(); + if (this_present_segment || that_present_segment) { + if (!(this_present_segment && that_present_segment)) + return false; + if (!this.segment.equals(that.segment)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_segment = true && (isSetSegment()); + list.add(present_segment); + if (present_segment) + list.add(segment); + + return list.hashCode(); + } + + @Override + public int compareTo(getSegmentsImmediatlyFollowing_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSegment()).compareTo(other.isSetSegment()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSegment()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.segment, other.segment); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getSegmentsImmediatlyFollowing_args("); + boolean first = true; + + sb.append("segment:"); + if (this.segment == null) { + sb.append("null"); + } else { + sb.append(this.segment); + } + 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 (segment != null) { + segment.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, 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 getSegmentsImmediatlyFollowing_argsStandardSchemeFactory implements SchemeFactory { + public getSegmentsImmediatlyFollowing_argsStandardScheme getScheme() { + return new getSegmentsImmediatlyFollowing_argsStandardScheme(); + } + } + + private static class getSegmentsImmediatlyFollowing_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getSegmentsImmediatlyFollowing_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: // SEGMENT + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.segment = new SegmentId(); + struct.segment.read(iprot); + struct.setSegmentIsSet(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(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getSegmentsImmediatlyFollowing_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.segment != null) { + oprot.writeFieldBegin(SEGMENT_FIELD_DESC); + struct.segment.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getSegmentsImmediatlyFollowing_argsTupleSchemeFactory implements SchemeFactory { + public getSegmentsImmediatlyFollowing_argsTupleScheme getScheme() { + return new getSegmentsImmediatlyFollowing_argsTupleScheme(); + } + } + + private static class getSegmentsImmediatlyFollowing_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getSegmentsImmediatlyFollowing_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSegment()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSegment()) { + struct.segment.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getSegmentsImmediatlyFollowing_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.segment = new SegmentId(); + struct.segment.read(iprot); + struct.setSegmentIsSet(true); + } + } + } + + } + + public static class getSegmentsImmediatlyFollowing_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("getSegmentsImmediatlyFollowing_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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getSegmentsImmediatlyFollowing_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getSegmentsImmediatlyFollowing_resultTupleSchemeFactory()); + } + + private Map> success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new 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.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, SegmentId.class), + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSegmentsImmediatlyFollowing_result.class, metaDataMap); + } + + public getSegmentsImmediatlyFollowing_result() { + } + + public getSegmentsImmediatlyFollowing_result( + Map> success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public getSegmentsImmediatlyFollowing_result(getSegmentsImmediatlyFollowing_result other) { + if (other.isSetSuccess()) { + Map> __this__success = new HashMap>(other.success.size()); + for (Map.Entry> other_element : other.success.entrySet()) { + + SegmentId other_element_key = other_element.getKey(); + List other_element_value = other_element.getValue(); + + SegmentId __this__success_copy_key = new SegmentId(other_element_key); + + List __this__success_copy_value = new ArrayList(other_element_value); + + __this__success.put(__this__success_copy_key, __this__success_copy_value); + } + this.success = __this__success; + } + } + + public getSegmentsImmediatlyFollowing_result deepCopy() { + return new getSegmentsImmediatlyFollowing_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public void putToSuccess(SegmentId key, List val) { + if (this.success == null) { + this.success = new HashMap>(); + } + this.success.put(key, val); + } + + public Map> getSuccess() { + return this.success; + } + + public getSegmentsImmediatlyFollowing_result setSuccess(Map> 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; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Map>)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getSegmentsImmediatlyFollowing_result) + return this.equals((getSegmentsImmediatlyFollowing_result)that); + return false; + } + + public boolean equals(getSegmentsImmediatlyFollowing_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + return list.hashCode(); + } + + @Override + public int compareTo(getSegmentsImmediatlyFollowing_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getSegmentsImmediatlyFollowing_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, 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 getSegmentsImmediatlyFollowing_resultStandardSchemeFactory implements SchemeFactory { + public getSegmentsImmediatlyFollowing_resultStandardScheme getScheme() { + return new getSegmentsImmediatlyFollowing_resultStandardScheme(); + } + } + + private static class getSegmentsImmediatlyFollowing_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getSegmentsImmediatlyFollowing_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.MAP) { + { + org.apache.thrift.protocol.TMap _map34 = iprot.readMapBegin(); + struct.success = new HashMap>(2*_map34.size); + SegmentId _key35; + List _val36; + for (int _i37 = 0; _i37 < _map34.size; ++_i37) + { + _key35 = new SegmentId(); + _key35.read(iprot); + { + org.apache.thrift.protocol.TList _list38 = iprot.readListBegin(); + _val36 = new ArrayList(_list38.size); + int _elem39; + for (int _i40 = 0; _i40 < _list38.size; ++_i40) + { + _elem39 = iprot.readI32(); + _val36.add(_elem39); + } + iprot.readListEnd(); + } + struct.success.put(_key35, _val36); + } + iprot.readMapEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getSegmentsImmediatlyFollowing_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.STRUCT, org.apache.thrift.protocol.TType.LIST, struct.success.size())); + for (Map.Entry> _iter41 : struct.success.entrySet()) + { + _iter41.getKey().write(oprot); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, _iter41.getValue().size())); + for (int _iter42 : _iter41.getValue()) + { + oprot.writeI32(_iter42); + } + oprot.writeListEnd(); + } + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getSegmentsImmediatlyFollowing_resultTupleSchemeFactory implements SchemeFactory { + public getSegmentsImmediatlyFollowing_resultTupleScheme getScheme() { + return new getSegmentsImmediatlyFollowing_resultTupleScheme(); + } + } + + private static class getSegmentsImmediatlyFollowing_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getSegmentsImmediatlyFollowing_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (Map.Entry> _iter43 : struct.success.entrySet()) + { + _iter43.getKey().write(oprot); + { + oprot.writeI32(_iter43.getValue().size()); + for (int _iter44 : _iter43.getValue()) + { + oprot.writeI32(_iter44); + } + } + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getSegmentsImmediatlyFollowing_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TMap _map45 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.LIST, iprot.readI32()); + struct.success = new HashMap>(2*_map45.size); + SegmentId _key46; + List _val47; + for (int _i48 = 0; _i48 < _map45.size; ++_i48) + { + _key46 = new SegmentId(); + _key46.read(iprot); + { + org.apache.thrift.protocol.TList _list49 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, iprot.readI32()); + _val47 = new ArrayList(_list49.size); + int _elem50; + for (int _i51 = 0; _i51 < _list49.size; ++_i51) + { + _elem50 = iprot.readI32(); + _val47.add(_elem50); + } + } + struct.success.put(_key46, _val47); + } + } + struct.setSuccessIsSet(true); + } + } + } + + } + + public static class scale_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("scale_args"); + + private static final org.apache.thrift.protocol.TField SCOPE_FIELD_DESC = new org.apache.thrift.protocol.TField("scope", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField STREAM_FIELD_DESC = new org.apache.thrift.protocol.TField("stream", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField SEALED_SEGMENTS_FIELD_DESC = new org.apache.thrift.protocol.TField("sealedSegments", org.apache.thrift.protocol.TType.LIST, (short)3); + private static final org.apache.thrift.protocol.TField NEW_KEY_RANGES_FIELD_DESC = new org.apache.thrift.protocol.TField("newKeyRanges", org.apache.thrift.protocol.TType.MAP, (short)4); + private static final org.apache.thrift.protocol.TField SCALE_TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("scaleTimestamp", org.apache.thrift.protocol.TType.I64, (short)5); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new scale_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new scale_argsTupleSchemeFactory()); + } + + private String scope; // required + private String stream; // required + private List sealedSegments; // required + private Map newKeyRanges; // required + private long scaleTimestamp; // 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 { + SCOPE((short)1, "scope"), + STREAM((short)2, "stream"), + SEALED_SEGMENTS((short)3, "sealedSegments"), + NEW_KEY_RANGES((short)4, "newKeyRanges"), + SCALE_TIMESTAMP((short)5, "scaleTimestamp"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // SCOPE + return SCOPE; + case 2: // STREAM + return STREAM; + case 3: // SEALED_SEGMENTS + return SEALED_SEGMENTS; + case 4: // NEW_KEY_RANGES + return NEW_KEY_RANGES; + case 5: // SCALE_TIMESTAMP + return SCALE_TIMESTAMP; + 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 IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __SCALETIMESTAMP_ISSET_ID = 0; + private byte __isset_bitfield = 0; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SCOPE, new org.apache.thrift.meta_data.FieldMetaData("scope", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.STREAM, new org.apache.thrift.meta_data.FieldMetaData("stream", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.SEALED_SEGMENTS, new org.apache.thrift.meta_data.FieldMetaData("sealedSegments", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)))); + tmpMap.put(_Fields.NEW_KEY_RANGES, new org.apache.thrift.meta_data.FieldMetaData("newKeyRanges", 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.DOUBLE), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)))); + tmpMap.put(_Fields.SCALE_TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("scaleTimestamp", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scale_args.class, metaDataMap); + } + + public scale_args() { + } + + public scale_args( + String scope, + String stream, + List sealedSegments, + Map newKeyRanges, + long scaleTimestamp) + { + this(); + this.scope = scope; + this.stream = stream; + this.sealedSegments = sealedSegments; + this.newKeyRanges = newKeyRanges; + this.scaleTimestamp = scaleTimestamp; + setScaleTimestampIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public scale_args(scale_args other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetScope()) { + this.scope = other.scope; + } + if (other.isSetStream()) { + this.stream = other.stream; + } + if (other.isSetSealedSegments()) { + List __this__sealedSegments = new ArrayList(other.sealedSegments); + this.sealedSegments = __this__sealedSegments; + } + if (other.isSetNewKeyRanges()) { + Map __this__newKeyRanges = new HashMap(other.newKeyRanges); + this.newKeyRanges = __this__newKeyRanges; + } + this.scaleTimestamp = other.scaleTimestamp; + } + + public scale_args deepCopy() { + return new scale_args(this); + } + + @Override + public void clear() { + this.scope = null; + this.stream = null; + this.sealedSegments = null; + this.newKeyRanges = null; + setScaleTimestampIsSet(false); + this.scaleTimestamp = 0; + } + + public String getScope() { + return this.scope; + } + + public scale_args setScope(String scope) { + this.scope = scope; + return this; + } + + public void unsetScope() { + this.scope = null; + } + + /** Returns true if field scope is set (has been assigned a value) and false otherwise */ + public boolean isSetScope() { + return this.scope != null; + } + + public void setScopeIsSet(boolean value) { + if (!value) { + this.scope = null; + } + } + + public String getStream() { + return this.stream; + } + + public scale_args setStream(String stream) { + this.stream = stream; + return this; + } + + public void unsetStream() { + this.stream = null; + } + + /** Returns true if field stream is set (has been assigned a value) and false otherwise */ + public boolean isSetStream() { + return this.stream != null; + } + + public void setStreamIsSet(boolean value) { + if (!value) { + this.stream = null; + } + } + + public int getSealedSegmentsSize() { + return (this.sealedSegments == null) ? 0 : this.sealedSegments.size(); + } + + public java.util.Iterator getSealedSegmentsIterator() { + return (this.sealedSegments == null) ? null : this.sealedSegments.iterator(); + } + + public void addToSealedSegments(int elem) { + if (this.sealedSegments == null) { + this.sealedSegments = new ArrayList(); + } + this.sealedSegments.add(elem); + } + + public List getSealedSegments() { + return this.sealedSegments; + } + + public scale_args setSealedSegments(List sealedSegments) { + this.sealedSegments = sealedSegments; + return this; + } + + public void unsetSealedSegments() { + this.sealedSegments = null; + } + + /** Returns true if field sealedSegments is set (has been assigned a value) and false otherwise */ + public boolean isSetSealedSegments() { + return this.sealedSegments != null; + } + + public void setSealedSegmentsIsSet(boolean value) { + if (!value) { + this.sealedSegments = null; + } + } + + public int getNewKeyRangesSize() { + return (this.newKeyRanges == null) ? 0 : this.newKeyRanges.size(); + } + + public void putToNewKeyRanges(double key, double val) { + if (this.newKeyRanges == null) { + this.newKeyRanges = new HashMap(); + } + this.newKeyRanges.put(key, val); + } + + public Map getNewKeyRanges() { + return this.newKeyRanges; + } + + public scale_args setNewKeyRanges(Map newKeyRanges) { + this.newKeyRanges = newKeyRanges; + return this; + } + + public void unsetNewKeyRanges() { + this.newKeyRanges = null; + } + + /** Returns true if field newKeyRanges is set (has been assigned a value) and false otherwise */ + public boolean isSetNewKeyRanges() { + return this.newKeyRanges != null; + } + + public void setNewKeyRangesIsSet(boolean value) { + if (!value) { + this.newKeyRanges = null; + } + } + + public long getScaleTimestamp() { + return this.scaleTimestamp; + } + + public scale_args setScaleTimestamp(long scaleTimestamp) { + this.scaleTimestamp = scaleTimestamp; + setScaleTimestampIsSet(true); + return this; + } + + public void unsetScaleTimestamp() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SCALETIMESTAMP_ISSET_ID); + } + + /** Returns true if field scaleTimestamp is set (has been assigned a value) and false otherwise */ + public boolean isSetScaleTimestamp() { + return EncodingUtils.testBit(__isset_bitfield, __SCALETIMESTAMP_ISSET_ID); + } + + public void setScaleTimestampIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SCALETIMESTAMP_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SCOPE: + if (value == null) { + unsetScope(); + } else { + setScope((String)value); + } + break; + + case STREAM: + if (value == null) { + unsetStream(); + } else { + setStream((String)value); + } + break; + + case SEALED_SEGMENTS: + if (value == null) { + unsetSealedSegments(); + } else { + setSealedSegments((List)value); + } + break; + + case NEW_KEY_RANGES: + if (value == null) { + unsetNewKeyRanges(); + } else { + setNewKeyRanges((Map)value); + } + break; + + case SCALE_TIMESTAMP: + if (value == null) { + unsetScaleTimestamp(); + } else { + setScaleTimestamp((Long)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SCOPE: + return getScope(); + + case STREAM: + return getStream(); + + case SEALED_SEGMENTS: + return getSealedSegments(); + + case NEW_KEY_RANGES: + return getNewKeyRanges(); + + case SCALE_TIMESTAMP: + return getScaleTimestamp(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SCOPE: + return isSetScope(); + case STREAM: + return isSetStream(); + case SEALED_SEGMENTS: + return isSetSealedSegments(); + case NEW_KEY_RANGES: + return isSetNewKeyRanges(); + case SCALE_TIMESTAMP: + return isSetScaleTimestamp(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof scale_args) + return this.equals((scale_args)that); + return false; + } + + public boolean equals(scale_args that) { + if (that == null) + return false; + + boolean this_present_scope = true && this.isSetScope(); + boolean that_present_scope = true && that.isSetScope(); + if (this_present_scope || that_present_scope) { + if (!(this_present_scope && that_present_scope)) + return false; + if (!this.scope.equals(that.scope)) + return false; + } + + boolean this_present_stream = true && this.isSetStream(); + boolean that_present_stream = true && that.isSetStream(); + if (this_present_stream || that_present_stream) { + if (!(this_present_stream && that_present_stream)) + return false; + if (!this.stream.equals(that.stream)) + return false; + } + + boolean this_present_sealedSegments = true && this.isSetSealedSegments(); + boolean that_present_sealedSegments = true && that.isSetSealedSegments(); + if (this_present_sealedSegments || that_present_sealedSegments) { + if (!(this_present_sealedSegments && that_present_sealedSegments)) + return false; + if (!this.sealedSegments.equals(that.sealedSegments)) + return false; + } + + boolean this_present_newKeyRanges = true && this.isSetNewKeyRanges(); + boolean that_present_newKeyRanges = true && that.isSetNewKeyRanges(); + if (this_present_newKeyRanges || that_present_newKeyRanges) { + if (!(this_present_newKeyRanges && that_present_newKeyRanges)) + return false; + if (!this.newKeyRanges.equals(that.newKeyRanges)) + return false; + } + + boolean this_present_scaleTimestamp = true; + boolean that_present_scaleTimestamp = true; + if (this_present_scaleTimestamp || that_present_scaleTimestamp) { + if (!(this_present_scaleTimestamp && that_present_scaleTimestamp)) + return false; + if (this.scaleTimestamp != that.scaleTimestamp) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_scope = true && (isSetScope()); + list.add(present_scope); + if (present_scope) + list.add(scope); + + boolean present_stream = true && (isSetStream()); + list.add(present_stream); + if (present_stream) + list.add(stream); + + boolean present_sealedSegments = true && (isSetSealedSegments()); + list.add(present_sealedSegments); + if (present_sealedSegments) + list.add(sealedSegments); + + boolean present_newKeyRanges = true && (isSetNewKeyRanges()); + list.add(present_newKeyRanges); + if (present_newKeyRanges) + list.add(newKeyRanges); + + boolean present_scaleTimestamp = true; + list.add(present_scaleTimestamp); + if (present_scaleTimestamp) + list.add(scaleTimestamp); + + return list.hashCode(); + } + + @Override + public int compareTo(scale_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetScope()).compareTo(other.isSetScope()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetScope()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scope, other.scope); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetStream()).compareTo(other.isSetStream()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStream()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stream, other.stream); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetSealedSegments()).compareTo(other.isSetSealedSegments()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSealedSegments()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sealedSegments, other.sealedSegments); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetNewKeyRanges()).compareTo(other.isSetNewKeyRanges()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNewKeyRanges()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.newKeyRanges, other.newKeyRanges); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetScaleTimestamp()).compareTo(other.isSetScaleTimestamp()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetScaleTimestamp()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scaleTimestamp, other.scaleTimestamp); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("scale_args("); + boolean first = true; + + sb.append("scope:"); + if (this.scope == null) { + sb.append("null"); + } else { + sb.append(this.scope); + } + first = false; + if (!first) sb.append(", "); + sb.append("stream:"); + if (this.stream == null) { + sb.append("null"); + } else { + sb.append(this.stream); + } + first = false; + if (!first) sb.append(", "); + sb.append("sealedSegments:"); + if (this.sealedSegments == null) { + sb.append("null"); + } else { + sb.append(this.sealedSegments); + } + first = false; + if (!first) sb.append(", "); + sb.append("newKeyRanges:"); + if (this.newKeyRanges == null) { + sb.append("null"); + } else { + sb.append(this.newKeyRanges); + } + first = false; + if (!first) sb.append(", "); + sb.append("scaleTimestamp:"); + sb.append(this.scaleTimestamp); + 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, 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 scale_argsStandardSchemeFactory implements SchemeFactory { + public scale_argsStandardScheme getScheme() { + return new scale_argsStandardScheme(); + } + } + + private static class scale_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, scale_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: // SCOPE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.scope = iprot.readString(); + struct.setScopeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // STREAM + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.stream = iprot.readString(); + struct.setStreamIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // SEALED_SEGMENTS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list52 = iprot.readListBegin(); + struct.sealedSegments = new ArrayList(_list52.size); + int _elem53; + for (int _i54 = 0; _i54 < _list52.size; ++_i54) + { + _elem53 = iprot.readI32(); + struct.sealedSegments.add(_elem53); + } + iprot.readListEnd(); + } + struct.setSealedSegmentsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // NEW_KEY_RANGES + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map55 = iprot.readMapBegin(); + struct.newKeyRanges = new HashMap(2*_map55.size); + double _key56; + double _val57; + for (int _i58 = 0; _i58 < _map55.size; ++_i58) + { + _key56 = iprot.readDouble(); + _val57 = iprot.readDouble(); + struct.newKeyRanges.put(_key56, _val57); + } + iprot.readMapEnd(); + } + struct.setNewKeyRangesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // SCALE_TIMESTAMP + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.scaleTimestamp = iprot.readI64(); + struct.setScaleTimestampIsSet(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(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, scale_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.scope != null) { + oprot.writeFieldBegin(SCOPE_FIELD_DESC); + oprot.writeString(struct.scope); + oprot.writeFieldEnd(); + } + if (struct.stream != null) { + oprot.writeFieldBegin(STREAM_FIELD_DESC); + oprot.writeString(struct.stream); + oprot.writeFieldEnd(); + } + if (struct.sealedSegments != null) { + oprot.writeFieldBegin(SEALED_SEGMENTS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, struct.sealedSegments.size())); + for (int _iter59 : struct.sealedSegments) + { + oprot.writeI32(_iter59); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.newKeyRanges != null) { + oprot.writeFieldBegin(NEW_KEY_RANGES_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.DOUBLE, org.apache.thrift.protocol.TType.DOUBLE, struct.newKeyRanges.size())); + for (Map.Entry _iter60 : struct.newKeyRanges.entrySet()) + { + oprot.writeDouble(_iter60.getKey()); + oprot.writeDouble(_iter60.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(SCALE_TIMESTAMP_FIELD_DESC); + oprot.writeI64(struct.scaleTimestamp); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class scale_argsTupleSchemeFactory implements SchemeFactory { + public scale_argsTupleScheme getScheme() { + return new scale_argsTupleScheme(); + } + } + + private static class scale_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, scale_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetScope()) { + optionals.set(0); + } + if (struct.isSetStream()) { + optionals.set(1); + } + if (struct.isSetSealedSegments()) { + optionals.set(2); + } + if (struct.isSetNewKeyRanges()) { + optionals.set(3); + } + if (struct.isSetScaleTimestamp()) { + optionals.set(4); + } + oprot.writeBitSet(optionals, 5); + if (struct.isSetScope()) { + oprot.writeString(struct.scope); + } + if (struct.isSetStream()) { + oprot.writeString(struct.stream); + } + if (struct.isSetSealedSegments()) { + { + oprot.writeI32(struct.sealedSegments.size()); + for (int _iter61 : struct.sealedSegments) + { + oprot.writeI32(_iter61); + } + } + } + if (struct.isSetNewKeyRanges()) { + { + oprot.writeI32(struct.newKeyRanges.size()); + for (Map.Entry _iter62 : struct.newKeyRanges.entrySet()) + { + oprot.writeDouble(_iter62.getKey()); + oprot.writeDouble(_iter62.getValue()); + } + } + } + if (struct.isSetScaleTimestamp()) { + oprot.writeI64(struct.scaleTimestamp); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, scale_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(5); + if (incoming.get(0)) { + struct.scope = iprot.readString(); + struct.setScopeIsSet(true); + } + if (incoming.get(1)) { + struct.stream = iprot.readString(); + struct.setStreamIsSet(true); + } + if (incoming.get(2)) { + { + org.apache.thrift.protocol.TList _list63 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, iprot.readI32()); + struct.sealedSegments = new ArrayList(_list63.size); + int _elem64; + for (int _i65 = 0; _i65 < _list63.size; ++_i65) + { + _elem64 = iprot.readI32(); + struct.sealedSegments.add(_elem64); + } + } + struct.setSealedSegmentsIsSet(true); + } + if (incoming.get(3)) { + { + org.apache.thrift.protocol.TMap _map66 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.DOUBLE, org.apache.thrift.protocol.TType.DOUBLE, iprot.readI32()); + struct.newKeyRanges = new HashMap(2*_map66.size); + double _key67; + double _val68; + for (int _i69 = 0; _i69 < _map66.size; ++_i69) + { + _key67 = iprot.readDouble(); + _val68 = iprot.readDouble(); + struct.newKeyRanges.put(_key67, _val68); + } + } + struct.setNewKeyRangesIsSet(true); + } + if (incoming.get(4)) { + struct.scaleTimestamp = iprot.readI64(); + struct.setScaleTimestampIsSet(true); + } + } + } + + } + + public static class scale_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("scale_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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new scale_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new scale_resultTupleSchemeFactory()); + } + + private ScaleResponse success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ScaleResponse.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scale_result.class, metaDataMap); + } + + public scale_result() { + } + + public scale_result( + ScaleResponse success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public scale_result(scale_result other) { + if (other.isSetSuccess()) { + this.success = new ScaleResponse(other.success); + } + } + + public scale_result deepCopy() { + return new scale_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public ScaleResponse getSuccess() { + return this.success; + } + + public scale_result setSuccess(ScaleResponse 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; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((ScaleResponse)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof scale_result) + return this.equals((scale_result)that); + return false; + } + + public boolean equals(scale_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + return list.hashCode(); + } + + @Override + public int compareTo(scale_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("scale_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + if (success != null) { + success.validate(); + } + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, 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 scale_resultStandardSchemeFactory implements SchemeFactory { + public scale_resultStandardScheme getScheme() { + return new scale_resultStandardScheme(); + } + } + + private static class scale_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, scale_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.success = new ScaleResponse(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, scale_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + struct.success.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class scale_resultTupleSchemeFactory implements SchemeFactory { + public scale_resultTupleScheme getScheme() { + return new scale_resultTupleScheme(); + } + } + + private static class scale_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, scale_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + struct.success.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, scale_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new ScaleResponse(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + } + + public static class getURI_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("getURI_args"); + + private static final org.apache.thrift.protocol.TField SEGMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("segment", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getURI_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getURI_argsTupleSchemeFactory()); + } + + private SegmentId segment; // 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 { + SEGMENT((short)1, "segment"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // SEGMENT + return SEGMENT; + 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 IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SEGMENT, new org.apache.thrift.meta_data.FieldMetaData("segment", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, SegmentId.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getURI_args.class, metaDataMap); + } + + public getURI_args() { + } + + public getURI_args( + SegmentId segment) + { + this(); + this.segment = segment; + } + + /** + * Performs a deep copy on other. + */ + public getURI_args(getURI_args other) { + if (other.isSetSegment()) { + this.segment = new SegmentId(other.segment); + } + } + + public getURI_args deepCopy() { + return new getURI_args(this); + } + + @Override + public void clear() { + this.segment = null; + } + + public SegmentId getSegment() { + return this.segment; + } + + public getURI_args setSegment(SegmentId segment) { + this.segment = segment; + return this; + } + + public void unsetSegment() { + this.segment = null; + } + + /** Returns true if field segment is set (has been assigned a value) and false otherwise */ + public boolean isSetSegment() { + return this.segment != null; + } + + public void setSegmentIsSet(boolean value) { + if (!value) { + this.segment = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SEGMENT: + if (value == null) { + unsetSegment(); + } else { + setSegment((SegmentId)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SEGMENT: + return getSegment(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SEGMENT: + return isSetSegment(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getURI_args) + return this.equals((getURI_args)that); + return false; + } + + public boolean equals(getURI_args that) { + if (that == null) + return false; + + boolean this_present_segment = true && this.isSetSegment(); + boolean that_present_segment = true && that.isSetSegment(); + if (this_present_segment || that_present_segment) { + if (!(this_present_segment && that_present_segment)) + return false; + if (!this.segment.equals(that.segment)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_segment = true && (isSetSegment()); + list.add(present_segment); + if (present_segment) + list.add(segment); + + return list.hashCode(); + } + + @Override + public int compareTo(getURI_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSegment()).compareTo(other.isSetSegment()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSegment()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.segment, other.segment); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getURI_args("); + boolean first = true; + + sb.append("segment:"); + if (this.segment == null) { + sb.append("null"); + } else { + sb.append(this.segment); + } + 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 (segment != null) { + segment.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, 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 getURI_argsStandardSchemeFactory implements SchemeFactory { + public getURI_argsStandardScheme getScheme() { + return new getURI_argsStandardScheme(); + } + } + + private static class getURI_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getURI_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: // SEGMENT + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.segment = new SegmentId(); + struct.segment.read(iprot); + struct.setSegmentIsSet(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(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getURI_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.segment != null) { + oprot.writeFieldBegin(SEGMENT_FIELD_DESC); + struct.segment.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getURI_argsTupleSchemeFactory implements SchemeFactory { + public getURI_argsTupleScheme getScheme() { + return new getURI_argsTupleScheme(); + } + } + + private static class getURI_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getURI_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSegment()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSegment()) { + struct.segment.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getURI_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.segment = new SegmentId(); + struct.segment.read(iprot); + struct.setSegmentIsSet(true); + } + } + } + + } + + public static class getURI_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("getURI_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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getURI_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getURI_resultTupleSchemeFactory()); + } + + private NodeUri success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, NodeUri.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getURI_result.class, metaDataMap); + } + + public getURI_result() { + } + + public getURI_result( + NodeUri success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public getURI_result(getURI_result other) { + if (other.isSetSuccess()) { + this.success = new NodeUri(other.success); + } + } + + public getURI_result deepCopy() { + return new getURI_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public NodeUri getSuccess() { + return this.success; + } + + public getURI_result setSuccess(NodeUri 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; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((NodeUri)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getURI_result) + return this.equals((getURI_result)that); + return false; + } + + public boolean equals(getURI_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + return list.hashCode(); + } + + @Override + public int compareTo(getURI_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getURI_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + if (success != null) { + success.validate(); + } + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, 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 getURI_resultStandardSchemeFactory implements SchemeFactory { + public getURI_resultStandardScheme getScheme() { + return new getURI_resultStandardScheme(); + } + } + + private static class getURI_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getURI_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.success = new NodeUri(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getURI_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + struct.success.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getURI_resultTupleSchemeFactory implements SchemeFactory { + public getURI_resultTupleScheme getScheme() { + return new getURI_resultTupleScheme(); + } + } + + private static class getURI_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getURI_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + struct.success.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getURI_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new NodeUri(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + } + + public static class isSegmentValid_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("isSegmentValid_args"); + + private static final org.apache.thrift.protocol.TField SCOPE_FIELD_DESC = new org.apache.thrift.protocol.TField("scope", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField STREAM_FIELD_DESC = new org.apache.thrift.protocol.TField("stream", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField SEGMENT_NUMBER_FIELD_DESC = new org.apache.thrift.protocol.TField("segmentNumber", org.apache.thrift.protocol.TType.I32, (short)3); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new isSegmentValid_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new isSegmentValid_argsTupleSchemeFactory()); + } + + private String scope; // required + private String stream; // required + private int segmentNumber; // 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 { + SCOPE((short)1, "scope"), + STREAM((short)2, "stream"), + SEGMENT_NUMBER((short)3, "segmentNumber"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // SCOPE + return SCOPE; + case 2: // STREAM + return STREAM; + case 3: // SEGMENT_NUMBER + return SEGMENT_NUMBER; + 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 IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __SEGMENTNUMBER_ISSET_ID = 0; + private byte __isset_bitfield = 0; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SCOPE, new org.apache.thrift.meta_data.FieldMetaData("scope", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.STREAM, new org.apache.thrift.meta_data.FieldMetaData("stream", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.SEGMENT_NUMBER, new org.apache.thrift.meta_data.FieldMetaData("segmentNumber", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isSegmentValid_args.class, metaDataMap); + } + + public isSegmentValid_args() { + } + + public isSegmentValid_args( + String scope, + String stream, + int segmentNumber) + { + this(); + this.scope = scope; + this.stream = stream; + this.segmentNumber = segmentNumber; + setSegmentNumberIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public isSegmentValid_args(isSegmentValid_args other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetScope()) { + this.scope = other.scope; + } + if (other.isSetStream()) { + this.stream = other.stream; + } + this.segmentNumber = other.segmentNumber; + } + + public isSegmentValid_args deepCopy() { + return new isSegmentValid_args(this); + } + + @Override + public void clear() { + this.scope = null; + this.stream = null; + setSegmentNumberIsSet(false); + this.segmentNumber = 0; + } + + public String getScope() { + return this.scope; + } + + public isSegmentValid_args setScope(String scope) { + this.scope = scope; + return this; + } + + public void unsetScope() { + this.scope = null; + } + + /** Returns true if field scope is set (has been assigned a value) and false otherwise */ + public boolean isSetScope() { + return this.scope != null; + } + + public void setScopeIsSet(boolean value) { + if (!value) { + this.scope = null; + } + } + + public String getStream() { + return this.stream; + } + + public isSegmentValid_args setStream(String stream) { + this.stream = stream; + return this; + } + + public void unsetStream() { + this.stream = null; + } + + /** Returns true if field stream is set (has been assigned a value) and false otherwise */ + public boolean isSetStream() { + return this.stream != null; + } + + public void setStreamIsSet(boolean value) { + if (!value) { + this.stream = null; + } + } + + public int getSegmentNumber() { + return this.segmentNumber; + } + + public isSegmentValid_args setSegmentNumber(int segmentNumber) { + this.segmentNumber = segmentNumber; + setSegmentNumberIsSet(true); + return this; + } + + public void unsetSegmentNumber() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SEGMENTNUMBER_ISSET_ID); + } + + /** Returns true if field segmentNumber is set (has been assigned a value) and false otherwise */ + public boolean isSetSegmentNumber() { + return EncodingUtils.testBit(__isset_bitfield, __SEGMENTNUMBER_ISSET_ID); + } + + public void setSegmentNumberIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SEGMENTNUMBER_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SCOPE: + if (value == null) { + unsetScope(); + } else { + setScope((String)value); + } + break; + + case STREAM: + if (value == null) { + unsetStream(); + } else { + setStream((String)value); + } + break; + + case SEGMENT_NUMBER: + if (value == null) { + unsetSegmentNumber(); + } else { + setSegmentNumber((Integer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SCOPE: + return getScope(); + + case STREAM: + return getStream(); + + case SEGMENT_NUMBER: + return getSegmentNumber(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SCOPE: + return isSetScope(); + case STREAM: + return isSetStream(); + case SEGMENT_NUMBER: + return isSetSegmentNumber(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof isSegmentValid_args) + return this.equals((isSegmentValid_args)that); + return false; + } + + public boolean equals(isSegmentValid_args that) { + if (that == null) + return false; + + boolean this_present_scope = true && this.isSetScope(); + boolean that_present_scope = true && that.isSetScope(); + if (this_present_scope || that_present_scope) { + if (!(this_present_scope && that_present_scope)) + return false; + if (!this.scope.equals(that.scope)) + return false; + } + + boolean this_present_stream = true && this.isSetStream(); + boolean that_present_stream = true && that.isSetStream(); + if (this_present_stream || that_present_stream) { + if (!(this_present_stream && that_present_stream)) + return false; + if (!this.stream.equals(that.stream)) + return false; + } + + boolean this_present_segmentNumber = true; + boolean that_present_segmentNumber = true; + if (this_present_segmentNumber || that_present_segmentNumber) { + if (!(this_present_segmentNumber && that_present_segmentNumber)) + return false; + if (this.segmentNumber != that.segmentNumber) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_scope = true && (isSetScope()); + list.add(present_scope); + if (present_scope) + list.add(scope); + + boolean present_stream = true && (isSetStream()); + list.add(present_stream); + if (present_stream) + list.add(stream); + + boolean present_segmentNumber = true; + list.add(present_segmentNumber); + if (present_segmentNumber) + list.add(segmentNumber); + + return list.hashCode(); + } + + @Override + public int compareTo(isSegmentValid_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetScope()).compareTo(other.isSetScope()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetScope()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scope, other.scope); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetStream()).compareTo(other.isSetStream()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStream()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stream, other.stream); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetSegmentNumber()).compareTo(other.isSetSegmentNumber()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSegmentNumber()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.segmentNumber, other.segmentNumber); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("isSegmentValid_args("); + boolean first = true; + + sb.append("scope:"); + if (this.scope == null) { + sb.append("null"); + } else { + sb.append(this.scope); + } + first = false; + if (!first) sb.append(", "); + sb.append("stream:"); + if (this.stream == null) { + sb.append("null"); + } else { + sb.append(this.stream); + } + first = false; + if (!first) sb.append(", "); + sb.append("segmentNumber:"); + sb.append(this.segmentNumber); + 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, 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 isSegmentValid_argsStandardSchemeFactory implements SchemeFactory { + public isSegmentValid_argsStandardScheme getScheme() { + return new isSegmentValid_argsStandardScheme(); + } + } + + private static class isSegmentValid_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, isSegmentValid_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: // SCOPE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.scope = iprot.readString(); + struct.setScopeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // STREAM + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.stream = iprot.readString(); + struct.setStreamIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // SEGMENT_NUMBER + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.segmentNumber = iprot.readI32(); + struct.setSegmentNumberIsSet(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(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, isSegmentValid_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.scope != null) { + oprot.writeFieldBegin(SCOPE_FIELD_DESC); + oprot.writeString(struct.scope); + oprot.writeFieldEnd(); + } + if (struct.stream != null) { + oprot.writeFieldBegin(STREAM_FIELD_DESC); + oprot.writeString(struct.stream); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(SEGMENT_NUMBER_FIELD_DESC); + oprot.writeI32(struct.segmentNumber); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class isSegmentValid_argsTupleSchemeFactory implements SchemeFactory { + public isSegmentValid_argsTupleScheme getScheme() { + return new isSegmentValid_argsTupleScheme(); + } + } + + private static class isSegmentValid_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, isSegmentValid_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetScope()) { + optionals.set(0); + } + if (struct.isSetStream()) { + optionals.set(1); + } + if (struct.isSetSegmentNumber()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetScope()) { + oprot.writeString(struct.scope); + } + if (struct.isSetStream()) { + oprot.writeString(struct.stream); + } + if (struct.isSetSegmentNumber()) { + oprot.writeI32(struct.segmentNumber); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, isSegmentValid_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.scope = iprot.readString(); + struct.setScopeIsSet(true); + } + if (incoming.get(1)) { + struct.stream = iprot.readString(); + struct.setStreamIsSet(true); + } + if (incoming.get(2)) { + struct.segmentNumber = iprot.readI32(); + struct.setSegmentNumberIsSet(true); + } + } + } + + } + + public static class isSegmentValid_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("isSegmentValid_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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new isSegmentValid_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new isSegmentValid_resultTupleSchemeFactory()); + } + + private boolean success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __SUCCESS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isSegmentValid_result.class, metaDataMap); + } + + public isSegmentValid_result() { + } + + public isSegmentValid_result( + boolean success) + { + this(); + this.success = success; + setSuccessIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public isSegmentValid_result(isSegmentValid_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + } + + public isSegmentValid_result deepCopy() { + return new isSegmentValid_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = false; + } + + public boolean isSuccess() { + return this.success; + } + + public isSegmentValid_result setSuccess(boolean success) { + this.success = success; + setSuccessIsSet(true); + return this; + } + + public void unsetSuccess() { + __isset_bitfield = 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 EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Boolean)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return isSuccess(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof isSegmentValid_result) + return this.equals((isSegmentValid_result)that); + return false; + } + + public boolean equals(isSegmentValid_result that) { + if (that == null) + return false; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true; + list.add(present_success); + if (present_success) + list.add(success); + + return list.hashCode(); + } + + @Override + public int compareTo(isSegmentValid_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("isSegmentValid_result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, 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 isSegmentValid_resultStandardSchemeFactory implements SchemeFactory { + public isSegmentValid_resultStandardScheme getScheme() { + return new isSegmentValid_resultStandardScheme(); + } + } + + private static class isSegmentValid_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, isSegmentValid_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, isSegmentValid_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBool(struct.success); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class isSegmentValid_resultTupleSchemeFactory implements SchemeFactory { + public isSegmentValid_resultTupleScheme getScheme() { + return new isSegmentValid_resultTupleScheme(); + } + } + + private static class isSegmentValid_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, isSegmentValid_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + oprot.writeBool(struct.success); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, isSegmentValid_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } + } + } + + } + + public static class createTransaction_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("createTransaction_args"); + + private static final org.apache.thrift.protocol.TField SCOPE_FIELD_DESC = new org.apache.thrift.protocol.TField("scope", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField STREAM_FIELD_DESC = new org.apache.thrift.protocol.TField("stream", org.apache.thrift.protocol.TType.STRING, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new createTransaction_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new createTransaction_argsTupleSchemeFactory()); + } + + private String scope; // required + private String stream; // 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 { + SCOPE((short)1, "scope"), + STREAM((short)2, "stream"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // SCOPE + return SCOPE; + case 2: // STREAM + return STREAM; + 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 IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SCOPE, new org.apache.thrift.meta_data.FieldMetaData("scope", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.STREAM, new org.apache.thrift.meta_data.FieldMetaData("stream", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createTransaction_args.class, metaDataMap); + } + + public createTransaction_args() { + } + + public createTransaction_args( + String scope, + String stream) + { + this(); + this.scope = scope; + this.stream = stream; + } + + /** + * Performs a deep copy on other. + */ + public createTransaction_args(createTransaction_args other) { + if (other.isSetScope()) { + this.scope = other.scope; + } + if (other.isSetStream()) { + this.stream = other.stream; + } + } + + public createTransaction_args deepCopy() { + return new createTransaction_args(this); + } + + @Override + public void clear() { + this.scope = null; + this.stream = null; + } + + public String getScope() { + return this.scope; + } + + public createTransaction_args setScope(String scope) { + this.scope = scope; + return this; + } + + public void unsetScope() { + this.scope = null; + } + + /** Returns true if field scope is set (has been assigned a value) and false otherwise */ + public boolean isSetScope() { + return this.scope != null; + } + + public void setScopeIsSet(boolean value) { + if (!value) { + this.scope = null; + } + } + + public String getStream() { + return this.stream; + } + + public createTransaction_args setStream(String stream) { + this.stream = stream; + return this; + } + + public void unsetStream() { + this.stream = null; + } + + /** Returns true if field stream is set (has been assigned a value) and false otherwise */ + public boolean isSetStream() { + return this.stream != null; + } + + public void setStreamIsSet(boolean value) { + if (!value) { + this.stream = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SCOPE: + if (value == null) { + unsetScope(); + } else { + setScope((String)value); + } + break; + + case STREAM: + if (value == null) { + unsetStream(); + } else { + setStream((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SCOPE: + return getScope(); + + case STREAM: + return getStream(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SCOPE: + return isSetScope(); + case STREAM: + return isSetStream(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof createTransaction_args) + return this.equals((createTransaction_args)that); + return false; + } + + public boolean equals(createTransaction_args that) { + if (that == null) + return false; + + boolean this_present_scope = true && this.isSetScope(); + boolean that_present_scope = true && that.isSetScope(); + if (this_present_scope || that_present_scope) { + if (!(this_present_scope && that_present_scope)) + return false; + if (!this.scope.equals(that.scope)) + return false; + } + + boolean this_present_stream = true && this.isSetStream(); + boolean that_present_stream = true && that.isSetStream(); + if (this_present_stream || that_present_stream) { + if (!(this_present_stream && that_present_stream)) + return false; + if (!this.stream.equals(that.stream)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_scope = true && (isSetScope()); + list.add(present_scope); + if (present_scope) + list.add(scope); + + boolean present_stream = true && (isSetStream()); + list.add(present_stream); + if (present_stream) + list.add(stream); + + return list.hashCode(); + } + + @Override + public int compareTo(createTransaction_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetScope()).compareTo(other.isSetScope()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetScope()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scope, other.scope); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetStream()).compareTo(other.isSetStream()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStream()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stream, other.stream); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("createTransaction_args("); + boolean first = true; + + sb.append("scope:"); + if (this.scope == null) { + sb.append("null"); + } else { + sb.append(this.scope); + } + first = false; + if (!first) sb.append(", "); + sb.append("stream:"); + if (this.stream == null) { + sb.append("null"); + } else { + sb.append(this.stream); + } + 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, 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 createTransaction_argsStandardSchemeFactory implements SchemeFactory { + public createTransaction_argsStandardScheme getScheme() { + return new createTransaction_argsStandardScheme(); + } + } + + private static class createTransaction_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, createTransaction_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: // SCOPE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.scope = iprot.readString(); + struct.setScopeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // STREAM + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.stream = iprot.readString(); + struct.setStreamIsSet(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(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, createTransaction_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.scope != null) { + oprot.writeFieldBegin(SCOPE_FIELD_DESC); + oprot.writeString(struct.scope); + oprot.writeFieldEnd(); + } + if (struct.stream != null) { + oprot.writeFieldBegin(STREAM_FIELD_DESC); + oprot.writeString(struct.stream); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class createTransaction_argsTupleSchemeFactory implements SchemeFactory { + public createTransaction_argsTupleScheme getScheme() { + return new createTransaction_argsTupleScheme(); + } + } + + private static class createTransaction_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, createTransaction_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetScope()) { + optionals.set(0); + } + if (struct.isSetStream()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetScope()) { + oprot.writeString(struct.scope); + } + if (struct.isSetStream()) { + oprot.writeString(struct.stream); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, createTransaction_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.scope = iprot.readString(); + struct.setScopeIsSet(true); + } + if (incoming.get(1)) { + struct.stream = iprot.readString(); + struct.setStreamIsSet(true); + } + } + } + + } + + public static class createTransaction_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("createTransaction_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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new createTransaction_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new createTransaction_resultTupleSchemeFactory()); + } + + private TxnId success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TxnId.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createTransaction_result.class, metaDataMap); + } + + public createTransaction_result() { + } + + public createTransaction_result( + TxnId success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public createTransaction_result(createTransaction_result other) { + if (other.isSetSuccess()) { + this.success = new TxnId(other.success); + } + } + + public createTransaction_result deepCopy() { + return new createTransaction_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public TxnId getSuccess() { + return this.success; + } + + public createTransaction_result setSuccess(TxnId 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; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((TxnId)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof createTransaction_result) + return this.equals((createTransaction_result)that); + return false; + } + + public boolean equals(createTransaction_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + return list.hashCode(); + } + + @Override + public int compareTo(createTransaction_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("createTransaction_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + if (success != null) { + success.validate(); + } + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, 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 createTransaction_resultStandardSchemeFactory implements SchemeFactory { + public createTransaction_resultStandardScheme getScheme() { + return new createTransaction_resultStandardScheme(); + } + } + + private static class createTransaction_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, createTransaction_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.success = new TxnId(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, createTransaction_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + struct.success.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class createTransaction_resultTupleSchemeFactory implements SchemeFactory { + public createTransaction_resultTupleScheme getScheme() { + return new createTransaction_resultTupleScheme(); + } + } + + private static class createTransaction_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, createTransaction_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + struct.success.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, createTransaction_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new TxnId(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + } + + public static class commitTransaction_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("commitTransaction_args"); + + private static final org.apache.thrift.protocol.TField SCOPE_FIELD_DESC = new org.apache.thrift.protocol.TField("scope", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField STREAM_FIELD_DESC = new org.apache.thrift.protocol.TField("stream", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField TXNID_FIELD_DESC = new org.apache.thrift.protocol.TField("txnid", org.apache.thrift.protocol.TType.STRUCT, (short)3); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new commitTransaction_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new commitTransaction_argsTupleSchemeFactory()); + } + + private String scope; // required + private String stream; // required + private TxnId txnid; // 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 { + SCOPE((short)1, "scope"), + STREAM((short)2, "stream"), + TXNID((short)3, "txnid"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // SCOPE + return SCOPE; + case 2: // STREAM + return STREAM; + case 3: // TXNID + return TXNID; + 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 IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SCOPE, new org.apache.thrift.meta_data.FieldMetaData("scope", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.STREAM, new org.apache.thrift.meta_data.FieldMetaData("stream", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.TXNID, new org.apache.thrift.meta_data.FieldMetaData("txnid", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TxnId.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(commitTransaction_args.class, metaDataMap); + } + + public commitTransaction_args() { + } + + public commitTransaction_args( + String scope, + String stream, + TxnId txnid) + { + this(); + this.scope = scope; + this.stream = stream; + this.txnid = txnid; + } + + /** + * Performs a deep copy on other. + */ + public commitTransaction_args(commitTransaction_args other) { + if (other.isSetScope()) { + this.scope = other.scope; + } + if (other.isSetStream()) { + this.stream = other.stream; + } + if (other.isSetTxnid()) { + this.txnid = new TxnId(other.txnid); + } + } + + public commitTransaction_args deepCopy() { + return new commitTransaction_args(this); + } + + @Override + public void clear() { + this.scope = null; + this.stream = null; + this.txnid = null; + } + + public String getScope() { + return this.scope; + } + + public commitTransaction_args setScope(String scope) { + this.scope = scope; + return this; + } + + public void unsetScope() { + this.scope = null; + } + + /** Returns true if field scope is set (has been assigned a value) and false otherwise */ + public boolean isSetScope() { + return this.scope != null; + } + + public void setScopeIsSet(boolean value) { + if (!value) { + this.scope = null; + } + } + + public String getStream() { + return this.stream; + } + + public commitTransaction_args setStream(String stream) { + this.stream = stream; + return this; + } + + public void unsetStream() { + this.stream = null; + } + + /** Returns true if field stream is set (has been assigned a value) and false otherwise */ + public boolean isSetStream() { + return this.stream != null; + } + + public void setStreamIsSet(boolean value) { + if (!value) { + this.stream = null; + } + } + + public TxnId getTxnid() { + return this.txnid; + } + + public commitTransaction_args setTxnid(TxnId txnid) { + this.txnid = txnid; + return this; + } + + public void unsetTxnid() { + this.txnid = null; + } + + /** Returns true if field txnid is set (has been assigned a value) and false otherwise */ + public boolean isSetTxnid() { + return this.txnid != null; + } + + public void setTxnidIsSet(boolean value) { + if (!value) { + this.txnid = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SCOPE: + if (value == null) { + unsetScope(); + } else { + setScope((String)value); + } + break; + + case STREAM: + if (value == null) { + unsetStream(); + } else { + setStream((String)value); + } + break; + + case TXNID: + if (value == null) { + unsetTxnid(); + } else { + setTxnid((TxnId)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SCOPE: + return getScope(); + + case STREAM: + return getStream(); + + case TXNID: + return getTxnid(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SCOPE: + return isSetScope(); + case STREAM: + return isSetStream(); + case TXNID: + return isSetTxnid(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof commitTransaction_args) + return this.equals((commitTransaction_args)that); + return false; + } + + public boolean equals(commitTransaction_args that) { + if (that == null) + return false; + + boolean this_present_scope = true && this.isSetScope(); + boolean that_present_scope = true && that.isSetScope(); + if (this_present_scope || that_present_scope) { + if (!(this_present_scope && that_present_scope)) + return false; + if (!this.scope.equals(that.scope)) + return false; + } + + boolean this_present_stream = true && this.isSetStream(); + boolean that_present_stream = true && that.isSetStream(); + if (this_present_stream || that_present_stream) { + if (!(this_present_stream && that_present_stream)) + return false; + if (!this.stream.equals(that.stream)) + return false; + } + + boolean this_present_txnid = true && this.isSetTxnid(); + boolean that_present_txnid = true && that.isSetTxnid(); + if (this_present_txnid || that_present_txnid) { + if (!(this_present_txnid && that_present_txnid)) + return false; + if (!this.txnid.equals(that.txnid)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_scope = true && (isSetScope()); + list.add(present_scope); + if (present_scope) + list.add(scope); + + boolean present_stream = true && (isSetStream()); + list.add(present_stream); + if (present_stream) + list.add(stream); + + boolean present_txnid = true && (isSetTxnid()); + list.add(present_txnid); + if (present_txnid) + list.add(txnid); + + return list.hashCode(); + } + + @Override + public int compareTo(commitTransaction_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetScope()).compareTo(other.isSetScope()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetScope()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scope, other.scope); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetStream()).compareTo(other.isSetStream()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStream()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stream, other.stream); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTxnid()).compareTo(other.isSetTxnid()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTxnid()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.txnid, other.txnid); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("commitTransaction_args("); + boolean first = true; + + sb.append("scope:"); + if (this.scope == null) { + sb.append("null"); + } else { + sb.append(this.scope); + } + first = false; + if (!first) sb.append(", "); + sb.append("stream:"); + if (this.stream == null) { + sb.append("null"); + } else { + sb.append(this.stream); + } + first = false; + if (!first) sb.append(", "); + sb.append("txnid:"); + if (this.txnid == null) { + sb.append("null"); + } else { + sb.append(this.txnid); + } + 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 (txnid != null) { + txnid.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, 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 commitTransaction_argsStandardSchemeFactory implements SchemeFactory { + public commitTransaction_argsStandardScheme getScheme() { + return new commitTransaction_argsStandardScheme(); + } + } + + private static class commitTransaction_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, commitTransaction_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: // SCOPE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.scope = iprot.readString(); + struct.setScopeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // STREAM + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.stream = iprot.readString(); + struct.setStreamIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // TXNID + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.txnid = new TxnId(); + struct.txnid.read(iprot); + struct.setTxnidIsSet(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(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, commitTransaction_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.scope != null) { + oprot.writeFieldBegin(SCOPE_FIELD_DESC); + oprot.writeString(struct.scope); + oprot.writeFieldEnd(); + } + if (struct.stream != null) { + oprot.writeFieldBegin(STREAM_FIELD_DESC); + oprot.writeString(struct.stream); + oprot.writeFieldEnd(); + } + if (struct.txnid != null) { + oprot.writeFieldBegin(TXNID_FIELD_DESC); + struct.txnid.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class commitTransaction_argsTupleSchemeFactory implements SchemeFactory { + public commitTransaction_argsTupleScheme getScheme() { + return new commitTransaction_argsTupleScheme(); + } + } + + private static class commitTransaction_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, commitTransaction_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetScope()) { + optionals.set(0); + } + if (struct.isSetStream()) { + optionals.set(1); + } + if (struct.isSetTxnid()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetScope()) { + oprot.writeString(struct.scope); + } + if (struct.isSetStream()) { + oprot.writeString(struct.stream); + } + if (struct.isSetTxnid()) { + struct.txnid.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, commitTransaction_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.scope = iprot.readString(); + struct.setScopeIsSet(true); + } + if (incoming.get(1)) { + struct.stream = iprot.readString(); + struct.setStreamIsSet(true); + } + if (incoming.get(2)) { + struct.txnid = new TxnId(); + struct.txnid.read(iprot); + struct.setTxnidIsSet(true); + } + } + } + + } + + public static class commitTransaction_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("commitTransaction_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new commitTransaction_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new commitTransaction_resultTupleSchemeFactory()); + } + + private TxnStatus success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + /** + * + * @see TxnStatus + */ + SUCCESS((short)0, "success"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new 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.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TxnStatus.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(commitTransaction_result.class, metaDataMap); + } + + public commitTransaction_result() { + } + + public commitTransaction_result( + TxnStatus success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public commitTransaction_result(commitTransaction_result other) { + if (other.isSetSuccess()) { + this.success = other.success; + } + } + + public commitTransaction_result deepCopy() { + return new commitTransaction_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + /** + * + * @see TxnStatus + */ + public TxnStatus getSuccess() { + return this.success; + } + + /** + * + * @see TxnStatus + */ + public commitTransaction_result setSuccess(TxnStatus 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; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((TxnStatus)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof commitTransaction_result) + return this.equals((commitTransaction_result)that); + return false; + } + + public boolean equals(commitTransaction_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success.getValue()); + + return list.hashCode(); + } + + @Override + public int compareTo(commitTransaction_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("commitTransaction_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, 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 commitTransaction_resultStandardSchemeFactory implements SchemeFactory { + public commitTransaction_resultStandardScheme getScheme() { + return new commitTransaction_resultStandardScheme(); + } + } + + private static class commitTransaction_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, commitTransaction_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.I32) { + struct.success = com.emc.pravega.controller.stream.api.v1.TxnStatus.findByValue(iprot.readI32()); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, commitTransaction_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeI32(struct.success.getValue()); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class commitTransaction_resultTupleSchemeFactory implements SchemeFactory { + public commitTransaction_resultTupleScheme getScheme() { + return new commitTransaction_resultTupleScheme(); + } + } + + private static class commitTransaction_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, commitTransaction_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + oprot.writeI32(struct.success.getValue()); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, commitTransaction_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = com.emc.pravega.controller.stream.api.v1.TxnStatus.findByValue(iprot.readI32()); + struct.setSuccessIsSet(true); + } + } + } + + } + + public static class abortTransaction_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("abortTransaction_args"); + + private static final org.apache.thrift.protocol.TField SCOPE_FIELD_DESC = new org.apache.thrift.protocol.TField("scope", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField STREAM_FIELD_DESC = new org.apache.thrift.protocol.TField("stream", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField TXNID_FIELD_DESC = new org.apache.thrift.protocol.TField("txnid", org.apache.thrift.protocol.TType.STRUCT, (short)3); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new abortTransaction_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new abortTransaction_argsTupleSchemeFactory()); + } + + private String scope; // required + private String stream; // required + private TxnId txnid; // 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 { + SCOPE((short)1, "scope"), + STREAM((short)2, "stream"), + TXNID((short)3, "txnid"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // SCOPE + return SCOPE; + case 2: // STREAM + return STREAM; + case 3: // TXNID + return TXNID; + 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 IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SCOPE, new org.apache.thrift.meta_data.FieldMetaData("scope", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.STREAM, new org.apache.thrift.meta_data.FieldMetaData("stream", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.TXNID, new org.apache.thrift.meta_data.FieldMetaData("txnid", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TxnId.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(abortTransaction_args.class, metaDataMap); + } + + public abortTransaction_args() { + } + + public abortTransaction_args( + String scope, + String stream, + TxnId txnid) + { + this(); + this.scope = scope; + this.stream = stream; + this.txnid = txnid; + } + + /** + * Performs a deep copy on other. + */ + public abortTransaction_args(abortTransaction_args other) { + if (other.isSetScope()) { + this.scope = other.scope; + } + if (other.isSetStream()) { + this.stream = other.stream; + } + if (other.isSetTxnid()) { + this.txnid = new TxnId(other.txnid); + } + } + + public abortTransaction_args deepCopy() { + return new abortTransaction_args(this); + } + + @Override + public void clear() { + this.scope = null; + this.stream = null; + this.txnid = null; + } + + public String getScope() { + return this.scope; + } + + public abortTransaction_args setScope(String scope) { + this.scope = scope; + return this; + } + + public void unsetScope() { + this.scope = null; + } + + /** Returns true if field scope is set (has been assigned a value) and false otherwise */ + public boolean isSetScope() { + return this.scope != null; + } + + public void setScopeIsSet(boolean value) { + if (!value) { + this.scope = null; + } + } + + public String getStream() { + return this.stream; + } + + public abortTransaction_args setStream(String stream) { + this.stream = stream; + return this; + } + + public void unsetStream() { + this.stream = null; + } + + /** Returns true if field stream is set (has been assigned a value) and false otherwise */ + public boolean isSetStream() { + return this.stream != null; + } + + public void setStreamIsSet(boolean value) { + if (!value) { + this.stream = null; + } + } + + public TxnId getTxnid() { + return this.txnid; + } + + public abortTransaction_args setTxnid(TxnId txnid) { + this.txnid = txnid; + return this; + } + + public void unsetTxnid() { + this.txnid = null; + } + + /** Returns true if field txnid is set (has been assigned a value) and false otherwise */ + public boolean isSetTxnid() { + return this.txnid != null; + } + + public void setTxnidIsSet(boolean value) { + if (!value) { + this.txnid = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SCOPE: + if (value == null) { + unsetScope(); + } else { + setScope((String)value); + } + break; + + case STREAM: + if (value == null) { + unsetStream(); + } else { + setStream((String)value); + } + break; + + case TXNID: + if (value == null) { + unsetTxnid(); + } else { + setTxnid((TxnId)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SCOPE: + return getScope(); + + case STREAM: + return getStream(); + + case TXNID: + return getTxnid(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SCOPE: + return isSetScope(); + case STREAM: + return isSetStream(); + case TXNID: + return isSetTxnid(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof abortTransaction_args) + return this.equals((abortTransaction_args)that); + return false; + } + + public boolean equals(abortTransaction_args that) { + if (that == null) + return false; + + boolean this_present_scope = true && this.isSetScope(); + boolean that_present_scope = true && that.isSetScope(); + if (this_present_scope || that_present_scope) { + if (!(this_present_scope && that_present_scope)) + return false; + if (!this.scope.equals(that.scope)) + return false; + } + + boolean this_present_stream = true && this.isSetStream(); + boolean that_present_stream = true && that.isSetStream(); + if (this_present_stream || that_present_stream) { + if (!(this_present_stream && that_present_stream)) + return false; + if (!this.stream.equals(that.stream)) + return false; + } + + boolean this_present_txnid = true && this.isSetTxnid(); + boolean that_present_txnid = true && that.isSetTxnid(); + if (this_present_txnid || that_present_txnid) { + if (!(this_present_txnid && that_present_txnid)) + return false; + if (!this.txnid.equals(that.txnid)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_scope = true && (isSetScope()); + list.add(present_scope); + if (present_scope) + list.add(scope); + + boolean present_stream = true && (isSetStream()); + list.add(present_stream); + if (present_stream) + list.add(stream); + + boolean present_txnid = true && (isSetTxnid()); + list.add(present_txnid); + if (present_txnid) + list.add(txnid); + + return list.hashCode(); + } + + @Override + public int compareTo(abortTransaction_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetScope()).compareTo(other.isSetScope()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetScope()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scope, other.scope); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetStream()).compareTo(other.isSetStream()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStream()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stream, other.stream); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTxnid()).compareTo(other.isSetTxnid()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTxnid()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.txnid, other.txnid); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("abortTransaction_args("); + boolean first = true; + + sb.append("scope:"); + if (this.scope == null) { + sb.append("null"); + } else { + sb.append(this.scope); + } + first = false; + if (!first) sb.append(", "); + sb.append("stream:"); + if (this.stream == null) { + sb.append("null"); + } else { + sb.append(this.stream); + } + first = false; + if (!first) sb.append(", "); + sb.append("txnid:"); + if (this.txnid == null) { + sb.append("null"); + } else { + sb.append(this.txnid); + } + 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 (txnid != null) { + txnid.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, 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 abortTransaction_argsStandardSchemeFactory implements SchemeFactory { + public abortTransaction_argsStandardScheme getScheme() { + return new abortTransaction_argsStandardScheme(); + } + } + + private static class abortTransaction_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, abortTransaction_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: // SCOPE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.scope = iprot.readString(); + struct.setScopeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // STREAM + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.stream = iprot.readString(); + struct.setStreamIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // TXNID + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.txnid = new TxnId(); + struct.txnid.read(iprot); + struct.setTxnidIsSet(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(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, abortTransaction_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.scope != null) { + oprot.writeFieldBegin(SCOPE_FIELD_DESC); + oprot.writeString(struct.scope); + oprot.writeFieldEnd(); + } + if (struct.stream != null) { + oprot.writeFieldBegin(STREAM_FIELD_DESC); + oprot.writeString(struct.stream); + oprot.writeFieldEnd(); + } + if (struct.txnid != null) { + oprot.writeFieldBegin(TXNID_FIELD_DESC); + struct.txnid.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class abortTransaction_argsTupleSchemeFactory implements SchemeFactory { + public abortTransaction_argsTupleScheme getScheme() { + return new abortTransaction_argsTupleScheme(); + } + } + + private static class abortTransaction_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, abortTransaction_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetScope()) { + optionals.set(0); + } + if (struct.isSetStream()) { + optionals.set(1); + } + if (struct.isSetTxnid()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetScope()) { + oprot.writeString(struct.scope); + } + if (struct.isSetStream()) { + oprot.writeString(struct.stream); + } + if (struct.isSetTxnid()) { + struct.txnid.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, abortTransaction_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.scope = iprot.readString(); + struct.setScopeIsSet(true); + } + if (incoming.get(1)) { + struct.stream = iprot.readString(); + struct.setStreamIsSet(true); + } + if (incoming.get(2)) { + struct.txnid = new TxnId(); + struct.txnid.read(iprot); + struct.setTxnidIsSet(true); + } + } + } + + } + + public static class abortTransaction_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("abortTransaction_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new abortTransaction_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new abortTransaction_resultTupleSchemeFactory()); + } + + private TxnStatus success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + /** + * + * @see TxnStatus + */ + SUCCESS((short)0, "success"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new 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.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TxnStatus.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(abortTransaction_result.class, metaDataMap); + } + + public abortTransaction_result() { + } + + public abortTransaction_result( + TxnStatus success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public abortTransaction_result(abortTransaction_result other) { + if (other.isSetSuccess()) { + this.success = other.success; + } + } + + public abortTransaction_result deepCopy() { + return new abortTransaction_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + /** + * + * @see TxnStatus + */ + public TxnStatus getSuccess() { + return this.success; + } + + /** + * + * @see TxnStatus + */ + public abortTransaction_result setSuccess(TxnStatus 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; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((TxnStatus)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof abortTransaction_result) + return this.equals((abortTransaction_result)that); + return false; + } + + public boolean equals(abortTransaction_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success.getValue()); + + return list.hashCode(); + } + + @Override + public int compareTo(abortTransaction_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("abortTransaction_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, 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 abortTransaction_resultStandardSchemeFactory implements SchemeFactory { + public abortTransaction_resultStandardScheme getScheme() { + return new abortTransaction_resultStandardScheme(); + } + } + + private static class abortTransaction_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, abortTransaction_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.I32) { + struct.success = com.emc.pravega.controller.stream.api.v1.TxnStatus.findByValue(iprot.readI32()); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, abortTransaction_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeI32(struct.success.getValue()); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class abortTransaction_resultTupleSchemeFactory implements SchemeFactory { + public abortTransaction_resultTupleScheme getScheme() { + return new abortTransaction_resultTupleScheme(); + } + } + + private static class abortTransaction_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, abortTransaction_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + oprot.writeI32(struct.success.getValue()); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, abortTransaction_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = com.emc.pravega.controller.stream.api.v1.TxnStatus.findByValue(iprot.readI32()); + struct.setSuccessIsSet(true); + } + } + } + + } + + public static class checkTransactionStatus_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("checkTransactionStatus_args"); + + private static final org.apache.thrift.protocol.TField SCOPE_FIELD_DESC = new org.apache.thrift.protocol.TField("scope", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField STREAM_FIELD_DESC = new org.apache.thrift.protocol.TField("stream", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField TXNID_FIELD_DESC = new org.apache.thrift.protocol.TField("txnid", org.apache.thrift.protocol.TType.STRUCT, (short)3); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new checkTransactionStatus_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new checkTransactionStatus_argsTupleSchemeFactory()); + } + + private String scope; // required + private String stream; // required + private TxnId txnid; // 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 { + SCOPE((short)1, "scope"), + STREAM((short)2, "stream"), + TXNID((short)3, "txnid"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // SCOPE + return SCOPE; + case 2: // STREAM + return STREAM; + case 3: // TXNID + return TXNID; + 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 IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SCOPE, new org.apache.thrift.meta_data.FieldMetaData("scope", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.STREAM, new org.apache.thrift.meta_data.FieldMetaData("stream", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.TXNID, new org.apache.thrift.meta_data.FieldMetaData("txnid", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TxnId.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(checkTransactionStatus_args.class, metaDataMap); + } + + public checkTransactionStatus_args() { + } + + public checkTransactionStatus_args( + String scope, + String stream, + TxnId txnid) + { + this(); + this.scope = scope; + this.stream = stream; + this.txnid = txnid; + } + + /** + * Performs a deep copy on other. + */ + public checkTransactionStatus_args(checkTransactionStatus_args other) { + if (other.isSetScope()) { + this.scope = other.scope; + } + if (other.isSetStream()) { + this.stream = other.stream; + } + if (other.isSetTxnid()) { + this.txnid = new TxnId(other.txnid); + } + } + + public checkTransactionStatus_args deepCopy() { + return new checkTransactionStatus_args(this); + } + + @Override + public void clear() { + this.scope = null; + this.stream = null; + this.txnid = null; + } + + public String getScope() { + return this.scope; + } + + public checkTransactionStatus_args setScope(String scope) { + this.scope = scope; + return this; + } + + public void unsetScope() { + this.scope = null; + } + + /** Returns true if field scope is set (has been assigned a value) and false otherwise */ + public boolean isSetScope() { + return this.scope != null; + } + + public void setScopeIsSet(boolean value) { + if (!value) { + this.scope = null; + } + } + + public String getStream() { + return this.stream; + } + + public checkTransactionStatus_args setStream(String stream) { + this.stream = stream; + return this; + } + + public void unsetStream() { + this.stream = null; + } + + /** Returns true if field stream is set (has been assigned a value) and false otherwise */ + public boolean isSetStream() { + return this.stream != null; + } + + public void setStreamIsSet(boolean value) { + if (!value) { + this.stream = null; + } + } + + public TxnId getTxnid() { + return this.txnid; + } + + public checkTransactionStatus_args setTxnid(TxnId txnid) { + this.txnid = txnid; + return this; + } + + public void unsetTxnid() { + this.txnid = null; + } + + /** Returns true if field txnid is set (has been assigned a value) and false otherwise */ + public boolean isSetTxnid() { + return this.txnid != null; + } + + public void setTxnidIsSet(boolean value) { + if (!value) { + this.txnid = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SCOPE: + if (value == null) { + unsetScope(); + } else { + setScope((String)value); + } + break; + + case STREAM: + if (value == null) { + unsetStream(); + } else { + setStream((String)value); + } + break; + + case TXNID: + if (value == null) { + unsetTxnid(); + } else { + setTxnid((TxnId)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SCOPE: + return getScope(); + + case STREAM: + return getStream(); + + case TXNID: + return getTxnid(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SCOPE: + return isSetScope(); + case STREAM: + return isSetStream(); + case TXNID: + return isSetTxnid(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof checkTransactionStatus_args) + return this.equals((checkTransactionStatus_args)that); + return false; + } + + public boolean equals(checkTransactionStatus_args that) { + if (that == null) + return false; + + boolean this_present_scope = true && this.isSetScope(); + boolean that_present_scope = true && that.isSetScope(); + if (this_present_scope || that_present_scope) { + if (!(this_present_scope && that_present_scope)) + return false; + if (!this.scope.equals(that.scope)) + return false; + } + + boolean this_present_stream = true && this.isSetStream(); + boolean that_present_stream = true && that.isSetStream(); + if (this_present_stream || that_present_stream) { + if (!(this_present_stream && that_present_stream)) + return false; + if (!this.stream.equals(that.stream)) + return false; + } + + boolean this_present_txnid = true && this.isSetTxnid(); + boolean that_present_txnid = true && that.isSetTxnid(); + if (this_present_txnid || that_present_txnid) { + if (!(this_present_txnid && that_present_txnid)) + return false; + if (!this.txnid.equals(that.txnid)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_scope = true && (isSetScope()); + list.add(present_scope); + if (present_scope) + list.add(scope); + + boolean present_stream = true && (isSetStream()); + list.add(present_stream); + if (present_stream) + list.add(stream); + + boolean present_txnid = true && (isSetTxnid()); + list.add(present_txnid); + if (present_txnid) + list.add(txnid); + + return list.hashCode(); + } + + @Override + public int compareTo(checkTransactionStatus_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetScope()).compareTo(other.isSetScope()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetScope()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scope, other.scope); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetStream()).compareTo(other.isSetStream()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStream()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stream, other.stream); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTxnid()).compareTo(other.isSetTxnid()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTxnid()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.txnid, other.txnid); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("checkTransactionStatus_args("); + boolean first = true; + + sb.append("scope:"); + if (this.scope == null) { + sb.append("null"); + } else { + sb.append(this.scope); + } + first = false; + if (!first) sb.append(", "); + sb.append("stream:"); + if (this.stream == null) { + sb.append("null"); + } else { + sb.append(this.stream); + } + first = false; + if (!first) sb.append(", "); + sb.append("txnid:"); + if (this.txnid == null) { + sb.append("null"); + } else { + sb.append(this.txnid); + } + 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 (txnid != null) { + txnid.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, 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 checkTransactionStatus_argsStandardSchemeFactory implements SchemeFactory { + public checkTransactionStatus_argsStandardScheme getScheme() { + return new checkTransactionStatus_argsStandardScheme(); + } + } + + private static class checkTransactionStatus_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, checkTransactionStatus_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: // SCOPE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.scope = iprot.readString(); + struct.setScopeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // STREAM + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.stream = iprot.readString(); + struct.setStreamIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // TXNID + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.txnid = new TxnId(); + struct.txnid.read(iprot); + struct.setTxnidIsSet(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(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, checkTransactionStatus_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.scope != null) { + oprot.writeFieldBegin(SCOPE_FIELD_DESC); + oprot.writeString(struct.scope); + oprot.writeFieldEnd(); + } + if (struct.stream != null) { + oprot.writeFieldBegin(STREAM_FIELD_DESC); + oprot.writeString(struct.stream); + oprot.writeFieldEnd(); + } + if (struct.txnid != null) { + oprot.writeFieldBegin(TXNID_FIELD_DESC); + struct.txnid.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class checkTransactionStatus_argsTupleSchemeFactory implements SchemeFactory { + public checkTransactionStatus_argsTupleScheme getScheme() { + return new checkTransactionStatus_argsTupleScheme(); + } + } + + private static class checkTransactionStatus_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, checkTransactionStatus_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetScope()) { + optionals.set(0); + } + if (struct.isSetStream()) { + optionals.set(1); + } + if (struct.isSetTxnid()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetScope()) { + oprot.writeString(struct.scope); + } + if (struct.isSetStream()) { + oprot.writeString(struct.stream); + } + if (struct.isSetTxnid()) { + struct.txnid.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, checkTransactionStatus_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.scope = iprot.readString(); + struct.setScopeIsSet(true); + } + if (incoming.get(1)) { + struct.stream = iprot.readString(); + struct.setStreamIsSet(true); + } + if (incoming.get(2)) { + struct.txnid = new TxnId(); + struct.txnid.read(iprot); + struct.setTxnidIsSet(true); + } + } + } + + } + + public static class checkTransactionStatus_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("checkTransactionStatus_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new checkTransactionStatus_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new checkTransactionStatus_resultTupleSchemeFactory()); + } + + private TxnState success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + /** + * + * @see TxnState + */ + SUCCESS((short)0, "success"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new 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.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TxnState.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(checkTransactionStatus_result.class, metaDataMap); + } + + public checkTransactionStatus_result() { + } + + public checkTransactionStatus_result( + TxnState success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public checkTransactionStatus_result(checkTransactionStatus_result other) { + if (other.isSetSuccess()) { + this.success = other.success; + } + } + + public checkTransactionStatus_result deepCopy() { + return new checkTransactionStatus_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + /** + * + * @see TxnState + */ + public TxnState getSuccess() { + return this.success; + } + + /** + * + * @see TxnState + */ + public checkTransactionStatus_result setSuccess(TxnState 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; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((TxnState)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof checkTransactionStatus_result) + return this.equals((checkTransactionStatus_result)that); + return false; + } + + public boolean equals(checkTransactionStatus_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success.getValue()); + + return list.hashCode(); + } + + @Override + public int compareTo(checkTransactionStatus_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("checkTransactionStatus_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, 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 checkTransactionStatus_resultStandardSchemeFactory implements SchemeFactory { + public checkTransactionStatus_resultStandardScheme getScheme() { + return new checkTransactionStatus_resultStandardScheme(); + } + } + + private static class checkTransactionStatus_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, checkTransactionStatus_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.I32) { + struct.success = com.emc.pravega.controller.stream.api.v1.TxnState.findByValue(iprot.readI32()); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, checkTransactionStatus_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeI32(struct.success.getValue()); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class checkTransactionStatus_resultTupleSchemeFactory implements SchemeFactory { + public checkTransactionStatus_resultTupleScheme getScheme() { + return new checkTransactionStatus_resultTupleScheme(); + } + } + + private static class checkTransactionStatus_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, checkTransactionStatus_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + oprot.writeI32(struct.success.getValue()); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, checkTransactionStatus_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = com.emc.pravega.controller.stream.api.v1.TxnState.findByValue(iprot.readI32()); + struct.setSuccessIsSet(true); + } + } + } + + } + +}