Package java.util

Examples of java.util.Random.nextLong()


      {
        queue.offer(new Node(random.nextLong()));
      }
      for (int j = 0; j < 10; j++)
      {
        queue.offer(queue.asArray()[random.nextInt(1000)], random.nextLong());
      }
     
      while (queue.getSize() != 0)
      {
        long min = queue.poll().getValue();
View Full Code Here


        configuration.add(SymbolConstants.MIN_GZIP_SIZE, "100");

        Random random = new Random(System.currentTimeMillis());

        configuration.add(SymbolConstants.APPLICATION_VERSION, Long.toHexString(random.nextLong()));

        configuration.add(SymbolConstants.OMIT_GENERATOR_META, "false");
        configuration.add(SymbolConstants.GZIP_COMPRESSION_ENABLED, "true");

        configuration.add(SymbolConstants.SECURE_ENABLED, SymbolConstants.PRODUCTION_MODE_VALUE);
View Full Code Here

    int size = 100;
    SequenceIDBuffer buffer = new SequenceIDBuffer(size);
    Assert.assertEquals(size, buffer.size());
    Random random = new Random();
    for (int i = 0; i < 100; i++) {
      buffer.put(i, Math.abs(random.nextLong()));
    }

    buffer.sort();

    long last = Long.MIN_VALUE;
View Full Code Here

          final long ts = rand.nextInt();
          final byte[] qual = Bytes.toBytes("col" + iCol);
          if (rand.nextBoolean()) {
            final byte[] value = Bytes.toBytes("value_for_row_" + iRow +
                "_cf_" + Bytes.toStringBinary(cf) + "_col_" + iCol + "_ts_" +
                ts + "_random_" + rand.nextLong());
            put.add(cf, qual, ts, value);
          } else if (rand.nextDouble() < 0.8) {
            del.deleteColumn(cf, qual, ts);
          } else {
            del.deleteColumns(cf, qual, ts);
View Full Code Here

      }
      if (0 < i && randomizer.nextFloat() < CHANCE_TO_REPEAT) {
        timestamp = keyValues.get(
            randomizer.nextInt(keyValues.size())).getTimestamp();
      } else {
        timestamp = randomizer.nextLong();
      }

      keyValues.add(new KeyValue(row, family, qualifier, timestamp, value));
    }
View Full Code Here

    DataOutputStream dataOutputStream = new DataOutputStream(dos);
    for (KeyValue kv : keyValues) {
      totalSize += kv.getLength();
      dataOutputStream.write(kv.getBuffer(), kv.getOffset(), kv.getLength());
      if (includesMemstoreTS) {
        long memstoreTS = randomizer.nextLong();
        WritableUtils.writeVLong(dataOutputStream, memstoreTS);
        totalSize += WritableUtils.getVIntSize(memstoreTS);
      }
    }
View Full Code Here

    public void testBytes() throws Exception {
        final int count = 250;
        final int LENGTH_MASK = 0xffff;

        Random r = newRandom();
        final long seed = r.nextLong();
        Random gen = new Random(seed);
        int totalLength = 0;
        int duration;
        Date end;
View Full Code Here

    public void testDelete() throws Exception {
        final int count = 250;
        final int LENGTH_MASK = 0xffff;

        Random r = newRandom();
        final long seed = r.nextLong();
        Random gen = new Random(seed);
        int totalLength = 0;
        int duration;
        Date end;
View Full Code Here

    public void testArrays() throws Exception {
        final int count = 250;
        final int LENGTH_MASK = 0xffff;

        Random r = newRandom();
        final long seed = r.nextLong();
        Random gen = new Random(seed);
        int totalLength = 0;
        int duration;
        Date end;
View Full Code Here

    try {

      // increase number of iterations for more complete testing
      for (int i=0; i<1000; i++) {
        int level = rnd.nextInt(3);
        q1 = randBoolQuery(new Random(rnd.nextLong()), rnd.nextBoolean(), level, field, vals, null);
       
        // Can't sort by relevance since floating point numbers may not quite
        // match up.
        Sort sort = Sort.INDEXORDER;
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.