Package java.util

Examples of java.util.Random.nextLong()


        return token;
    }

    public String getAdminCookie(){
        final Random r = new Random();
        final String token = Long.toString(Math.abs(r.nextLong()), 36);
        cookieUsers.put(token, "admin");
        return token;
    }
   
    public static String getLoginToken(final String cookies){
View Full Code Here


        for (int i = 0; i < tablefile.length; i++) {
            if ((tablefile[i].startsWith(prefix)) &&
                (tablefile[i].charAt(prefix.length()) == '.') &&
                (tablefile[i].length() == prefix.length() + 7)) {
                f = new File(path, tablefile[i]);
                String newname = tablefile[i] + "0100000" + (Long.toString(r.nextLong())+"00000").substring(1,5) + ".table";
                f.renameTo(new File(path, newname));
            }
        }
        // read new list again
        tablefile = path.list();
View Full Code Here

    }
  }
 
  private String createRandomString() {
    Random random = new Random(System.currentTimeMillis());
    long randomLong = random.nextLong();
    return Long.toHexString(randomLong);
  }

  /**
   * Returns the queryCount number for this cluster node.
View Full Code Here

    private long[] longArray(int count)
    {
        Random r = new Random(count);
        long[] result = new long[count];
        for (int i = 0; i < count; ++i) {
            long base = r.nextLong();
            int shift = (r.nextInt() % 56);
            result[i] = (base >> shift);
        }
        return result;
    }
View Full Code Here

            } else {
                Random rnd = new Random(9);
                int len = ARRAY_TEST_LENGTHS[i-1];
                data = new long[len];
                for (int ix = 0; ix < len; ++ix) {
                    data[ix] = rnd.nextLong();
                }
            }
            String contents;
            if (testAttr) {
                contents = getAttributeContent(writeLongArrayAttrDoc("root", "attr", data));
View Full Code Here

                data = new double[len];
                for (int ix = 0; ix < len; ++ix) {
                    // Need to scale: nextDouble is [0.0, 1.0[
                    double value = rnd.nextDouble();
                    if (rnd.nextBoolean()) {
                        value = (value * rnd.nextLong());
                    }
                    if (rnd.nextBoolean()) {
                        value = -value;
                    }
                    data[ix] = value;
View Full Code Here

      try{
        //Create User with LdapData
        Long userid;
        if (ldap_sync_passwd_to_om != null && ldap_sync_passwd_to_om.equals("no")){
          Random r = new Random();
          String token = Long.toString(Math.abs(r.nextLong()), 36);
          log.debug("Synching Ldap user to OM DB with RANDOM password: " + token);
          userid = createUserFromLdapData(userData, token, user, ldapAttrs);         
        }
        else{
          log.debug("Synching Ldap user to OM DB with password");
View Full Code Here

        repCacheDb.runWriteTransaction(new ISqlJetTransaction() {
            public Object run(SqlJetDb db) throws SqlJetException {
                final Random random = new Random();
                for (int i = 0; i < REPEATS_COUNT; i++) {
                    for (int y = 0; y < REPEATS_COUNT; y++) {
                        final String hash = String.valueOf(Math.abs(random.nextLong()));
                        ISqlJetCursor lookup = table.lookup(table.getPrimaryKeyIndexName(), hash);
                        if (!lookup.first()) {
                            logger.info(i + " " + hash);
                            table.insert(hash, i, i, i, i);
                            break;
View Full Code Here

            public Object run(SqlJetDb db) throws SqlJetException {
                final ISqlJetTable table = repCacheDb.getTable(REP_CACHE_TABLE);
                final Random random = new Random();
                for (int i = 0; i < REPEATS_COUNT; i++) {
                    for (int y = 0; y < REPEATS_COUNT; y++) {
                        final String hash = String.valueOf(Math.abs(random.nextLong()));
                        ISqlJetCursor lookup = table.lookup(table.getPrimaryKeyIndexName(), hash);
                        if (!lookup.first()) {
                            logger.info(i + " " + hash);
                            table.insert(hash, i, i, i, i);
                            break;
View Full Code Here

                db.createIndex("create index cd on t(c desc)");
                table = db.getTable("t");

                Random r = new Random();
                for (int i = 10; i > 0; i--) {
                    table.insert(null, i, r.nextLong());
                }

                db.createTable("create table t1(a integer, b integer, primary key (a,b))");
                table1 = db.getTable("t1");
                for (int i = 10; i > 0; 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.