分享

storm配置:如何解决worker进程内存过小的问题

pig2 发表于 2014-6-13 22:21:38 [显示全部楼层] 只看大图 回帖奖励 阅读模式 关闭右栏 5 92803
问题导读
1.如何设置storm内存?
2.如果没有配置文件的情况下,该如何配置一些参数?
3.通过哪个参数可以配置内存?






Storm中真正干活的是各个worker,而worker由supervisor负责启动。在topology启动过程中我们会看到如下的启动日志:


20131220135003562.jpg


这就是启动一个worker进程,也就是一个JVM进程。


默认情况下,Storm启动worker进程时,JVM的最大内存是768M。
但我在使用过程中,由于会在Bolt中加载大量数据,768M内存无法满足需求,会导致内存溢出程序崩溃。
经过研究发现,可以通过在Strom的配置文件storm.yaml中设置worker的启动参数:

  1. worker.childopts: "-Xmx2048m"
复制代码


该参数会在启动时传递给JVM,然后就可以在worker中使用2048m内存了。

目前好像Storm还没有配置文件的详细说明,比如可以配置哪些参数,怎么配置?
大家可以先参考Storm源代码中的Config.java.

  1. package backtype.storm;
  2. import backtype.storm.ConfigValidation;
  3. import backtype.storm.serialization.IKryoDecorator;
  4. import backtype.storm.serialization.IKryoFactory;
  5. import com.esotericsoftware.kryo.Serializer;
  6. import java.util.ArrayList;
  7. import java.util.HashMap;
  8. import java.util.List;
  9. import java.util.Map;
  10. /**
  11. * Topology configs are specified as a plain old map. This class provides a
  12. * convenient way to create a topology config map by providing setter methods for
  13. * all the configs that can be set. It also makes it easier to do things like add
  14. * serializations.
  15. *
  16. * <p>This class also provides constants for all the configurations possible on
  17. * a Storm cluster and Storm topology. Each constant is paired with a schema
  18. * that defines the validity criterion of the corresponding field. Default
  19. * values for these configs can be found in defaults.yaml.</p>
  20. *
  21. * <p>Note that you may put other configurations in any of the configs. Storm
  22. * will ignore anything it doesn't recognize, but your topologies are free to make
  23. * use of them by reading them in the prepare method of Bolts or the open method of
  24. * Spouts.</p>
  25. */
  26. public class Config extends HashMap<String, Object> {
  27.     /**
  28.      * The transporter for communication among Storm tasks
  29.      */
  30.     public static final String STORM_MESSAGING_TRANSPORT = "storm.messaging.transport";
  31.     public static final Object STORM_MESSAGING_TRANSPORT_SCHEMA = String.class;
  32.     /**
  33.      * Netty based messaging: The buffer size for send/recv buffer
  34.      */
  35.     public static final String STORM_MESSAGING_NETTY_BUFFER_SIZE = "storm.messaging.netty.buffer_size";
  36.     public static final Object STORM_MESSAGING_NETTY_BUFFER_SIZE_SCHEMA = Number.class;
  37.     /**
  38.      * Netty based messaging: The max # of retries that a peer will perform when a remote is not accessible
  39.      */
  40.     public static final String STORM_MESSAGING_NETTY_MAX_RETRIES = "storm.messaging.netty.max_retries";
  41.     public static final Object STORM_MESSAGING_NETTY_MAX_RETRIES_SCHEMA = Number.class;
  42.     /**
  43.      * Netty based messaging: The min # of milliseconds that a peer will wait.
  44.      */
  45.     public static final String STORM_MESSAGING_NETTY_MIN_SLEEP_MS = "storm.messaging.netty.min_wait_ms";
  46.     public static final Object STORM_MESSAGING_NETTY_MIN_SLEEP_MS_SCHEMA = Number.class;
  47.     /**
  48.      * Netty based messaging: The max # of milliseconds that a peer will wait.
  49.      */
  50.     public static final String STORM_MESSAGING_NETTY_MAX_SLEEP_MS = "storm.messaging.netty.max_wait_ms";
  51.     public static final Object STORM_MESSAGING_NETTY_MAX_SLEEP_MS_SCHEMA = Number.class;
  52.     /**
  53.      * Netty based messaging: The # of worker threads for the server.
  54.      */
  55.     public static final String STORM_MESSAGING_NETTY_SERVER_WORKER_THREADS = "storm.messaging.netty.server_worker_threads";
  56.     public static final Object STORM_MESSAGING_NETTY_SERVER_WORKER_THREADS_SCHEMA = Number.class;
  57.     /**
  58.      * Netty based messaging: The # of worker threads for the client.
  59.      */
  60.     public static final String STORM_MESSAGING_NETTY_CLIENT_WORKER_THREADS = "storm.messaging.netty.client_worker_threads";
  61.     public static final Object STORM_MESSAGING_NETTY_CLIENT_WORKER_THREADS_SCHEMA = Number.class;
  62.     /**
  63.      * A list of hosts of ZooKeeper servers used to manage the cluster.
  64.      */
  65.     public static final String STORM_ZOOKEEPER_SERVERS = "storm.zookeeper.servers";
  66.     public static final Object STORM_ZOOKEEPER_SERVERS_SCHEMA = ConfigValidation.StringsValidator;
  67.     /**
  68.      * The port Storm will use to connect to each of the ZooKeeper servers.
  69.      */
  70.     public static final String STORM_ZOOKEEPER_PORT = "storm.zookeeper.port";
  71.     public static final Object STORM_ZOOKEEPER_PORT_SCHEMA = Number.class;
  72.     /**
  73.      * A directory on the local filesystem used by Storm for any local
  74.      * filesystem usage it needs. The directory must exist and the Storm daemons must
  75.      * have permission to read/write from this location.
  76.      */
  77.     public static final String STORM_LOCAL_DIR = "storm.local.dir";
  78.     public static final Object STORM_LOCAL_DIR_SCHEMA = String.class;
  79.     /**
  80.      * A global task scheduler used to assign topologies's tasks to supervisors' wokers.
  81.      *
  82.      * If this is not set, a default system scheduler will be used.
  83.      */
  84.     public static final String STORM_SCHEDULER = "storm.scheduler";
  85.     public static final Object STORM_SCHEDULER_SCHEMA = String.class;
  86.     /**
  87.      * The mode this Storm cluster is running in. Either "distributed" or "local".
  88.      */
  89.     public static final String STORM_CLUSTER_MODE = "storm.cluster.mode";
  90.     public static final Object STORM_CLUSTER_MODE_SCHEMA = String.class;
  91.     /**
  92.      * The hostname the supervisors/workers should report to nimbus. If unset, Storm will
  93.      * get the hostname to report by calling <code>InetAddress.getLocalHost().getCanonicalHostName()</code>.
  94.      *
  95.      * You should set this config when you dont have a DNS which supervisors/workers
  96.      * can utilize to find each other based on hostname got from calls to
  97.      * <code>InetAddress.getLocalHost().getCanonicalHostName()</code>.
  98.      */
  99.     public static final String STORM_LOCAL_HOSTNAME = "storm.local.hostname";
  100.     public static final Object STORM_LOCAL_HOSTNAME_SCHEMA = String.class;
  101.     /**
  102.      * The transport plug-in for Thrift client/server communication
  103.      */
  104.     public static final String STORM_THRIFT_TRANSPORT_PLUGIN = "storm.thrift.transport";
  105.     public static final Object STORM_THRIFT_TRANSPORT_PLUGIN_SCHEMA = String.class;
  106.     /**
  107.      * The serializer class for ListDelegate (tuple payload).
  108.      * The default serializer will be ListDelegateSerializer
  109.      */
  110.     public static final String TOPOLOGY_TUPLE_SERIALIZER = "topology.tuple.serializer";
  111.     public static final Object TOPOLOGY_TUPLE_SERIALIZER_SCHEMA = String.class;
  112.     /**
  113.      * Whether or not to use ZeroMQ for messaging in local mode. If this is set
  114.      * to false, then Storm will use a pure-Java messaging system. The purpose
  115.      * of this flag is to make it easy to run Storm in local mode by eliminating
  116.      * the need for native dependencies, which can be difficult to install.
  117.      *
  118.      * Defaults to false.
  119.      */
  120.     public static final String STORM_LOCAL_MODE_ZMQ = "storm.local.mode.zmq";
  121.     public static final Object STORM_LOCAL_MODE_ZMQ_SCHEMA = Boolean.class;
  122.     /**
  123.      * The root location at which Storm stores data in ZooKeeper.
  124.      */
  125.     public static final String STORM_ZOOKEEPER_ROOT = "storm.zookeeper.root";
  126.     public static final Object STORM_ZOOKEEPER_ROOT_SCHEMA = String.class;
  127.     /**
  128.      * The session timeout for clients to ZooKeeper.
  129.      */
  130.     public static final String STORM_ZOOKEEPER_SESSION_TIMEOUT = "storm.zookeeper.session.timeout";
  131.     public static final Object STORM_ZOOKEEPER_SESSION_TIMEOUT_SCHEMA = Number.class;
  132.     /**
  133.      * The connection timeout for clients to ZooKeeper.
  134.      */
  135.     public static final String STORM_ZOOKEEPER_CONNECTION_TIMEOUT = "storm.zookeeper.connection.timeout";
  136.     public static final Object STORM_ZOOKEEPER_CONNECTION_TIMEOUT_SCHEMA = Number.class;
  137.     /**
  138.      * The number of times to retry a Zookeeper operation.
  139.      */
  140.     public static final String STORM_ZOOKEEPER_RETRY_TIMES="storm.zookeeper.retry.times";
  141.     public static final Object STORM_ZOOKEEPER_RETRY_TIMES_SCHEMA = Number.class;
  142.     /**
  143.      * The interval between retries of a Zookeeper operation.
  144.      */
  145.     public static final String STORM_ZOOKEEPER_RETRY_INTERVAL="storm.zookeeper.retry.interval";
  146.     public static final Object STORM_ZOOKEEPER_RETRY_INTERVAL_SCHEMA = Number.class;
  147.     /**
  148.      * The ceiling of the interval between retries of a Zookeeper operation.
  149.      */
  150.     public static final String STORM_ZOOKEEPER_RETRY_INTERVAL_CEILING="storm.zookeeper.retry.intervalceiling.millis";
  151.     public static final Object STORM_ZOOKEEPER_RETRY_INTERVAL_CEILING_SCHEMA = Number.class;
  152.     /**
  153.      * The Zookeeper authentication scheme to use, e.g. "digest". Defaults to no authentication.
  154.      */
  155.     public static final String STORM_ZOOKEEPER_AUTH_SCHEME="storm.zookeeper.auth.scheme";
  156.     public static final Object STORM_ZOOKEEPER_AUTH_SCHEME_SCHEMA = String.class;
  157.     /**
  158.      * A string representing the payload for Zookeeper authentication. It gets serialized using UTF-8 encoding during authentication.
  159.      */
  160.     public static final String STORM_ZOOKEEPER_AUTH_PAYLOAD="storm.zookeeper.auth.payload";
  161.     public static final Object STORM_ZOOKEEPER_AUTH_PAYLOAD_SCHEMA = String.class;
  162.     /**
  163.      * The id assigned to a running topology. The id is the storm name with a unique nonce appended.
  164.      */
  165.     public static final String STORM_ID = "storm.id";
  166.     public static final Object STORM_ID_SCHEMA = String.class;
  167.     /**
  168.      * The host that the master server is running on.
  169.      */
  170.     public static final String NIMBUS_HOST = "nimbus.host";
  171.     public static final Object NIMBUS_HOST_SCHEMA = String.class;
  172.     /**
  173.      * Which port the Thrift interface of Nimbus should run on. Clients should
  174.      * connect to this port to upload jars and submit topologies.
  175.      */
  176.     public static final String NIMBUS_THRIFT_PORT = "nimbus.thrift.port";
  177.     public static final Object NIMBUS_THRIFT_PORT_SCHEMA = Number.class;
  178.     /**
  179.      * This parameter is used by the storm-deploy project to configure the
  180.      * jvm options for the nimbus daemon.
  181.      */
  182.     public static final String NIMBUS_CHILDOPTS = "nimbus.childopts";
  183.     public static final Object NIMBUS_CHILDOPTS_SCHEMA = String.class;
  184.     /**
  185.      * How long without heartbeating a task can go before nimbus will consider the
  186.      * task dead and reassign it to another location.
  187.      */
  188.     public static final String NIMBUS_TASK_TIMEOUT_SECS = "nimbus.task.timeout.secs";
  189.     public static final Object NIMBUS_TASK_TIMEOUT_SECS_SCHEMA = Number.class;
  190.     /**
  191.      * How often nimbus should wake up to check heartbeats and do reassignments. Note
  192.      * that if a machine ever goes down Nimbus will immediately wake up and take action.
  193.      * This parameter is for checking for failures when there's no explicit event like that
  194.      * occuring.
  195.      */
  196.     public static final String NIMBUS_MONITOR_FREQ_SECS = "nimbus.monitor.freq.secs";
  197.     public static final Object NIMBUS_MONITOR_FREQ_SECS_SCHEMA = Number.class;
  198.     /**
  199.      * How often nimbus should wake the cleanup thread to clean the inbox.
  200.      * @see NIMBUS_INBOX_JAR_EXPIRATION_SECS
  201.      */
  202.     public static final String NIMBUS_CLEANUP_INBOX_FREQ_SECS = "nimbus.cleanup.inbox.freq.secs";
  203.     public static final Object NIMBUS_CLEANUP_INBOX_FREQ_SECS_SCHEMA = Number.class;
  204.     /**
  205.      * The length of time a jar file lives in the inbox before being deleted by the cleanup thread.
  206.      *
  207.      * Probably keep this value greater than or equal to NIMBUS_CLEANUP_INBOX_JAR_EXPIRATION_SECS.
  208.      * Note that the time it takes to delete an inbox jar file is going to be somewhat more than
  209.      * NIMBUS_CLEANUP_INBOX_JAR_EXPIRATION_SECS (depending on how often NIMBUS_CLEANUP_FREQ_SECS
  210.      * is set to).
  211.      * @see NIMBUS_CLEANUP_FREQ_SECS
  212.      */
  213.     public static final String NIMBUS_INBOX_JAR_EXPIRATION_SECS = "nimbus.inbox.jar.expiration.secs";
  214.     public static final Object NIMBUS_INBOX_JAR_EXPIRATION_SECS_SCHEMA = Number.class;
  215.     /**
  216.      * How long before a supervisor can go without heartbeating before nimbus considers it dead
  217.      * and stops assigning new work to it.
  218.      */
  219.     public static final String NIMBUS_SUPERVISOR_TIMEOUT_SECS = "nimbus.supervisor.timeout.secs";
  220.     public static final Object NIMBUS_SUPERVISOR_TIMEOUT_SECS_SCHEMA = Number.class;
  221.     /**
  222.      * A special timeout used when a task is initially launched. During launch, this is the timeout
  223.      * used until the first heartbeat, overriding nimbus.task.timeout.secs.
  224.      *
  225.      * <p>A separate timeout exists for launch because there can be quite a bit of overhead
  226.      * to launching new JVM's and configuring them.</p>
  227.      */
  228.     public static final String NIMBUS_TASK_LAUNCH_SECS = "nimbus.task.launch.secs";
  229.     public static final Object NIMBUS_TASK_LAUNCH_SECS_SCHEMA = Number.class;
  230.     /**
  231.      * Whether or not nimbus should reassign tasks if it detects that a task goes down.
  232.      * Defaults to true, and it's not recommended to change this value.
  233.      */
  234.     public static final String NIMBUS_REASSIGN = "nimbus.reassign";
  235.     public static final Object NIMBUS_REASSIGN_SCHEMA = Boolean.class;
  236.     /**
  237.      * During upload/download with the master, how long an upload or download connection is idle
  238.      * before nimbus considers it dead and drops the connection.
  239.      */
  240.     public static final String NIMBUS_FILE_COPY_EXPIRATION_SECS = "nimbus.file.copy.expiration.secs";
  241.     public static final Object NIMBUS_FILE_COPY_EXPIRATION_SECS_SCHEMA = Number.class;
  242.     /**
  243.      * A custom class that implements ITopologyValidator that is run whenever a
  244.      * topology is submitted. Can be used to provide business-specific logic for
  245.      * whether topologies are allowed to run or not.
  246.      */
  247.     public static final String NIMBUS_TOPOLOGY_VALIDATOR = "nimbus.topology.validator";
  248.     public static final Object NIMBUS_TOPOLOGY_VALIDATOR_SCHEMA = String.class;
  249.     /**
  250.      * Class name for authorization plugin for Nimbus
  251.      */
  252.     public static final String NIMBUS_AUTHORIZER = "nimbus.authorizer";
  253.     public static final Object NIMBUS_AUTHORIZER_SCHEMA = String.class;
  254.     /**
  255.      * Storm UI binds to this port.
  256.      */
  257.     public static final String UI_PORT = "ui.port";
  258.     public static final Object UI_PORT_SCHEMA = Number.class;
  259.     /**
  260.      * HTTP UI port for log viewer
  261.      */
  262.     public static final String LOGVIEWER_PORT = "logviewer.port";
  263.     public static final Object LOGVIEWER_PORT_SCHEMA = Number.class;
  264.     /**
  265.      * Childopts for log viewer java process.
  266.      */
  267.     public static final String LOGVIEWER_CHILDOPTS = "logviewer.childopts";
  268.     public static final Object LOGVIEWER_CHILDOPTS_SCHEMA = String.class;
  269.     /**
  270.      * Appender name used by log viewer to determine log directory.
  271.      */
  272.     public static final String LOGVIEWER_APPENDER_NAME = "logviewer.appender.name";
  273.     public static final Object LOGVIEWER_APPENDER_NAME_SCHEMA = String.class;
  274.     /**
  275.      * Childopts for Storm UI Java process.
  276.      */
  277.     public static final String UI_CHILDOPTS = "ui.childopts";
  278.     public static final Object UI_CHILDOPTS_SCHEMA = String.class;
  279.     /**
  280.      * List of DRPC servers so that the DRPCSpout knows who to talk to.
  281.      */
  282.     public static final String DRPC_SERVERS = "drpc.servers";
  283.     public static final Object DRPC_SERVERS_SCHEMA = ConfigValidation.StringsValidator;
  284.     /**
  285.      * This port is used by Storm DRPC for receiving DPRC requests from clients.
  286.      */
  287.     public static final String DRPC_PORT = "drpc.port";
  288.     public static final Object DRPC_PORT_SCHEMA = Number.class;
  289.     /**
  290.      * DRPC thrift server worker threads
  291.      */
  292.     public static final String DRPC_WORKER_THREADS = "drpc.worker.threads";
  293.     public static final Object DRPC_WORKER_THREADS_SCHEMA = Number.class;
  294.     /**
  295.      * DRPC thrift server queue size
  296.      */
  297.     public static final String DRPC_QUEUE_SIZE = "drpc.queue.size";
  298.     public static final Object DRPC_QUEUE_SIZE_SCHEMA = Number.class;
  299.     /**
  300.      * This port on Storm DRPC is used by DRPC topologies to receive function invocations and send results back.
  301.      */
  302.     public static final String DRPC_INVOCATIONS_PORT = "drpc.invocations.port";
  303.     public static final Object DRPC_INVOCATIONS_PORT_SCHEMA = Number.class;
  304.     /**
  305.      * The timeout on DRPC requests within the DRPC server. Defaults to 10 minutes. Note that requests can also
  306.      * timeout based on the socket timeout on the DRPC client, and separately based on the topology message
  307.      * timeout for the topology implementing the DRPC function.
  308.      */
  309.     public static final String DRPC_REQUEST_TIMEOUT_SECS  = "drpc.request.timeout.secs";
  310.     public static final Object DRPC_REQUEST_TIMEOUT_SECS_SCHEMA = Number.class;
  311.     /**
  312.      * Childopts for Storm DRPC Java process.
  313.      */
  314.     public static final String DRPC_CHILDOPTS = "drpc.childopts";
  315.     public static final Object DRPC_CHILDOPTS_SCHEMA = String.class;
  316.     /**
  317.      * the metadata configed on the supervisor
  318.      */
  319.     public static final String SUPERVISOR_SCHEDULER_META = "supervisor.scheduler.meta";
  320.     public static final Object SUPERVISOR_SCHEDULER_META_SCHEMA = Map.class;
  321.     /**
  322.      * A list of ports that can run workers on this supervisor. Each worker uses one port, and
  323.      * the supervisor will only run one worker per port. Use this configuration to tune
  324.      * how many workers run on each machine.
  325.      */
  326.     public static final String SUPERVISOR_SLOTS_PORTS = "supervisor.slots.ports";
  327.     public static final Object SUPERVISOR_SLOTS_PORTS_SCHEMA = ConfigValidation.NumbersValidator;
  328.     /**
  329.      * This parameter is used by the storm-deploy project to configure the
  330.      * jvm options for the supervisor daemon.
  331.      */
  332.     public static final String SUPERVISOR_CHILDOPTS = "supervisor.childopts";
  333.     public static final Object SUPERVISOR_CHILDOPTS_SCHEMA = String.class;
  334.     /**
  335.      * How long a worker can go without heartbeating before the supervisor tries to
  336.      * restart the worker process.
  337.      */
  338.     public static final String SUPERVISOR_WORKER_TIMEOUT_SECS = "supervisor.worker.timeout.secs";
  339.     public static final Object SUPERVISOR_WORKER_TIMEOUT_SECS_SCHEMA = Number.class;
  340.     /**
  341.      * How long a worker can go without heartbeating during the initial launch before
  342.      * the supervisor tries to restart the worker process. This value override
  343.      * supervisor.worker.timeout.secs during launch because there is additional
  344.      * overhead to starting and configuring the JVM on launch.
  345.      */
  346.     public static final String SUPERVISOR_WORKER_START_TIMEOUT_SECS = "supervisor.worker.start.timeout.secs";
  347.     public static final Object SUPERVISOR_WORKER_START_TIMEOUT_SECS_SCHEMA = Number.class;
  348.     /**
  349.      * Whether or not the supervisor should launch workers assigned to it. Defaults
  350.      * to true -- and you should probably never change this value. This configuration
  351.      * is used in the Storm unit tests.
  352.      */
  353.     public static final String SUPERVISOR_ENABLE = "supervisor.enable";
  354.     public static final Object SUPERVISOR_ENABLE_SCHEMA = Boolean.class;
  355.     /**
  356.      * how often the supervisor sends a heartbeat to the master.
  357.      */
  358.     public static final String SUPERVISOR_HEARTBEAT_FREQUENCY_SECS = "supervisor.heartbeat.frequency.secs";
  359.     public static final Object SUPERVISOR_HEARTBEAT_FREQUENCY_SECS_SCHEMA = Number.class;
  360.     /**
  361.      * How often the supervisor checks the worker heartbeats to see if any of them
  362.      * need to be restarted.
  363.      */
  364.     public static final String SUPERVISOR_MONITOR_FREQUENCY_SECS = "supervisor.monitor.frequency.secs";
  365.     public static final Object SUPERVISOR_MONITOR_FREQUENCY_SECS_SCHEMA = Number.class;
  366.     /**
  367.      * The jvm opts provided to workers launched by this supervisor. All "%ID%" substrings are replaced
  368.      * with an identifier for this worker.
  369.      */
  370.     public static final String WORKER_CHILDOPTS = "worker.childopts";
  371.     public static final Object WORKER_CHILDOPTS_SCHEMA = String.class;
  372.     /**
  373.      * How often this worker should heartbeat to the supervisor.
  374.      */
  375.     public static final String WORKER_HEARTBEAT_FREQUENCY_SECS = "worker.heartbeat.frequency.secs";
  376.     public static final Object WORKER_HEARTBEAT_FREQUENCY_SECS_SCHEMA = Number.class;
  377.     /**
  378.      * How often a task should heartbeat its status to the master.
  379.      */
  380.     public static final String TASK_HEARTBEAT_FREQUENCY_SECS = "task.heartbeat.frequency.secs";
  381.     public static final Object TASK_HEARTBEAT_FREQUENCY_SECS_SCHEMA = Number.class;
  382.     /**
  383.      * How often a task should sync its connections with other tasks (if a task is
  384.      * reassigned, the other tasks sending messages to it need to refresh their connections).
  385.      * In general though, when a reassignment happens other tasks will be notified
  386.      * almost immediately. This configuration is here just in case that notification doesn't
  387.      * come through.
  388.      */
  389.     public static final String TASK_REFRESH_POLL_SECS = "task.refresh.poll.secs";
  390.     public static final Object TASK_REFRESH_POLL_SECS_SCHEMA = Number.class;
  391.     /**
  392.      * True if Storm should timeout messages or not. Defaults to true. This is meant to be used
  393.      * in unit tests to prevent tuples from being accidentally timed out during the test.
  394.      */
  395.     public static final String TOPOLOGY_ENABLE_MESSAGE_TIMEOUTS = "topology.enable.message.timeouts";
  396.     public static final Object TOPOLOGY_ENABLE_MESSAGE_TIMEOUTS_SCHEMA = Boolean.class;
  397.     /**
  398.      * When set to true, Storm will log every message that's emitted.
  399.      */
  400.     public static final String TOPOLOGY_DEBUG = "topology.debug";
  401.     public static final Object TOPOLOGY_DEBUG_SCHEMA = Boolean.class;
  402.     /**
  403.      * Whether or not the master should optimize topologies by running multiple
  404.      * tasks in a single thread where appropriate.
  405.      */
  406.     public static final String TOPOLOGY_OPTIMIZE = "topology.optimize";
  407.     public static final Object TOPOLOGY_OPTIMIZE_SCHEMA = Boolean.class;
  408.     /**
  409.      * How many processes should be spawned around the cluster to execute this
  410.      * topology. Each process will execute some number of tasks as threads within
  411.      * them. This parameter should be used in conjunction with the parallelism hints
  412.      * on each component in the topology to tune the performance of a topology.
  413.      */
  414.     public static final String TOPOLOGY_WORKERS = "topology.workers";
  415.     public static final Object TOPOLOGY_WORKERS_SCHEMA = Number.class;
  416.     /**
  417.      * How many instances to create for a spout/bolt. A task runs on a thread with zero or more
  418.      * other tasks for the same spout/bolt. The number of tasks for a spout/bolt is always
  419.      * the same throughout the lifetime of a topology, but the number of executors (threads) for
  420.      * a spout/bolt can change over time. This allows a topology to scale to more or less resources
  421.      * without redeploying the topology or violating the constraints of Storm (such as a fields grouping
  422.      * guaranteeing that the same value goes to the same task).
  423.      */
  424.     public static final String TOPOLOGY_TASKS = "topology.tasks";
  425.     public static final Object TOPOLOGY_TASKS_SCHEMA = Number.class;
  426.     /**
  427.      * How many executors to spawn for ackers.
  428.      *
  429.      * <p>If this is set to 0, then Storm will immediately ack tuples as soon
  430.      * as they come off the spout, effectively disabling reliability.</p>
  431.      */
  432.     public static final String TOPOLOGY_ACKER_EXECUTORS = "topology.acker.executors";
  433.     public static final Object TOPOLOGY_ACKER_EXECUTORS_SCHEMA = Number.class;
  434.     /**
  435.      * The maximum amount of time given to the topology to fully process a message
  436.      * emitted by a spout. If the message is not acked within this time frame, Storm
  437.      * will fail the message on the spout. Some spouts implementations will then replay
  438.      * the message at a later time.
  439.      */
  440.     public static final String TOPOLOGY_MESSAGE_TIMEOUT_SECS = "topology.message.timeout.secs";
  441.     public static final Object TOPOLOGY_MESSAGE_TIMEOUT_SECS_SCHEMA = Number.class;
  442.     /**
  443.      * A list of serialization registrations for Kryo ( http://code.google.com/p/kryo/ ),
  444.      * the underlying serialization framework for Storm. A serialization can either
  445.      * be the name of a class (in which case Kryo will automatically create a serializer for the class
  446.      * that saves all the object's fields), or an implementation of com.esotericsoftware.kryo.Serializer.
  447.      *
  448.      * See Kryo's documentation for more information about writing custom serializers.
  449.      */
  450.     public static final String TOPOLOGY_KRYO_REGISTER = "topology.kryo.register";
  451.     public static final Object TOPOLOGY_KRYO_REGISTER_SCHEMA = ConfigValidation.StringsValidator;
  452.     /**
  453.      * A list of classes that customize storm's kryo instance during start-up.
  454.      * Each listed class name must implement IKryoDecorator. During start-up the
  455.      * listed class is instantiated with 0 arguments, then its 'decorate' method
  456.      * is called with storm's kryo instance as the only argument.
  457.      */
  458.     public static final String TOPOLOGY_KRYO_DECORATORS = "topology.kryo.decorators";
  459.     public static final Object TOPOLOGY_KRYO_DECORATORS_SCHEMA = ConfigValidation.StringsValidator;
  460.     /**
  461.      * Class that specifies how to create a Kryo instance for serialization. Storm will then apply
  462.      * topology.kryo.register and topology.kryo.decorators on top of this. The default implementation
  463.      * implements topology.fall.back.on.java.serialization and turns references off.
  464.      */
  465.     public static final String TOPOLOGY_KRYO_FACTORY = "topology.kryo.factory";
  466.     public static final Object TOPOLOGY_KRYO_FACTORY_SCHEMA = String.class;
  467.     /**
  468.      * Whether or not Storm should skip the loading of kryo registrations for which it
  469.      * does not know the class or have the serializer implementation. Otherwise, the task will
  470.      * fail to load and will throw an error at runtime. The use case of this is if you want to
  471.      * declare your serializations on the storm.yaml files on the cluster rather than every single
  472.      * time you submit a topology. Different applications may use different serializations and so
  473.      * a single application may not have the code for the other serializers used by other apps.
  474.      * By setting this config to true, Storm will ignore that it doesn't have those other serializations
  475.      * rather than throw an error.
  476.      */
  477.     public static final String TOPOLOGY_SKIP_MISSING_KRYO_REGISTRATIONS= "topology.skip.missing.kryo.registrations";
  478.     public static final Object TOPOLOGY_SKIP_MISSING_KRYO_REGISTRATIONS_SCHEMA = Boolean.class;
  479.     /*
  480.      * A list of classes implementing IMetricsConsumer (See storm.yaml.example for exact config format).
  481.      * Each listed class will be routed all the metrics data generated by the storm metrics API.
  482.      * Each listed class maps 1:1 to a system bolt named __metrics_ClassName#N, and it's parallelism is configurable.
  483.      */
  484.     public static final String TOPOLOGY_METRICS_CONSUMER_REGISTER = "topology.metrics.consumer.register";
  485.     public static final Object TOPOLOGY_METRICS_CONSUMER_REGISTER_SCHEMA = ConfigValidation.MapsValidator;
  486.     /**
  487.      * The maximum parallelism allowed for a component in this topology. This configuration is
  488.      * typically used in testing to limit the number of threads spawned in local mode.
  489.      */
  490.     public static final String TOPOLOGY_MAX_TASK_PARALLELISM="topology.max.task.parallelism";
  491.     public static final Object TOPOLOGY_MAX_TASK_PARALLELISM_SCHEMA = Number.class;
  492.     /**
  493.      * The maximum number of tuples that can be pending on a spout task at any given time.
  494.      * This config applies to individual tasks, not to spouts or topologies as a whole.
  495.      *
  496.      * A pending tuple is one that has been emitted from a spout but has not been acked or failed yet.
  497.      * Note that this config parameter has no effect for unreliable spouts that don't tag
  498.      * their tuples with a message id.
  499.      */
  500.     public static final String TOPOLOGY_MAX_SPOUT_PENDING="topology.max.spout.pending";
  501.     public static final Object TOPOLOGY_MAX_SPOUT_PENDING_SCHEMA = Number.class;
  502.     /**
  503.      * A class that implements a strategy for what to do when a spout needs to wait. Waiting is
  504.      * triggered in one of two conditions:
  505.      *
  506.      * 1. nextTuple emits no tuples
  507.      * 2. The spout has hit maxSpoutPending and can't emit any more tuples
  508.      */
  509.     public static final String TOPOLOGY_SPOUT_WAIT_STRATEGY="topology.spout.wait.strategy";
  510.     public static final Object TOPOLOGY_SPOUT_WAIT_STRATEGY_SCHEMA = String.class;
  511.     /**
  512.      * The amount of milliseconds the SleepEmptyEmitStrategy should sleep for.
  513.      */
  514.     public static final String TOPOLOGY_SLEEP_SPOUT_WAIT_STRATEGY_TIME_MS="topology.sleep.spout.wait.strategy.time.ms";
  515.     public static final Object TOPOLOGY_SLEEP_SPOUT_WAIT_STRATEGY_TIME_MS_SCHEMA = Number.class;
  516.     /**
  517.      * The maximum amount of time a component gives a source of state to synchronize before it requests
  518.      * synchronization again.
  519.      */
  520.     public static final String TOPOLOGY_STATE_SYNCHRONIZATION_TIMEOUT_SECS="topology.state.synchronization.timeout.secs";
  521.     public static final Object TOPOLOGY_STATE_SYNCHRONIZATION_TIMEOUT_SECS_SCHEMA = Number.class;
  522.     /**
  523.      * The percentage of tuples to sample to produce stats for a task.
  524.      */
  525.     public static final String TOPOLOGY_STATS_SAMPLE_RATE="topology.stats.sample.rate";
  526.     public static final Object TOPOLOGY_STATS_SAMPLE_RATE_SCHEMA = Number.class;
  527.     /**
  528.      * The time period that builtin metrics data in bucketed into.
  529.      */
  530.     public static final String TOPOLOGY_BUILTIN_METRICS_BUCKET_SIZE_SECS="topology.builtin.metrics.bucket.size.secs";
  531.     public static final Object TOPOLOGY_BUILTIN_METRICS_BUCKET_SIZE_SECS_SCHEMA = Number.class;
  532.     /**
  533.      * Whether or not to use Java serialization in a topology.
  534.      */
  535.     public static final String TOPOLOGY_FALL_BACK_ON_JAVA_SERIALIZATION="topology.fall.back.on.java.serialization";
  536.     public static final Object TOPOLOGY_FALL_BACK_ON_JAVA_SERIALIZATION_SCHEMA = Boolean.class;
  537.     /**
  538.      * Topology-specific options for the worker child process. This is used in addition to WORKER_CHILDOPTS.
  539.      */
  540.     public static final String TOPOLOGY_WORKER_CHILDOPTS="topology.worker.childopts";
  541.     public static final Object TOPOLOGY_WORKER_CHILDOPTS_SCHEMA = String.class;
  542.     /**
  543.      * This config is available for TransactionalSpouts, and contains the id ( a String) for
  544.      * the transactional topology. This id is used to store the state of the transactional
  545.      * topology in Zookeeper.
  546.      */
  547.     public static final String TOPOLOGY_TRANSACTIONAL_ID="topology.transactional.id";
  548.     public static final Object TOPOLOGY_TRANSACTIONAL_ID_SCHEMA = String.class;
  549.     /**
  550.      * A list of task hooks that are automatically added to every spout and bolt in the topology. An example
  551.      * of when you'd do this is to add a hook that integrates with your internal
  552.      * monitoring system. These hooks are instantiated using the zero-arg constructor.
  553.      */
  554.     public static final String TOPOLOGY_AUTO_TASK_HOOKS="topology.auto.task.hooks";
  555.     public static final Object TOPOLOGY_AUTO_TASK_HOOKS_SCHEMA = ConfigValidation.StringsValidator;
  556.     /**
  557.      * The size of the Disruptor receive queue for each executor. Must be a power of 2.
  558.      */
  559.     public static final String TOPOLOGY_EXECUTOR_RECEIVE_BUFFER_SIZE="topology.executor.receive.buffer.size";
  560.     public static final Object TOPOLOGY_EXECUTOR_RECEIVE_BUFFER_SIZE_SCHEMA = ConfigValidation.PowerOf2Validator;
  561.     /**
  562.      * The maximum number of messages to batch from the thread receiving off the network to the
  563.      * executor queues. Must be a power of 2.
  564.      */
  565.     public static final String TOPOLOGY_RECEIVER_BUFFER_SIZE="topology.receiver.buffer.size";
  566.     public static final Object TOPOLOGY_RECEIVER_BUFFER_SIZE_SCHEMA = ConfigValidation.PowerOf2Validator;
  567.     /**
  568.      * The size of the Disruptor send queue for each executor. Must be a power of 2.
  569.      */
  570.     public static final String TOPOLOGY_EXECUTOR_SEND_BUFFER_SIZE="topology.executor.send.buffer.size";
  571.     public static final Object TOPOLOGY_EXECUTOR_SEND_BUFFER_SIZE_SCHEMA = ConfigValidation.PowerOf2Validator;
  572.     /**
  573.      * The size of the Disruptor transfer queue for each worker.
  574.      */
  575.     public static final String TOPOLOGY_TRANSFER_BUFFER_SIZE="topology.transfer.buffer.size";
  576.     public static final Object TOPOLOGY_TRANSFER_BUFFER_SIZE_SCHEMA = Number.class;
  577.    /**
  578.     * How often a tick tuple from the "__system" component and "__tick" stream should be sent
  579.     * to tasks. Meant to be used as a component-specific configuration.
  580.     */
  581.     public static final String TOPOLOGY_TICK_TUPLE_FREQ_SECS="topology.tick.tuple.freq.secs";
  582.     public static final Object TOPOLOGY_TICK_TUPLE_FREQ_SECS_SCHEMA = Number.class;
  583.    /**
  584.     * Configure the wait strategy used for internal queuing. Can be used to tradeoff latency
  585.     * vs. throughput
  586.     */
  587.     public static final String TOPOLOGY_DISRUPTOR_WAIT_STRATEGY="topology.disruptor.wait.strategy";
  588.     public static final Object TOPOLOGY_DISRUPTOR_WAIT_STRATEGY_SCHEMA = String.class;
  589.    /**
  590.     * The size of the shared thread pool for worker tasks to make use of. The thread pool can be accessed
  591.     * via the TopologyContext.
  592.     */
  593.     public static final String TOPOLOGY_WORKER_SHARED_THREAD_POOL_SIZE="topology.worker.shared.thread.pool.size";
  594.     public static final Object TOPOLOGY_WORKER_SHARED_THREAD_POOL_SIZE_SCHEMA = Number.class;
  595.     /**
  596.      * The interval in seconds to use for determining whether to throttle error reported to Zookeeper. For example,
  597.      * an interval of 10 seconds with topology.max.error.report.per.interval set to 5 will only allow 5 errors to be
  598.      * reported to Zookeeper per task for every 10 second interval of time.
  599.      */
  600.     public static final String TOPOLOGY_ERROR_THROTTLE_INTERVAL_SECS="topology.error.throttle.interval.secs";
  601.     public static final Object TOPOLOGY_ERROR_THROTTLE_INTERVAL_SECS_SCHEMA = Number.class;
  602.     /**
  603.      * See doc for TOPOLOGY_ERROR_THROTTLE_INTERVAL_SECS
  604.      */
  605.     public static final String TOPOLOGY_MAX_ERROR_REPORT_PER_INTERVAL="topology.max.error.report.per.interval";
  606.     public static final Object TOPOLOGY_MAX_ERROR_REPORT_PER_INTERVAL_SCHEMA = Number.class;
  607.     /**
  608.      * How often a batch can be emitted in a Trident topology.
  609.      */
  610.     public static final String TOPOLOGY_TRIDENT_BATCH_EMIT_INTERVAL_MILLIS="topology.trident.batch.emit.interval.millis";
  611.     public static final Object TOPOLOGY_TRIDENT_BATCH_EMIT_INTERVAL_MILLIS_SCHEMA = Number.class;
  612.     /**
  613.      * Name of the topology. This config is automatically set by Storm when the topology is submitted.
  614.      */
  615.     public static final String TOPOLOGY_NAME="topology.name";
  616.     public static final Object TOPOLOGY_NAME_SCHEMA = String.class;
  617.     /**
  618.      * Max pending tuples in one ShellBolt
  619.      */
  620.     public static final String TOPOLOGY_SHELLBOLT_MAX_PENDING="topology.shellbolt.max.pending";
  621.     public static final Object TOPOLOGY_SHELLBOLT_MAX_PENDING_SCHEMA = Number.class;
  622.     /**
  623.      * The root directory in ZooKeeper for metadata about TransactionalSpouts.
  624.      */
  625.     public static final String TRANSACTIONAL_ZOOKEEPER_ROOT="transactional.zookeeper.root";
  626.     public static final Object TRANSACTIONAL_ZOOKEEPER_ROOT_SCHEMA = String.class;
  627.     /**
  628.      * The list of zookeeper servers in which to keep the transactional state. If null (which is default),
  629.      * will use storm.zookeeper.servers
  630.      */
  631.     public static final String TRANSACTIONAL_ZOOKEEPER_SERVERS="transactional.zookeeper.servers";
  632.     public static final Object TRANSACTIONAL_ZOOKEEPER_SERVERS_SCHEMA = ConfigValidation.StringsValidator;
  633.     /**
  634.      * The port to use to connect to the transactional zookeeper servers. If null (which is default),
  635.      * will use storm.zookeeper.port
  636.      */
  637.     public static final String TRANSACTIONAL_ZOOKEEPER_PORT="transactional.zookeeper.port";
  638.     public static final Object TRANSACTIONAL_ZOOKEEPER_PORT_SCHEMA = Number.class;
  639.     /**
  640.      * The number of threads that should be used by the zeromq context in each worker process.
  641.      */
  642.     public static final String ZMQ_THREADS = "zmq.threads";
  643.     public static final Object ZMQ_THREADS_SCHEMA = Number.class;
  644.     /**
  645.      * How long a connection should retry sending messages to a target host when
  646.      * the connection is closed. This is an advanced configuration and can almost
  647.      * certainly be ignored.
  648.      */
  649.     public static final String ZMQ_LINGER_MILLIS = "zmq.linger.millis";
  650.     public static final Object ZMQ_LINGER_MILLIS_SCHEMA = Number.class;
  651.     /**
  652.      * The high water for the ZeroMQ push sockets used for networking. Use this config to prevent buffer explosion
  653.      * on the networking layer.
  654.      */
  655.     public static final String ZMQ_HWM = "zmq.hwm";
  656.     public static final Object ZMQ_HWM_SCHEMA = Number.class;
  657.     /**
  658.      * This value is passed to spawned JVMs (e.g., Nimbus, Supervisor, and Workers)
  659.      * for the java.library.path value. java.library.path tells the JVM where
  660.      * to look for native libraries. It is necessary to set this config correctly since
  661.      * Storm uses the ZeroMQ and JZMQ native libs.
  662.      */
  663.     public static final String JAVA_LIBRARY_PATH = "java.library.path";
  664.     public static final Object JAVA_LIBRARY_PATH_SCHEMA = String.class;
  665.     /**
  666.      * The path to use as the zookeeper dir when running a zookeeper server via
  667.      * "storm dev-zookeeper". This zookeeper instance is only intended for development;
  668.      * it is not a production grade zookeeper setup.
  669.      */
  670.     public static final String DEV_ZOOKEEPER_PATH = "dev.zookeeper.path";
  671.     public static final Object DEV_ZOOKEEPER_PATH_SCHEMA = String.class;
  672.     /**
  673.      * A map from topology name to the number of machines that should be dedicated for that topology. Set storm.scheduler
  674.      * to backtype.storm.scheduler.IsolationScheduler to make use of the isolation scheduler.
  675.      */
  676.     public static final String ISOLATION_SCHEDULER_MACHINES = "isolation.scheduler.machines";
  677.     public static final Object ISOLATION_SCHEDULER_MACHINES_SCHEMA = Map.class;
  678.     public static void setDebug(Map conf, boolean isOn) {
  679.         conf.put(Config.TOPOLOGY_DEBUG, isOn);
  680.     }
  681.     public void setDebug(boolean isOn) {
  682.         setDebug(this, isOn);
  683.     }
  684.    
  685.     @Deprecated
  686.     public void setOptimize(boolean isOn) {
  687.         put(Config.TOPOLOGY_OPTIMIZE, isOn);
  688.     }
  689.    
  690.     public static void setNumWorkers(Map conf, int workers) {
  691.         conf.put(Config.TOPOLOGY_WORKERS, workers);
  692.     }
  693.     public void setNumWorkers(int workers) {
  694.         setNumWorkers(this, workers);
  695.     }
  696.     public static void setNumAckers(Map conf, int numExecutors) {
  697.         conf.put(Config.TOPOLOGY_ACKER_EXECUTORS, numExecutors);
  698.     }
  699.     public void setNumAckers(int numExecutors) {
  700.         setNumAckers(this, numExecutors);
  701.     }
  702.    
  703.     public static void setMessageTimeoutSecs(Map conf, int secs) {
  704.         conf.put(Config.TOPOLOGY_MESSAGE_TIMEOUT_SECS, secs);
  705.     }
  706.     public void setMessageTimeoutSecs(int secs) {
  707.         setMessageTimeoutSecs(this, secs);
  708.     }
  709.    
  710.     public static void registerSerialization(Map conf, Class klass) {
  711.         getRegisteredSerializations(conf).add(klass.getName());
  712.     }
  713.     public void registerSerialization(Class klass) {
  714.         registerSerialization(this, klass);
  715.     }
  716.    
  717.     public static void registerSerialization(Map conf, Class klass, Class<? extends Serializer> serializerClass) {
  718.         Map<String, String> register = new HashMap<String, String>();
  719.         register.put(klass.getName(), serializerClass.getName());
  720.         getRegisteredSerializations(conf).add(register);        
  721.     }
  722.     public void registerSerialization(Class klass, Class<? extends Serializer> serializerClass) {
  723.         registerSerialization(this, klass, serializerClass);
  724.     }
  725.    
  726.     public void registerMetricsConsumer(Class klass, Object argument, long parallelismHint) {
  727.         HashMap m = new HashMap();
  728.         m.put("class", klass.getCanonicalName());
  729.         m.put("parallelism.hint", parallelismHint);
  730.         m.put("argument", argument);
  731.         List l = (List)this.get(TOPOLOGY_METRICS_CONSUMER_REGISTER);
  732.         if(l == null) { l = new ArrayList(); }
  733.         l.add(m);
  734.         this.put(TOPOLOGY_METRICS_CONSUMER_REGISTER, l);
  735.     }
  736.     public void registerMetricsConsumer(Class klass, long parallelismHint) {
  737.         registerMetricsConsumer(klass, null, parallelismHint);
  738.     }
  739.     public void registerMetricsConsumer(Class klass) {
  740.         registerMetricsConsumer(klass, null, 1L);
  741.     }
  742.     public static void registerDecorator(Map conf, Class<? extends IKryoDecorator> klass) {
  743.         getRegisteredDecorators(conf).add(klass.getName());
  744.     }
  745.     public void registerDecorator(Class<? extends IKryoDecorator> klass) {
  746.         registerDecorator(this, klass);
  747.     }
  748.    
  749.     public static void setKryoFactory(Map conf, Class<? extends IKryoFactory> klass) {
  750.         conf.put(Config.TOPOLOGY_KRYO_FACTORY, klass.getName());
  751.     }
  752.     public void setKryoFactory(Class<? extends IKryoFactory> klass) {
  753.         setKryoFactory(this, klass);
  754.     }
  755.     public static void setSkipMissingKryoRegistrations(Map conf, boolean skip) {
  756.         conf.put(Config.TOPOLOGY_SKIP_MISSING_KRYO_REGISTRATIONS, skip);
  757.     }
  758.     public void setSkipMissingKryoRegistrations(boolean skip) {
  759.        setSkipMissingKryoRegistrations(this, skip);
  760.     }
  761.    
  762.     public static void setMaxTaskParallelism(Map conf, int max) {
  763.         conf.put(Config.TOPOLOGY_MAX_TASK_PARALLELISM, max);
  764.     }
  765.     public void setMaxTaskParallelism(int max) {
  766.         setMaxTaskParallelism(this, max);
  767.     }
  768.    
  769.     public static void setMaxSpoutPending(Map conf, int max) {
  770.         conf.put(Config.TOPOLOGY_MAX_SPOUT_PENDING, max);
  771.     }
  772.     public void setMaxSpoutPending(int max) {
  773.         setMaxSpoutPending(this, max);
  774.     }
  775.    
  776.     public static void setStatsSampleRate(Map conf, double rate) {
  777.         conf.put(Config.TOPOLOGY_STATS_SAMPLE_RATE, rate);
  778.     }   
  779.     public void setStatsSampleRate(double rate) {
  780.         setStatsSampleRate(this, rate);
  781.     }   
  782.     public static void setFallBackOnJavaSerialization(Map conf, boolean fallback) {
  783.         conf.put(Config.TOPOLOGY_FALL_BACK_ON_JAVA_SERIALIZATION, fallback);
  784.     }   
  785.     public void setFallBackOnJavaSerialization(boolean fallback) {
  786.         setFallBackOnJavaSerialization(this, fallback);
  787.     }   
  788.    
  789.     private static List getRegisteredSerializations(Map conf) {
  790.         List ret;
  791.         if(!conf.containsKey(Config.TOPOLOGY_KRYO_REGISTER)) {
  792.             ret = new ArrayList();
  793.         } else {
  794.             ret = new ArrayList((List) conf.get(Config.TOPOLOGY_KRYO_REGISTER));
  795.         }
  796.         conf.put(Config.TOPOLOGY_KRYO_REGISTER, ret);
  797.         return ret;
  798.     }
  799.    
  800.     private static List getRegisteredDecorators(Map conf) {
  801.         List ret;
  802.         if(!conf.containsKey(Config.TOPOLOGY_KRYO_DECORATORS)) {
  803.             ret = new ArrayList();
  804.         } else {
  805.             ret = new ArrayList((List) conf.get(Config.TOPOLOGY_KRYO_DECORATORS));            
  806.         }
  807.         conf.put(Config.TOPOLOGY_KRYO_DECORATORS, ret);
  808.         return ret;
  809.     }
  810. }
复制代码








已有(5)人评论

跳转到指定楼层
邓立辉 发表于 2015-10-26 15:49:54
这个必须顶
回复

使用道具 举报

chimes298 发表于 2015-10-29 10:38:15
你好,请问一下如果节点上有多个worker,这个2048m指每个worker占用的内存还是所有worker总占用的?
回复

使用道具 举报

tntzbzc 发表于 2015-10-29 14:47:06
chimes298 发表于 2015-10-29 10:38
你好,请问一下如果节点上有多个worker,这个2048m指每个worker占用的内存还是所有worker总占用的?

2048M是两个G,work增多的话,2G不够用的。个人认为针对单个的
回复

使用道具 举报

chimes298 发表于 2015-10-29 16:07:22
tntzbzc 发表于 2015-10-29 14:47
2048M是两个G,work增多的话,2G不够用的。个人认为针对单个的

谢谢你~我也偏向于觉得是单个的
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条