static { STATE_TYPE_MAP.put(SYNCHRONIZED.getState(), SYNCHRONIZED); STATE_TYPE_MAP.put(UNSYNCHRONIZED.getState(), UNSYNCHRONIZED); STATE_TYPE_MAP.put(BROKEN.getState(), BROKEN); STATE_TYPE_MAP.put(UNKNOWN.getState(), UNKNOWN); STATE_TYPE_MAP.put(INPROGRESS.getState(), INPROGRESS); STATE_TYPE_MAP.put(WAITING.getState(), WAITING); }
public static Optional<TypeSignature> getCommonSuperTypeSignature( List<? extends TypeSignature> typeSignatures) { checkArgument(!typeSignatures.isEmpty(), "typeSignatures is empty"); TypeSignature superTypeSignature = UNKNOWN.getTypeSignature(); for (TypeSignature typeSignature : typeSignatures) { Optional<TypeSignature> commonSuperTypeSignature = getCommonSuperTypeSignature(superTypeSignature, typeSignature); if (!commonSuperTypeSignature.isPresent()) { return Optional.empty(); } superTypeSignature = commonSuperTypeSignature.get(); } return Optional.of(superTypeSignature); }
public TextCommandServiceImpl(Node node) { this.node = node; this.hazelcast = node.factory; this.logger = node.getLogger(this.getClass().getName()); this.parallelExecutor = this.node.executorManager.newParallelExecutor(40); textCommandProcessors[GET.getValue()] = new GetCommandProcessor(this, true); textCommandProcessors[PARTIAL_GET.getValue()] = new GetCommandProcessor(this, false); textCommandProcessors[SET.getValue()] = new SetCommandProcessor(this); textCommandProcessors[ADD.getValue()] = new SetCommandProcessor(this); textCommandProcessors[REPLACE.getValue()] = new SetCommandProcessor(this); textCommandProcessors[GET_END.getValue()] = new NoOpCommandProcessor(this); textCommandProcessors[DELETE.getValue()] = new DeleteCommandProcessor(this); textCommandProcessors[QUIT.getValue()] = new SimpleCommandProcessor(this); textCommandProcessors[STATS.getValue()] = new StatsCommandProcessor(this); textCommandProcessors[UNKNOWN.getValue()] = new ErrorCommandProcessor(this); textCommandProcessors[ERROR_CLIENT.getValue()] = new ErrorCommandProcessor(this); textCommandProcessors[ERROR_SERVER.getValue()] = new ErrorCommandProcessor(this); textCommandProcessors[HTTP_GET.getValue()] = new HttpGetCommandProcessor(this); textCommandProcessors[HTTP_POST.getValue()] = new HttpPostCommandProcessor(this); textCommandProcessors[HTTP_PUT.getValue()] = new HttpPostCommandProcessor(this); textCommandProcessors[HTTP_DELETE.getValue()] = new HttpDeleteCommandProcessor(this); textCommandProcessors[NO_OP.getValue()] = new NoOpCommandProcessor(this); }
@Inject public TypeRegistry(Set<Type> types) { requireNonNull(types, "types is null"); // Manually register UNKNOWN type without a verifyTypeClass call since it is a special type that // can not be used by functions this.types.put(UNKNOWN.getTypeSignature(), UNKNOWN); // always add the built-in types; Presto will not function without these addType(BOOLEAN); addType(BIGINT); addType(DOUBLE); addType(VARCHAR); addType(VARBINARY); addType(DATE); addType(TIME); addType(TIME_WITH_TIME_ZONE); addType(TIMESTAMP); addType(TIMESTAMP_WITH_TIME_ZONE); addType(INTERVAL_YEAR_MONTH); addType(INTERVAL_DAY_TIME); addType(HYPER_LOG_LOG); addType(P4_HYPER_LOG_LOG); addType(REGEXP); addType(LIKE_PATTERN); addType(JSON_PATH); addType(COLOR); addType(JSON); addParametricType(ROW); addParametricType(ARRAY); addParametricType(MAP); addParametricType(FUNCTION); for (Type type : types) { addType(type); } }
/** * Static method to get enum instance given localName XsdString * * @param localName a XsdString used as localname (typically tag name as defined in xsd) * @return the enum instance */ public static Tag forName(String localName) { final Tag element = MAP.get(localName); return element == null ? UNKNOWN.value(localName) : element; }
/** * Static method to get enum instance given localName XsdString * * @param localName a XsdString used as localname (typically tag name as defined in xsd) * @return the enum instance */ public static Attribute forName(String localName) { final Attribute element = MAP.get(localName); return element == null ? UNKNOWN.value(localName) : element; }