Skip to content

Commit

Permalink
🐛 Add default impl for hbase delete (#537)
Browse files Browse the repository at this point in the history
* 💚 Fix publish

* 🐛 Add default impl for hbase delete

* Make ktlint happy
  • Loading branch information
devkanro authored Oct 30, 2023
1 parent aa2c9d3 commit 402147d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ on:
pull_request:
branches: [ master ]

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v3
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ on:
release:
types: [ prereleased, released ]

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

jobs:
build:

runs-on: ubuntu-latest

steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v3
Expand All @@ -41,6 +41,3 @@ jobs:
gpg-key-name: ${{ secrets.GPG_KEY_NAME }}
- name: Publish with Gradle
run: gradle publish --no-daemon
- name: Publish plugins to Gradle Portal
if: ${{ github.event_name == 'release' }}
run: gradle publishPlugins --no-daemon
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import com.bybutter.sisyphus.middleware.hbase.annotation.HTable
import com.bybutter.sisyphus.reflect.uncheckedCast
import org.apache.hadoop.hbase.TableName
import org.apache.hadoop.hbase.client.Connection
import org.apache.hadoop.hbase.client.Delete
import org.apache.hadoop.hbase.client.Get
import org.apache.hadoop.hbase.client.Put
import org.apache.hadoop.hbase.client.Scan
Expand Down Expand Up @@ -112,4 +113,14 @@ abstract class HTableTemplate<TKey : Any, TValue : Any> : HTemplate<TKey, TValue
override fun setMap(vararg values: Pair<TKey, TValue>) {
return setMap(values.toMap())
}

override fun delete(vararg keys: TKey) {
connection.getTable(TableName.valueOf(table)).use {
val deleteRequests =
keys.map {
Delete(rowKeyConverter.convert(it))
}
it.delete(deleteRequests)
}
}
}

0 comments on commit 402147d

Please sign in to comment.