Examples of resize()


Examples of org.apache.hadoop.zebra.io.KeyDistribution.resize()

      // should never happen.
      SortedTableSplit split = new SortedTableSplit(null, null, null, conf);
      return new InputSplit[] { split };
    }
   
    keyDistri.resize(lastBd);
   
    RawComparable[] keys = keyDistri.getKeys();
    for (int i = 0; i <= keys.length; ++i) {
      RawComparable begin = (i == 0) ? null : keys[i - 1];
      RawComparable end = (i == keys.length) ? null : keys[i];
View Full Code Here

Examples of org.apache.hadoop.zebra.io.KeyDistribution.resize()

    if (keyDistri == null) {
      // should never happen.
       return splits;
    }

    keyDistri.resize(lastBd);

    RawComparable[] keys = keyDistri.getKeys();
    for (int i = 0; i <= keys.length; ++i) {
      RawComparable begin = (i == 0) ? null : keys[i - 1];
      RawComparable end = (i == keys.length) ? null : keys[i];
View Full Code Here

Examples of org.apache.hadoop.zebra.io.KeyDistribution.resize()

    KeyDistribution keyDistri = reader.getKeyDistribution(numSplits * 10, 1, lastBd);
    Assert.assertEquals(totalBytes, keyDistri.length()+lastBd.getLength());
    reader.close();
    BytesWritable[] keys = null;
    if (keyDistri.size() >= numSplits) {
      keyDistri.resize(lastBd);
      Assert.assertEquals(totalBytes, keyDistri.length()+lastBd.getLength());
      RawComparable[] rawComparables = keyDistri.getKeys();
      keys = new BytesWritable[rawComparables.length];
      for (int i = 0; i < keys.length; ++i) {
        keys[i] = new BytesWritable();
View Full Code Here

Examples of org.apache.hadoop.zebra.io.KeyDistribution.resize()

    KeyDistribution keyDistri = reader.getKeyDistribution(numSplits * 10);
    Assert.assertEquals(totalBytes, keyDistri.length());
    reader.close();
    BytesWritable[] keys = null;
    if (keyDistri.size() >= numSplits) {
      keyDistri.resize(numSplits);
      Assert.assertEquals(totalBytes, keyDistri.length());
      RawComparable[] rawComparables = keyDistri.getKeys();
      keys = new BytesWritable[rawComparables.length];
      for (int i = 0; i < keys.length; ++i) {
        keys[i] = new BytesWritable();
View Full Code Here

Examples of org.apache.hadoop.zebra.io.KeyDistribution.resize()

    KeyDistribution keyDistri = reader.getKeyDistribution(numSplits * 10);
    Assert.assertEquals(totalBytes, keyDistri.length());
    reader.close();
    BytesWritable[] keys = null;
    if (keyDistri.size() >= numSplits) {
      keyDistri.resize(numSplits);
      Assert.assertEquals(totalBytes, keyDistri.length());
      RawComparable[] rawComparables = keyDistri.getKeys();
      keys = new BytesWritable[rawComparables.length];
      for (int i = 0; i < keys.length; ++i) {
        keys[i] = new BytesWritable();
View Full Code Here

Examples of org.apache.hadoop.zebra.io.KeyDistribution.resize()

    KeyDistribution keyDistri = reader.getKeyDistribution(numSplits * 10);
    Assert.assertEquals(totalBytes, keyDistri.length());
    reader.close();
    BytesWritable[] keys = null;
    if (keyDistri.size() >= numSplits) {
      keyDistri.resize(numSplits);
      Assert.assertEquals(totalBytes, keyDistri.length());
      RawComparable[] rawComparables = keyDistri.getKeys();
      keys = new BytesWritable[rawComparables.length];
      for (int i = 0; i < keys.length; ++i) {
        keys[i] = new BytesWritable();
View Full Code Here

Examples of org.apache.log4j.helpers.BoundedFIFO.resize()

        BoundedFIFO bf = new BoundedFIFO(size);
        for(int f = 0; f < i; f++) {
          bf.put(e[f]);
        }

        bf.resize(n);
        int expectedSize = min(n, min(i, size));
        assertEquals(bf.length(), expectedSize);
        for(int c = 0; c < expectedSize; c++) {
          assertEquals(bf.get(), e[c]);
        }
View Full Code Here

Examples of org.apache.log4j.helpers.BoundedFIFO.resize()

    }

    // x = the number of elems in
    int x = bf.length();

    bf.resize(n);

    int expectedSize = min(n, x);
    assertEquals(bf.length(), expectedSize);

    for(int c = 0; c < expectedSize; c++) {
View Full Code Here

Examples of org.apache.log4j.helpers.CyclicBuffer.resize()

    //         +numberOfAdds+", newSize="+newSize);
    CyclicBuffer cb = new CyclicBuffer(initialSize);
    for(int i = 0; i < numberOfAdds; i++) {
      cb.add(e[i]);
    }   
    cb.resize(newSize);

    int offset = numberOfAdds - initialSize;
    if(offset< 0)
      offset = 0;
View Full Code Here

Examples of org.apache.lucene.util.packed.PagedMutable.resize()

            while ((point = iter.next()) != null) {
                final long ord = builder.currentOrdinal();
                if (lat.size() <= ord) {
                    final long newSize = BigArrays.overSize(ord + 1);
                    lat = lat.resize(newSize);
                    lon = lon.resize(newSize);
                }
                lat.set(ord, encoding.encodeCoordinate(point.getLat()));
                lon.set(ord, encoding.encodeCoordinate(point.getLon()));
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.