Clears and fills {@code mBuckets} with buckets
8089
private List<Bucket<V>> refillBuckets() {
    List<Bucket<V>> bucketsToTrim = new ArrayList<>(mBuckets.size());

    for (int i = 0, len = mBuckets.size(); i < len; ++i) {
      final Bucket<V> oldBucket = mBuckets.valueAt(i);
      final int bucketSize = oldBucket.mItemSize;
      final int maxLength = oldBucket.mMaxLength;
      final int bucketInUseCount = oldBucket.getInUseCount();
      if (oldBucket.getFreeListSize() > 0) {
        bucketsToTrim.add(oldBucket);
      }
      mBuckets.setValueAt(
          i,
          new Bucket<V>(
              getSizeInBytes(bucketSize),
              maxLength,
              bucketInUseCount,
              mPoolParams.fixBucketsReinitialization));
    }

    return bucketsToTrim;
  }
1366723
protected void rehash (int ncount)
    {
        int[] obuckets = _buckets;
        createBuckets(ncount);

        for (int idx = 0, pos = 0; pos < _size; idx++) {
            int value = obuckets[idx];
            if (value != _sentinel) {
                readd(value);
                pos++;
            }
        }
    }
791469
private void fillOutputStream(OutputStream stream, int length)
			throws AsnException, IOException {
		byte[] dataBucket = new byte[DATA_BUCKET_SIZE];
		int readCount;

		while (length != 0) {
			int cnt = length < DATA_BUCKET_SIZE ? length : DATA_BUCKET_SIZE;
			readCount = read(dataBucket, 0, cnt);
			if (readCount < cnt)
				throw new AsnException("input stream has reached the end");
			stream.write(dataBucket, 0, readCount);
			length -= readCount;
		}
	}
245896
@Override
	public void clear(final Class<?> clas) {
		this.logger.debug("@clear:".concat(clas.getName()));
		getCachableMap(clas).clear();
	}
1059011
public void clear() {
		Mutator<K> mutator = HFactory.createMutator(this.keyspace, this.keySerializer, new BatchSizeHint(1, this.mutateInterval));

		SliceCounterQuery<K, N> query = HFactory.createCounterSliceQuery(this.keyspace, this.keySerializer, this.nameSerializer).
						setColumnFamily(this.cf).
						setKey(this.rowKey);

		SliceCounterIterator<K, N> iterator =
						new SliceCounterIterator<K, N>(query, null, (N) null, false, this.count);

		while(iterator.hasNext()) {
			HCounterColumn<N> column = iterator.next();
			mutator.incrementCounter(this.rowKey, this.cf, column.getName(), column.getValue() * -1);
		}

		mutator.execute();
	}
704396
public void clear() {
		modCount++;

		// this does not allocate more memory:
		//TODO possibly faster: create new empty bucket? -> test speeds create vs set-to-null
		for (int i = 0; i < bucketSize; i++) {
			bucket[i] = null;
		}

		bucketDepth = 0;
		size = 0;
	}
642271
@Override
	public void clearPartitions() {
		// clear the iterators, so the next call to next() will notice
		this.bucketIterator = null;
		this.probeIterator = null;

		for (int i = this.partitionsBeingBuilt.size() - 1; i >= 0; --i) {
			final BinaryHashPartition p = this.partitionsBeingBuilt.get(i);
			try {
				p.clearAllMemory(this.availableMemory);
			} catch (Exception e) {
				LOG.error("Error during partition cleanup.", e);
			}
		}
		this.partitionsBeingBuilt.clear();

		// clear the partitions that are still to be done (that have files on disk)
		for (final BinaryHashPartition p : this.partitionsPending) {
			p.clearAllMemory(this.availableMemory);
		}
	}
541534
static <T> void bucketSort(final List<? extends T> c, final Comparator<? super T> cmp) {
        if (N.isNullOrEmpty(c)) {
            return;
        }

        bucketSort(c, 0, c.size(), cmp);
    }
1205220
public void setBuckets(java.util.Collection<Bucket> buckets) {
        if (buckets == null) {
            this.buckets = null;
            return;
        }

        this.buckets = new com.amazonaws.internal.SdkInternalList<Bucket>(buckets);
    }
103302
function(T, SA, fs, n, k, isbwt) {
        var C, B, RA;
        var i, j, b, c, m, p, q, name, pidx = 0, newfs;
        var c0, c1;
        var flags = 0;

        // allocate temporary storage [CSA]
        if (k <= 256) {
            C = Util.makeS32Buffer(k);
            if (k <= fs) { B = SA.subarray(n + fs - k); flags = 1; }
            else { B = Util.makeS32Buffer(k); flags = 3; }
        } else if (k <= fs) {
            C = SA.subarray(n + fs - k);
            if (k <= (fs - k)) { B = SA.subarray(n + fs - k * 2); flags = 0; }
            else if (k <= 1024) { B = Util.makeS32Buffer(k); flags = 2; }
            else { B = C; flags = 8; }
        } else {
            C = B = Util.makeS32Buffer(k);
            flags = 4 | 8;
        }

        /* stage 1: reduce the problem by at least 1/2
           sort all the LMS-substrings */
        getCounts(T, C, n, k);
        getBuckets(C, B, k, true); /* find ends of buckets */
        for (i = 0; i < n; i++) { SA[i] = 0; }
        b = -1; i = n - 1; j = n; m = 0; c0 = T[n - 1];
        do { c1 = c0; } while ((--i >= 0) && ((c0 = T[i]) >= c1));
        for (; i >= 0 ;) {
            do { c1 = c0; } while ((--i >= 0) && ((c0 = T[i]) <= c1));
            if ( i >= 0 ) {
                if ( b >= 0 ) { SA[b] = j; }
                b = --B[c1];
                j = i;
                ++m;
                do { c1 = c0; } while ((--i >= 0) && ((c0 = T[i]) >= c1));
            }
        }

        if (m > 1) {
            LMSsort(T, SA, C, B, n, k);
            name = LMSpostproc(T, SA, n, m);
        } else if (m === 1) {
            SA[b] = j + 1;
            name = 1;
        } else {
            name = 0;
        }

        /* stage 2: solve the reduced problem
           recurse if names are not yet unique */
        if(name < m) {
            if((flags & 4) !== 0) { C = null; B = null; }
            if((flags & 2) !== 0) { B = null; }
            newfs = (n + fs) - (m * 2);
            if((flags & (1 | 4 | 8)) === 0) {
                if((k + name) <= newfs) { newfs -= k; }
                else { flags |= 8; }
            }
            ASSERT( (n >>> 1) <= (newfs + m) );
            for (i = m + (n >>> 1) - 1, j = m * 2 + newfs - 1; m <= i; i--) {
                if(SA[i] !== 0) { SA[j--] = SA[i] - 1; }
            }
            RA = SA.subarray(m + newfs);
            SA_IS(RA, SA, newfs, m, name, false);
            RA = null;

            i = n - 1; j = m * 2 - 1; c0 = T[n - 1];
            do { c1 = c0; } while ((--i >= 0) && ((c0 = T[i]) >= c1));
            for (; i >= 0 ;) {
                do { c1 = c0; } while ((--i >= 0) && ((c0 = T[i]) <= c1));
                if ( i >= 0 ) {
                    SA[j--] = i + 1;
                    do { c1 = c0; } while ((--i >= 0) && ((c0 = T[i]) >= c1));
                }
            }

            for (i = 0; i < m; i++) { SA[i] = SA[m + SA[i]]; }
            if((flags & 4) !== 0) { C = B = Util.makeS32Buffer(k); }
            if((flags & 2) !== 0) { B = Util.makeS32Buffer(k); }
        }

        /* stage 3: induce the result for the original problem */
        if((flags & 8) !== 0) { getCounts(T, C, n, k); }
        /* put all left-most S characters into their buckets */
        if (m > 1) {
            getBuckets(C, B, k, true); /* find ends of buckets */
            i = m - 1; j = n; p = SA[m - 1]; c1 = T[p];
            do {
                q = B[c0 = c1];
                while (q < j) { SA[--j] = 0; }
                do {
                    SA[--j] = p;
                    if(--i < 0) { break; }
                    p = SA[i];
                } while((c1 = T[p]) === c0);
            } while (i >= 0 );
            while ( j > 0 ) { SA[--j] = 0; }
        }
        if (!isbwt) { induceSA(T, SA, C, B, n, k); }
        else { pidx = computeBWT(T, SA, C, B, n, k); }
        C = null; B = null;
        return pidx;
    }
59482
public void setBucket(Bucket<Data> bucket) throws BucketContainerException, InterruptedException {
        buckets[bucket.getBucketId()] = bucket;
    }
948743
private void reset() {
		for (DietzfelbingerHash hashfunction : this.hashfunctions) {
			hashfunction.nextHashFunction();
		}

		int sizeTables = 1 << this.hashSize;
		for (List<Entry<T>> table : this.tables) {
			table.clear();
			for (int j = 0; j < sizeTables; j++) {
				table.add(null);
			}
		}

		this.stash.clear();
		this.stashSize = 0;

		for (Entry<T> entry : this.elements) {
			fileElement(entry, false);
		}
	}
1319478
@Override
    public synchronized void clear() {
        File[] files = mRootDirectory.listFiles();
        if (files != null) {
            for (File file : files) {
                file.delete();
            }
        }
        mEntries.clear();
        mTotalSize = 0;
        //todo add queue markers
        //JusLog.d("Cache cleared.");
    }
72294
@Override
    public void clear() {
        if (mSize != 0) {
            freeArrays(mHashes, mArray, mSize);
            mHashes = ContainerHelpers.EMPTY_INTS;
            mArray = ContainerHelpers.EMPTY_OBJECTS;
            mSize = 0;
        }
    }
309338
synchronized private void clearCachedStructures() {
        mapsInitialized = false;
        packageMap = new HashMap();
        classSource = new HashMap();
        unqNameTable = null;
        nameSpaceChanged();
    }
1219147
protected final Buckets createBuckets(Stopwatch stopwatch, long min, long max, int bucketNb) {
		Buckets buckets = bucketsType.createBuckets(stopwatch, min, max, bucketNb);
		buckets.setLogTemplate(createLogTemplate(stopwatch));
		return buckets;
	}
111980
@Override
	public void clearChildren() {
		super.clearChildren();
		for (CuckooHashing<List<ClusteringTreeNode>> bucket : this.buckets) {
			bucket.clear();
		}
	}