Package me.prettyprint.hector.api.beans

Examples of me.prettyprint.hector.api.beans.DynamicComposite


        return entryKey;
    }

    private void insertIndexColumn(K itemKey, long timestamp, List<Object> indexValues, Mutator<String> indexMutator) {
        LOGGER.debug("Indexing key {} with values {}...", itemKey, indexValues);
        DynamicComposite indexColumnName = CassidyUtils.toComposite(context.serializerRegistry(), indexValues);
        indexColumnName.addComponent(itemKey, keySerializer);
        indexColumnName.addComponent(timestamp, LONG_SERIALIZER);
        LOGGER.debug("Creating '{}' index column with name {} and value {}...", indexName, indexColumnName, itemKey);
        final HColumn<DynamicComposite, K> indexColumn = HFactory.createColumn(indexColumnName, itemKey, DYNAMIC_COMPOSITE_SERIALIZER, keySerializer);
        indexMutator.addInsertion(indexName, indexColumnFamily, indexColumn);
    }
View Full Code Here


        final HColumn<DynamicComposite, K> indexColumn = HFactory.createColumn(indexColumnName, itemKey, DYNAMIC_COMPOSITE_SERIALIZER, keySerializer);
        indexMutator.addInsertion(indexName, indexColumnFamily, indexColumn);
    }

    private void performCleanup(K key, Mutator<String> indexMutator, Mutator<DynamicComposite> entryMutator) {
        final DynamicComposite entryKey = entryKey(key);
        final List<HColumn<Long, DynamicComposite>> entries = getEntries(entryKey);
        for (HColumn<Long, DynamicComposite> entry : entries) {
            final Long entryTimestamp = entry.getName();

            DynamicComposite indexColumnName = new DynamicComposite();
            appendComponents(entry.getValue(), indexColumnName);
            indexColumnName.addComponent(key, keySerializer);
            indexColumnName.addComponent(entryTimestamp, LONG_SERIALIZER);

            indexMutator.addDeletion(indexName, indexColumnFamily, indexColumnName, DYNAMIC_COMPOSITE_SERIALIZER);
            entryMutator.addDeletion(entryKey, entryColumnFamily, entryTimestamp, LONG_SERIALIZER);
        }
    }
View Full Code Here

        }
    }

    @SuppressWarnings("unchecked")
    public static DynamicComposite toComposite(SerializerRegistry registry, Iterable<?> values) {
        DynamicComposite composite = new DynamicComposite();
        for (Object value : values) {
            if (value == null) {
                composite.addComponent(NULL_VALUE, NULL_SERIALIZER);
            } else {
                composite.addComponent(value, (Serializer<Object>) registry.getSerializer(value.getClass()));
            }
        }
        return composite;
    }
View Full Code Here

    @Override
    public List<HColumn<DynamicComposite, ?>> toColumns(V object) {
        List<AssemblyStep> steps = disassemblerService.disassemble(object);
        List<HColumn<DynamicComposite, ?>> columns = new ArrayList<>(steps.size());
        for (AssemblyStep step : steps) {
            final DynamicComposite name = new DynamicComposite(columns.size(), step.getClass().getName());
            final Object columnValue = step.getColumnValue();
            final HColumn<DynamicComposite, ?> column = createColumn(name, columnValue);
            columns.add(column);
        }
        return columns;
View Full Code Here

    @Override
    public List<HColumn<DynamicComposite, ?>> toColumns(V object) {
        List<AssemblyStep> steps = disassemblerService.disassemble(object);
        List<HColumn<DynamicComposite, ?>> columns = new ArrayList<HColumn<DynamicComposite, ?>>(steps.size());
        for (AssemblyStep step : steps) {
            final DynamicComposite name = new DynamicComposite(columns.size(), step.getClass().getName());
            ColumnValueDefinition<?> valueDefinition = step.toColumnDefinition();
            final HColumn<DynamicComposite, ?> column = createColumn(name, valueDefinition);
            LOGGER.debug("Adding column {} with value {}...", name, column.getValue());
            columns.add(column);
        }
View Full Code Here

TOP

Related Classes of me.prettyprint.hector.api.beans.DynamicComposite

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.