All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.xiaomi.infra.galaxy.rpc.thrift.CommonConstants Maven / Gradle / Ivy

There is a newer version: 1.3.2
Show newest version
/**
 * 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.rpc.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 {

  /**
   * client端读写超时时间(ms)
   */
  public static final double DEFAULT_CLIENT_TIMEOUT = (double)10000;

  /**
   * client端最大读写超时时间(ms)
   */
  public static final double DEFAULT_MAX_CLIENT_TIMEOUT = (double)10000;

  /**
   * client端DDL操作超时时间(ms)
   */
  public static final double DEFAULT_ADMIN_CLIENT_TIMEOUT = (double)30000;

  /**
   * client端连接超时时间(ms)
   */
  public static final double DEFAULT_CLIENT_CONN_TIMEOUT = (double)3000;

  /**
   * RPC根路径
   */
  public static final String API_ROOT_PATH = "/v1/api";

  /**
   * 权限RPC路径
   */
  public static final String AUTH_SERVICE_PATH = "/v1/api/auth";

  /**
   * 管理操作RPC路径
   */
  public static final String ADMIN_SERVICE_PATH = "/v1/api/admin";

  /**
   * 兼容其它SDK,等同于application/x-thrift-json
   */
  public static final String DEFAULT_THRIFT_HEADER = "application/x-thrift";

  public static final String THRIFT_JSON_HEADER = "application/x-thrift-json";

  public static final String THRIFT_COMPACT_HEADER = "application/x-thrift-compact";

  public static final String THRIFT_BINARY_HEADER = "application/x-thrift-binary";

  public static final Map THRIFT_HEADER_MAP = new HashMap();
  static {
    THRIFT_HEADER_MAP.put(com.xiaomi.infra.galaxy.rpc.thrift.ThriftProtocol.TCOMPACT, "application/x-thrift-compact");
    THRIFT_HEADER_MAP.put(com.xiaomi.infra.galaxy.rpc.thrift.ThriftProtocol.TJSON, "application/x-thrift-json");
    THRIFT_HEADER_MAP.put(com.xiaomi.infra.galaxy.rpc.thrift.ThriftProtocol.TBINARY, "application/x-thrift-binary");
  }

  public static final Map HEADER_THRIFT_MAP = new HashMap();
  static {
    HEADER_THRIFT_MAP.put("application/x-thrift-compact", com.xiaomi.infra.galaxy.rpc.thrift.ThriftProtocol.TCOMPACT);
    HEADER_THRIFT_MAP.put("application/x-thrift-json", com.xiaomi.infra.galaxy.rpc.thrift.ThriftProtocol.TJSON);
    HEADER_THRIFT_MAP.put("application/x-thrift-binary", com.xiaomi.infra.galaxy.rpc.thrift.ThriftProtocol.TBINARY);
    HEADER_THRIFT_MAP.put("application/x-thrift", com.xiaomi.infra.galaxy.rpc.thrift.ThriftProtocol.TJSON);
  }

  /**
   * HTTP请求的超时时限
   */
  public static final String HK_REQUEST_TIMEOUT = "X-Xiaomi-Request-Timeout";

  /**
   * HTTP头的错误码
   */
  public static final String HK_ERROR_CODE_HEADER = "X-Xiaomi-Error-Code";

  /**
   * HTTP Body最大字节数
   */
  public static final int MAX_CONTENT_SIZE = 524288;

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy