Github user pferrel commented on a diff in the pull request:

    
https://github.com/apache/incubator-predictionio/pull/269#discussion_r73793218
  
    --- Diff: 
data/src/main/scala/io/prediction/data/storage/hbase/HBPEvents.scala ---
    @@ -109,4 +109,25 @@ class HBPEvents(client: HBClient, config: 
StorageClientConfig, namespace: String
     
       }
     
    +  def delete(
    +    eventIds: RDD[String], appId: Int, channelId: Option[Int])(sc: 
SparkContext): Unit = {
    +
    +    checkTableExists(appId, channelId)
    +
    +    val tableName = HBEventsUtil.tableName(namespace, appId, channelId) 
    + 
    +    eventIds.foreachPartition{ iter =>
    +      val conf = HBaseConfiguration.create()
    +      conf.set(TableOutputFormat.OUTPUT_TABLE,
    +        tableName)
    +
    +      val table = new HTable(conf, tableName)
    +      iter.foreach { id =>
    +        val rowKey = HBEventsUtil.RowKey(id)
    +        val delete = new Delete(rowKey.b)
    +        table.delete(delete)
    +      }
    +      table.close 
    +    } 
    +  }
     }
    --- End diff --
    
    ready for review
    
    supports SelfCleaningDatasource.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to