/** * Autogenerated by Thrift Compiler (0.9.2) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package com.xiaomi.infra.galaxy.emq.thrift; import libthrift091.scheme.IScheme; import libthrift091.scheme.SchemeFactory; import libthrift091.scheme.StandardScheme; import libthrift091.scheme.TupleScheme; import libthrift091.protocol.TTupleProtocol; import libthrift091.protocol.TProtocolException; import libthrift091.EncodingUtils; import libthrift091.TException; import libthrift091.async.AsyncMethodCallback; import libthrift091.server.AbstractNonblockingServer.*; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.util.HashMap; import java.util.EnumMap; import java.util.Set; import java.util.HashSet; import java.util.EnumSet; import java.util.Collections; import java.util.BitSet; import java.nio.ByteBuffer; import java.util.Arrays; import javax.annotation.Generated; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) public class CommonConstants { /** * SDK auto retry ErrorCode and backOff reference time, * Wait time = 2 ^ retry time * backOff reference time */ public static final Map<ErrorCode,Long> ERROR_BACKOFF = new HashMap<ErrorCode,Long>(); static { ERROR_BACKOFF.put(com.xiaomi.infra.galaxy.emq.thrift.ErrorCode.PARTITION_NOT_EXIST, 1000L); ERROR_BACKOFF.put(com.xiaomi.infra.galaxy.emq.thrift.ErrorCode.PARTITION_NOT_SERVING, 1000L); ERROR_BACKOFF.put(com.xiaomi.infra.galaxy.emq.thrift.ErrorCode.PARTITION_NOT_RUNNING, 1000L); ERROR_BACKOFF.put(com.xiaomi.infra.galaxy.emq.thrift.ErrorCode.QUEUE_NOT_CACHED, 1000L); ERROR_BACKOFF.put(com.xiaomi.infra.galaxy.emq.thrift.ErrorCode.QUEUE_INUSE, 1000L); ERROR_BACKOFF.put(com.xiaomi.infra.galaxy.emq.thrift.ErrorCode.INTERNAL_ERROR, 1000L); ERROR_BACKOFF.put(com.xiaomi.infra.galaxy.emq.thrift.ErrorCode.TTRANSPORT_ERROR, 1000L); } /** * Retry types for defined ErrorCode. */ public static final Map<ErrorCode,RetryType> ERROR_RETRY_TYPE = new HashMap<ErrorCode,RetryType>(); static { ERROR_RETRY_TYPE.put(com.xiaomi.infra.galaxy.emq.thrift.ErrorCode.PARTITION_NOT_EXIST, com.xiaomi.infra.galaxy.emq.thrift.RetryType.SAFE); ERROR_RETRY_TYPE.put(com.xiaomi.infra.galaxy.emq.thrift.ErrorCode.PARTITION_NOT_SERVING, com.xiaomi.infra.galaxy.emq.thrift.RetryType.SAFE); ERROR_RETRY_TYPE.put(com.xiaomi.infra.galaxy.emq.thrift.ErrorCode.PARTITION_NOT_RUNNING, com.xiaomi.infra.galaxy.emq.thrift.RetryType.SAFE); ERROR_RETRY_TYPE.put(com.xiaomi.infra.galaxy.emq.thrift.ErrorCode.QUEUE_NOT_CACHED, com.xiaomi.infra.galaxy.emq.thrift.RetryType.SAFE); ERROR_RETRY_TYPE.put(com.xiaomi.infra.galaxy.emq.thrift.ErrorCode.QUEUE_INUSE, com.xiaomi.infra.galaxy.emq.thrift.RetryType.SAFE); ERROR_RETRY_TYPE.put(com.xiaomi.infra.galaxy.emq.thrift.ErrorCode.INTERNAL_ERROR, com.xiaomi.infra.galaxy.emq.thrift.RetryType.UNSAFE); ERROR_RETRY_TYPE.put(com.xiaomi.infra.galaxy.emq.thrift.ErrorCode.TTRANSPORT_ERROR, com.xiaomi.infra.galaxy.emq.thrift.RetryType.UNSURE); } /** * The max retry time before throwing exception. */ public static final int MAX_RETRY = 3; }