Examples of StringSerializer


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

Examples of me.prettyprint.cassandra.serializers.StringSerializer

            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

Examples of me.prettyprint.cassandra.serializers.StringSerializer

    }


    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

Examples of me.prettyprint.cassandra.serializers.StringSerializer

    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

Examples of me.prettyprint.cassandra.serializers.StringSerializer

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

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

    }
View Full Code Here

Examples of me.prettyprint.cassandra.serializers.StringSerializer

        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

Examples of me.prettyprint.cassandra.serializers.StringSerializer

    }


    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

Examples of org.apache.directory.mavibot.btree.serializer.StringSerializer

        {
            forwardKeySerializer = ( ElementSerializer<K> ) new ByteArraySerializer( ( Comparator<byte[]> ) comp );
        }
        else
        {
            forwardKeySerializer = ( ElementSerializer<K> ) new StringSerializer( ( Comparator<String> ) comp );
        }

        boolean forwardDups = true;

        String oid = attributeType.getOid();
View Full Code Here

Examples of org.apache.directory.mavibot.btree.serializer.StringSerializer

        MavibotParentIdAndRdnSerializer.setSchemaManager( schemaManager );
        MavibotParentIdAndRdnSerializer parentIdAndSerializer = new MavibotParentIdAndRdnSerializer();

        String forwardTableName = attributeType.getOid() + FORWARD_BTREE;
        forward = new MavibotTable<ParentIdAndRdn, String>( recordMan, schemaManager, forwardTableName,
            parentIdAndSerializer, new StringSerializer(), false );

        String reverseTableName = attributeType.getOid() + REVERSE_BTREE;
        reverse = new MavibotTable<String, ParentIdAndRdn>( recordMan, schemaManager, reverseTableName,
            new StringSerializer(), parentIdAndSerializer, false );
    }
View Full Code Here

Examples of org.apache.directory.mavibot.btree.serializer.StringSerializer

        {
            forwardKeySerializer = ( ElementSerializer<K> ) new ByteArraySerializer( ( Comparator<byte[]> ) comp );
        }
        else
        {
            forwardKeySerializer = ( ElementSerializer<K> ) new StringSerializer( ( Comparator<String> ) comp );
        }

        boolean forwardDups = true;

        String oid = attributeType.getOid();
        // disable duplicates for entryCSN and entryUUID attribute indices
        if ( oid.equals( SchemaConstants.ENTRY_CSN_AT_OID ) || oid.equals( SchemaConstants.ENTRY_UUID_AT_OID ) )
        {
            forwardDups = false;
        }

        String forwardTableName = attributeType.getOid() + FORWARD_BTREE;
        forward = new MavibotTable<K, String>( recordMan, schemaManager, forwardTableName, forwardKeySerializer,
            new StringSerializer(), forwardDups );

        /*
         * Now the reverse map stores the primary key into the master table as
         * the key and the values of attributes as the value.  If an attribute
         * is single valued according to its specification based on a schema
         * then duplicate keys should not be allowed within the reverse table.
         */
        if ( withReverse )
        {
            String reverseTableName = attributeType.getOid() + REVERSE_BTREE;
            reverse = new MavibotTable<String, K>( recordMan, schemaManager, reverseTableName, new StringSerializer(),
                forwardKeySerializer, !attributeType.isSingleValued() );
        }

        String path = new File( this.wkDirPath, attributeType.getOid() ).getAbsolutePath();
        // finally write a text file in the format <OID>-<attribute-name>.txt
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.