Examples of compare()


Examples of org.apache.fop.layoutmgr.Keep.compare()

        LinkedList returnList = new LinkedList();
        while ((step = getNextStep(elementLists, start, end, partialHeights)) > 0) {

            if (end[0] + 1 == elementLists[0].size()) {
                keepWithNextActive = keepWithNextActive.compare(keepWithNextPendingOnLabel);
            }
            if (end[1] + 1 == elementLists[1].size()) {
                keepWithNextActive = keepWithNextActive.compare(keepWithNextPendingOnBody);
            }
View Full Code Here

Examples of org.apache.hadoop.cli.util.ComparatorBase.compare()

      try {
      // Initialize the comparator class and run its compare method
        comparatorClass = Class.forName("org.apache.hadoop.cli.util." +
          comparatorType);
        ComparatorBase comp = (ComparatorBase) comparatorClass.newInstance();
        compareOutput = comp.compare(CommandExecutor.getLastCommandOutput(),
          compdata.getExpectedOutput());
      } catch (Exception e) {
        LOG.info("Error in instantiating the comparator" + e);
      }
    }
View Full Code Here

Examples of org.apache.hadoop.hbase.KeyValue.KVComparator.compare()

    // Root compares
    long now = System.currentTimeMillis();
    KeyValue a = new KeyValue(Bytes.toBytes(".META.,,99999999999999"), now);
    KeyValue b = new KeyValue(Bytes.toBytes(".META.,,1"), now);
    KVComparator c = new KeyValue.RootComparator();
    assertTrue(c.compare(b, a) < 0);
    KeyValue aa = new KeyValue(Bytes.toBytes(".META.,,1"), now);
    KeyValue bb = new KeyValue(Bytes.toBytes(".META.,,1"),
        Bytes.toBytes("info:regioninfo"), 1235943454602L);
    assertTrue(c.compare(aa, bb) < 0);
   
View Full Code Here

Examples of org.apache.hadoop.hbase.KeyValue.KeyComparator.compare()

    //verify that faked shorter rowkey could be generated
    long ts = 5;
    KeyValue kv1 = new KeyValue(Bytes.toBytes("the quick brown fox"), family, qualA, ts, Type.Put);
    KeyValue kv2 = new KeyValue(Bytes.toBytes("the who test text"), family, qualA, ts, Type.Put);
    byte[] newKey = keyComparator.getShortMidpointKey(kv1.getKey(), kv2.getKey());
    assertTrue(keyComparator.compare(kv1.getKey(), newKey) < 0);
    assertTrue(keyComparator.compare(newKey, kv2.getKey()) < 0);
    short newRowLength = Bytes.toShort(newKey, 0);
    byte[] expectedArray = Bytes.toBytes("the r");
    Bytes.equals(newKey, KeyValue.ROW_LENGTH_SIZE, newRowLength, expectedArray, 0,
      expectedArray.length);
View Full Code Here

Examples of org.apache.hadoop.hbase.KeyValue.MetaComparator.compare()

    // meta keys values are not quite right.  A users can enter illegal values
    // from shell when scanning meta.
    KeyValue a = new KeyValue(Bytes.toBytes("table,a1"), now);
    KeyValue b = new KeyValue(Bytes.toBytes("table,a2"), now);
    try {
      c.compare(a, b);
    } catch (IllegalArgumentException iae) {
      assertEquals(".META. key must have two ',' delimiters and have the following" +
          " format: '<table>,<key>,<etc>'", iae.getMessage());
      return;
    }
View Full Code Here

Examples of org.apache.hadoop.hbase.master.CatalogJanitor.SplitParentFirstComparator.compare()

    assertTrue(comp.compare(firstRegiona, firstRegiona) == 0);
    assertTrue(comp.compare(firstRegionb, firstRegionb) == 0);
    assertTrue(comp.compare(rootRegion, firstRegiona) < 0);
    assertTrue(comp.compare(rootRegion, firstRegionb) < 0);
    assertTrue(comp.compare(firstRegion, firstRegiona) < 0);
    assertTrue(comp.compare(firstRegion, firstRegionb) < 0);
    assertTrue(comp.compare(firstRegiona, firstRegionb) < 0);

    assertTrue(comp.compare(lastRegiona, lastRegiona) == 0);
    assertTrue(comp.compare(lastRegionb, lastRegionb) == 0);
    assertTrue(comp.compare(rootRegion, lastRegiona) < 0);
View Full Code Here

Examples of org.apache.hadoop.hbase.util.Bytes.ByteArrayComparator.compare()

                // For all the stores in this column family.
                for (FileStatus storeFile : storeFiles) {
                  HFile.Reader reader = HFile.createReader(fs, storeFile.getPath(), new CacheConfig(
                      getConf()));
                  if ((reader.getFirstKey() != null)
                      && ((storeFirstKey == null) || (comparator.compare(storeFirstKey,
                          reader.getFirstKey()) > 0))) {
                    storeFirstKey = reader.getFirstKey();
                  }
                  if ((reader.getLastKey() != null)
                      && ((storeLastKey == null) || (comparator.compare(storeLastKey,
View Full Code Here

Examples of org.apache.hadoop.io.BytesWritable.Comparator.compare()

      IOUtils.cleanup(LOG, fis);
    }

    // Compare with the request
    Comparator comparator = new Comparator();
    if (comparator.compare(readbuffer, 0, readCount, data, 0, count) != 0) {
      LOG.info("Perfect overwrite has different content");
      response = new WRITE3Response(Nfs3Status.NFS3ERR_INVAL, wccData, 0,
          stableHow, Nfs3Constant.WRITE_COMMIT_VERF);
    } else {
      LOG.info("Perfect overwrite has same content,"
View Full Code Here

Examples of org.apache.hadoop.io.RawComparator.compare()

        //custom comparator for OBJECT
        int length1 = WritableComparator.readVInt(b1, o.offset1);
        int length2 = WritableComparator.readVInt(b2, o.offset2);
        o.offset1 += WritableUtils.decodeVIntSize(b1[o.offset1]);
        o.offset2 += WritableUtils.decodeVIntSize(b2[o.offset2]);
        int comparison = comparator.compare(b1, o.offset1, length1, b2,
            o.offset2, length2);
        o.offset1 += length1;
        o.offset2 += length2;
        if(comparison != 0) {
          return (sort == Order.ASC) ? comparison : -comparison;
View Full Code Here

Examples of org.apache.hadoop.io.WritableComparator.compare()

      int highpos = -1;
      ArrayList<ComposableRecordReader<K, ?>> list = new ArrayList<ComposableRecordReader<K, ?>>(
          kids.length);
      q.peek().key(iterkey);
      final WritableComparator cmp = getComparator();
      while (0 == cmp.compare(q.peek().key(), iterkey)) {
        ComposableRecordReader<K, ?> t = q.poll();
        if (-1 == highpos || list.get(highpos).id() < t.id()) {
          highpos = list.size();
        }
        list.add(t);
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.