File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed
external/kafka-0-10/src/test/java/org/apache/spark/streaming/kafka010 Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -48,15 +48,12 @@ public void testConsumerStrategyConstructors() {
4848 JavaConverters .mapAsScalaMapConverter (kafkaParams ).asScala ();
4949 final Map <TopicPartition , Long > offsets = new HashMap <>();
5050 offsets .put (tp1 , 23L );
51+ final Map <TopicPartition , Object > dummyOffsets = new HashMap <>();
52+ for (Map .Entry <TopicPartition , Long > kv : offsets .entrySet ()) {
53+ dummyOffsets .put (kv .getKey (), kv .getValue ());
54+ }
5155 final scala .collection .Map <TopicPartition , Object > sOffsets =
52- JavaConverters .mapAsScalaMapConverter (offsets ).asScala ().mapValues (
53- new scala .runtime .AbstractFunction1 <Long , Object >() {
54- @ Override
55- public Object apply (Long x ) {
56- return (Object ) x ;
57- }
58- }
59- ).toMap (null );
56+ JavaConverters .asScala (dummyOffsets );
6057
6158 final ConsumerStrategy <String , String > sub1 =
6259 ConsumerStrategies .Subscribe (sTopics , sKafkaParams , sOffsets );
You can’t perform that action at this time.
0 commit comments