Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
   /*
    * 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.
   */
  // Generated by the protocol buffer compiler.  DO NOT EDIT!
  // source: filechannel.proto
  
  package org.apache.flume.channel.file.proto;
  
  public final class ProtosFactory {
    private ProtosFactory() {}
    public static void registerAllExtensions(
        com.google.protobuf.ExtensionRegistry registry) {
    }
    public interface CheckpointOrBuilder
        extends com.google.protobuf.MessageOrBuilder {
  
      // required sfixed32 version = 1;
      
required sfixed32 version = 1;
  
      boolean hasVersion();
    
required sfixed32 version = 1;
  
      int getVersion();
  
      // required sfixed64 writeOrderID = 2;
      
required sfixed64 writeOrderID = 2;
  
      boolean hasWriteOrderID();
    
required sfixed64 writeOrderID = 2;
  
      long getWriteOrderID();
  
      // required sfixed32 queueSize = 3;
      
required sfixed32 queueSize = 3;
  
      boolean hasQueueSize();
    
required sfixed32 queueSize = 3;
  
      int getQueueSize();
  
      // required sfixed32 queueHead = 4;
      
required sfixed32 queueHead = 4;
  
      boolean hasQueueHead();
    
required sfixed32 queueHead = 4;
  
      int getQueueHead();
  
      // repeated .ActiveLog activeLogs = 5;
      
repeated .ActiveLog activeLogs = 5;
  
          getActiveLogsList();
    
repeated .ActiveLog activeLogs = 5;
  
repeated .ActiveLog activeLogs = 5;
  
      int getActiveLogsCount();
    
repeated .ActiveLog activeLogs = 5;
  
          getActiveLogsOrBuilderList();
    
repeated .ActiveLog activeLogs = 5;
  
          int index);
    }
  
Protobuf type Checkpoint
  
   public static final class Checkpoint extends
       implements CheckpointOrBuilder {
     // Use Checkpoint.newBuilder() to construct.
     private Checkpoint(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
       super(builder);
       this. = builder.getUnknownFields();
     }
     private Checkpoint(boolean noInit) { this. = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
 
     private static final Checkpoint defaultInstance;
     public static Checkpoint getDefaultInstance() {
       return ;
     }
 
       return ;
     }
 
     private final com.google.protobuf.UnknownFieldSet unknownFields;
     @java.lang.Override
     public final com.google.protobuf.UnknownFieldSet
         getUnknownFields() {
       return this.;
     }
     private Checkpoint(
         com.google.protobuf.CodedInputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
       initFields();
       int mutable_bitField0_ = 0;
       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;
             default: {
               if (!parseUnknownField(inputunknownFields,
                                      extensionRegistrytag)) {
                 done = true;
               }
               break;
             }
             case 13: {
                |= 0x00000001;
                = input.readSFixed32();
               break;
             }
             case 17: {
                |= 0x00000002;
                = input.readSFixed64();
               break;
             }
             case 29: {
                |= 0x00000004;
                = input.readSFixed32();
               break;
             }
             case 37: {
                |= 0x00000008;
                = input.readSFixed32();
               break;
             }
             case 42: {
               if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) {
                  = new java.util.ArrayList<org.apache.flume.channel.file.proto.ProtosFactory.ActiveLog>();
                 mutable_bitField0_ |= 0x00000010;
               }
               .add(input.readMessage(........extensionRegistry));
               break;
             }
           }
         }
       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
         throw e.setUnfinishedMessage(this);
       } catch (java.io.IOException e) {
         throw new com.google.protobuf.InvalidProtocolBufferException(
             e.getMessage()).setUnfinishedMessage(this);
       } finally {
         if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) {
            = java.util.Collections.unmodifiableList();
         }
         this. = unknownFields.build();
         makeExtensionsImmutable();
       }
     }
     public static final com.google.protobuf.Descriptors.Descriptor
         getDescriptor() {
     }
 
         internalGetFieldAccessorTable() {
           .ensureFieldAccessorsInitialized(
     }
 
     public static com.google.protobuf.Parser<CheckpointPARSER =
         new com.google.protobuf.AbstractParser<Checkpoint>() {
       public Checkpoint parsePartialFrom(
           com.google.protobuf.CodedInputStream input,
           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
           throws com.google.protobuf.InvalidProtocolBufferException {
         return new Checkpoint(inputextensionRegistry);
       }
     };
 
     @java.lang.Override
       return ;
     }
 
     private int bitField0_;
     // required sfixed32 version = 1;
     public static final int VERSION_FIELD_NUMBER = 1;
     private int version_;
    
required sfixed32 version = 1;
 
     public boolean hasVersion() {
       return (( & 0x00000001) == 0x00000001);
     }
    
required sfixed32 version = 1;
 
     public int getVersion() {
       return ;
     }
 
     // required sfixed64 writeOrderID = 2;
     public static final int WRITEORDERID_FIELD_NUMBER = 2;
     private long writeOrderID_;
    
required sfixed64 writeOrderID = 2;
 
     public boolean hasWriteOrderID() {
       return (( & 0x00000002) == 0x00000002);
     }
    
required sfixed64 writeOrderID = 2;
 
     public long getWriteOrderID() {
       return ;
     }
 
     // required sfixed32 queueSize = 3;
     public static final int QUEUESIZE_FIELD_NUMBER = 3;
     private int queueSize_;
    
required sfixed32 queueSize = 3;
 
     public boolean hasQueueSize() {
       return (( & 0x00000004) == 0x00000004);
     }
    
required sfixed32 queueSize = 3;
 
     public int getQueueSize() {
       return ;
     }
 
     // required sfixed32 queueHead = 4;
     public static final int QUEUEHEAD_FIELD_NUMBER = 4;
     private int queueHead_;
    
required sfixed32 queueHead = 4;
 
     public boolean hasQueueHead() {
       return (( & 0x00000008) == 0x00000008);
     }
    
required sfixed32 queueHead = 4;
 
     public int getQueueHead() {
       return ;
     }
 
     // repeated .ActiveLog activeLogs = 5;
     public static final int ACTIVELOGS_FIELD_NUMBER = 5;
repeated .ActiveLog activeLogs = 5;
 
       return ;
     }
    
repeated .ActiveLog activeLogs = 5;
 
         getActiveLogsOrBuilderList() {
       return ;
     }
    
repeated .ActiveLog activeLogs = 5;
 
     public int getActiveLogsCount() {
       return .size();
     }
    
repeated .ActiveLog activeLogs = 5;
 
       return .get(index);
     }
    
repeated .ActiveLog activeLogs = 5;
 
         int index) {
       return .get(index);
     }
 
     private void initFields() {
        = 0;
        = 0L;
        = 0;
        = 0;
        = java.util.Collections.emptyList();
     }
     private byte memoizedIsInitialized = -1;
     public final boolean isInitialized() {
       byte isInitialized = ;
       if (isInitialized != -1) return isInitialized == 1;
 
       if (!hasVersion()) {
          = 0;
         return false;
       }
       if (!hasWriteOrderID()) {
          = 0;
         return false;
       }
       if (!hasQueueSize()) {
          = 0;
         return false;
       }
       if (!hasQueueHead()) {
          = 0;
         return false;
       }
       for (int i = 0; i < getActiveLogsCount(); i++) {
         if (!getActiveLogs(i).isInitialized()) {
            = 0;
           return false;
         }
       }
        = 1;
       return true;
     }
 
     public void writeTo(com.google.protobuf.CodedOutputStream output)
                         throws java.io.IOException {
       getSerializedSize();
       if ((( & 0x00000001) == 0x00000001)) {
         output.writeSFixed32(1, );
       }
       if ((( & 0x00000002) == 0x00000002)) {
         output.writeSFixed64(2, );
       }
       if ((( & 0x00000004) == 0x00000004)) {
         output.writeSFixed32(3, );
       }
       if ((( & 0x00000008) == 0x00000008)) {
         output.writeSFixed32(4, );
       }
       for (int i = 0; i < .size(); i++) {
         output.writeMessage(5, .get(i));
       }
       getUnknownFields().writeTo(output);
     }
 
     private int memoizedSerializedSize = -1;
     public int getSerializedSize() {
       int size = ;
       if (size != -1) return size;
 
       size = 0;
       if ((( & 0x00000001) == 0x00000001)) {
         size += com.google.protobuf.CodedOutputStream
           .computeSFixed32Size(1, );
       }
       if ((( & 0x00000002) == 0x00000002)) {
         size += com.google.protobuf.CodedOutputStream
           .computeSFixed64Size(2, );
       }
       if ((( & 0x00000004) == 0x00000004)) {
         size += com.google.protobuf.CodedOutputStream
           .computeSFixed32Size(3, );
       }
       if ((( & 0x00000008) == 0x00000008)) {
         size += com.google.protobuf.CodedOutputStream
           .computeSFixed32Size(4, );
       }
       for (int i = 0; i < .size(); i++) {
         size += com.google.protobuf.CodedOutputStream
           .computeMessageSize(5, .get(i));
       }
       size += getUnknownFields().getSerializedSize();
        = size;
       return size;
     }
 
     private static final long serialVersionUID = 0L;
     @java.lang.Override
     protected java.lang.Object writeReplace()
         throws java.io.ObjectStreamException {
       return super.writeReplace();
     }
 
         com.google.protobuf.ByteString data)
       return .parseFrom(data);
     }
         com.google.protobuf.ByteString data,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
       return .parseFrom(dataextensionRegistry);
     }
     public static org.apache.flume.channel.file.proto.ProtosFactory.Checkpoint parseFrom(byte[] data)
       return .parseFrom(data);
     }
         byte[] data,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
       return .parseFrom(dataextensionRegistry);
     }
         throws java.io.IOException {
       return .parseFrom(input);
     }
         java.io.InputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
       return .parseFrom(inputextensionRegistry);
     }
         throws java.io.IOException {
       return .parseDelimitedFrom(input);
     }
         java.io.InputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
       return .parseDelimitedFrom(inputextensionRegistry);
     }
         com.google.protobuf.CodedInputStream input)
         throws java.io.IOException {
       return .parseFrom(input);
     }
         com.google.protobuf.CodedInputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
       return .parseFrom(inputextensionRegistry);
     }
 
     public static Builder newBuilder() { return Builder.create(); }
     public Builder newBuilderForType() { return newBuilder(); }
     public static Builder newBuilder(org.apache.flume.channel.file.proto.ProtosFactory.Checkpoint prototype) {
       return newBuilder().mergeFrom(prototype);
     }
     public Builder toBuilder() { return newBuilder(this); }
 
     @java.lang.Override
     protected Builder newBuilderForType(
         com.google.protobuf.GeneratedMessage.BuilderParent parent) {
       Builder builder = new Builder(parent);
       return builder;
     }
    
Protobuf type Checkpoint
 
     public static final class Builder extends
       public static final com.google.protobuf.Descriptors.Descriptor
           getDescriptor() {
       }
 
           internalGetFieldAccessorTable() {
             .ensureFieldAccessorsInitialized(
       }
 
       // Construct using org.apache.flume.channel.file.proto.ProtosFactory.Checkpoint.newBuilder()
       private Builder() {
       }
 
       private Builder(
           com.google.protobuf.GeneratedMessage.BuilderParent parent) {
         super(parent);
       }
       private void maybeForceBuilderInitialization() {
           getActiveLogsFieldBuilder();
         }
       }
       private static Builder create() {
         return new Builder();
       }
 
       public Builder clear() {
         super.clear();
          = 0;
          = ( & ~0x00000001);
          = 0L;
          = ( & ~0x00000002);
          = 0;
          = ( & ~0x00000004);
          = 0;
          = ( & ~0x00000008);
         if ( == null) {
            = java.util.Collections.emptyList();
            = ( & ~0x00000010);
         } else {
           .clear();
         }
         return this;
       }
 
       public Builder clone() {
         return create().mergeFrom(buildPartial());
       }
 
           getDescriptorForType() {
       }
 
         return org.apache.flume.channel.file.proto.ProtosFactory.Checkpoint.getDefaultInstance();
       }
 
         if (!result.isInitialized()) {
           throw newUninitializedMessageException(result);
         }
         return result;
       }
 
         int from_bitField0_ = ;
         int to_bitField0_ = 0;
         if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
           to_bitField0_ |= 0x00000001;
         }
         result.version_ = ;
         if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
           to_bitField0_ |= 0x00000002;
         }
         result.writeOrderID_ = ;
         if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
           to_bitField0_ |= 0x00000004;
         }
         result.queueSize_ = ;
         if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
           to_bitField0_ |= 0x00000008;
         }
         result.queueHead_ = ;
         if ( == null) {
           if ((( & 0x00000010) == 0x00000010)) {
              = java.util.Collections.unmodifiableList();
              = ( & ~0x00000010);
           }
           result.activeLogs_ = ;
         } else {
           result.activeLogs_ = .build();
         }
         result.bitField0_ = to_bitField0_;
         onBuilt();
         return result;
       }
 
       public Builder mergeFrom(com.google.protobuf.Message other) {
         if (other instanceof org.apache.flume.channel.file.proto.ProtosFactory.Checkpoint) {
           return mergeFrom((org.apache.flume.channel.file.proto.ProtosFactory.Checkpoint)other);
         } else {
           super.mergeFrom(other);
           return this;
         }
       }
 
         if (other == org.apache.flume.channel.file.proto.ProtosFactory.Checkpoint.getDefaultInstance()) return this;
         if (other.hasVersion()) {
           setVersion(other.getVersion());
         }
         if (other.hasWriteOrderID()) {
           setWriteOrderID(other.getWriteOrderID());
         }
         if (other.hasQueueSize()) {
           setQueueSize(other.getQueueSize());
         }
         if (other.hasQueueHead()) {
           setQueueHead(other.getQueueHead());
         }
         if ( == null) {
           if (!other.activeLogs_.isEmpty()) {
             if (.isEmpty()) {
                = other.activeLogs_;
                = ( & ~0x00000010);
             } else {
               ensureActiveLogsIsMutable();
               .addAll(other.activeLogs_);
             }
             onChanged();
           }
         } else {
           if (!other.activeLogs_.isEmpty()) {
             if (.isEmpty()) {
               .dispose();
                = null;
                = other.activeLogs_;
                = ( & ~0x00000010);
                = 
                 .... ?
                    getActiveLogsFieldBuilder() : null;
             } else {
               .addAllMessages(other.activeLogs_);
             }
           }
         }
         this.mergeUnknownFields(other.getUnknownFields());
         return this;
       }
 
       public final boolean isInitialized() {
         if (!hasVersion()) {
           
           return false;
         }
         if (!hasWriteOrderID()) {
           
           return false;
         }
         if (!hasQueueSize()) {
           
           return false;
         }
         if (!hasQueueHead()) {
           
           return false;
         }
         for (int i = 0; i < getActiveLogsCount(); i++) {
           if (!getActiveLogs(i).isInitialized()) {
             
             return false;
           }
         }
         return true;
       }
 
       public Builder mergeFrom(
           com.google.protobuf.CodedInputStream input,
           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
           throws java.io.IOException {
         org.apache.flume.channel.file.proto.ProtosFactory.Checkpoint parsedMessage = null;
         try {
           parsedMessage = .parsePartialFrom(inputextensionRegistry);
         } catch (com.google.protobuf.InvalidProtocolBufferException e) {
           parsedMessage = (org.apache.flume.channel.file.proto.ProtosFactory.Checkpointe.getUnfinishedMessage();
           throw e;
         } finally {
           if (parsedMessage != null) {
             mergeFrom(parsedMessage);
           }
         }
         return this;
       }
       private int bitField0_;
 
       // required sfixed32 version = 1;
       private int version_ ;
      
required sfixed32 version = 1;
 
       public boolean hasVersion() {
         return (( & 0x00000001) == 0x00000001);
       }
      
required sfixed32 version = 1;
 
       public int getVersion() {
         return ;
       }
      
required sfixed32 version = 1;
 
       public Builder setVersion(int value) {
          |= 0x00000001;
          = value;
         onChanged();
         return this;
       }
      
required sfixed32 version = 1;
 
       public Builder clearVersion() {
          = ( & ~0x00000001);
          = 0;
         onChanged();
         return this;
       }
 
       // required sfixed64 writeOrderID = 2;
       private long writeOrderID_ ;
      
required sfixed64 writeOrderID = 2;
 
       public boolean hasWriteOrderID() {
         return (( & 0x00000002) == 0x00000002);
       }
      
required sfixed64 writeOrderID = 2;
 
       public long getWriteOrderID() {
         return ;
       }
      
required sfixed64 writeOrderID = 2;
 
       public Builder setWriteOrderID(long value) {
          |= 0x00000002;
          = value;
         onChanged();
         return this;
       }
      
required sfixed64 writeOrderID = 2;
 
       public Builder clearWriteOrderID() {
          = ( & ~0x00000002);
          = 0L;
         onChanged();
         return this;
       }
 
       // required sfixed32 queueSize = 3;
       private int queueSize_ ;
      
required sfixed32 queueSize = 3;
 
       public boolean hasQueueSize() {
         return (( & 0x00000004) == 0x00000004);
       }
      
required sfixed32 queueSize = 3;
 
       public int getQueueSize() {
         return ;
       }
      
required sfixed32 queueSize = 3;
 
       public Builder setQueueSize(int value) {
          |= 0x00000004;
          = value;
         onChanged();
         return this;
       }
      
required sfixed32 queueSize = 3;
 
       public Builder clearQueueSize() {
          = ( & ~0x00000004);
          = 0;
         onChanged();
         return this;
       }
 
       // required sfixed32 queueHead = 4;
       private int queueHead_ ;
      
required sfixed32 queueHead = 4;
 
       public boolean hasQueueHead() {
         return (( & 0x00000008) == 0x00000008);
       }
      
required sfixed32 queueHead = 4;
 
       public int getQueueHead() {
         return ;
       }
      
required sfixed32 queueHead = 4;
 
       public Builder setQueueHead(int value) {
          |= 0x00000008;
          = value;
         onChanged();
         return this;
       }
      
required sfixed32 queueHead = 4;
 
       public Builder clearQueueHead() {
          = ( & ~0x00000008);
          = 0;
         onChanged();
         return this;
       }
 
       // repeated .ActiveLog activeLogs = 5;
         java.util.Collections.emptyList();
       private void ensureActiveLogsIsMutable() {
         if (!(( & 0x00000010) == 0x00000010)) {
            |= 0x00000010;
          }
       }
 
       private com.google.protobuf.RepeatedFieldBuilder<
repeated .ActiveLog activeLogs = 5;
 
         if ( == null) {
           return java.util.Collections.unmodifiableList();
         } else {
           return .getMessageList();
         }
       }
      
repeated .ActiveLog activeLogs = 5;
 
       public int getActiveLogsCount() {
         if ( == null) {
           return .size();
         } else {
           return .getCount();
         }
       }
      
repeated .ActiveLog activeLogs = 5;
 
       public org.apache.flume.channel.file.proto.ProtosFactory.ActiveLog getActiveLogs(int index) {
         if ( == null) {
           return .get(index);
         } else {
           return .getMessage(index);
         }
       }
      
repeated .ActiveLog activeLogs = 5;
 
       public Builder setActiveLogs(
           int indexorg.apache.flume.channel.file.proto.ProtosFactory.ActiveLog value) {
         if ( == null) {
           if (value == null) {
             throw new NullPointerException();
           }
           ensureActiveLogsIsMutable();
           .set(indexvalue);
           onChanged();
         } else {
           .setMessage(indexvalue);
         }
         return this;
       }
      
repeated .ActiveLog activeLogs = 5;
 
       public Builder setActiveLogs(
           int indexorg.apache.flume.channel.file.proto.ProtosFactory.ActiveLog.Builder builderForValue) {
         if ( == null) {
           ensureActiveLogsIsMutable();
           .set(indexbuilderForValue.build());
           onChanged();
         } else {
           .setMessage(indexbuilderForValue.build());
         }
         return this;
       }
      
repeated .ActiveLog activeLogs = 5;
 
         if ( == null) {
           if (value == null) {
             throw new NullPointerException();
           }
           ensureActiveLogsIsMutable();
           .add(value);
           onChanged();
         } else {
           .addMessage(value);
         }
         return this;
       }
      
repeated .ActiveLog activeLogs = 5;
 
       public Builder addActiveLogs(
           int indexorg.apache.flume.channel.file.proto.ProtosFactory.ActiveLog value) {
         if ( == null) {
           if (value == null) {
             throw new NullPointerException();
           }
           ensureActiveLogsIsMutable();
           .add(indexvalue);
           onChanged();
         } else {
           .addMessage(indexvalue);
         }
         return this;
       }
      
repeated .ActiveLog activeLogs = 5;
 
       public Builder addActiveLogs(
           org.apache.