Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Raphael
histream
Commits
3946a9ce
Commit
3946a9ce
authored
Aug 25, 2015
by
rwm
Browse files
javadoc, resource leaks
parent
170e35c1
Changes
5
Hide whitespace changes
Inline
Side-by-side
HIStream-i2b2/src/main/java/de/sekmi/histream/i2b2/ont/Import.java
View file @
3946a9ce
...
...
@@ -30,7 +30,8 @@ import de.sekmi.histream.ontology.ValueRestriction;
/**
* Import ontology data into i2b2.
* <p>
* Use the methods in the following order: {@link #openDatabase(Map)}, {@link #loadOntology(Class, Map)}, {@link #processOntology()}, {@link #close
* Use the methods in the following order:
* constructor {@link #Import(Map)}, {@link #setOntology(Ontology)}, {@link #processOntology()}, {@link #close()}
*
* @author Raphael
*
...
...
@@ -68,8 +69,8 @@ public class Import implements AutoCloseable{
* Any other parameters starting with {@code jdbc.} are also passed to {@link DriverManager#getConnection(String, Properties)}.
* <p>
* More parameters: {@code ont.language} and {@code ont.scheme}.
* @throws ClassNotFoundException
* @throws SQLException
* @throws ClassNotFoundException
if database driver not found
* @throws SQLException
for SQL errors
*/
public
Import
(
Map
<
String
,
String
>
props
)
throws
ClassNotFoundException
,
SQLException
{
openDatabase
(
props
);
...
...
histream-core/src/test/java/de/sekmi/histream/TestDateTimeAccuracy.java
View file @
3946a9ce
package
de.sekmi.histream
;
import
java.time.format.DateTimeFormatter
;
import
java.time.format.DateTimeFormatterBuilder
;
import
java.time.format.ResolverStyle
;
import
java.time.temporal.ChronoField
;
import
java.time.temporal.ChronoUnit
;
...
...
@@ -26,7 +25,7 @@ public class TestDateTimeAccuracy {
public
void
testFormatExceedsText
(){
DateTimeFormatter
formatter
=
DateTimeFormatter
.
ofPattern
(
"d.M.u[ H[:m[:s]]]"
);
formatter
.
withResolverStyle
(
ResolverStyle
.
STRICT
);
DateTimeFormatterBuilder
b
=
new
DateTimeFormatterBuilder
();
//
DateTimeFormatterBuilder b = new DateTimeFormatterBuilder();
DateTimeAccuracy
a
;
a
=
DateTimeAccuracy
.
parse
(
formatter
,
"01.02.2003"
);
Assert
.
assertEquals
(
ChronoUnit
.
DAYS
,
a
.
getAccuracy
());
...
...
histream-core/src/test/java/de/sekmi/histream/io/TransformerTest.java
View file @
3946a9ce
...
...
@@ -3,6 +3,7 @@ package de.sekmi.histream.io;
import
java.io.FileInputStream
;
import
java.io.FileNotFoundException
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
org.junit.Test
;
...
...
@@ -14,13 +15,17 @@ public class TransformerTest {
f
.
initializeObservationFactory
();
Transformation
t
=
Transformation
.
Identity
;
try
(
FlatObservationSupplier
sup
=
new
FlatObservationSupplier
(
f
.
getFactory
(),
new
FileInputStream
(
"examples/dwh-flat.txt"
))
){
PullTransformer
p
=
new
PullTransformer
(
sup
,
t
);
// validate content after identity transformation
f
.
initializeHandler
();
f
.
validateExample
(
p
);
f
.
closeHandler
();
}
InputStream
in
=
new
FileInputStream
(
"examples/dwh-flat.txt"
);
FlatObservationSupplier
sup
=
new
FlatObservationSupplier
(
f
.
getFactory
(),
in
);
PullTransformer
p
=
new
PullTransformer
(
sup
,
t
);
// validate content after identity transformation
f
.
initializeHandler
();
f
.
validateExample
(
p
);
f
.
closeHandler
();
sup
.
close
();
in
.
close
();
}
}
histream-import/src/main/java/de/sekmi/histream/etl/ETLObservationSupplier.java
View file @
3946a9ce
...
...
@@ -84,6 +84,7 @@ public class ETLObservationSupplier implements ObservationSupplier{
// open all tables
wr
=
new
ArrayList
<>(
wt
.
size
());
for
(
WideTable
t
:
wt
){
@SuppressWarnings
(
"resource"
)
RecordSupplier
<
WideRow
>
s
=
t
.
open
(
factory
,
sourceId
);
queue
.
addFactTable
(
s
);
wr
.
add
(
s
);
...
...
histream-import/src/main/java/de/sekmi/histream/etl/config/TableSource.java
View file @
3946a9ce
...
...
@@ -2,7 +2,6 @@ package de.sekmi.histream.etl.config;
import
java.io.IOException
;
import
java.time.Instant
;
import
javax.xml.bind.annotation.XmlAccessType
;
import
javax.xml.bind.annotation.XmlAccessorType
;
...
...
@@ -18,8 +17,8 @@ import de.sekmi.histream.etl.RowSupplier;
public
abstract
class
TableSource
{
/**
*
* @return
* @throws IOException
* @return
row supplier
* @throws IOException
IO errors during row supplier construction
*/
public
abstract
RowSupplier
rows
()
throws
IOException
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment