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;
021import org.apache.yetus.audience.InterfaceAudience;
022
023/**
024 * For internal purpose. {@link Tag} and memstoreTS/mvcc are internal implementation detail that
025 * should not be exposed publicly. Use {@link ExtendedCellBuilderFactory} to get ExtendedCellBuilder
026 * instance. TODO: ditto for ByteBufferExtendedCell?
027 */
028@InterfaceAudience.Private
029public interface ExtendedCellBuilder extends RawCellBuilder {
030  @Override
031  ExtendedCellBuilder setRow(final byte[] row);
032
033  @Override
034  ExtendedCellBuilder setRow(final byte[] row, final int rOffset, final int rLength);
035
036  @Override
037  ExtendedCellBuilder setFamily(final byte[] family);
038
039  @Override
040  ExtendedCellBuilder setFamily(final byte[] family, final int fOffset, final int fLength);
041
042  @Override
043  ExtendedCellBuilder setQualifier(final byte[] qualifier);
044
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
059  @Override
060  ExtendedCellBuilder setValue(final byte[] value, final int vOffset, final int vLength);
061
062  @Override
063  ExtendedCell build();
064
065  @Override
066  ExtendedCellBuilder clear();
067
068  // we have this method for performance reasons so that if one could create a cell directly from
069  // the tag byte[] of the cell without having to convert to a list of Tag(s) and again adding it
070  // back.
071  ExtendedCellBuilder setTags(final byte[] tags);
072
073  // we have this method for performance reasons so that if one could create a cell directly from
074  // the tag byte[] of the cell without having to convert to a list of Tag(s) and again adding it
075  // back.
076  ExtendedCellBuilder setTags(final byte[] tags, int tagsOffset, int tagsLength);
077
078  @Override
079  ExtendedCellBuilder setTags(List<Tag> tags);
080
081  /**
082   * Internal usage. Be careful before you use this while building a cell
083   * @param seqId set the seqId
084   * @return the current ExternalCellBuilder
085   */
086  ExtendedCellBuilder setSequenceId(final long seqId);
087}