Package org.apache.flink.types

Examples of org.apache.flink.types.IntValue


   
    // wee need to do the final aggregation manually in the test, because the
    // combiner is not guaranteed to do that
    final HashMap<IntValue, IntValue> aggMap = new HashMap<IntValue, IntValue>();
    for (Record record : this.outList) {
      IntValue key = new IntValue();
      IntValue value = new IntValue();
      key = record.getField(0, key);
      value = record.getField(1, value);
      IntValue prevVal = aggMap.get(key);
      if (prevVal != null) {
        aggMap.put(key, new IntValue(prevVal.getValue() + value.getValue()));
      }
      else {
        aggMap.put(key, value);
      }
    }
View Full Code Here


   
    // wee need to do the final aggregation manually in the test, because the
    // combiner is not guaranteed to do that
    final HashMap<IntValue, IntValue> aggMap = new HashMap<IntValue, IntValue>();
    for (Record record : this.outList) {
      IntValue key = new IntValue();
      IntValue value = new IntValue();
      key = record.getField(0, key);
      value = record.getField(1, value);
      IntValue prevVal = aggMap.get(key);
      if (prevVal != null) {
        aggMap.put(key, new IntValue(prevVal.getValue() + value.getValue()));
      }
      else {
        aggMap.put(key, value);
      }
    }
View Full Code Here

    this.memman = new DefaultMemoryManager(MEMORY_CAPACITY, 1);
   
    // create test objects
    this.objects = new ArrayList<Record>(20000);
    for (int i = 0; i < NUM_VALUES; ++i) {
      this.objects.add(new Record(new IntValue(i)));
    }
   
    // create the reader
    this.reader = new MutableObjectIteratorWrapper(this.objects.iterator());
  }
View Full Code Here

    // create test objects
    final ArrayList<Record> objects = new ArrayList<Record>(NUM_TESTRECORDS);

    for (int i = 0; i < NUM_TESTRECORDS; ++i) {
      Record tmp = new Record(new IntValue(i));
      objects.add(tmp);
    }
    this.reader = new MutableObjectIteratorWrapper(objects.iterator());
  }
View Full Code Here

    // create test objects
    ArrayList<IntValue> objects = new ArrayList<IntValue>(NUM_TESTRECORDS);

    for (int i = 0; i < NUM_TESTRECORDS; ++i) {
      IntValue tmp = new IntValue(i);
      objects.add(tmp);
    }
    this.reader = objects.iterator();
  }
View Full Code Here

      SpillingResettableIterator<IntValue> iterator = new SpillingResettableIterator<IntValue>(
          this.reader, this.serializer, this.memman, this.ioman, 2, this.memOwner);
      // open the iterator
      iterator.open();
 
      IntValue record;
      int cnt = 0;
      while (cnt < NUM_TESTRECORDS) {
        record = iterator.next();
        Assert.assertTrue("Record was not read from iterator", record != null);
        cnt++;
View Full Code Here

    this.memman = new DefaultMemoryManager(MEMORY_CAPACITY, 1);
   
    // create test objects
    this.objects = new ArrayList<Record>(20000);
    for (int i = 0; i < NUM_VALUES; ++i) {
      this.objects.add(new Record(new IntValue(i)));
    }
   
    // create the reader
    this.reader = objects.iterator();
  }
View Full Code Here

    int numChans = 100;
    int numRecs = 50000;
    int[] hit = new int[numChans];

    for (int i = 0; i < numRecs; i++) {
      IntValue k = new IntValue(i);
      Record rec = new Record(k);
     
      delegate.setInstance(rec);
     
      int[] chans = oe1.selectChannels(delegate, hit.length);
View Full Code Here

    int numRecords = 50000;
   
    int[] hit = new int[numChannels];

    for (int i = 0; i < numRecords; i++) {
      IntValue k = new IntValue(i);
      Record rec = new Record(k);
      delegate.setInstance(rec);
     
      int[] chans = oe1.selectChannels(delegate, hit.length);
      for(int j=0; j < chans.length; j++) {
View Full Code Here

    int numRecords = 50000;
   
    int[] hit = new int[numChannels];

    for (int i = 0; i < numRecords; i++) {
      IntValue k = new IntValue(i);
      Record rec = new Record(k);
      delegate.setInstance(rec);
     
      int[] chans = oe1.selectChannels(delegate, hit.length);
      for(int j=0; j < chans.length; j++) {
View Full Code Here

TOP

Related Classes of org.apache.flink.types.IntValue

Copyright © 2018 www.massapicom. 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.