Generate sync point information from the proto representation.
@param syncPointInfo the proto representation
@return sync point info object
426796
public static SyncPointInfo fromProto(alluxio.grpc.SyncPointInfo syncPointInfo) {
    SyncStatus syncStatus;
    switch (syncPointInfo.getSyncStatus()) {
      case Not_Initially_Synced:
        syncStatus = SyncStatus.NOT_INITIALLY_SYNCED;
        break;
      case Syncing:
        syncStatus = SyncStatus.SYNCING;
        break;
      case Initially_Synced:
        syncStatus = SyncStatus.INITIALLY_SYNCED;
        break;
      default:
        syncStatus = SyncStatus.NOT_INITIALLY_SYNCED;
    }
    return new SyncPointInfo(new AlluxioURI(syncPointInfo.getSyncPointUri()), syncStatus);
  }
426472
public ISynchronizationPoint<IOException> end() {
		while (!context.isEmpty())
			closeElement();
		ISynchronizationPoint<IOException> write = writer.flush();
		if (!write.isUnblocked()) {
			SynchronizationPoint<IOException> sp = new SynchronizationPoint<>();
			write.listenInline(() -> { output.flush().listenInline(sp); }, sp);
			return sp;
		}
		if (write.hasError())
			return write;
		return output.flush();
	}
672038
public com.google.protobuf.ByteString
      getSyncPointUriBytes() {
    java.lang.Object ref = syncPointUri_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      syncPointUri_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }
128503
static <T> boolean syncInstantiation(T objectType) {
        List<Template> templates = new ArrayList<>();
        Templates tr = TEMP_FINDER.findAnnotations(templates, objectType);
        if (tr == null) {
            /* Default to synchronous instantiation */
            return true;
        } else {
            return tr.syncInstantiation();
        }
    }
1337149
public void syncTopologyMetaForFollower() {
        // sys meta, use remote only
        syncSysMetaFromRemote();

        // normal topology meta, local + remote
        for (Entry<String, TopologyMetricContext> entry : context.getTopologyMetricContexts().entrySet()) {
            String topology = entry.getKey();
            TopologyMetricContext metricContext = entry.getValue();

            if (!JStormMetrics.SYS_TOPOLOGY_SET.contains(topology)) {
                try {
                    syncMetaFromCache(topology, metricContext);
                    syncNonSysMetaFromRemote(topology, metricContext);
                } catch (Exception e1) {
                    LOG.warn("failed to sync meta for topology:{}", topology);
                }
            }
        }
    }
147718
protected static void initEndpointInfo(List<EndpointInfo> endpoints) {
        for (int i = 0; i < endpoints.size(); i++) {
            initEndpointInfo(endpoints.get(i));
        }
    }
1272527
public CmsUploadProgessInfo getInfo() {

        if (m_finished) {
            return new CmsUploadProgessInfo(
                getItem(),
                (int)getPercent(),
                UPLOAD_STATE.finished,
                getContentLength(),
                getBytesRead());
        }
        return new CmsUploadProgessInfo(
            getItem(),
            (int)getPercent(),
            UPLOAD_STATE.running,
            getContentLength(),
            getBytesRead());
    }
1047146
public alluxio.grpc.SyncPointStatus getSyncStatus() {
    alluxio.grpc.SyncPointStatus result = alluxio.grpc.SyncPointStatus.valueOf(syncStatus_);
    return result == null ? alluxio.grpc.SyncPointStatus.Not_Initially_Synced : result;
  }
1018249
private Map<String, T> sync() throws KeeperException {
    log.debug("syncing: {}", path);

    final Map<String, T> newSnapshot = Maps.newHashMap();

    // Fetch new snapshot and register watchers
    try {
      final List<String> children = getChildren();
      log.debug("children: {}", children);
      for (final String child : children) {
        final String node = ZKPaths.makePath(path, child);
        final byte[] bytes = curator.getData()
            .usingWatcher(dataWatcher)
            .forPath(node);
        final String json = new String(bytes, UTF_8);
        log.debug("child: {}={}", node, json);
        final T value;
        try {
          value = Json.read(bytes, valueType);
        } catch (IOException e) {
          log.warn("failed to parse node: {}: {}", node, json, e);
          // Treat parse failure as absence
          continue;
        }
        newSnapshot.put(node, value);
      }
    } catch (KeeperException e) {
      throw e;
    } catch (Exception e) {
      Throwables.throwIfUnchecked(e);
      throw new RuntimeException(e);
    }

    return newSnapshot;
  }
1044053
public SynchronizationPoint<IOException> onDone() {
		synchronized (buffers) {
			if (writing == null) return new SynchronizationPoint<>(true);
			if (writing.hasError()) return new SynchronizationPoint<IOException>(writing.getError());
			if (writing.isCancelled()) return new SynchronizationPoint<IOException>(writing.getCancelEvent());
			if (waitDone == null) waitDone = new SynchronizationPoint<>();
		}
		return waitDone;
	}
861695
public static Class[] getParameterTypes(JoinPoint joinPoint) {
        MethodSignature signature = (MethodSignature) joinPoint.getSignature();
        Method method = signature.getMethod();
        return method.getParameterTypes();
    }
1279823
public static Class infoClass(Class cmp) {
        Class info = null;
        try {
            info = Class.forName(cmp.getName() + "CompInfo");
        } catch (ClassNotFoundException E) {        // there is no info class,
            info = cmp;
        }
        return info;
    }
1039694
def get_sync_info(self, name, key=None):
        """"""
        peer_target = self.peer
        if self.is_local():
            info = self.cur_dir_meta.dir["peer_sync"].get(peer_target.get_id())
        else:
            info = peer_target.cur_dir_meta.dir["peer_sync"].get(self.get_id())
        if name is not None:
            info = info.get(name) if info else None
        if info and key:
            info = info.get(key)
        return info
243021
protected final CodeBlock generateTypeInfo( BeanTypeInfo typeInfo ) {

        Class type;
        ImmutableMap<JClassType, String> mapTypeToMetadata;
        if ( isSerializer() ) {
            type = TypeSerializationInfo.class;
            mapTypeToMetadata = typeInfo.getMapTypeToSerializationMetadata();
        } else {
            type = TypeDeserializationInfo.class;
            mapTypeToMetadata = typeInfo.getMapTypeToDeserializationMetadata();
        }

        CodeBlock.Builder builder = CodeBlock.builder()
                .add( "new $T($T.$L, $S)", type, As.class, typeInfo.getInclude(), typeInfo.getPropertyName() )
                .indent()
                .indent();

        for ( Entry<JClassType, String> entry : mapTypeToMetadata.entrySet() ) {
            builder.add( "\n.addTypeInfo($T.class, $S)", rawName( entry.getKey() ), entry.getValue() );
        }

        return builder.unindent().unindent().build();
    }
502428
@java.lang.Deprecated
  public java.util.Map<java.lang.String, alluxio.grpc.MountPointInfo> getMountPoints() {
    return getMountPointsMap();
  }
1301074
JPAPUnitInfo getUniquePuInfo() {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled())
            Tr.entry(tc, "getUniquePuInfo");

        JPAPUnitInfo rtnVal = null;

        synchronized (pxmlsInfo) {
            for (JPAPxmlInfo pxmlInfo : pxmlsInfo.values()) {
                Set<String> puNames = pxmlInfo.getPuNames();
                if (rtnVal == null && puNames.size() == 1) {
                    rtnVal = pxmlInfo.getPuInfo(puNames.iterator().next());
                } else {
                    // the current persistence.xml may have 0 persistence unit
                    // <xsd:element name="persistence-unit" minOccurs="0"
                    if (puNames.size() != 0) // d392996.3
                    {
                        rtnVal = null;
                        break;
                    }
                }
            }
        }

        if (isTraceOn && tc.isEntryEnabled())
            Tr.exit(tc, "getUniquePuInfo", rtnVal);
        return rtnVal;
    }
644125
public static NodeInfo[] generateOrderedNodeInfos(Collection<WorkerInfo> workerInfos) {
    NodeInfo[] ret = new NodeInfo[workerInfos.size()];
    int index = 0;
    for (WorkerInfo workerInfo : workerInfos) {
      ret[index++] = new NodeInfo(workerInfo);
    }
    Arrays.sort(ret);

    return ret;
  }