docs: public Deferred<Boolean> syncToStorage(final TSDB tsdb, 
        final boolean overwrite) {
      if (uid == null || uid.isEmpty()) {
        throw new IllegalArgumentException("Missing UID");
      }
      if (type == null) {
        throw new IllegalArgumentException("Missing type");
      }
  
      boolean has_changes = false;
      for (Map.Entry<String, Boolean> entry : changed.entrySet()) {
        if (entry.getValue()) {
          has_changes = true;
          break;
        }
      }
      if (!has_changes) {
        LOG.debug(this + " does not have changes, skipping sync to storage");
        throw new IllegalStateException("No changes detected in UID meta data");
      }
      
      /**
       * Callback used to verify that the UID to name mapping exists. Uses the TSD
       * for verification so the name may be cached. If the name does not exist
       * it will throw a NoSuchUniqueId and the meta data will not be saved to
       * storage
       */
      final class NameCB implements Callback<Deferred<Boolean>, String> {
        private final UIDMeta local_meta;
        
        public NameCB(final UIDMeta meta) {
          local_meta = meta;
        }
        
        /**
         *  Nested callback used to merge and store the meta data after verifying
         *  that the UID mapping exists. It has to access the {@code local_meta} 
         *  object so that's why it's nested within the NameCB class
         */
        final class StoreUIDMeta implements Callback<Deferred<Boolean>, 
          ArrayList<KeyValue>> {
  
          /**
           * Executes the CompareAndSet after merging changes
           * @return True if the CAS was successful, false if the stored data
           * was modified during flight.
           */
          @Override
          public Deferred<Boolean> call(final ArrayList<KeyValue> row) 
            throws Exception {
            
            final UIDMeta stored_meta;
            if (row == null || row.isEmpty()) {
              stored_meta = null;
            } else {
              stored_meta = JSON.parseToObject(row.get(0).value(), UIDMeta.class);
              stored_meta.initializeChangedMap();
            }
            
            final byte[] original_meta = row == null || row.isEmpty() ? 
                new byte[0] : row.get(0).value();
  
            if (stored_meta != null) {
              local_meta.syncMeta(stored_meta, overwrite);
            }
         
            // verify the name is set locally just to be safe
            if (name == null || name.isEmpty()) {
              local_meta.name = name;
            }
            
            final PutRequest put = new PutRequest(tsdb.uidTable(), 
                UniqueId.stringToUid(uid), FAMILY, 
                (type.toString().toLowerCase() + "_meta").getBytes(CHARSET), 
                local_meta.getStorageJSON());
            return tsdb.getClient().compareAndSet(put, original_meta);
          }
          
        }
        
        /**
         * NameCB method that fetches the object from storage for merging and
         * use in the CAS call
         * @return The results of the {@link #StoreUIDMeta} callback
         */
        @Override
        public Deferred<Boolean> call(final String name) throws Exception {
          
          final GetRequest get = new GetRequest(tsdb.uidTable(), 
              UniqueId.stringToUid(uid));
          get.family(FAMILY);
          get.qualifier((type.toString().toLowerCase() + "_meta").getBytes(CHARSET));
          
          // #2 deferred
          return tsdb.getClient().get(get)
            .addCallbackDeferring(new StoreUIDMeta());
        }
        
      }
  
      // start the callback chain by veryfing that the UID name mapping exists
      return tsdb.getUidName(type, UniqueId.stringToUid(uid))
        .addCallbackDeferring(new NameCB(this));
    }