Commit 5c777a045ca639cdba3d707980e43a0f0e4e88f9

Authored by 박용규 ago
1 parent dc44f2e39c
Exists in master

editor_score insert 이슈 수정

Showing 1 changed file with 7 additions and 8 deletions Side-by-side Diff

app/com/piki_ds/ver1/EditorScore.scala View file @ 5c777a0
... ... @@ -3,16 +3,16 @@
3 3 //import breeze.linalg.min
4 4 import com.piki_ds.utils.FileDelete._
5 5 import org.apache.spark.rdd.RDD
6   -import org.apache.hadoop.fs.{Path, FileStatus, FileSystem}
  6 +import org.apache.hadoop.fs.{FileStatus, FileSystem, Path}
7 7 import org.apache.spark.sql.SQLContext
8 8 import org.apache.spark.{SparkConf, SparkContext}
9 9 import org.jblas.MatrixFunctions
10   -
11 10 import com.piki_ds.utils.DateTimeEtc.getDateKey
12 11 import com.piki_ds.utils.GetTextFile.getDashTable
13 12 import com.piki_ds.utils.SqlContextConf.readPartialTable
14 13 import com.piki_ds.utils.TempScoreSaveLoad
15   -import com.piki_ds.utils.GeneralTransformers.{make_0to1_2Keys,make_0to1}
  14 +import com.piki_ds.utils.GeneralTransformers.{make_0to1, make_0to1_2Keys}
  15 +import com.piki_ds.utils.hbase.HbaseInserter
16 16 import com.piki_ds.ver1.DashRelatedScore.previousDash
17 17 //import com.piki_ds.utils.hbase.HbaseInserter
18 18  
19 19  
... ... @@ -168,12 +168,11 @@
168 168  
169 169 TempScoreSaveLoad.scoreSave(doi,"editor","",formatOutput,1)
170 170 deleteNDaysAgo(sc,TempScoreSaveLoad.scorePathMaker("editor",""),doi,30)
171   - scala.io.Source.fromURL(s"http://hbase.api.piki.work:9081/insert?table=editor_score&path=/preprocess/timelineScore/editor/$doi")
172   - /*
  171 +// scala.io.Source.fromURL(s"http://hbase.api.piki.work:9081/insert?table=editor_score&path=/preprocess/timelineScore/editor/$doi")
  172 +
173 173 val insertArray: Array[(String, String)] = finalScore.map(x=>(x._1.toString, (x._2*1000).toLong.toString)).collect
174   - val test = new HbaseInserter("editor_score")
175   - test.insert(insertArray)
176   -*/
  174 + val inserter = new HbaseInserter("editor_score")
  175 + inserter.insert(insertArray)
177 176 }
178 177  
179 178 }