com.yandex.ydb.coordination.SemaphoreSession Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ydb-sdk-jdbc-uberjar Show documentation
Show all versions of ydb-sdk-jdbc-uberjar Show documentation
JDBC client implementation over Table client, single jar
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: ydb/public/api/protos/ydb_coordination.proto
package com.yandex.ydb.coordination;
/**
*
**
* Describes an owner or a waiter of this semaphore
*
*
* Protobuf type {@code Ydb.Coordination.SemaphoreSession}
*/
public final class SemaphoreSession extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:Ydb.Coordination.SemaphoreSession)
SemaphoreSessionOrBuilder {
private static final long serialVersionUID = 0L;
// Use SemaphoreSession.newBuilder() to construct.
private SemaphoreSession(com.google.protobuf.GeneratedMessageV3.Builder builder) {
super(builder);
}
private SemaphoreSession() {
data_ = com.google.protobuf.ByteString.EMPTY;
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new SemaphoreSession();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private SemaphoreSession(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 8: {
sessionId_ = input.readUInt64();
break;
}
case 16: {
timeoutMillis_ = input.readUInt64();
break;
}
case 24: {
count_ = input.readUInt64();
break;
}
case 34: {
data_ = input.readBytes();
break;
}
case 40: {
orderId_ = input.readUInt64();
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.yandex.ydb.coordination.CoordinationProtos.internal_static_Ydb_Coordination_SemaphoreSession_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.yandex.ydb.coordination.CoordinationProtos.internal_static_Ydb_Coordination_SemaphoreSession_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.yandex.ydb.coordination.SemaphoreSession.class, com.yandex.ydb.coordination.SemaphoreSession.Builder.class);
}
public static final int ORDER_ID_FIELD_NUMBER = 5;
private long orderId_;
/**
*
* A monotonically increasing id which determines locking order
*
*
* uint64 order_id = 5;
* @return The orderId.
*/
@java.lang.Override
public long getOrderId() {
return orderId_;
}
public static final int SESSION_ID_FIELD_NUMBER = 1;
private long sessionId_;
/**
*
* An id of the session which tried to acquire the semaphore
*
*
* uint64 session_id = 1;
* @return The sessionId.
*/
@java.lang.Override
public long getSessionId() {
return sessionId_;
}
public static final int TIMEOUT_MILLIS_FIELD_NUMBER = 2;
private long timeoutMillis_;
/**
*
* A timeout in milliseconds for operation in waiters queue
*
*
* uint64 timeout_millis = 2;
* @return The timeoutMillis.
*/
@java.lang.Override
public long getTimeoutMillis() {
return timeoutMillis_;
}
public static final int COUNT_FIELD_NUMBER = 3;
private long count_;
/**
*
* Number of tokens for an acquire operation
*
*
* uint64 count = 3;
* @return The count.
*/
@java.lang.Override
public long getCount() {
return count_;
}
public static final int DATA_FIELD_NUMBER = 4;
private com.google.protobuf.ByteString data_;
/**
*
* User-defined data attached to the acquire operation
*
*
* bytes data = 4;
* @return The data.
*/
@java.lang.Override
public com.google.protobuf.ByteString getData() {
return data_;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (sessionId_ != 0L) {
output.writeUInt64(1, sessionId_);
}
if (timeoutMillis_ != 0L) {
output.writeUInt64(2, timeoutMillis_);
}
if (count_ != 0L) {
output.writeUInt64(3, count_);
}
if (!data_.isEmpty()) {
output.writeBytes(4, data_);
}
if (orderId_ != 0L) {
output.writeUInt64(5, orderId_);
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (sessionId_ != 0L) {
size += com.google.protobuf.CodedOutputStream
.computeUInt64Size(1, sessionId_);
}
if (timeoutMillis_ != 0L) {
size += com.google.protobuf.CodedOutputStream
.computeUInt64Size(2, timeoutMillis_);
}
if (count_ != 0L) {
size += com.google.protobuf.CodedOutputStream
.computeUInt64Size(3, count_);
}
if (!data_.isEmpty()) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(4, data_);
}
if (orderId_ != 0L) {
size += com.google.protobuf.CodedOutputStream
.computeUInt64Size(5, orderId_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.yandex.ydb.coordination.SemaphoreSession)) {
return super.equals(obj);
}
com.yandex.ydb.coordination.SemaphoreSession other = (com.yandex.ydb.coordination.SemaphoreSession) obj;
if (getOrderId()
!= other.getOrderId()) return false;
if (getSessionId()
!= other.getSessionId()) return false;
if (getTimeoutMillis()
!= other.getTimeoutMillis()) return false;
if (getCount()
!= other.getCount()) return false;
if (!getData()
.equals(other.getData())) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + ORDER_ID_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getOrderId());
hash = (37 * hash) + SESSION_ID_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getSessionId());
hash = (37 * hash) + TIMEOUT_MILLIS_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getTimeoutMillis());
hash = (37 * hash) + COUNT_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getCount());
hash = (37 * hash) + DATA_FIELD_NUMBER;
hash = (53 * hash) + getData().hashCode();
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.yandex.ydb.coordination.SemaphoreSession parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.yandex.ydb.coordination.SemaphoreSession parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.yandex.ydb.coordination.SemaphoreSession parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.yandex.ydb.coordination.SemaphoreSession parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.yandex.ydb.coordination.SemaphoreSession parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.yandex.ydb.coordination.SemaphoreSession parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.yandex.ydb.coordination.SemaphoreSession parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.yandex.ydb.coordination.SemaphoreSession parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static com.yandex.ydb.coordination.SemaphoreSession parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.yandex.ydb.coordination.SemaphoreSession parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static com.yandex.ydb.coordination.SemaphoreSession parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.yandex.ydb.coordination.SemaphoreSession parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(com.yandex.ydb.coordination.SemaphoreSession prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
**
* Describes an owner or a waiter of this semaphore
*
*
* Protobuf type {@code Ydb.Coordination.SemaphoreSession}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:Ydb.Coordination.SemaphoreSession)
com.yandex.ydb.coordination.SemaphoreSessionOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.yandex.ydb.coordination.CoordinationProtos.internal_static_Ydb_Coordination_SemaphoreSession_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.yandex.ydb.coordination.CoordinationProtos.internal_static_Ydb_Coordination_SemaphoreSession_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.yandex.ydb.coordination.SemaphoreSession.class, com.yandex.ydb.coordination.SemaphoreSession.Builder.class);
}
// Construct using com.yandex.ydb.coordination.SemaphoreSession.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
orderId_ = 0L;
sessionId_ = 0L;
timeoutMillis_ = 0L;
count_ = 0L;
data_ = com.google.protobuf.ByteString.EMPTY;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.yandex.ydb.coordination.CoordinationProtos.internal_static_Ydb_Coordination_SemaphoreSession_descriptor;
}
@java.lang.Override
public com.yandex.ydb.coordination.SemaphoreSession getDefaultInstanceForType() {
return com.yandex.ydb.coordination.SemaphoreSession.getDefaultInstance();
}
@java.lang.Override
public com.yandex.ydb.coordination.SemaphoreSession build() {
com.yandex.ydb.coordination.SemaphoreSession result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.yandex.ydb.coordination.SemaphoreSession buildPartial() {
com.yandex.ydb.coordination.SemaphoreSession result = new com.yandex.ydb.coordination.SemaphoreSession(this);
result.orderId_ = orderId_;
result.sessionId_ = sessionId_;
result.timeoutMillis_ = timeoutMillis_;
result.count_ = count_;
result.data_ = data_;
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.yandex.ydb.coordination.SemaphoreSession) {
return mergeFrom((com.yandex.ydb.coordination.SemaphoreSession)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.yandex.ydb.coordination.SemaphoreSession other) {
if (other == com.yandex.ydb.coordination.SemaphoreSession.getDefaultInstance()) return this;
if (other.getOrderId() != 0L) {
setOrderId(other.getOrderId());
}
if (other.getSessionId() != 0L) {
setSessionId(other.getSessionId());
}
if (other.getTimeoutMillis() != 0L) {
setTimeoutMillis(other.getTimeoutMillis());
}
if (other.getCount() != 0L) {
setCount(other.getCount());
}
if (other.getData() != com.google.protobuf.ByteString.EMPTY) {
setData(other.getData());
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
com.yandex.ydb.coordination.SemaphoreSession parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.yandex.ydb.coordination.SemaphoreSession) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private long orderId_ ;
/**
*
* A monotonically increasing id which determines locking order
*
*
* uint64 order_id = 5;
* @return The orderId.
*/
@java.lang.Override
public long getOrderId() {
return orderId_;
}
/**
*
* A monotonically increasing id which determines locking order
*
*
* uint64 order_id = 5;
* @param value The orderId to set.
* @return This builder for chaining.
*/
public Builder setOrderId(long value) {
orderId_ = value;
onChanged();
return this;
}
/**
*
* A monotonically increasing id which determines locking order
*
*
* uint64 order_id = 5;
* @return This builder for chaining.
*/
public Builder clearOrderId() {
orderId_ = 0L;
onChanged();
return this;
}
private long sessionId_ ;
/**
*
* An id of the session which tried to acquire the semaphore
*
*
* uint64 session_id = 1;
* @return The sessionId.
*/
@java.lang.Override
public long getSessionId() {
return sessionId_;
}
/**
*
* An id of the session which tried to acquire the semaphore
*
*
* uint64 session_id = 1;
* @param value The sessionId to set.
* @return This builder for chaining.
*/
public Builder setSessionId(long value) {
sessionId_ = value;
onChanged();
return this;
}
/**
*
* An id of the session which tried to acquire the semaphore
*
*
* uint64 session_id = 1;
* @return This builder for chaining.
*/
public Builder clearSessionId() {
sessionId_ = 0L;
onChanged();
return this;
}
private long timeoutMillis_ ;
/**
*
* A timeout in milliseconds for operation in waiters queue
*
*
* uint64 timeout_millis = 2;
* @return The timeoutMillis.
*/
@java.lang.Override
public long getTimeoutMillis() {
return timeoutMillis_;
}
/**
*
* A timeout in milliseconds for operation in waiters queue
*
*
* uint64 timeout_millis = 2;
* @param value The timeoutMillis to set.
* @return This builder for chaining.
*/
public Builder setTimeoutMillis(long value) {
timeoutMillis_ = value;
onChanged();
return this;
}
/**
*
* A timeout in milliseconds for operation in waiters queue
*
*
* uint64 timeout_millis = 2;
* @return This builder for chaining.
*/
public Builder clearTimeoutMillis() {
timeoutMillis_ = 0L;
onChanged();
return this;
}
private long count_ ;
/**
*
* Number of tokens for an acquire operation
*
*
* uint64 count = 3;
* @return The count.
*/
@java.lang.Override
public long getCount() {
return count_;
}
/**
*
* Number of tokens for an acquire operation
*
*
* uint64 count = 3;
* @param value The count to set.
* @return This builder for chaining.
*/
public Builder setCount(long value) {
count_ = value;
onChanged();
return this;
}
/**
*
* Number of tokens for an acquire operation
*
*
* uint64 count = 3;
* @return This builder for chaining.
*/
public Builder clearCount() {
count_ = 0L;
onChanged();
return this;
}
private com.google.protobuf.ByteString data_ = com.google.protobuf.ByteString.EMPTY;
/**
*
* User-defined data attached to the acquire operation
*
*
* bytes data = 4;
* @return The data.
*/
@java.lang.Override
public com.google.protobuf.ByteString getData() {
return data_;
}
/**
*
* User-defined data attached to the acquire operation
*
*
* bytes data = 4;
* @param value The data to set.
* @return This builder for chaining.
*/
public Builder setData(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
data_ = value;
onChanged();
return this;
}
/**
*
* User-defined data attached to the acquire operation
*
*
* bytes data = 4;
* @return This builder for chaining.
*/
public Builder clearData() {
data_ = getDefaultInstance().getData();
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:Ydb.Coordination.SemaphoreSession)
}
// @@protoc_insertion_point(class_scope:Ydb.Coordination.SemaphoreSession)
private static final com.yandex.ydb.coordination.SemaphoreSession DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.yandex.ydb.coordination.SemaphoreSession();
}
public static com.yandex.ydb.coordination.SemaphoreSession getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public SemaphoreSession parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new SemaphoreSession(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public com.yandex.ydb.coordination.SemaphoreSession getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}