flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject [1/2] flink git commit: [hotfix] Remove unused legacy code
Date Tue, 23 Aug 2016 17:14:01 GMT
Repository: flink
Updated Branches:
  refs/heads/master 502ae585c -> 863dc1805


[hotfix] Remove unused legacy code


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/1619e01e
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/1619e01e
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/1619e01e

Branch: refs/heads/master
Commit: 1619e01e15c45b67f1b5ad16521ce632457d3f28
Parents: 502ae58
Author: Stephan Ewen <sewen@apache.org>
Authored: Fri Aug 19 13:53:17 2016 +0200
Committer: Stephan Ewen <sewen@apache.org>
Committed: Tue Aug 23 18:29:45 2016 +0200

----------------------------------------------------------------------
 .../runtime/util/SerializableArrayList.java     | 100 -----------------
 .../flink/runtime/util/SerializableHashMap.java | 111 -------------------
 .../flink/runtime/util/SerializableHashSet.java |  78 -------------
 .../flink/runtime/event/task/EventList.java     |  36 ------
 .../flink/runtime/event/task/TaskEventTest.java |  27 -----
 5 files changed, 352 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/1619e01e/flink-runtime/src/main/java/org/apache/flink/runtime/util/SerializableArrayList.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/util/SerializableArrayList.java
b/flink-runtime/src/main/java/org/apache/flink/runtime/util/SerializableArrayList.java
deleted file mode 100644
index 8793691..0000000
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/util/SerializableArrayList.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * 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.flink.runtime.util;
-
-import java.io.IOException;
-import java.util.ArrayList;
-
-import org.apache.flink.core.io.IOReadableWritable;
-import org.apache.flink.core.memory.DataInputView;
-import org.apache.flink.core.memory.DataOutputView;
-import org.apache.flink.util.StringUtils;
-
-/**
- * This class extends a standard {@link java.util.ArrayList} by implementing the
- * {@link org.apache.flink.core.io.IOReadableWritable} interface.
- *
- * @param <E>
- *        the type of object stored inside this array list
- */
-public class SerializableArrayList<E extends IOReadableWritable> extends ArrayList<E>
implements IOReadableWritable {
-
-	private static final long serialVersionUID = 8196856588290198537L;
-
-	/**
-	 * Constructs an empty list with an initial capacity of ten.
-	 */
-	public SerializableArrayList() {
-		super();
-	}
-
-	/**
-	 * Constructs an empty list with the specified initial capacity.
-	 * 
-	 * @param initialCapacity
-	 *        the initial capacity of the list
-	 */
-	public SerializableArrayList(final int initialCapacity) {
-		super(initialCapacity);
-	}
-
-	@Override
-	public void write(final DataOutputView out) throws IOException {
-
-		out.writeInt(size());
-		for (E element : this) {
-			// Write out type
-			StringUtils.writeNullableString(element.getClass().getName(), out);
-			// Write out element itself
-			element.write(out);
-		}
-	}
-
-	@Override
-	public void read(final DataInputView in) throws IOException {
-		// Make sure the list is empty
-		clear();
-
-		final int numberOfElements = in.readInt();
-		for (int i = 0; i < numberOfElements; i++) {
-			final String elementType = StringUtils.readNullableString(in);
-
-			E element;
-			try {
-				@SuppressWarnings("unchecked")
-				Class<E> clazz = (Class<E>) Class.forName(elementType);
-				element = clazz.newInstance();
-			}
-			catch (ClassNotFoundException e) {
-				throw new IOException(e);
-			}
-			catch (Exception e) {
-				throw new IOException(e);
-			}
-
-			element.read(in);
-			add(element);
-		}
-	}
-
-	@Override
-	public boolean equals(Object obj) {
-		return obj instanceof SerializableArrayList<?> && super.equals(obj);
-	}
-}

http://git-wip-us.apache.org/repos/asf/flink/blob/1619e01e/flink-runtime/src/main/java/org/apache/flink/runtime/util/SerializableHashMap.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/util/SerializableHashMap.java
b/flink-runtime/src/main/java/org/apache/flink/runtime/util/SerializableHashMap.java
deleted file mode 100644
index dae1827..0000000
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/util/SerializableHashMap.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * 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.flink.runtime.util;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.flink.core.io.IOReadableWritable;
-import org.apache.flink.core.memory.DataInputView;
-import org.apache.flink.core.memory.DataOutputView;
-import org.apache.flink.util.StringUtils;
-
-/**
- * This class extends a standard {@link java.util.HashMap} by implementing the
- * {@link org.apache.flink.core.io.IOReadableWritable} interface.
- * 
- * @param <K>
- *        the type of the key used in this hash map
- * @param <V>
- *        the type of the value used in this hash map
- */
-public class SerializableHashMap<K extends IOReadableWritable, V extends IOReadableWritable>
extends HashMap<K, V>
-		implements IOReadableWritable {
-
-	/**
-	 * The generated serial version UID.
-	 */
-	private static final long serialVersionUID = 6693468726881121924L;
-
-
-	@Override
-	public void write(final DataOutputView out) throws IOException {
-		
-		out.writeInt(size());
-
-		for (Map.Entry<K, V> entry : entrySet()) {
-			final K key = entry.getKey();
-			final V value = entry.getValue();
-
-			StringUtils.writeNullableString(key.getClass().getName(), out);
-			key.write(out);
-
-			StringUtils.writeNullableString(value.getClass().getName(), out);
-			value.write(out);
-		}
-	}
-
-
-	@SuppressWarnings("unchecked")
-	@Override
-	public void read(final DataInputView in) throws IOException {
-		
-		final int numberOfMapEntries = in.readInt();
-
-		for (int i = 0; i < numberOfMapEntries; i++) {
-
-			final String keyType = StringUtils.readNullableString(in);
-			Class<K> keyClass;
-			try {
-				keyClass = (Class<K>) Class.forName(keyType);
-			} catch (ClassNotFoundException e) {
-				throw new IOException(e);
-			}
-
-			K key = null;
-			try {
-				key = keyClass.newInstance();
-			} catch (Exception e) {
-				throw new IOException(e);
-			}
-
-			key.read(in);
-
-			final String valueType = StringUtils.readNullableString(in);
-			Class<V> valueClass;
-			try {
-				valueClass = (Class<V>) Class.forName(valueType);
-			} catch (ClassNotFoundException e) {
-				throw new IOException(e);
-			}
-
-			V value;
-			try {
-				value = valueClass.newInstance();
-			} catch (Exception e) {
-				throw new IOException(e);
-			}
-			value.read(in);
-
-			put(key, value);
-		}
-
-	}
-}

http://git-wip-us.apache.org/repos/asf/flink/blob/1619e01e/flink-runtime/src/main/java/org/apache/flink/runtime/util/SerializableHashSet.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/util/SerializableHashSet.java
b/flink-runtime/src/main/java/org/apache/flink/runtime/util/SerializableHashSet.java
deleted file mode 100644
index fb7b06f..0000000
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/util/SerializableHashSet.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * 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.flink.runtime.util;
-
-import java.io.IOException;
-import java.util.HashSet;
-
-import org.apache.flink.core.io.IOReadableWritable;
-import org.apache.flink.core.memory.DataInputView;
-import org.apache.flink.core.memory.DataOutputView;
-import org.apache.flink.util.StringUtils;
-
-/**
- * This class extends a standard {@link java.util.HashSet} by implementing the
- * {@link org.apache.flink.core.io.IOReadableWritable} interface.
- * 
- * @param <T>
- *        the type used in this hash set
- */
-public class SerializableHashSet<T extends IOReadableWritable> extends HashSet<T>
implements IOReadableWritable {
-
-	/**
-	 * The generated serial version UID.
-	 */
-	private static final long serialVersionUID = -4615823301768215807L;
-
-
-	@Override
-	public void write(final DataOutputView out) throws IOException {
-		out.writeInt(size());
-
-		for (T entry : this) {
-			StringUtils.writeNullableString(entry.getClass().getName(), out);
-			entry.write(out);
-		}
-	}
-
-	@Override
-	public void read(final DataInputView in) throws IOException {
-		final int numberOfMapEntries = in.readInt();
-
-		for (int i = 0; i < numberOfMapEntries; i++) {
-			final String type = StringUtils.readNullableString(in);
-
-			T entry;
-			try {
-				@SuppressWarnings("unchecked")
-				Class<T> clazz = (Class<T>) Class.forName(type);
-				entry = clazz.newInstance();
-			}
-			catch (ClassNotFoundException e) {
-				throw new IOException(e);
-			}
-			catch (Exception e) {
-				throw new IOException(e);
-			}
-
-			entry.read(in);
-			add(entry);
-		}
-	}
-}

http://git-wip-us.apache.org/repos/asf/flink/blob/1619e01e/flink-runtime/src/test/java/org/apache/flink/runtime/event/task/EventList.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/event/task/EventList.java
b/flink-runtime/src/test/java/org/apache/flink/runtime/event/task/EventList.java
deleted file mode 100644
index c055a92..0000000
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/event/task/EventList.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * 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.flink.runtime.event.task;
-
-import org.apache.flink.runtime.event.AbstractEvent;
-import org.apache.flink.runtime.util.SerializableArrayList;
-
-/**
- * Objects of this class can store and serialize/deserialize {@link org.apache.flink.runtime.event.AbstractEvent}
- * objects.
- * 
- */
-public class EventList extends SerializableArrayList<AbstractEvent> {
-
-	/**
-	 * Generated serial UID.
-	 */
-	private static final long serialVersionUID = 4788250278393432776L;
-}

http://git-wip-us.apache.org/repos/asf/flink/blob/1619e01e/flink-runtime/src/test/java/org/apache/flink/runtime/event/task/TaskEventTest.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/event/task/TaskEventTest.java
b/flink-runtime/src/test/java/org/apache/flink/runtime/event/task/TaskEventTest.java
index 314471e..902f0bf 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/event/task/TaskEventTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/event/task/TaskEventTest.java
@@ -23,9 +23,7 @@ import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
 import java.io.IOException;
-import java.util.Iterator;
 
-import org.apache.flink.runtime.event.AbstractEvent;
 import org.apache.flink.util.InstantiationUtil;
 
 import org.junit.Test;
@@ -74,29 +72,4 @@ public class TaskEventTest {
 			fail(ioe.getMessage());
 		}
 	}
-
-	/**
-	 * This test checks the serialization/deserialization of {@link EventList} objects.
-	 */
-	@Test
-	public void testEventList() {
-
-		try {
-
-			final EventList orig = new EventList();
-			orig.add(new StringTaskEvent("Test 2"));
-			orig.add(new IntegerTaskEvent(70));
-			final EventList copy = InstantiationUtil.createCopyWritable(orig);
-
-			assertEquals(orig.size(), copy.size());
-			final Iterator<AbstractEvent> origIt = orig.iterator();
-			final Iterator<AbstractEvent> copyIt = copy.iterator();
-			while (origIt.hasNext()) {
-				assertEquals(origIt.next(), copyIt.next());
-			}
-
-		} catch (IOException ioe) {
-			fail(ioe.getMessage());
-		}
-	}
 }


Mime
View raw message