puts `si` into the currently open chunk, which it creates if
        necessary.  If this item causes the chunk to cross chunk_max,
        then the chunk closed after adding.
175058
def add(self, si):
        '''

        '''
        if self.o_chunk is None:
            if os.path.exists(self.t_path):
                os.remove(self.t_path)
            self.o_chunk = streamcorpus.Chunk(self.t_path, mode='wb')
        self.o_chunk.add(si)
        logger.debug('added %d-th item to chunk', len(self.o_chunk))
        if len(self.o_chunk) == self.chunk_max:
            self.close()
479673
public void putChunkedMessageWrapper(long wrapperId, ChunkedMessageWrapper wrapper)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "putChunkedMessageWrapper", new Object[] { Long.valueOf(wrapperId), wrapper });
        inProgressMessages.put(Long.valueOf(wrapperId), wrapper);
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "putChunkedMessageWrapper");
    }
1193009
public void put(Object o)
        throws InterruptedException
    {
        synchronized(lock)
        {
            while (size==maxSize)
                lock.wait();

            elements[tail]=o;
            if(++tail==maxSize)
                tail=0;
            size++;
            lock.notify();
        }
    }
322882
synchronized void addChunks(List<SegmentChunk> segmentChunks) {
        Preconditions.checkState(!this.sealed, "Cannot add SegmentChunks for a Sealed Handle.");
        long expectedOffset = 0;
        if (this.segmentChunks.size() > 0) {
            expectedOffset = this.segmentChunks.get(this.segmentChunks.size() - 1).getLastOffset();
        } else if (segmentChunks.size() > 0) {
            expectedOffset = segmentChunks.get(0).getStartOffset();
        }

        for (SegmentChunk s : segmentChunks) {
            Preconditions.checkArgument(s.getStartOffset() == expectedOffset,
                    "Invalid SegmentChunk StartOffset. Expected %s, given %s.", expectedOffset, s.getStartOffset());
            expectedOffset += s.getLength();
        }

        this.segmentChunks.addAll(segmentChunks);
        this.activeChunkHandle = null;
    }
1261611
def append(self, item):
        
        with self.lock:
            with self._closeable_cursor() as cursor:
                cursor.execute('''INSERT INTO list (list_index, value) VALUES ((SELECT MAX(list_index) FROM list) + 1, ?)''', (self._coder(item), ) )
            self._do_write()
975444
private byte[] requestChunk(int requestedSize)
	{
		mPosInChunk = 0;
		if (mCurrentChunkIndex++ < mChunkList.size() - 1)
		{
			// there is one more unused buffer in the list, return it
			return mCurrentChunk = mChunkList.get(mCurrentChunkIndex);
		}

		mChunkList.add(mCurrentChunk = new byte[Math.max(requestedSize, mMinChunkSize)]);
		return mCurrentChunk;
	}
202601
void append(String s) throws IOException {
    if (closed) throw new IllegalStateException("closed");

    if (nextFlush != null) {
      int nextNewline = s.indexOf('\n');

      // If s doesn't cause the current line to cross the limit, buffer it and return. We'll decide
      // whether or not we have to wrap it later.
      if (nextNewline == -1 && column + s.length() <= columnLimit) {
        buffer.append(s);
        column += s.length();
        return;
      }

      // Wrap if appending s would overflow the current line.
      boolean wrap = nextNewline == -1 || column + nextNewline > columnLimit;
      flush(wrap ? FlushType.WRAP : nextFlush);
    }

    out.append(s);
    int lastNewline = s.lastIndexOf('\n');
    column = lastNewline != -1
        ? s.length() - lastNewline - 1
        : column + s.length();
  }
444368
public function close()
    {
        if ($this->isClosed) {
            // TODO: Should this be an error condition? e.g. BadMethodCallException
            return;
        }

        if (strlen($this->buffer) > 0) {
            $this->insertChunkFromBuffer();
        }

        $this->fileCollectionInsert();
        $this->isClosed = true;
    }
325975
void add0(PoolChunk<T> chunk) {
        chunk.parent = this;
        if (head == null) {
            head = chunk;
            chunk.prev = null;
            chunk.next = null;
        } else {
            chunk.prev = null;
            chunk.next = head;
            head.prev = chunk;
            head = chunk;
        }
    }
1171335
protected void setClosed()
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setClosed");
      closed = true;
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setClosed");
   }
389624
def insert(self, index, value):
        
        def insert_trans(pipe):
            len_self = self.__len__(pipe)
            if (self.maxlen is not None) and (len_self >= self.maxlen):
                raise IndexError

            if index == 0:
                self._insert_left(value, pipe)
            else:
                self._insert_middle(index, value, pipe=pipe)

        self._transaction(insert_trans)
587053
public Chunk new_close() {
    Chunk chk = compress();
    if(_vec instanceof AppendableVec)
      ((AppendableVec)_vec).closeChunk(this);
    return chk;
  }
433960
function put(item, force) {
				if (!callback) {
						if (max >= 0 && q.length >= max && !force) return false;
						q.push(item);
					} else {
						var cb = callback;
						callback = null;
						exports.setImmediate(function () {
							cb(err, item);
						});
					}
				return true;
			}
925950
def insert_value(self, agg, value, idx, name=''):
        
        if not isinstance(idx, (tuple, list)):
            idx = [idx]
        instr = instructions.InsertValue(self.block, agg, value, idx, name=name)
        self._insert(instr)
        return instr
834896
def _useChunk(self, index) -> None:
        

        if self.currentChunk is not None:
            if self.currentChunkIndex == index and \
                    not self.currentChunk.closed:
                return
            self.currentChunk.close()

        self.currentChunk = self._openChunk(index)
        self.currentChunkIndex = index
        self.itemNum = self.currentChunk.numKeys + 1
1327897
private void updateLargestChunkSoFarSize(@NotNull ByteBuffer outBuffer) {
        int sizeOfThisChunk = (int) (outBuffer.limit() - limitOfLast);
        if (largestChunkSoFar < sizeOfThisChunk)
            largestChunkSoFar = sizeOfThisChunk;

        limitOfLast = outBuffer.limit();
    }
16262
private Deferred<Object> addPointInternal(final long timestamp,
      final byte[] value, final short flags) throws IllegalDataException {
    final boolean ms_timestamp = (timestamp & Const.SECOND_MASK) != 0;

    // we only accept unix epoch timestamps in seconds or milliseconds
    if (timestamp < 0 || (ms_timestamp && timestamp > 9999999999999L)) {
      throw new IllegalArgumentException((timestamp < 0 ? "negative " : "bad")
          + " timestamp=" + timestamp
          + " when trying to add value=" + Arrays.toString(value) + " to " + this);
    }

    // always maintain lastTimestamp in milliseconds
    if ((ms_timestamp ? timestamp : timestamp * 1000) <= last_timestamp) {
      throw new IllegalArgumentException("New timestamp=" + timestamp
          + " is less than or equal to previous=" + last_timestamp
          + " when trying to add value=" + Arrays.toString(value)
          + " to " + this);
    }
    last_timestamp = (ms_timestamp ? timestamp : timestamp * 1000);

    long incomingBaseTime;
    if (ms_timestamp) {
      // drop the ms timestamp to seconds to calculate the base timestamp
      incomingBaseTime = 
          ((timestamp / 1000) - ((timestamp / 1000) % Const.MAX_TIMESPAN));
    }
    else {
      incomingBaseTime = (timestamp - (timestamp % Const.MAX_TIMESPAN));
    }

    /**
     * First time we add a point initialize the rows timestamp.
     */
    if (base_time == Long.MIN_VALUE) {
      base_time = incomingBaseTime;
      Bytes.setInt(row_key, (int) base_time, 
          tsdb.metrics.width() + Const.SALT_WIDTH());
    }

    if (incomingBaseTime - base_time >= Const.MAX_TIMESPAN) {
      throw new IllegalDataException(
          "The timestamp is beyond the boundary of this batch of data points");
    }
    if (incomingBaseTime < base_time) {
      throw new IllegalDataException(
          "The timestamp is prior to the boundary of this batch of data points");
    }

    // Java is so stupid with its auto-promotion of int to float.
    final byte[] new_qualifier = Internal.buildQualifier(timestamp, flags);

    // compact this data point with the previously compacted data points.
    append(new_qualifier, value);
    size++;

    /**
     * Satisfies the interface.
     */
    return Deferred.fromResult((Object) null);
  }