Michael Blow has uploaded a new change for review. https://asterix-gerrit.ics.uci.edu/2903
Change subject: [NO ISSUE][EXT] Prevent NPE in close() when using TestTypedAdapter ...................................................................... [NO ISSUE][EXT] Prevent NPE in close() when using TestTypedAdapter <>[Intake Thread] WARN org.apache.hyracks.api.util.CleanupUtils - Failure closing a closeable resource java.lang.NullPointerException: null at org.apache.asterix.external.dataset.adapter.FeedAdapter.close(FeedAdapter.java:63) Change-Id: If2d62ce00858ff9a9f8033bd21d5da5f1f207c56 --- M asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/library/adapter/TestTypedAdapter.java A asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/library/adapter/TestTypedFeedDataFlowController.java 2 files changed, 41 insertions(+), 1 deletion(-) git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/03/2903/1 diff --git a/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/library/adapter/TestTypedAdapter.java b/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/library/adapter/TestTypedAdapter.java index 90336fe..effd59f 100644 --- a/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/library/adapter/TestTypedAdapter.java +++ b/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/library/adapter/TestTypedAdapter.java @@ -55,7 +55,7 @@ public TestTypedAdapter(ITupleParserFactory parserFactory, ARecordType sourceDatatype, IHyracksTaskContext ctx, Map<String, String> configuration, int partition) throws IOException { - super(null); + super(new TestTypedFeedDataFlowController(ctx)); pos = new PipedOutputStream(); pis = new PipedInputStream(pos); this.configuration = configuration; @@ -150,4 +150,5 @@ public boolean resume() { return false; } + } diff --git a/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/library/adapter/TestTypedFeedDataFlowController.java b/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/library/adapter/TestTypedFeedDataFlowController.java new file mode 100644 index 0000000..2985b92 --- /dev/null +++ b/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/library/adapter/TestTypedFeedDataFlowController.java @@ -0,0 +1,39 @@ +/* + * 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.asterix.external.library.adapter; + +import org.apache.asterix.external.dataflow.AbstractFeedDataFlowController; +import org.apache.hyracks.api.comm.IFrameWriter; +import org.apache.hyracks.api.context.IHyracksTaskContext; + +class TestTypedFeedDataFlowController extends AbstractFeedDataFlowController { + TestTypedFeedDataFlowController(IHyracksTaskContext ctx) { + super(ctx, null, -1); + } + + @Override + public String getStats() { + throw new UnsupportedOperationException(); + } + + @Override + public void start(IFrameWriter writer) { + throw new UnsupportedOperationException(); + } +} -- To view, visit https://asterix-gerrit.ics.uci.edu/2903 To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If2d62ce00858ff9a9f8033bd21d5da5f1f207c56 Gerrit-PatchSet: 1 Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Owner: Michael Blow <mb...@apache.org>