Package java.util

Examples of java.util.Random.nextLong()


            testCompare(-1, i);
            testCompare(1, i);
        }
        Random rand = new Random();
        for (int i = 0; i < 200000; i++) {
            long value = rand.nextLong();
            int scale = rand.nextInt(40) - 20;
            testCompare(value, scale);
        }
    }
View Full Code Here


    @Before
    public void fillRandoms() {
        Random random = new Random();
        for (int i = 0; i < TOTAL_RECORDS; i++) {
            for (int j = 0; j < NUM_ENTRIES_PER_RECORD; j++) {
                RANDOM_LONGS[i][j] = random.nextLong();
                RANDOM_DOUBLES[i][j] = random.nextDouble() * 1e10;
            }
            RANDOM_LONGS[i][0] = Long.MIN_VALUE;
            RANDOM_LONGS[i][1] = Long.MAX_VALUE;
            RANDOM_LONGS[i][2] = 0;
View Full Code Here

            final ServerTracer serverTracer =
                Brave.getServerTracer(mockSpanCollector, Arrays.<TraceFilter>asList(new FixedSampleRateTraceFilter(1)));

            final Random random = new Random();

            final String serverSpanName = "server span name " + random.nextLong();
            serverTracer.setStateCurrentTrace(random.nextLong(), random.nextLong(), random.nextLong(), serverSpanName);

            serverTracer.setServerReceived();

            final long startDate = System.currentTimeMillis();
View Full Code Here

                Brave.getServerTracer(mockSpanCollector, Arrays.<TraceFilter>asList(new FixedSampleRateTraceFilter(1)));

            final Random random = new Random();

            final String serverSpanName = "server span name " + random.nextLong();
            serverTracer.setStateCurrentTrace(random.nextLong(), random.nextLong(), random.nextLong(), serverSpanName);

            serverTracer.setServerReceived();

            final long startDate = System.currentTimeMillis();
            serverTracer.submitAnnotation("custom annotation", startDate, startDate + 1000);
View Full Code Here

                Brave.getServerTracer(mockSpanCollector, Arrays.<TraceFilter>asList(new FixedSampleRateTraceFilter(1)));

            final Random random = new Random();

            final String serverSpanName = "server span name " + random.nextLong();
            serverTracer.setStateCurrentTrace(random.nextLong(), random.nextLong(), random.nextLong(), serverSpanName);

            serverTracer.setServerReceived();

            final long startDate = System.currentTimeMillis();
            serverTracer.submitAnnotation("custom annotation", startDate, startDate + 1000);
View Full Code Here

                Brave.getServerTracer(mockSpanCollector, Arrays.<TraceFilter>asList(new FixedSampleRateTraceFilter(1)));

            final Random random = new Random();

            final String serverSpanName = "server span name " + random.nextLong();
            serverTracer.setStateCurrentTrace(random.nextLong(), random.nextLong(), random.nextLong(), serverSpanName);

            serverTracer.setServerReceived();

            final long startDate = System.currentTimeMillis();
            serverTracer.submitAnnotation("custom annotation", startDate, startDate + 1000);
View Full Code Here

            serverTracer.submitAnnotation("custom annotation", startDate, startDate + 1000);

            // Simulate client.
            final ClientTracer clientTracer =
                Brave.getClientTracer(mockSpanCollector, Arrays.<TraceFilter>asList(new FixedSampleRateTraceFilter(1)));
            final String clientSpanName = "client span name " + random.nextLong();
            clientTracer.startNewSpan(clientSpanName);
            clientTracer.setClientSent();
            clientTracer.setClientReceived();

            serverTracer.setServerSend();
View Full Code Here

    int minInt=0, maxInt=0;
    String y;
    String minStr = null, maxStr = null;
    for(int i=0; i < 21000; ++i) {
      x = r1.nextInt();
      y = Long.toHexString(r2.nextLong());
      if (i == 0 || x < minInt) {
        minInt = x;
      }
      if (i == 0 || x > maxInt) {
        maxInt = x;
View Full Code Here

      assertEquals(true, rows1.hasNext());
      assertEquals(true, rows2.hasNext());
      row1 = (OrcLazyStruct) rows1.next(row1);
      row2 = (OrcLazyStruct) rows2.next(row2);
      assertEquals(r1.nextInt(), ((IntWritable) ((OrcLazyInt) ((OrcStruct) row1.materialize()).getFieldValue(0)).materialize()).get());
      assertEquals(Long.toHexString(r2.nextLong()),
          ((OrcLazyString) ((OrcStruct) row2.materialize()).getFieldValue(1)).materialize().toString());
    }
    assertEquals(false, rows1.hasNext());
    assertEquals(false, rows2.hasNext());
    rows1.close();
View Full Code Here

    String[] words = inputs.words;
    for(int i=0; i < words.length; ++i) {
      words[i] = Integer.toHexString(rand.nextInt());
    }
    for(int i=0; i < count/2; ++i) {
      intValues[2*i] = rand.nextLong();
      intValues[2*i+1] = rand.nextLong();
      stringValues[2*i] = words[rand.nextInt(words.length)];
      stringValues[2*i+1] = words[rand.nextInt(words.length)];
    }
    for(int i=0; i < count; ++i) {
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.