Examples of Mutation


Examples of com.google.collide.dto.Mutation

   * Handles ADD, RENAME, DELETE, or COPY messages.
   */
  private void handleFileTreeMutation(WorkspaceTreeUpdateBroadcast treeUpdate) {
    JsonArray<Mutation> mutations = treeUpdate.getMutations();
    for (int i = 0, n = mutations.size(); i < n; i++) {
      Mutation mutation = mutations.get(i);
      switch (mutation.getMutationType()) {
        case ADD:
          handleExternalAdd(
              mutation.getNewPath(), mutation.getNewNodeInfo(), treeUpdate.getNewTreeVersion());
          break;
        case DELETE:
          handleExternalDelete(treeUpdate.getMutations(), treeUpdate.getNewTreeVersion());
          break;
        case MOVE:
          handleExternalMove(mutation.getOldPath(), mutation.getNewPath(), treeUpdate.getNewTreeVersion());
          break;
        case COPY:
          handleExternalCopy(mutation.getNewPath(), mutation.getNewNodeInfo(), treeUpdate.getNewTreeVersion());
          break;
        default:
          assert (false) : "We got some kind of malformed workspace tree mutation!";
          break;
      }
View Full Code Here

Examples of com.sleepycat.persist.evolve.Mutation

         * for arrays.
         */
        String newName;
        if (oldFormat.isArray()) {
            if (deleter != null || converter != null || renamer != null) {
                Mutation mutation = (deleter != null) ? deleter :
                    ((converter != null) ? converter : renamer);
                addInvalidMutation
                    (oldFormat, null, mutation,
                     "Mutations not allowed for an array");
                return false;
View Full Code Here

Examples of jfun.yan.Mutation

    final Component r = super.eval();
    if(echo){
      final String msg = (String)this.getNutEnvironment().findService("echo_msg");
      if(msg == null)
        throw raise("echo_msg not found.");
      return r.mutate(new Mutation(){
        public void mutate(Object r){
          System.out.println(msg + r +" constructed.");
        }
      });
    }
View Full Code Here

Examples of org.apache.accumulo.core.data.Mutation

    public void addData() {
        try {
            Connector conn = mockInstance.getConnector("user1", "password");
            BatchWriter writer = conn.createBatchWriter
                    (PEOPLE_TABLE, MAX_MEMORY, MAX_LATENCY, MAX_WRITE_THREADS);
            Mutation m1 = new Mutation("row1");
            m1.put(INFO_CF, NAME, new Value("brian".getBytes()));
            m1.put(INFO_CF, AGE, new Value(ByteBuffer.wrap(new byte[4]).putInt(30).array()));
            m1.put(INFO_CF, SIBLINGS, new Value(ByteBuffer.wrap(new byte[4]).putInt(3).array()));
            m1.put(INFO_CF, LIFETIME_MILLS, new Value(ByteBuffer.wrap(new byte[8]).putLong(12345l).array()));
            m1.put(INFO_CF, GPA, new Value(ByteBuffer.wrap(new byte[8]).putDouble(3.7d).array()));
            m1.put(INFO_CF, HEIGHT, new Value("6ft".getBytes()));
            m1.put(EVENTS_CF, EVENT1, new Value("".getBytes()));
            m1.put(EVENTS_CF, EVENT2, new Value("".getBytes()));

            Mutation m2 = new Mutation("row2");
            m2.put(INFO_CF, NAME, new Value("adam".getBytes()));
            m2.put(INFO_CF, AGE, new Value(ByteBuffer.wrap(new byte[4]).putInt(29).array()));
            m2.put(INFO_CF, SIBLINGS, new Value(ByteBuffer.wrap(new byte[4]).putInt(6).array()));
            m2.put(INFO_CF, LIFETIME_MILLS, new Value(ByteBuffer.wrap(new byte[8]).putLong(6789l).array()));
            m2.put(INFO_CF, GPA, new Value(ByteBuffer.wrap(new byte[8]).putDouble(3.2d).array()));
            m2.put(INFO_CF, HEIGHT, new Value("5ft7inch".getBytes()));
            m2.put(EVENTS_CF, EVENT1, new Value("".getBytes()));

            writer.addMutation(m1);
            writer.addMutation(m2);
            writer.close();
View Full Code Here

Examples of org.apache.accumulo.core.data.Mutation

    public void addData() {
        try {
            Connector conn = mockInstance.getConnector("user1", "password");
            BatchWriter writer = conn.createBatchWriter
                    (PEOPLE_TABLE, MAX_MEMORY, MAX_LATENCY, MAX_WRITE_THREADS);
            Mutation m1 = new Mutation("row1");
            m1.put(INFO_CF, NAME, new Value("brian".getBytes()));
            m1.put(INFO_CF, AGE, new Value("30".getBytes()));
            m1.put(INFO_CF, HEIGHT, new Value("6ft".getBytes()));
            m1.put(EVENTS_CF, EVENT1, new Value("".getBytes()));
            m1.put(EVENTS_CF, EVENT2, new Value("".getBytes()));

            Mutation m2 = new Mutation("row2");
            m2.put(INFO_CF, NAME, new Value("adam".getBytes()));
            m2.put(INFO_CF, AGE, new Value("29".getBytes()));
            m2.put(INFO_CF, HEIGHT, new Value("5ft7inch".getBytes()));
            m2.put(EVENTS_CF, EVENT1, new Value("".getBytes()));

            writer.addMutation(m1);
            writer.addMutation(m2);
            writer.close();
View Full Code Here

Examples of org.apache.accumulo.core.data.Mutation

     */
    public static <C> DBItemTransformer<Mutation, C> primativeCellValueToBytes() {
        return new DBItemTransformer<Mutation, C>() {
            public List<Mutation> apply(CellGroup<C> group) throws CellExtractorException {
                String rowId = group.getTag();
                Mutation m1 = new Mutation(rowId);
                List<Mutation> mutations = Lists.newArrayList();
                for (C cell : group.getInternalList()) {
                    String colFam = CellReflector.getColFam(cell);
                    String label = CellReflector.getLabelAsString(cell);
                    byte[] value = CellReflector.getValueBytesIfPrimative(cell);
                    m1.put(new Text(colFam), new Text(label), new Value(value));
                }
                mutations.add(m1);
                return mutations;
            }
        };
View Full Code Here

Examples of org.apache.accumulo.core.data.Mutation

    public static <C> DBItemTransformer<Mutation, C> primativeCellValueToBytesWithColVis
            (final String colVisAuxName) {
        return new DBItemTransformer<Mutation, C>() {
            public List<Mutation> apply(CellGroup<C> group) throws CellExtractorException {
                String rowId = group.getTag();
                Mutation m1 = new Mutation(rowId);
                List<Mutation> mutations = Lists.newArrayList();
                for (C cell : group.getInternalList()) {
                    String colFam = CellReflector.getColFam(cell);
                    String label = CellReflector.getLabelAsString(cell);
                    String colVis = CellReflector.getAuxiliaryValue(String.class, cell, colVisAuxName);
                    byte[] value = CellReflector.getValueBytesIfPrimative(cell);
                    m1.put(new Text(colFam), new Text(label), new ColumnVisibility(colVis), new Value(value));
                }
                mutations.add(m1);
                return mutations;
            }
        };
View Full Code Here

Examples of org.apache.accumulo.core.data.Mutation

    public static <C> DBItemTransformer<Mutation, C> primativeCellValueToBytesWithColVisAndTimestamp
            (final String timestampAuxName, final String colVisAuxName) {
        return new DBItemTransformer<Mutation, C>() {
            public List<Mutation> apply(CellGroup<C> group) throws CellExtractorException {
                String rowId = group.getTag();
                Mutation m1 = new Mutation(rowId);
                List<Mutation> mutations = Lists.newArrayList();
                for (C cell : group.getInternalList()) {
                    String colFam = CellReflector.getColFam(cell);
                    String label = CellReflector.getLabelAsString(cell);
                    String colVis = CellReflector.getAuxiliaryValue(String.class, cell, colVisAuxName);
                    long ts = CellReflector.getAuxiliaryValue(long.class, cell, timestampAuxName);
                    byte[] value = CellReflector.getValueBytesIfPrimative(cell);
                    m1.put(new Text(colFam), new Text(label), new ColumnVisibility(colVis), ts, new Value(value));
                }
                mutations.add(m1);
                return mutations;
            }
        };
View Full Code Here

Examples of org.apache.accumulo.core.data.Mutation

    public static <C> DBItemTransformer<Mutation, C> primativeCellValueToBytesWithTimestamp
            (final String timestampAuxName) {
        return new DBItemTransformer<Mutation, C>() {
            public List<Mutation> apply(CellGroup<C> group) throws CellExtractorException {
                String rowId = group.getTag();
                Mutation m1 = new Mutation(rowId);
                List<Mutation> mutations = Lists.newArrayList();
                for (C cell : group.getInternalList()) {
                    String colFam = CellReflector.getColFam(cell);
                    String label = CellReflector.getLabelAsString(cell);
                    long ts = CellReflector.getAuxiliaryValue(long.class, cell, timestampAuxName);
                    byte[] value = CellReflector.getValueBytesIfPrimative(cell);
                    m1.put(new Text(colFam), new Text(label),ts, new Value(value));
                }
                mutations.add(m1);
                return mutations;
            }
        };
View Full Code Here

Examples of org.apache.accumulo.core.data.Mutation

            (final Set<String> colFamsToWriteValueAsQual) {
        return new DBItemTransformer<Mutation, C>() {
            private final byte[] emptyArray = new byte[]{};
            public List<Mutation> apply(CellGroup<C> group) throws CellExtractorException {
                String rowId = group.getTag();
                Mutation m1 = new Mutation(rowId);
                List<Mutation> mutations = Lists.newArrayList();
                for (C cell : group.getInternalList()) {
                    String colFam = CellReflector.getColFam(cell);
                    String qual = CellReflector.getLabelAsString(cell);
                    byte[] value = CellReflector.getValueBytesIfPrimative(cell);
                    if(colFamsToWriteValueAsQual.contains(colFam)){
                        qual = CellReflector.getValueAsString(cell);
                        value = emptyArray;
                    }
                    m1.put(new Text(colFam), new Text(qual),new Value(value));
                }
                mutations.add(m1);
                return mutations;
            }
        };
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.