Examples of LongValue


Examples of com.caucho.quercus.env.LongValue

    try {

      int size = _preparedMapping.size();

      for (int i = 0; i < size; i++) {
        LongValue param = _preparedMapping.get(i);

        Value paramV = getParam(param.toInt()-1);

        if (paramV.equals(UnsetValue.UNSET)) {
          env.warning(L.l("Not all parameters are bound"));
          return false;
        }
View Full Code Here

Examples of eu.stratosphere.types.LongValue

  private Random random;

  @Override
  public void open(Configuration parameters) {
    record = new Record();
    vertexID = new LongValue();
    partialRank = new DoubleValue();

    workerIndex = getRuntimeContext().getIndexOfThisSubtask();
    currentIteration = getIterationRuntimeContext().getSuperstepNumber();
    failingIteration = ConfigUtils.asInteger("compensation.failingIteration", parameters);
View Full Code Here

Examples of net.openhft.lang.values.LongValue

                .entrySize(24)
                .generatedKeyType(true)
                .generatedValueType(true).file(file).kClass(LongValue.class).vClass(LongValue.class).create();

        // add keys
        LongValue key = DataValueClasses.newInstance(LongValue.class);
        LongValue value = DataValueClasses.newInstance(LongValue.class);
        for (long i = 0; i < KEYS; i++) {
            key.setValue(i);
            value.setValue(0);
            countersMap.put(key, value);
        }
        System.out.println("Keys created");
//        Monitor monitor = new Monitor();
        LongValue value2 = DataValueClasses.newDirectReference(LongValue.class);
        for (int t = 0; t < 5; t++) {
            for (int rate : new int[]{2 * 1000 * 1000, 1000 * 1000, 500 * 1000/*, 250 * 1000, 100 * 1000, 50 * 1000*/}) {
                Histogram times = new Histogram();
                int u = 0;
                long start = System.nanoTime();
                long delay = 1000 * 1000 * 1000L / rate;
                long next = start + delay;
                for (long j = 0; j < RUN_TIME * rate; j += KEYS) {
                    int stride = Math.max(1, KEYS / (RUN_TIME * rate));
                    // the timed part
                    for (int i = 0; i < KEYS && u < RUN_TIME * rate; i += stride) {
                        // busy wait for next time.
                        while (System.nanoTime() < next - 12) ;
//                        monitor.sample = System.nanoTime();
                        long start0 = next;

                        // start the update.
                        key.setValue(i);
                        LongValue using = countersMap.getUsing(key, value2);
                        if (using == null)
                            assertNotNull(using);
                        value2.addAtomicValue(1);

                        // calculate the time using the time it should have started, not when it was able.
View Full Code Here

Examples of net.openhft.lang.values.LongValue

    }

    public void testAcquireAndGet(SharedHashMap<CharSequence, LongValue> map, int entries)
            throws IOException, ClassNotFoundException, IllegalAccessException,
            InstantiationException {
        LongValue value = new LongValue$$Native();
        LongValue value2 = new LongValue$$Native();
        LongValue value3 = new LongValue$$Native();

        for (int j = 1; j <= 3; j++) {
            for (int i = 0; i < entries; i++) {
                CharSequence userCS = getUserCharSequence(i);

                if (j > 1) {
                    assertNotNull(map.getUsing(userCS, value));
                } else {
                    map.acquireUsing(userCS, value);
                }
                assertEquals(j - 1, value.getValue());

                value.addAtomicValue(1);

                assertEquals(value2, map.acquireUsing(userCS, value2));
                assertEquals(j, value2.getValue());

                assertEquals(value3, map.getUsing(userCS, value3));
                assertEquals(j, value3.getValue());
            }
        }

        map.close();
    }
View Full Code Here

Examples of net.openhft.lang.values.LongValue

        }

        @Override
        public void run() {
            try {
                LongValue value = new LongValue$$Native();
                barrier.await();
                for (int i = 0; i < iterations; i++) {
                    map.acquireUsing(key, value);
                    value.addAtomicValue(1);
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
View Full Code Here

Examples of net.openhft.lang.values.LongValue$$Native

    }

    @Test
    public void testAcquireWithNullContainer() throws Exception {
        SharedHashMap<CharSequence, LongValue> map = getSharedMap(10 * 1000, 128, 24);
        map.acquireUsing("key", new LongValue$$Native());
        assertEquals(0, map.acquireUsing("key", null).getValue());

        map.close();
    }
View Full Code Here

Examples of net.sf.jsqlparser.expression.LongValue

        default:
          jj_la1[113] = jj_gen;
          ;
        }
        token = jj_consume_token(S_INTEGER);
                                                                                                               retval = new LongValue(tmp+token.image);
      } else if (jj_2_29(2)) {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case 94:
        case 95:
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
View Full Code Here

Examples of net.sf.jsqlparser.expression.LongValue

 
  protected ObjectExpression processExpression(Expression e,JSONObject item) throws JSONException{
    ObjectExpression oe = new ObjectExpression();
    Object columnObj = invokeMethod(e, "getLeftExpression");
    if(columnObj instanceof LongValue){
      LongValue longValue = (LongValue)columnObj;
      oe.setColumnname(longValue.getStringValue());
    }else{
      Column column = (Column)invokeMethod(e, "getLeftExpression");   
      oe.setColumnname(column.getColumnName());
    }
    if (e instanceof BinaryExpression) {
View Full Code Here

Examples of net.sf.jsqlparser.expression.LongValue

    Select select = (Select) CCJSqlParserUtil.parse("select a from mytable");
    SelectUtils.addExpression(select, new Column("b"));
    assertEquals("SELECT a, b FROM mytable", select.toString());
   
    Addition add = new Addition();
    add.setLeftExpression(new LongValue(5));
    add.setRightExpression(new LongValue(6));
    SelectUtils.addExpression(select, add);
   
    assertEquals("SELECT a, b, 5 + 6 FROM mytable", select.toString());
  }
View Full Code Here

Examples of org.apache.flink.types.LongValue

  private Random random;

  @Override
  public void open(Configuration parameters) {
    record = new Record();
    vertexID = new LongValue();
    partialRank = new DoubleValue();

    workerIndex = getRuntimeContext().getIndexOfThisSubtask();
    currentIteration = getIterationRuntimeContext().getSuperstepNumber();
    failingIteration = ConfigUtils.asInteger("compensation.failingIteration", parameters);
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.