小编Joe*_*erg的帖子

文件大小单元的Java枚举是否等同于java.util.concurrent.TimeUnit?

我一直很喜欢使用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)

java time enums filesize

35
推荐指数
3
解决办法
6565
查看次数

在我的Storm集群中读取AWS SQS队列时,导致这些ParseError异常的原因是什么

我正在使用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)

java jaxp amazon-sqs amazon-web-services apache-storm

24
推荐指数
1
解决办法
1万
查看次数