define a tumbling count window

@param size count size
184789
public BaseWindowedBolt<T> countWindow(long size) {
        ensurePositiveTime(size);

        setSizeAndSlide(size, DEFAULT_SLIDE);
        this.windowAssigner = TumblingCountWindows.create(size);
        return this;
    }
1226924
private void setBufferSize(int size) {

        this.amountToBuffer = size;
        this.bbSize = (49152 < size) ? 32768 : 8192;
        int numBuffers = (size / this.bbSize);
        if (0 == size || 0 != (size % this.bbSize)) {
            numBuffers++;
        }
        this._output = new WsByteBuffer[numBuffers];
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "setBufferSize=[" + size + "]; " + this);
        }
    }
1111554
public void count(final Stat name, final int count) {
        Integer value = counters.get(name);
        value = value == null ? count : value + count;
        counters.put(name, value);
    }
187717
public void setCount(Integer count) {
        if (count == null)
            throw new RuntimeException("Cannot set count to null. Call removeCount() if you wanted to remove the bubble");

        if (countElem == null)
            createAndAttachCountElement();
        countElem.setInnerText(count.toString());
    }
918051
public void ensureCapacity(int size) {
    if (size > elements.length) {
      reallocate(Math.max(size, 2 * elements.length));
    }
  }
866436
public org.grails.datastore.mapping.query.api.Criteria sizeEq(String propertyName, int size) {
        if (!validateSimpleExpression()) {
            throwRuntimeException(new IllegalArgumentException("Call to [sizeEq] with propertyName [" +
                    propertyName + "] and size [" + size + "] not allowed here."));
        }

        propertyName = calculatePropertyName(propertyName);
        addToCriteria(Restrictions.sizeEq(propertyName, size));
        return this;
    }
1158275
public
  void prepareCache(int size){
   if (tc.isEntryEnabled())
      tc.entry(this,cclass, "prepareCache", "size: " + size);

    int oldSize = (cacheTag == null) ? 0 : cacheTag.length;

    if (size <= oldSize) {
      // If the cache is big enough, make sure we are not out of counters
      if (generation == Integer.MAX_VALUE) {
        generation = 1;
        for (int i = 0; i < size; i++)
          cacheTag[i] = 0;
      } else generation++;

    if (tc.isEntryEnabled())
	  tc.exit(this,cclass, "prepareCache");

      return;
    }

    // Allocate fresh

    cacheTag = new int[2*size];
    cacheValue = new Object[2*size];

    // Reset generation since all cache fields are null.
    generation = 1;

    if (tc.isEntryEnabled())
	  tc.exit(this,cclass, "prepareCache");
  }
277453
public BaseWindowedBolt<T> sessionEventTimeWindow(Time size) {
        long s = size.toMilliseconds();
        ensurePositiveTime(s);

        setSizeAndSlide(s, DEFAULT_SLIDE);
        this.windowAssigner = EventTimeSessionWindows.withGap(s);
        return this;
    }
1369626
public WindowedStream<T, KEY, GlobalWindow> countWindow(long size, long slide) {
		return window(GlobalWindows.create())
				.evictor(CountEvictor.of(size))
				.trigger(CountTrigger.of(slide));
	}
352275
public void setBufferSize(int size)
    {
        HttpOutputStream out = (HttpOutputStream)_httpResponse.getOutputStream();
        if (out.isWritten()  || _writer!=null && _writer.isWritten())
            throw new IllegalStateException("Output written");
        out.setBufferSize(size);
    }
866768
public function setChunkSize($size)
    {
        if(static::MODE == 'cli' && is_numeric($size))
        {
            $this->chunkSize = (int)$size;
        }
        elseif(static::MODE == 'web')
        {
            throw new Exception('Chunk size is not supported on web mode');
        }
        else
        {
            throw new Exception("$size is not a valid chunk size");
        }

        return $this;
    }
610751
public void recordPutTimeAndSize(long timeNS, long valueSize, long keySize) {
        recordTime(Tracked.PUT, timeNS, 0, valueSize, keySize, 0);
    }
1156145
public void setTCPBufferSize(final int size) throws ClientException {
        logger.debug("Changing local TCP buffer setting to " + size);

        gSession.TCPBufferSize = size;

        SocketOperator op = new SocketOperator() {
                public void operate(SocketBox s) throws Exception {

                    // synchronize to prevent race condition against
                    // the socket initialization code that also sets
                    // TCP buffer (GridFTPActiveConnectTask)
                    synchronized (s) {
                        logger.debug(
                                     "Changing local socket's TCP buffer to " + size);
                        Socket mySocket = s.getSocket();
                        if (mySocket != null) {
                            mySocket.setReceiveBufferSize(size);
                            mySocket.setSendBufferSize(size);
                        } else {
                            logger.debug(
                                         "the socket is null. probably being initialized");
                        }
                    }
                }
        };
        try {
            socketPool.applyToAll(op);
        } catch (Exception e) {
            ClientException ce =
                new ClientException(ClientException.SOCKET_OP_FAILED);
            ce.setRootCause(e);
            throw ce;
        }
    }
500522
public void setLength(long size) throws IOException, RepositoryException
   {
      if (!changed)
      {
         internalData = createEditableCopy(this.getInternalData());
      }

      ((EditableValueData)internalData).setLength(size);
      invalidateStream();
   }
650397
private void checkWrite(int size) {
    // If the buffer does not have enough bytes remaining, attempt to discard some of the read bytes.
    // It is possible that the buffer could discard 0 bytes, so we ensure the buffer is writable after
    // discarding some read bytes, and if not discard all read bytes.
    if (buffer.writerIndex() + size > buffer.maxCapacity()) {
      buffer.discardSomeReadBytes();
      if (buffer.writerIndex() + size > buffer.maxCapacity()) {
        buffer.discardReadBytes();
      }
    }
  }
597845
public final void setBorderWidth(int unit,
                                     int size) {
        if (size < 0) {
            throw new IllegalArgumentException("Border width cannot be less than zero.");
        }

        int scaledSize = (int) TypedValue.applyDimension(unit, size, getResources().getDisplayMetrics());
        setBorderInternal(scaledSize, mBorderColor, true);
    }
166253
private void setSizeRatio(double size) {
        double width = widthHeightRatio * size;
        double height = size / widthHeightRatio;
        if (width <= size) {
            setSize(width, size);
        } else if (height <= size) {
            setSize(size, height);
        } else {
            setSize(size, size);
        }
    }