我一直很喜欢使用TimeUnit的作业的可读性,如下所示:
long timePeriodInMillis = TimeUnit.MINUTES.toMillis( 53 );
Run Code Online (Sandbox Code Playgroud)
比如:
long timePeriodInMillis = 53 * 60 * 1000;
Run Code Online (Sandbox Code Playgroud)
是否有可用于文件大小单元的等效枚举?就像是
long maxBits = FilesizeUnit.MEGABYTES.toBits( 11 );
Run Code Online (Sandbox Code Playgroud) 我正在使用Storm 0.8.1从Amazon SQS队列中读取传入消息,并在执行此操作时获得一致的异常:
2013-12-02 02:21:38 executor [ERROR]
java.lang.RuntimeException: com.amazonaws.AmazonClientException: Unable to unmarshall response (ParseError at [row,col]:[1,1]
Message: JAXP00010001: The parser has encountered more than "64000" entity expansions in this document; this is the limit imposed by the JDK.)
at REDACTED.spouts.SqsQueueSpout.handleNextTuple(SqsQueueSpout.java:219)
at REDACTED.spouts.SqsQueueSpout.nextTuple(SqsQueueSpout.java:88)
at backtype.storm.daemon.executor$fn__3976$fn__4017$fn__4018.invoke(executor.clj:447)
at backtype.storm.util$async_loop$fn__465.invoke(util.clj:377)
at clojure.lang.AFn.run(AFn.java:24)
at java.lang.Thread.run(Thread.java:701)
Caused by: com.amazonaws.AmazonClientException: Unable to unmarshall response (ParseError at [row,col]:[1,1]
Message: JAXP00010001: The parser has encountered more than "64000" entity expansions in this document; this is the limit imposed by …
Run Code Online (Sandbox Code Playgroud)