001/*
002 * Licensed to the Apache Software Foundation (ASF) under one
003 * or more contributor license agreements.  See the NOTICE file
004 * distributed with this work for additional information
005 * regarding copyright ownership.  The ASF licenses this file
006 * to you under the Apache License, Version 2.0 (the
007 * "License"); you may not use this file except in compliance
008 * with the License.  You may obtain a copy of the License at
009 *
010 *     http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing, software
013 * distributed under the License is distributed on an "AS IS" BASIS,
014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015 * See the License for the specific language governing permissions and
016 * limitations under the License.
017 */
018package org.apache.hadoop.hbase;
019
020import java.util.List;
021
022import org.apache.yetus.audience.InterfaceAudience;
023
024/**
025 * For internal purpose.
026 * {@link Tag} and memstoreTS/mvcc are internal implementation detail
027 *  that should not be exposed publicly.
028 * Use {@link ExtendedCellBuilderFactory} to get ExtendedCellBuilder instance.
029 * TODO: ditto for ByteBufferExtendedCell?
030 */
031@InterfaceAudience.Private
032public interface ExtendedCellBuilder extends RawCellBuilder {
033  @Override
034  ExtendedCellBuilder setRow(final byte[] row);
035  @Override
036  ExtendedCellBuilder setRow(final byte[] row, final int rOffset, final int rLength);
037
038  @Override
039  ExtendedCellBuilder setFamily(final byte[] family);
040  @Override
041  ExtendedCellBuilder setFamily(final byte[] family, final int fOffset, final int fLength);
042
043  @Override
044  ExtendedCellBuilder setQualifier(final byte[] qualifier);
045  @Override
046  ExtendedCellBuilder setQualifier(final byte[] qualifier, final int qOffset, final int qLength);
047
048  @Override
049  ExtendedCellBuilder setTimestamp(final long timestamp);
050
051  @Override
052  ExtendedCellBuilder setType(final Cell.Type type);
053
054  ExtendedCellBuilder setType(final byte type);
055
056  @Override
057  ExtendedCellBuilder setValue(final byte[] value);
058  @Override
059  ExtendedCellBuilder setValue(final byte[] value, final int vOffset, final int vLength);
060
061  @Override
062  ExtendedCell build();
063
064  @Override
065  ExtendedCellBuilder clear();
066
067  // we have this method for performance reasons so that if one could create a cell directly from
068  // the tag byte[] of the cell without having to convert to a list of Tag(s) and again adding it
069  // back.
070  ExtendedCellBuilder setTags(final byte[] tags);
071  // we have this method for performance reasons so that if one could create a cell directly from
072  // the tag byte[] of the cell without having to convert to a list of Tag(s) and again adding it
073  // back.
074  ExtendedCellBuilder setTags(final byte[] tags, int tagsOffset, int tagsLength);
075
076  @Override
077  ExtendedCellBuilder setTags(List<Tag> tags);
078  /**
079   * Internal usage. Be careful before you use this while building a cell
080   * @param seqId set the seqId
081   * @return the current ExternalCellBuilder
082   */
083  ExtendedCellBuilder setSequenceId(final long seqId);
084}