forked from apache/flink
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the external packaged program test after merge with the new java api
Relax generic bound in tuple type infor to work around bug in Java 6 compiler type inference. Local file system is used by default when URI is missing Removed final declaration from Tuple classes to allow inheritance (Fabian Hueske) Fix in TupleType comparator generation (Fabian Hueske) Cogroup Implementation (Markus Holzemer) Added missing Apache license header (Fabian Hueske) Initial commit for join operator for new Java API (Fabian Hueske) Added cross operator to new Java API (Fabian Hueske) First part of CoGroup (Markus Holzemer) Added join example prog and fix in join operator (Fabian Hueske) Unified operator translation (Fabian Hueske) Add Cross Prog for API implementation (Fabian Hueske) Implement CsvInputFormat for new Java API, including tests. Fix logging messages in data source and sink tasks. Fix error in data source task with new InputFormat siignatures Add group reduce to new java api. Finaliz Key Extractors for new Java API Fix bug in intitialization of broadcast serializers. Added first set of comparators. Added generic type serialization via avro Add first stab at KeyExtractor implementation (Aljoscha Krettek) Add trivial parts of serialization (Aljoscha Krettek) Connected serializers to the typeutils. Fix tests to run with the NEW-API changes (Aljoscha Krettek) Scala Post pass got confused because of ReduceNode renaming. (Aljoscha Krettek) Some input format mishaps. (Aljoscha Krettek) First set of new simple type serializers. Connect first paths of new Java API to optimizer. Add name() to Operator plus some other stuff (Aljoscha Krettek) Clean up moved annotations Add CoGroup, Cross, and Union operators (Aljoscha Krettek) Make reduce operators children of UdfOperator (Aljoscha Krettek) Adjust input formats to new signature Adjusted, extended, and tested parsers for new java api compatibility. First draft of new java api. Removing dependency to Combinable annotation. (Jesus Camacho Rodriguez) Moving all annotations to Java API. (Jesus Camacho Rodriguez) Moving all annotations from the core to the Java API package. Created SemanticProperties in the core to store properties inferred currently from Java annotations. (Jesus Camacho Rodriguez) Moving all annotations to Java API (Jesus Camacho Rodriguez)
- Loading branch information
StephanEwen
committed
Mar 6, 2014
1 parent
ddc1dc9
commit 0038c9d
Showing
415 changed files
with
23,028 additions
and
2,606 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 98 additions & 0 deletions
98
stratosphere-addons/avro/src/main/java/eu/stratosphere/api/java/io/AvroInputFormat.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
/*********************************************************************************************************************** | ||
* | ||
* Copyright (C) 2010-2013 by the Stratosphere project (http:https://stratosphere.eu) | ||
* | ||
* Licensed 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:https://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 eu.stratosphere.api.java.io; | ||
|
||
import java.io.IOException; | ||
|
||
import org.apache.avro.file.DataFileReader; | ||
import org.apache.avro.file.FileReader; | ||
import org.apache.avro.file.SeekableInput; | ||
import org.apache.avro.io.DatumReader; | ||
import org.apache.avro.reflect.ReflectDatumReader; | ||
import org.apache.avro.specific.SpecificDatumReader; | ||
|
||
import org.apache.commons.logging.Log; | ||
import org.apache.commons.logging.LogFactory; | ||
|
||
import eu.stratosphere.core.fs.FileInputSplit; | ||
import eu.stratosphere.api.avro.FSDataInputStreamWrapper; | ||
import eu.stratosphere.api.common.io.FileInputFormat; | ||
import eu.stratosphere.util.InstantiationUtil; | ||
|
||
|
||
public class AvroInputFormat<E> extends FileInputFormat<E> { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
private static final Log LOG = LogFactory.getLog(AvroInputFormat.class); | ||
|
||
|
||
private final Class<E> avroValueType; | ||
|
||
private final boolean reuseAvroValue; | ||
|
||
|
||
private transient FileReader<E> dataFileReader; | ||
|
||
|
||
|
||
public AvroInputFormat(Class<E> type) { | ||
this(type, true); | ||
} | ||
|
||
public AvroInputFormat(Class<E> type, boolean reuseAvroValue) { | ||
this.avroValueType = type; | ||
this.reuseAvroValue = reuseAvroValue; | ||
} | ||
|
||
@Override | ||
public void open(FileInputSplit split) throws IOException { | ||
super.open(split); | ||
|
||
DatumReader<E> datumReader; | ||
if (org.apache.avro.specific.SpecificRecordBase.class.isAssignableFrom(avroValueType)) { | ||
datumReader = new SpecificDatumReader<E>(avroValueType); | ||
} else { | ||
datumReader = new ReflectDatumReader<E>(avroValueType); | ||
} | ||
|
||
LOG.info("Opening split " + split); | ||
|
||
SeekableInput in = new FSDataInputStreamWrapper(stream, (int) split.getLength()); | ||
|
||
dataFileReader = DataFileReader.openReader(in, datumReader); | ||
dataFileReader.sync(split.getStart()); | ||
} | ||
|
||
@Override | ||
public boolean reachedEnd() throws IOException { | ||
return !dataFileReader.hasNext(); | ||
} | ||
|
||
@Override | ||
public E nextRecord(E reuseValue) throws IOException { | ||
if (!dataFileReader.hasNext()) { | ||
return null; | ||
} | ||
|
||
if (!reuseAvroValue) { | ||
reuseValue = InstantiationUtil.instantiate(avroValueType, Object.class); | ||
} | ||
|
||
reuseValue = dataFileReader.next(reuseValue); | ||
return reuseValue; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.