Skip to content

Commit

Permalink
remove iterator.toList for memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
smdmts committed Jun 25, 2018
1 parent 2e21f95 commit dd0cf1d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ configurations {
provided
}

version = "0.1.2"
version = "0.1.3"

sourceCompatibility = 1.7
targetCompatibility = 1.7

dependencies {
compile "org.embulk:embulk-core:0.8.22"
compile "org.scala-lang:scala-library:2.11.11"
compile group: 'com.sksamuel.avro4s', name: 'avro4s-core_2.11', version: '1.6.4'
compile group: 'com.sksamuel.avro4s', name: 'avro4s-core_2.11', version: '1.8.3'
compile group: 'io.circe', name: 'circe-core_2.11', version: '0.8.0'
compile group: 'io.circe', name: 'circe-generic_2.11', version: '0.8.0'
provided "org.embulk:embulk-core:0.8.22"
provided "org.embulk:embulk-core:0.9.7"
}

task classpath(type: Copy, dependsOn: ["jar"]) {
Expand Down
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ resolvers += Resolver.sonatypeRepo("releases")

lazy val circeVersion = "0.8.0"
libraryDependencies ++= Seq(
"com.sksamuel.avro4s" %% "avro4s-core" % "1.6.4",
"com.sksamuel.avro4s" %% "avro4s-core" % "1.8.3",
"org.jruby" % "jruby-complete" % "1.6.5",
"org.embulk" % "embulk-core" % "0.8.22",
"org.embulk" % "embulk-core" % "0.9.7",
"com.chuusai" %% "shapeless" % "2.3.2",
"io.circe" %% "circe-core" % circeVersion,
"io.circe" %% "circe-generic" % circeVersion,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class FirebaseAvroParserPlugin extends ParserPlugin {
LoanPattern(new PageBuilder(Exec.getBufferAllocator, schema, output)) { pb =>
while (input.nextFile()) {
val bytes = ByteStreams.toByteArray(new FileInputInputStream(input))
AvroInputStream.data[Root](bytes).iterator().toList.foreach { record =>
AvroInputStream.data[Root](bytes).iterator.foreach { record =>
addRecords(pb, record)
}
}
Expand Down

0 comments on commit dd0cf1d

Please sign in to comment.