Package com.netflix.staash.rest.meta.entity

Examples of com.netflix.staash.rest.meta.entity.PaasTimeseriesEntity$Builder


            tableToStorageMap.put(tableEnt.getName(), storage);
            // List<String> primaryKeys = entity.getPrimaryKey();
        }
        if (entity instanceof PaasTimeseriesEntity) {
            // first create/check if schema db exists
            PaasTimeseriesEntity tableEnt = (PaasTimeseriesEntity) entity;
            try {
                String schemaName = tableEnt.getSchemaName();
                session.execute(String.format(
                        PaasUtils.CREATE_KEYSPACE_SIMPLE_FORMAT, schemaName, 1));
            } catch (AlreadyExistsException e) {
                // It's ok, ignore
            }
            // if schema/db already exists now create the table
            try {
                Thread.sleep(10);
            } catch (InterruptedException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            String query = BuildQuery(tableEnt);
            Print(query);
            session.execute(query);
            List<String> tables = dbToTimeseriesMap.get(tableEnt.getSchemaName());
            if (tables==null) tables = new ArrayList<String>();
            tables.add(tableEnt.getName().substring(tableEnt.getName().indexOf(".")+1));
            // List<String> primaryKeys = entity.getPrimaryKey();
        }
        JsonObject obj = new JsonObject("{\"status\":\"ok\"}");
        return obj.toString();
    }
View Full Code Here


                String rettbl =  meta.writeMetaEntity(pte);
                cache.addEntityToCache(EntityType.TABLE, pte);
                return rettbl;
            case SERIES:
                String tsschema = new JsonObject(payload).getString("db");
                PaasTimeseriesEntity ptse = PaasTimeseriesEntity.builder()
                        .withJsonPayLoad(new JsonObject(payload), tsschema)
                        .build();
                createDBTable(ptse.getPayLoad());
                String retseries =  meta.writeMetaEntity(ptse);
                cache.addEntityToCache(EntityType.SERIES, ptse);
                return retseries;
            }
        }
View Full Code Here

TOP

Related Classes of com.netflix.staash.rest.meta.entity.PaasTimeseriesEntity$Builder

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.