Examples of Mutator


Examples of org.apache.accumulo.server.zookeeper.ZooReaderWriter.Mutator

      String zTablePath = Constants.ZROOT + "/" + HdfsZooInstance.getInstance().getInstanceID() + Constants.ZTABLES + "/" + tableId + Constants.ZTABLE_FLUSH_ID;
     
      IZooReaderWriter zoo = ZooReaderWriter.getInstance();
      byte fid[];
      try {
        fid = zoo.mutate(zTablePath, null, null, new Mutator() {
          @Override
          public byte[] mutate(byte[] currentValue) throws Exception {
            long flushID = Long.parseLong(new String(currentValue));
            flushID++;
            return ("" + flushID).getBytes();
View Full Code Here

Examples of org.apache.accumulo.server.zookeeper.ZooReaderWriter.Mutator

    String zTablePath = Constants.ZROOT + "/" + HdfsZooInstance.getInstance().getInstanceID() + Constants.ZTABLES + "/" + tableId + Constants.ZTABLE_COMPACT_ID;
   
    IZooReaderWriter zoo = ZooReaderWriter.getRetryingInstance();
    byte[] cid;
    try {
      cid = zoo.mutate(zTablePath, null, null, new Mutator() {
        @Override
        public byte[] mutate(byte[] currentValue) throws Exception {
          long flushID = Long.parseLong(new String(currentValue));
          flushID++;
          return ("" + flushID).getBytes();
View Full Code Here

Examples of org.apache.accumulo.server.zookeeper.ZooReaderWriter.Mutator

    try {
      Utils.checkTableDoesNotExist(instance, newTableName, tableId, TableOperation.RENAME);
     
      final String tap = ZooUtil.getRoot(instance) + Constants.ZTABLES + "/" + tableId + Constants.ZTABLE_NAME;
     
      zoo.mutate(tap, null, null, new Mutator() {
        public byte[] mutate(byte[] current) throws Exception {
          final String currentName = new String(current);
          if (currentName.equals(newTableName))
            return null; // assume in this case the operation is running again, so we are done
          if (!currentName.equals(oldTableName)) {
View Full Code Here

Examples of org.apache.accumulo.server.zookeeper.ZooReaderWriter.Mutator

   
    String tableId = null;
    try {
      IZooReaderWriter zoo = ZooReaderWriter.getRetryingInstance();
      final String ntp = ZooUtil.getRoot(instance) + Constants.ZTABLES;
      byte[] nid = zoo.mutate(ntp, "0".getBytes(), ZooUtil.PUBLIC, new Mutator() {
        @Override
        public byte[] mutate(byte[] currentValue) throws Exception {
          BigInteger nextId = new BigInteger(new String(currentValue), Character.MAX_RADIX);
          nextId = nextId.add(BigInteger.ONE);
          return nextId.toString(Character.MAX_RADIX).getBytes();
View Full Code Here

Examples of org.apache.accumulo.server.zookeeper.ZooReaderWriter.Mutator

 
  public synchronized void transitionTableState(final String tableId, final TableState newState) {
    String statePath = ZooUtil.getRoot(HdfsZooInstance.getInstance()) + Constants.ZTABLES + "/" + tableId + Constants.ZTABLE_STATE;
   
    try {
      ZooReaderWriter.getRetryingInstance().mutate(statePath, (byte[]) newState.name().getBytes(), ZooUtil.PUBLIC, new Mutator() {
        @Override
        public byte[] mutate(byte[] oldData) throws Exception {
          TableState oldState = TableState.UNKNOWN;
          if (oldData != null)
            oldState = TableState.valueOf(new String(oldData));
View Full Code Here

Examples of org.apache.accumulo.server.zookeeper.ZooReaderWriter.Mutator

      String zTablePath = Constants.ZROOT + "/" + HdfsZooInstance.getInstance().getInstanceID() + Constants.ZTABLES + "/" + tableId + Constants.ZTABLE_FLUSH_ID;
     
      IZooReaderWriter zoo = ZooReaderWriter.getInstance();
      byte fid[];
      try {
        fid = zoo.mutate(zTablePath, null, null, new Mutator() {
          @Override
          public byte[] mutate(byte[] currentValue) throws Exception {
            long flushID = Long.parseLong(new String(currentValue));
            flushID++;
            return ("" + flushID).getBytes();
View Full Code Here

Examples of org.jboss.as.console.client.widgets.forms.Mutator

     * @return An AutoBean<T> for the entity.
     */
    @Override
    public T newEntity() {
        T entity = (T) propertyMetadata.getFactory(type).create();
        Mutator mutator = propertyMetadata.getMutator(type);
        for (PropertyBinding prop : beanMetaData.getProperties()) {
            mutator.setValue(entity, prop.getJavaName(), prop.getDefaultValue());
        }

        return entity;
    }
View Full Code Here

Examples of org.jboss.as.console.client.widgets.forms.Mutator

        if (changedValues.isEmpty() && (extraSteps.length == 0)) {
            return;
        }

        // must write back unchanged flattened values
        Mutator mutator = propertyMetadata.getMutator(type);
        for (PropertyBinding prop : beanMetaData.getProperties()) {
            String javaName = prop.getJavaName();
            Object value = mutator.getValue(entity, javaName);
            if (changedValuesContainsFlattenedSibling(prop, changedValues) &&
                    (value != null) && !changedValues.containsKey(javaName)) {
                changedValues.put(javaName, value);
            }
        }
View Full Code Here

Examples of org.jboss.as.console.client.widgets.forms.Mutator

     * @return An AutoBean<T> for the entity.
     */
    @Override
    public T newEntity() {
        T entity = (T) propertyMetadata.getFactory(type).create();
        Mutator mutator = propertyMetadata.getMutator(type);
        for (PropertyBinding prop : beanMetaData.getProperties()) {
            mutator.setValue(entity, prop.getJavaName(), prop.getDefaultValue());
        }

        return entity;
    }
View Full Code Here

Examples of org.jboss.as.console.client.widgets.forms.Mutator

        if (changedValues.isEmpty() && (extraSteps.length == 0)) {
            return;
        }

        // must write back unchanged flattened values
        Mutator mutator = propertyMetadata.getMutator(type);
        for (PropertyBinding prop : beanMetaData.getProperties()) {
            String javaName = prop.getJavaName();
            Object value = mutator.getValue(entity, javaName);
            if (changedValuesContainsFlattenedSibling(prop, changedValues) &&
                    (value != null) && !changedValues.containsKey(javaName)) {
                changedValues.put(javaName, value);
            }
        }
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.