Package com.netflix.astyanax

Examples of com.netflix.astyanax.MutationBatch.withRow()


    @Override
    public ResponseData put(Object key, Object colName, Object value) throws OperationException
    {
        MutationBatch m = AstyanaxConnection.instance.keyspace().prepareMutationBatch();
        if (isCounter)
            m.withRow(cfs, key).incrementCounterColumn(colName, (Long) value);
        else
            m.withRow(cfs, key).putColumn(colName, value, valueSerializer, null);
        try
        {
            OperationResult<Void> result = m.execute();
View Full Code Here


    {
        MutationBatch m = AstyanaxConnection.instance.keyspace().prepareMutationBatch();
        if (isCounter)
            m.withRow(cfs, key).incrementCounterColumn(colName, (Long) value);
        else
            m.withRow(cfs, key).putColumn(colName, value, valueSerializer, null);
        try
        {
            OperationResult<Void> result = m.execute();
            return new AstyanaxResponseData("", 0, result, key, colName, value);
        }
View Full Code Here

    @Override
    public ResponseData batchMutate(Object key, Map<?, ?> nv) throws OperationException
    {
        MutationBatch m = AstyanaxConnection.instance.keyspace().prepareMutationBatch();
        ColumnListMutation<Object> cf = m.withRow(cfs, key);
        for (Map.Entry<?, ?> entry : nv.entrySet())
        {
            if (isCounter)
                cf.incrementCounterColumn(entry.getKey(), (Long) entry.getValue());
            else
View Full Code Here

      long start = System.currentTimeMillis();
      ChunkedStorage.newWriter(indexStorage, key, new FileInputStream(compressedIndexFile))
          .withConcurrencyLevel(CONCURRENCY).call();
      byte[] json = jsonMapper.writeValueAsBytes(segment);
      MutationBatch mutation = this.keyspace.prepareMutationBatch();
      mutation.withRow(descriptorStorage, key)
        .putColumn("lastmodified", System.currentTimeMillis(), null)
        .putColumn("descriptor", json, null);       
      mutation.execute();
      log.info("Wrote index to C* in [%s] ms", System.currentTimeMillis() - start);
    } catch (Exception e)
View Full Code Here

        Keyspace ks = kscp.acquireKeyspace("meta");
        ks.prepareMutationBatch();
        MutationBatch m;
        OperationResult<Void> result;
        m = ks.prepareMutationBatch();
        m.withRow(dbcf, entity.getRowKey()).putColumn(entity.getName(), entity.getPayLoad(), null);
        try {
            result = m.execute();
            if (entity instanceof PaasTableEntity) {
                String schemaName = ((PaasTableEntity)entity).getSchemaName();
                Keyspace schemaks = kscp.acquireKeyspace(schemaName);
View Full Code Here

                IndexEntry previousEntry = null;
                for (Column<IndexEntry> column : row.getColumns()) {
                    IndexEntry entry = column.getName();
                    if (previousEntry != null && entry.id == previousEntry.id) {
                        if (mrow == null)
                            mrow = mb.withRow(indexCf, row.getKey());
                        mrow.deleteColumn(previousEntry);
                    }
                    ids.add(entry.id);
                }
            }
View Full Code Here

                IndexEntry previousEntry = null;
                for (Column<IndexEntry> column : row.getColumns()) {
                    IndexEntry entry = column.getName();
                    if (previousEntry != null && entry.id == previousEntry.id) {
                        if (mrow == null)
                            mrow = mb.withRow(indexCf, row.getKey());
                        mrow.deleteColumn(previousEntry);
                    }
                   
                    rowIds.add(entry.id);
                }
View Full Code Here

            for (Column<IndexEntry> column : row) {
                IndexEntry entry = column.getName();
                ColumnListMutation<IndexEntry> mrow = null;
                if (previousEntry != null && entry.id == previousEntry.id) {
                    if (mrow == null)
                        mrow = mb.withRow(indexCf, indexRowKey);
                    mrow.deleteColumn(previousEntry);
                }
                else {
                    ids.add(entry.id);
                }
View Full Code Here

    @Override
    public void tagId(String id, Map<String, String> tags) throws IndexerException  {
        MutationBatch mb = keyspace.prepareMutationBatch();
       
        ColumnListMutation<String> idRow = mb.withRow(dataCf, id);
        UUID uuid = TimeUUIDUtils.getUniqueTimeUUIDinMicros();
        for (Map.Entry<String, String> tag : tags.entrySet()) {
            String rowkey = tag.getKey() + "=" + tag.getValue();
            System.out.println("Rowkey: " + rowkey);
            mb.withRow(indexCf, tag.getKey() + "=" + tag.getValue())
View Full Code Here

        ColumnListMutation<String> idRow = mb.withRow(dataCf, id);
        UUID uuid = TimeUUIDUtils.getUniqueTimeUUIDinMicros();
        for (Map.Entry<String, String> tag : tags.entrySet()) {
            String rowkey = tag.getKey() + "=" + tag.getValue();
            System.out.println("Rowkey: " + rowkey);
            mb.withRow(indexCf, tag.getKey() + "=" + tag.getValue())
              .putEmptyColumn(new IndexEntry(id, uuid));
//            idRow.putColumn(tag.getKey(), tag.getValue());
        }
       
        try {
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.