Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
import java.util.Map;

import org.apache.storm.hdfs.common.HdfsUtils.Pair;
import sun.reflect.generics.reflectiveObjects.NotImplementedException;


public class TestHdfsSpout {
Expand Down Expand Up @@ -704,12 +703,12 @@ public List<Integer> emit(String streamId, List<Object> tuple, Object messageId)

@Override
public void emitDirect(int arg0, String arg1, List<Object> arg2, Object arg3) {
throw new NotImplementedException();
throw new UnsupportedOperationException("NOT Implemented");
}

@Override
public void reportError(Throwable arg0) {
throw new NotImplementedException();
throw new UnsupportedOperationException("NOT Implemented");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.storm.kinesis.spout.test;

import org.apache.storm.task.OutputCollector;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.storm.kinesis.spout.test;

import com.amazonaws.ClientConfiguration;
Expand Down Expand Up @@ -37,4 +54,4 @@ public static void main (String args[]) throws InvalidTopologyException, Authori
topologyConfig.setNumWorkers(3);
StormSubmitter.submitTopology(topologyName, topologyConfig, topologyBuilder.createTopology());
}
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.storm.kinesis.spout.test;

import com.amazonaws.services.kinesis.model.Record;
Expand Down
4 changes: 4 additions & 0 deletions external/storm-redis/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</dependency>
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import redis.clients.jedis.JedisCommands;
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;
import org.apache.commons.codec.binary.Base64;

import java.io.IOException;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
Expand All @@ -42,9 +40,7 @@ public class RedisKeyValueState<K, V> implements KeyValueState<K, V> {
private static final Logger LOG = LoggerFactory.getLogger(RedisKeyValueState.class);
private static final String COMMIT_TXID_KEY = "commit";
private static final String PREPARE_TXID_KEY = "prepare";

private final BASE64Encoder base64Encoder;
private final BASE64Decoder base64Decoder;

private final String namespace;
private final String prepareNamespace;
private final String txidNamespace;
Expand All @@ -69,8 +65,6 @@ public RedisKeyValueState(String namespace, JedisPoolConfig poolConfig, Serializ

public RedisKeyValueState(String namespace, JedisCommandsInstanceContainer jedisContainer,
Serializer<K> keySerializer, Serializer<V> valueSerializer) {
base64Encoder = new BASE64Encoder();
base64Decoder = new BASE64Decoder();
this.namespace = namespace;
this.prepareNamespace = namespace + "$prepare";
this.txidNamespace = namespace + "$txid";
Expand Down Expand Up @@ -297,14 +291,10 @@ private Long lastId(String key) {
}

private String encode(byte[] bytes) {
return base64Encoder.encode(bytes);
return Base64.encodeBase64String(bytes);
}

private byte[] decode(String s) {
try {
return base64Decoder.decodeBuffer(s);
} catch (IOException ex) {
throw new RuntimeException("Error while decoding string " + s);
}
return Base64.decodeBase64(s);
}
}
4 changes: 4 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,10 @@
<!-- exclude intellij projects -->
<exclude>**/*.iml</exclude>
<exclude>**/.idea/**</exclude>
<!-- exclude eclipse projects -->
<exclude>**/*.classpath</exclude>
<exclude>**/.project</exclude>
<exclude>**/.settings/**</exclude>
<!-- module specific testing artifacts -->
<exclude>**/metastore_db/**</exclude>
<!-- anything written into build should be ignored -->
Expand Down
2 changes: 1 addition & 1 deletion storm-core/test/jvm/org/apache/storm/tuple/FieldsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public void selectTest() {
Assert.assertTrue(pickSecondAndFirst.equals(secondAndFirst));
}

@Test(expected = NullPointerException.class)
@Test(expected = IllegalArgumentException.class)
public void selectingUnknownFieldThrowsTest() {
Fields fields = new Fields("foo", "bar");
fields.select(new Fields("bar", "baz"), Arrays.asList(new Object[]{"a", "b", "c"}));
Expand Down