Github user vanzin commented on a diff in the pull request:
https://github.com/apache/spark/pull/5400#discussion_r28718430
--- Diff:
network/common/src/main/java/org/apache/spark/network/buffer/LargeByteBuffer.java
---
@@ -0,0 +1,113 @@
+/*
+* 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.spark.network.buffer;
+
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.nio.channels.WritableByteChannel;
+
+public interface LargeByteBuffer {
+ public byte get();
+
+ /**
+ * Bulk copy data from this buffer into the given array. First checks
there is sufficient
+ * data in this buffer; if not, throws a {@link
java.nio.BufferUnderflowException}.
+ *
+ * @param dst
+ * @param offset
+ * @param length
+ */
+ public void get(byte[] dst, int offset, int length);
+
+ public LargeByteBuffer rewind();
+
+ /**
+ * Return a deep copy of this buffer.
+ * The returned buffer will have position == 0. The position
+ * of this buffer will not change as a result of copying.
+ *
+ * @return a new buffer with a full copy of this buffer's data
+ */
+ public LargeByteBuffer deepCopy();
+
+ /**
+ * Advance the position in this buffer by up to <code>n</code> bytes.
<code>n</code> may be
+ * positive or negative. It will move the full <code>n</code> unless
that moves
+ * it past the end (or beginning) of the buffer, in which case it will
move to the end
+ * (or beginning).
+ *
+ * @return the number of bytes moved forward (can be negative if
<code>n</code> is negative)
+ */
+ public long skip(long n);
+
+ public long position();
+
+ /**
+ * Creates a new byte buffer that shares this buffer's content.
+ * <p/>
+ * <p> The content of the new buffer will be that of this buffer.
Changes
+ * to this buffer's content will be visible in the new buffer, and vice
+ * versa; the two buffers' positions will be independent.
+ * <p/>
+ * <p> The new buffer's position will be identical to those of this
buffer
+ */
+ public LargeByteBuffer duplicate();
+
+
+ public long remaining();
+
+ /**
+ * Total number of bytes in this buffer
+ *
+ * @return
--- End diff --
It'd be nice to fill in these empty javadoc tags, or remove them.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]