Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MINOR: Some optimizations #2

Closed
wants to merge 2 commits into from
Closed
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
2 changes: 1 addition & 1 deletion cpp/src/arrow/array/array_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ class ARROW_EXPORT Array {
/// Input-checking variant of Array::Slice
Result<std::shared_ptr<Array>> SliceSafe(int64_t offset) const;

std::shared_ptr<ArrayData> data() const { return data_; }
const std::shared_ptr<ArrayData>& data() const { return data_; }

int num_fields() const { return static_cast<int>(data_->child_data.size()); }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

package org.apache.arrow.flight.grpc;

import java.io.IOException;
import java.io.OutputStream;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
Expand Down Expand Up @@ -87,8 +88,11 @@ public class AddWritableBuffer {
* @param buf The buffer to add.
* @param stream The Candidate OutputStream to add to.
* @return True if added. False if not possible.
* @throws IOException on error
*/
public static boolean add(ByteBuf buf, OutputStream stream) {
public static boolean add(ByteBuf buf, OutputStream stream) throws IOException {
buf.readBytes(stream, buf.readableBytes());

if (bufChainOut == null) {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void register(FlightProducer.ServerStreamListener listener) {

@Override
public WaitResult waitForListener(long timeout) {
while (!listener.isReady() && !listener.isCancelled()) {
while (!listener.isReady()) {
// busy wait
}
return WaitResult.READY;
Expand Down