2011-11-21 15:39:33 +00:00
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
// This file contains protocol buffers that are used throughout HDFS -- i.e.
|
|
|
|
// by the client, server, and data transfer protocols.
|
|
|
|
|
|
|
|
option java_package = "org.apache.hadoop.hdfs.protocol.proto";
|
|
|
|
option java_outer_classname = "JournalProtocolProtos";
|
|
|
|
option java_generic_services = true;
|
|
|
|
option java_generate_equals_and_hash = true;
|
|
|
|
|
|
|
|
import "hdfs.proto";
|
|
|
|
|
|
|
|
/**
|
2012-04-06 00:08:19 +00:00
|
|
|
* Journal information used by the journal receiver to identify a journal.
|
|
|
|
*/
|
|
|
|
message JournalInfoProto {
|
|
|
|
required string clusterID = 1; // ID of the cluster
|
|
|
|
optional uint32 layoutVersion = 2; // Layout version
|
|
|
|
optional uint32 namespaceID = 3; // Namespace ID
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* JournalInfo - the information about the journal
|
|
|
|
* firstTxnId - the first txid in the journal records
|
2011-11-21 15:39:33 +00:00
|
|
|
* numTxns - Number of transactions in editlog
|
|
|
|
* records - bytes containing serialized journal records
|
|
|
|
*/
|
|
|
|
message JournalRequestProto {
|
2012-04-06 00:08:19 +00:00
|
|
|
required JournalInfoProto journalInfo = 1;
|
|
|
|
required uint64 firstTxnId = 2;
|
|
|
|
required uint32 numTxns = 3;
|
|
|
|
required bytes records = 4;
|
2011-11-21 15:39:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* void response
|
|
|
|
*/
|
|
|
|
message JournalResponseProto {
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2012-04-06 00:08:19 +00:00
|
|
|
* JournalInfo - the information about the journal
|
2011-11-21 15:39:33 +00:00
|
|
|
* txid - first txid in the new log
|
|
|
|
*/
|
|
|
|
message StartLogSegmentRequestProto {
|
2012-04-06 00:08:19 +00:00
|
|
|
required JournalInfoProto journalInfo = 1;
|
|
|
|
required uint64 txid = 2;
|
2011-11-21 15:39:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* void response
|
|
|
|
*/
|
|
|
|
message StartLogSegmentResponseProto {
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Protocol used to journal edits to a remote node. Currently,
|
|
|
|
* this is used to publish edits from the NameNode to a BackupNode.
|
|
|
|
*
|
|
|
|
* See the request and response for details of rpc call.
|
|
|
|
*/
|
|
|
|
service JournalProtocolService {
|
|
|
|
/**
|
|
|
|
* Request sent by active namenode to backup node via
|
|
|
|
* EditLogBackupOutputStream to stream editlog records.
|
|
|
|
*/
|
|
|
|
rpc journal(JournalRequestProto) returns (JournalResponseProto);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Request sent by active namenode to backup node to notify
|
|
|
|
* that the NameNode has rolled its edit logs and is now writing a
|
|
|
|
* new log segment.
|
|
|
|
*/
|
|
|
|
rpc startLogSegment(StartLogSegmentRequestProto)
|
|
|
|
returns (StartLogSegmentResponseProto);
|
|
|
|
}
|