Examples of RowMutation


Examples of org.apache.cassandra.db.RowMutation

        Table table = Table.open("Keyspace1");
        ColumnFamilyStore cfs = table.getColumnFamilyStore("Standard1");

        ByteBuffer key = ByteBufferUtil.bytes("k");
        RowMutation rm = new RowMutation("Keyspace1", key);
        rm.add(new QueryPath("Standard1", null, ByteBufferUtil.bytes("c")), ByteBufferUtil.EMPTY_BYTE_BUFFER, 0);
        rm.apply();
        cfs.forceBlockingFlush();

        assertBytes(cfs, Integer.MAX_VALUE, true);
    }
View Full Code Here

Examples of org.apache.cassandra.db.RowMutation

        Table table = Table.open("Keyspace1");
        ColumnFamilyStore cfs = table.getColumnFamilyStore("Standard1");

        ByteBuffer key = ByteBufferUtil.bytes("k");
        RowMutation rm = new RowMutation("Keyspace1", key);
        rm.add(new QueryPath("Standard1", null, ByteBufferUtil.bytes("c")), ByteBufferUtil.EMPTY_BYTE_BUFFER, 0);
        rm.add(new QueryPath("Standard1", null, ByteBufferUtil.bytes("d")), ByteBufferUtil.EMPTY_BYTE_BUFFER, 0);
        rm.apply();
        cfs.forceBlockingFlush();

        assertBytes(cfs, Integer.MAX_VALUE, true);
    }
View Full Code Here

Examples of org.apache.cassandra.db.RowMutation

        Table table = Table.open("Keyspace1");
        ColumnFamilyStore cfs = table.getColumnFamilyStore("Standard1");

        ByteBuffer key = ByteBufferUtil.bytes("k");
        RowMutation rm = new RowMutation("Keyspace1", key);
        rm.add(new QueryPath("Standard1", null, ByteBufferUtil.bytes("c")), ByteBufferUtil.EMPTY_BYTE_BUFFER, 0);
        rm.apply();
        cfs.forceBlockingFlush();

        rm.apply();
        cfs.forceBlockingFlush();

        assertBytes(cfs, Integer.MAX_VALUE, true);
    }
View Full Code Here

Examples of org.apache.cassandra.db.RowMutation

        Table table = Table.open("Keyspace1");
        ColumnFamilyStore cfs = table.getColumnFamilyStore("Standard1");

        ByteBuffer key = ByteBufferUtil.bytes("k");
        RowMutation rm = new RowMutation("Keyspace1", key);
        rm.add(new QueryPath("Standard1", null, ByteBufferUtil.bytes("c")), ByteBufferUtil.EMPTY_BYTE_BUFFER, 0);
        rm.add(new QueryPath("Standard1", null, ByteBufferUtil.bytes("d")), ByteBufferUtil.EMPTY_BYTE_BUFFER, 0);
        rm.apply();
        cfs.forceBlockingFlush();

        rm.apply();
        cfs.forceBlockingFlush();

        assertBytes(cfs, Integer.MAX_VALUE, true);
    }
View Full Code Here

Examples of org.apache.cassandra.db.RowMutation

        final int ROWS_PER_SSTABLE = 10;
        for (int j = 0; j < (DatabaseDescriptor.getIndexInterval() * 3) / ROWS_PER_SSTABLE; j++) {
            for (int i = 0; i < ROWS_PER_SSTABLE; i++) {
                ByteBuffer key = ByteBufferUtil.bytes(String.valueOf(i % 2));
                RowMutation rm = new RowMutation("Keyspace1", key);
                rm.add(new QueryPath("Standard1", null, ByteBufferUtil.bytes(String.valueOf(i / 2))), ByteBufferUtil.EMPTY_BYTE_BUFFER, j * ROWS_PER_SSTABLE + i);
                rm.apply();
            }
            cfs.forceBlockingFlush();
        }

        assertBytes(cfs, Integer.MAX_VALUE, true);
View Full Code Here

Examples of org.apache.cassandra.db.RowMutation

        Table table = Table.open("Keyspace4");
        ColumnFamilyStore cfs = table.getColumnFamilyStore("Super5");

        ByteBuffer key = ByteBufferUtil.bytes("k");
        RowMutation rm = new RowMutation("Keyspace4", key);
        ByteBuffer scKey = ByteBuffer.wrap(UUIDGen.decompose(UUIDGen.makeType1UUIDFromHost(FBUtilities.getLocalAddress())));
        rm.add(new QueryPath("Super5", scKey , ByteBufferUtil.bytes("c")), ByteBufferUtil.EMPTY_BYTE_BUFFER, 0);
        rm.apply();
        cfs.forceBlockingFlush();

        rm.apply();
        cfs.forceBlockingFlush();

        assertBytes(cfs, Integer.MAX_VALUE, true);
    }
View Full Code Here

Examples of org.apache.cassandra.db.RowMutation

      String sTableName = DatabaseDescriptor.getTables().get(0);

        try
        {
          // do the insert first
            RowMutation rm = new RowMutation(sTableName, sKey);
            rm.add(sColumnFamily + ":" + sColumn, sDataToInsert.getBytes(), 0);
            rm.apply();

            fInsertSuccess = true;
          sRetVal = "columnfamily=" + httpRequest.getParameter("columnfamily") + " key=" + httpRequest.getParameter("key") + " data=" + httpRequest.getParameter("data");
        }
        catch (Exception e)
View Full Code Here

Examples of org.apache.cassandra.db.RowMutation

      // TODO : handle deletes
      Row diffRow = rowList.get(i).diff(retRow);
      if(diffRow == null) // no repair needs to happen
        continue;
      // create the row mutation message based on the diff and schedule a read repair
      RowMutation rowMutation = new RowMutation(table, key);                 
        Map<String, ColumnFamily> columnFamilies = diffRow.getColumnFamilyMap();
          Set<String> cfNames = columnFamilies.keySet();
         
          for ( String cfName : cfNames )
          {
              ColumnFamily cf = columnFamilies.get(cfName);
              rowMutation.add(cf);
          }
            RowMutationMessage rowMutationMessage = new RowMutationMessage(rowMutation);
          // schedule the read repair
          ReadRepairManager.instance().schedule(endPoints.get(i),rowMutationMessage);
    }
View Full Code Here

Examples of org.apache.cassandra.db.RowMutation

      while(true)
      {
        int key = random.nextInt(keys) + 1;
              String stringKey = new Integer(key).toString();
              stringKey = stringKey + keyFix_ ;
              RowMutation rm = new RowMutation(tablename_, stringKey);
              int j = random.nextInt(columns) + 1;
                random.nextBytes(bytes);
                rm.add( columnFamilyColumn_ + ":" + columnFix_ + j, bytes, ts);
                if ( ts == Integer.MAX_VALUE)
                {
                  ts = 0 ;
                }
                ts++;
View Full Code Here

Examples of org.apache.cassandra.db.RowMutation

      while(true)
      {
        int key = random.nextInt(keys) + 1;
              String stringKey = new Integer(key).toString();
              stringKey = stringKey + keyFix_ ;
              RowMutation rm = new RowMutation(tablename_, stringKey);
              int i = random.nextInt(superColumns) + 1;
              int j = random.nextInt(columns) + 1;
                random.nextBytes(bytes);
                rm.add( columnFamilySuperColumn_ + ":" + superColumnFix_ + i + ":" + columnFix_ + j, bytes, ts);
                if ( ts == Integer.MAX_VALUE )
                {
                  ts = 0 ;
                }
                ts++;
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.