Package me.prettyprint.cassandra.serializers

Examples of me.prettyprint.cassandra.serializers.StringSerializer


            String key = getrowID(path);
            if(key == null){
            return false;
            }
            String _cf = CassandraResourceProviderUtil.getColumnFamilySector(path);
            createColumnFamily(_cf, this.getKeyspace(), new StringSerializer());

            StringSerializer se = new StringSerializer();
            CqlQuery<String, String, String> cqlQuery = new CqlQuery<String, String, String>(keyspace, se, se, se);
            String query = "delete FROM " + _cf + " where KEY = '" + key + "';";
            cqlQuery.setQuery(query);
            QueryResult<CqlRows<String, String, String>> result = cqlQuery.execute();
        } catch (NoSuchAlgorithmException e) {
View Full Code Here


            String r = getrowID(path);
            if(r == null){
             return false;
            }
            String _cf = CassandraResourceProviderUtil.getColumnFamilySector(path);
            createColumnFamily(_cf, this.getKeyspace(), new StringSerializer());
            String metadata = map.get("metadata") == null? "resolutionPathInfo=json":(String)map.get("metadata");
            String resourceType =  map.get("resourceType") == null?"nt:cassandra":(String)map.get("resourceType");
            String resourceSuperType =  map.get("resourceSuperType") == null?"nt:superCassandra":(String) map.get("resourceSuperType");

            addData(this.getKeyspace(), _cf, new StringSerializer(),
                    new String[]{
                            "'" + r + "','" + path + "','" + resourceType + "','" + resourceSuperType + "','" + metadata + "'",
                    });
        } catch (NoSuchAlgorithmException e) {
            throw new PersistenceException(e.getMessage());
View Full Code Here

    }


    private void addACE(String path, String policy) throws Exception {
        String rid = getrowID(path);
        createColumnFamily(ACL_CF, provider.getKeyspace(), new StringSerializer());
        String getAllACEs = "select * from " + ACL_CF + " where KEY = '" + rid + "'";
        QueryResult<CqlRows<String, String, String>> results = CassandraResourceProviderUtil.executeQuery(getAllACEs, provider.getKeyspace(), new StringSerializer());
        if (CassandraResourceProviderUtil.recordExists(results, "policy")) {
            updateACL(rid, policy, new StringSerializer(), results);
        } else {
            addACL(rid, policy, new StringSerializer());
        }
    }
View Full Code Here

    private String[] getACL(String path) throws Exception {
        if(getCassandraSystemNodeACL(path) != null){
         return getCassandraSystemNodeACL(path);
        }
        String rid = getrowID(path);
        createColumnFamily(ACL_CF, provider.getKeyspace(), new StringSerializer());
        String getAllACEs = "select * from " + ACL_CF + " where KEY = '" + rid + "'";
        QueryResult<CqlRows<String, String, String>> results = CassandraResourceProviderUtil.executeQuery(getAllACEs, provider.getKeyspace(), new StringSerializer());
        String policy = null;
        for (Row<String, String, String> row : ((CqlRows<String, String, String>) results.get()).getList()) {
            for (HColumn column : row.getColumnSlice().getColumns()) {
                if ("policy".equalsIgnoreCase(column.getName().toString()) && column.getValue() != null) {
                    policy = column.getValue().toString();
View Full Code Here

        if (!oldACL.isEmpty()) {
            oldACL = oldACL + ";" + policy;
        }

        addACL(rid, oldACL, new StringSerializer());

    }
View Full Code Here

        return exists;
    }

    public static boolean isResourceExists(CassandraResourceProvider resourceProvider, Keyspace keyspace, String path) throws Exception {
        String cql = resourceProvider.getCassandraMapperMap().get(CassandraResourceProviderUtil.getColumnFamilySector(path)).getCQL(CassandraResourceProviderUtil.getColumnFamilySector(path), CassandraResourceProviderUtil.getRemainingPath(path));
        QueryResult<CqlRows<String, String, String>> result = CassandraResourceProviderUtil.executeQuery(cql, keyspace, new StringSerializer());
        return recordExists(result,"policy");
    }
View Full Code Here

    }


    public static QueryResult<CqlRows<String, String, String>> getAllNodes(Keyspace keyspace, String cf) throws Exception {
        String cql = "select * from " + cf;
        return CassandraResourceProviderUtil.executeQuery(cql, keyspace, new StringSerializer());
    }
View Full Code Here

        return hColumn == null ? null : hColumn.getValue();
    }

    public static String getAsStringValue( ColumnSlice<String, Long> columnSlice, String columnName )
    {
        StringSerializer ss = StringSerializer.get();
        if ( StringUtils.isEmpty( columnName ) )
        {
            return null;
        }

        HColumn<String, Long> hColumn = columnSlice.getColumnByName( columnName );
        return hColumn == null ? null : ss.fromByteBuffer( hColumn.getValueBytes() );
    }
View Full Code Here

            String key = new Namespace.KeyBuilder() //
                .withNamespace( namespaceId ) //
                .withRepositoryId( repositoryId ) //
                .build();

            HFactory.createMutator( cassandraArchivaManager.getKeyspace(), new StringSerializer() ) //
                .addDeletion( key, cassandraArchivaManager.getNamespaceFamilyName() ) //
                .execute();

            QueryResult<OrderedRows<String, String, String>> result = HFactory //
                .createRangeSlicesQuery( keyspace, ss, ss, ss ) //
View Full Code Here

      Serializer<K> keySerializer, Serializer<SN> superNameSerializer, Serializer<N> nameSerializer) {
    return new ThriftSubCountQuery<K,SN,N>(keyspace, keySerializer, superNameSerializer, nameSerializer);
  }

  public static ColumnQuery<String, String, String> createStringColumnQuery(Keyspace keyspace) {
    StringSerializer se = StringSerializer.get();
    return createColumnQuery(keyspace, se, se, se);
  }
View Full Code Here

TOP

Related Classes of me.prettyprint.cassandra.serializers.StringSerializer

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.