Package com.netflix.staash.json

Examples of com.netflix.staash.json.JsonObject


        StaashTestHelper.createTestTable(metasvc,tblpay);
        System.out.println("Done:");
  }
  @Test
  public void testTableWriteRead() {
    datasvc.writeRow(db, table, new JsonObject(insertPay1));
    datasvc.writeRow(db, table, new JsonObject(insertPay2));
        readRows();
  }
View Full Code Here


  @Test
  public void testTimeseriesWriteRead() {
    String payload1="{\"timestamp\":11000,\"event\":\"hi 11k event\",\"prefix\":\"source1\"}";
        String payload2="{\"timestamp\":21000,\"event\":\"hi 21k event\",\"prefix\":\"source1\"}";
        String payload3="{\"timestamp\":121000,\"event\":\"hi 121k event\",\"prefix\":\"source2\"}";
        StaashTestHelper.writeEvent(datasvc, new JsonObject(payload1));
        StaashTestHelper.writeEvent(datasvc, new JsonObject(payload2));
        StaashTestHelper.writeEvent(datasvc, new JsonObject(payload3));
        readTimeSeries();
  }
View Full Code Here

        } catch (StorageDoesNotExistException e) {
            e.printStackTrace();
        }
    }
    public static void createTestTimeSeries(MetaService metasvc, String tblpay) {
        JsonObject pload = new JsonObject(tblpay);
        pload.putString("db", db);
        try {
            metasvc.writeMetaEntity(EntityType.SERIES, pload.toString());
        } catch (StorageDoesNotExistException e) {
            e.printStackTrace();
        }
    }
View Full Code Here

   
    /*
     * Table Test
     */
    public static void createTestTable(MetaService metasvc, String tblpay) {
        JsonObject pload = new JsonObject(tblpay);
        pload.putString("db", db);
        try {
            metasvc.writeMetaEntity(EntityType.TABLE, pload.toString());
        } catch (StorageDoesNotExistException e) {
            e.printStackTrace();
        }
    }
View Full Code Here

            e.printStackTrace();
        }
       
        String tblpay = "{\"name\":\"unittbl2\",\"columns\":\"col1,col2,col3\",\"primarykey\":\"col1\",\"storage\":\"unit.mysql\"}";
        String db = "unitdb2";
        JsonObject pload = new JsonObject(tblpay);
        pload.putString("db", db);
        try {
            metasvc.writeMetaEntity(EntityType.TABLE, pload.toString());
        } catch (StorageDoesNotExistException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
View Full Code Here

            e.printStackTrace();
        }
       
        String tblpay = "{\"name\":\"tst2\",\"columns\":\"col1,col2,col3\",\"primarykey\":\"col1\",\"storage\":\"unit.cassandra\"}";
        String db = "unitdb2";
        JsonObject pload = new JsonObject(tblpay);
        pload.putString("db", db);
        try {
            metasvc.writeMetaEntity(EntityType.TABLE, pload.toString());
        } catch (StorageDoesNotExistException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
View Full Code Here

            e.printStackTrace();
        }
       
        String tblpay = "{\"name\":\"casstable1\",\"columns\":\"col1,col2,col3\",\"primarykey\":\"col1\",\"storage\":\"unit.cassandra\"}";
        String db = "unitcass";
        JsonObject pload = new JsonObject(tblpay);
        pload.putString("db", db);
        try {
            metasvc.writeMetaEntity(EntityType.TABLE, pload.toString());
        } catch (StorageDoesNotExistException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
       
        String insertPay = "{\"columns\":\"col1,col2,col3\",\"values\":\"'val1','val2','val3'\"}";
        datasvc.writeRow(db, "casstable1", new JsonObject(insertPay));
       
    }
View Full Code Here

            e.printStackTrace();
        }
       
        String tblpay = "{\"name\":\"my2\",\"columns\":\"col1,col2,col3\",\"primarykey\":\"col1\",\"storage\":\"unit.mysql\"}";
        String db = "unitdb3";
        JsonObject pload = new JsonObject(tblpay);
        pload.putString("db", db);
        try {
            metasvc.writeMetaEntity(EntityType.TABLE, pload.toString());
        } catch (StorageDoesNotExistException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
       
        String insertPay = "{\"columns\":\"col1,col2,col3\",\"values\":\"'val1','val2','val3'\"}";
        datasvc.writeRow(db, "my2", new JsonObject(insertPay));
       
    }
View Full Code Here

        e.printStackTrace();
    }
     
      String tblpay = "{\"name\":\"my2\",\"columns\":\"col1,col2,col3\",\"primarykey\":\"col1\",\"storage\":\"unit.mysqlremote\"}";
      String db = "unitdb3";
      JsonObject pload = new JsonObject(tblpay);
      pload.putString("db", db);
      try {
        metasvc.writeMetaEntity(EntityType.TABLE, pload.toString());
    } catch (StorageDoesNotExistException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
     
      String insertPay = "{\"columns\":\"col1,col2,col3\",\"values\":\"'val1','val2','val3'\"}";
      datasvc.writeRow(db, "my2", new JsonObject(insertPay));
     
  }
View Full Code Here

       
        String table1="cassjoin"+ new Random().nextInt(200);

        String tblpay = "{\"name\":\""+table1+"\",\"columns\":\"username,friends,wall,status\",\"primarykey\":\"username\",\"storage\":\"unit.remotecassandra\"}";
        String db = "jointest";
        JsonObject pload = new JsonObject(tblpay);
        pload.putString("db", db);
        try {
            metasvc.writeMetaEntity(EntityType.TABLE, pload.toString());
        } catch (StorageDoesNotExistException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        Print("table:"+(System.currentTimeMillis() - start));

       
        String insertPay = "{\"columns\":\"username,friends,wall,status\",\"values\":\"'federer','rafa#haas#tommy#sachin#beckham','getting ready for my next#out of wimbledon#out of french','looking fwd to my next match'\"}";
        datasvc.writeRow(db, table1, new JsonObject(insertPay));
        Print("insert cass:"+(System.currentTimeMillis() - start));

       
        String table2="mysqljoin" + new Random().nextInt(200);;
        tblpay = "{\"name\":\""+table2+"\",\"columns\":\"username,first,last,lastlogin,paid,address,email\",\"primarykey\":\"username\",\"storage\":\"unit.mysqlremote\"}";
         pload = new JsonObject(tblpay);
        pload.putString("db", db);
        try {
            metasvc.writeMetaEntity(EntityType.TABLE, pload.toString());
        } catch (StorageDoesNotExistException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
       
        Print("create mysql table:"+(System.currentTimeMillis() - start));

        insertPay = "{\"columns\":\"username,first,last,lastlogin,paid,address,email\",\"values\":\"'federer','Roger','Federer','july first','paid','1 swiss drive','RF@gmail.com'\"}";
        datasvc.writeRow(db, table2, new JsonObject(insertPay));
        Print("insert mysql row:"+(System.currentTimeMillis() - start));

        String str = datasvc.doJoin(db, table1, table2, "username", "rogerfederer");
        Print("Join:"+(System.currentTimeMillis() - start));
View Full Code Here

TOP

Related Classes of com.netflix.staash.json.JsonObject

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.