blob: 1be664bda4c19d000864df0e0341ca547fa2f60f [file] [log] [blame]
/*
* Copyright 2010 The Apache Software Foundation
*
* 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.
*/
option java_package = "org.apache.phoenix.coprocessor.generated";
option java_outer_classname = "MetaDataProtos";
option java_generic_services = true;
option java_generate_equals_and_hash = true;
option optimize_for = SPEED;
import "PTable.proto";
enum MutationCode {
TABLE_ALREADY_EXISTS = 0;
TABLE_NOT_FOUND = 1;
COLUMN_NOT_FOUND = 2;
COLUMN_ALREADY_EXISTS = 3;
CONCURRENT_TABLE_MUTATION = 4;
TABLE_NOT_IN_REGION = 5;
NEWER_TABLE_FOUND = 6;
UNALLOWED_TABLE_MUTATION = 7;
NO_PK_COLUMNS = 8;
PARENT_TABLE_NOT_FOUND = 9;
};
message MetaDataResponse {
optional MutationCode returnCode = 1;
optional int64 mutationTime = 2;
optional PTable table = 3;
repeated bytes tablesToDelete = 4;
optional bytes columnName = 5;
optional bytes familyName = 6;
}
message GetTableRequest {
required bytes tenantId = 1;
required bytes schemaName = 2;
required bytes tableName = 3;
required int64 tableTimestamp = 4;
required int64 clientTimestamp = 5;
}
// each byte array represents a MutationProto instance
message CreateTableRequest {
repeated bytes tableMetadataMutations = 1;
}
message DropTableRequest {
repeated bytes tableMetadataMutations = 1;
required string tableType = 2;
}
message AddColumnRequest {
repeated bytes tableMetadataMutations = 1;
}
message DropColumnRequest {
repeated bytes tableMetadataMutations = 1;
}
message UpdateIndexStateRequest {
repeated bytes tableMetadataMutations = 1;
}
message ClearCacheRequest {
}
message ClearCacheResponse {
}
message GetVersionRequest {
}
message GetVersionResponse {
required int64 version = 1;
}
service MetaDataService {
rpc getTable(GetTableRequest)
returns (MetaDataResponse);
rpc createTable(CreateTableRequest)
returns (MetaDataResponse);
rpc dropTable(DropTableRequest)
returns (MetaDataResponse);
rpc addColumn(AddColumnRequest)
returns (MetaDataResponse);
rpc dropColumn(DropColumnRequest)
returns (MetaDataResponse);
rpc updateIndexState(UpdateIndexStateRequest)
returns (MetaDataResponse);
rpc clearCache(ClearCacheRequest)
returns (ClearCacheResponse);
rpc getVersion(GetVersionRequest)
returns (GetVersionResponse);
}