Skip to content

Commit

Permalink
Merge pull request #31 from ryogrid/rest-server-interface-impl
Browse files Browse the repository at this point in the history
Rest server interface impl
  • Loading branch information
ryogrid authored Oct 26, 2023
2 parents e0a5c2f + 231c5e7 commit d16991a
Show file tree
Hide file tree
Showing 156 changed files with 1,579 additions and 688 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: testing
on: [push]

jobs:
# 共通処理
# for all tests
setup:
runs-on: ubuntu-latest
steps:
Expand All @@ -15,7 +15,7 @@ jobs:
- name: check out
uses: actions/checkout@v2

# 処理を高速化するために環境をキャッシュ
# cache environment
- name: Cache
uses: actions/[email protected]
with:
Expand All @@ -24,20 +24,20 @@ jobs:
restore-keys: |
${{ runner.os }}-go-
# buildテスト
# build testing
build:
needs: setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: build
run: go build ./...
run: cd server; go build ./...

# testを通す
# exec unit tests
test:
needs: setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: test
run: go test ./... -v -short
run: cd lib; go test ./... -v -short
4 changes: 2 additions & 2 deletions .idea/runConfigurations/go_test_SamehadaDB__short_.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package catalog_interface

import (
"github.com/ryogrid/SamehadaDB/storage/index"
"github.com/ryogrid/SamehadaDB/storage/tuple"
"github.com/ryogrid/SamehadaDB/types"
"github.com/ryogrid/SamehadaDB/lib/storage/index"
"github.com/ryogrid/SamehadaDB/lib/storage/tuple"
"github.com/ryogrid/SamehadaDB/lib/types"
)

type CatalogInterface interface {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ package catalog_test

import (
"fmt"
"github.com/ryogrid/SamehadaDB/catalog"
"github.com/ryogrid/SamehadaDB/common"
"github.com/ryogrid/SamehadaDB/samehada"
"github.com/ryogrid/SamehadaDB/storage/buffer"
"github.com/ryogrid/SamehadaDB/storage/index/index_constants"
"github.com/ryogrid/SamehadaDB/storage/table/column"
"github.com/ryogrid/SamehadaDB/storage/table/schema"
testingpkg "github.com/ryogrid/SamehadaDB/testing/testing_assert"
"github.com/ryogrid/SamehadaDB/types"
"github.com/ryogrid/SamehadaDB/lib/catalog"
"github.com/ryogrid/SamehadaDB/lib/common"
"github.com/ryogrid/SamehadaDB/lib/samehada"
"github.com/ryogrid/SamehadaDB/lib/storage/buffer"
"github.com/ryogrid/SamehadaDB/lib/storage/index/index_constants"
"github.com/ryogrid/SamehadaDB/lib/storage/table/column"
"github.com/ryogrid/SamehadaDB/lib/storage/table/schema"
testingpkg "github.com/ryogrid/SamehadaDB/lib/testing/testing_assert"
"github.com/ryogrid/SamehadaDB/lib/types"
"os"
"testing"
)
Expand Down
8 changes: 4 additions & 4 deletions catalog/schemas.go → lib/catalog/schemas.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
package catalog

import (
"github.com/ryogrid/SamehadaDB/storage/index/index_constants"
"github.com/ryogrid/SamehadaDB/storage/table/column"
"github.com/ryogrid/SamehadaDB/storage/table/schema"
"github.com/ryogrid/SamehadaDB/types"
"github.com/ryogrid/SamehadaDB/lib/storage/index/index_constants"
"github.com/ryogrid/SamehadaDB/lib/storage/table/column"
"github.com/ryogrid/SamehadaDB/lib/storage/table/schema"
"github.com/ryogrid/SamehadaDB/lib/types"
)

func TableCatalogSchema() *schema.Schema {
Expand Down
12 changes: 6 additions & 6 deletions catalog/statistics.go → lib/catalog/statistics.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ package catalog

import (
"errors"
"github.com/ryogrid/SamehadaDB/common"
"github.com/ryogrid/SamehadaDB/execution/expression"
"github.com/ryogrid/SamehadaDB/samehada/samehada_util"
"github.com/ryogrid/SamehadaDB/storage/access"
"github.com/ryogrid/SamehadaDB/storage/table/schema"
"github.com/ryogrid/SamehadaDB/types"
"github.com/ryogrid/SamehadaDB/lib/common"
"github.com/ryogrid/SamehadaDB/lib/execution/expression"
"github.com/ryogrid/SamehadaDB/lib/samehada/samehada_util"
"github.com/ryogrid/SamehadaDB/lib/storage/access"
"github.com/ryogrid/SamehadaDB/lib/storage/table/schema"
"github.com/ryogrid/SamehadaDB/lib/types"
"math"
)

Expand Down
18 changes: 9 additions & 9 deletions catalog/table_catalog.go → lib/catalog/table_catalog.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ import (
"strings"
"sync"

"github.com/ryogrid/SamehadaDB/storage/index"
"github.com/ryogrid/SamehadaDB/storage/index/index_constants"
"github.com/ryogrid/SamehadaDB/lib/storage/index"
"github.com/ryogrid/SamehadaDB/lib/storage/index/index_constants"
"sync/atomic"

"github.com/ryogrid/SamehadaDB/recovery"
"github.com/ryogrid/SamehadaDB/storage/access"
"github.com/ryogrid/SamehadaDB/storage/buffer"
"github.com/ryogrid/SamehadaDB/storage/table/column"
"github.com/ryogrid/SamehadaDB/storage/table/schema"
"github.com/ryogrid/SamehadaDB/storage/tuple"
"github.com/ryogrid/SamehadaDB/types"
"github.com/ryogrid/SamehadaDB/lib/recovery"
"github.com/ryogrid/SamehadaDB/lib/storage/access"
"github.com/ryogrid/SamehadaDB/lib/storage/buffer"
"github.com/ryogrid/SamehadaDB/lib/storage/table/column"
"github.com/ryogrid/SamehadaDB/lib/storage/table/schema"
"github.com/ryogrid/SamehadaDB/lib/storage/tuple"
"github.com/ryogrid/SamehadaDB/lib/types"
)

// TableCatalogPageId indicates the page where the table catalog can be found
Expand Down
10 changes: 5 additions & 5 deletions catalog/table_metadata.go → lib/catalog/table_metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
package catalog

import (
"github.com/ryogrid/SamehadaDB/common"
"github.com/ryogrid/SamehadaDB/storage/access"
"github.com/ryogrid/SamehadaDB/storage/index"
"github.com/ryogrid/SamehadaDB/storage/index/index_constants"
"github.com/ryogrid/SamehadaDB/storage/table/schema"
"github.com/ryogrid/SamehadaDB/lib/common"
"github.com/ryogrid/SamehadaDB/lib/storage/access"
"github.com/ryogrid/SamehadaDB/lib/storage/index"
"github.com/ryogrid/SamehadaDB/lib/storage/index/index_constants"
"github.com/ryogrid/SamehadaDB/lib/storage/table/schema"
)

type TableMetadata struct {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
32 changes: 0 additions & 32 deletions common/rwlatch.go → lib/common/rwlatch.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package common

import (
"fmt"
"github.com/sasha-s/go-deadlock"
"math"
"sync"
"sync/atomic"
Expand Down Expand Up @@ -153,34 +152,3 @@ func (l *readerWriterLatchDebug) RUnlock() {
func (l *readerWriterLatchDebug) PrintDebugInfo() {
fmt.Printf("PrintDebugInfo: readerCnt=%d, writerCnt=%d\n", l.readerCnt, l.writerCnt)
}

type readerWriterLatchTrace struct {
mutex *deadlock.RWMutex
}

func NewRWLatchTrace() ReaderWriterLatch {
deadlock.Opts.DisableLockOrderDetection = true
latch := readerWriterLatchTrace{new(deadlock.RWMutex)}

return &latch
}

func (l *readerWriterLatchTrace) WLock() {
l.mutex.Lock()
}

func (l *readerWriterLatchTrace) WUnlock() {
l.mutex.Unlock()
}

func (l *readerWriterLatchTrace) RLock() {
l.mutex.RLock()
}

func (l *readerWriterLatchTrace) RUnlock() {
l.mutex.RUnlock()
}

func (l *readerWriterLatchTrace) PrintDebugInfo() {
// do nothing
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package concurrency

import (
"fmt"
"github.com/ryogrid/SamehadaDB/recovery"
"github.com/ryogrid/SamehadaDB/storage/access"
"github.com/ryogrid/SamehadaDB/storage/buffer"
"github.com/ryogrid/SamehadaDB/lib/recovery"
"github.com/ryogrid/SamehadaDB/lib/storage/access"
"github.com/ryogrid/SamehadaDB/lib/storage/buffer"
"time"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package concurrency

import (
"fmt"
"github.com/ryogrid/SamehadaDB/catalog"
"github.com/ryogrid/SamehadaDB/storage/access"
"github.com/ryogrid/SamehadaDB/lib/catalog"
"github.com/ryogrid/SamehadaDB/lib/storage/access"
"time"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
package hash

import (
"github.com/ryogrid/SamehadaDB/common"
"github.com/ryogrid/SamehadaDB/storage/page"
testingpkg "github.com/ryogrid/SamehadaDB/testing/testing_assert"
"github.com/ryogrid/SamehadaDB/lib/common"
"github.com/ryogrid/SamehadaDB/lib/storage/page"
testingpkg "github.com/ryogrid/SamehadaDB/lib/testing/testing_assert"
"os"
"testing"
"unsafe"

"github.com/ryogrid/SamehadaDB/recovery"
"github.com/ryogrid/SamehadaDB/storage/buffer"
"github.com/ryogrid/SamehadaDB/storage/disk"
"github.com/ryogrid/SamehadaDB/types"
"github.com/ryogrid/SamehadaDB/lib/recovery"
"github.com/ryogrid/SamehadaDB/lib/storage/buffer"
"github.com/ryogrid/SamehadaDB/lib/storage/disk"
"github.com/ryogrid/SamehadaDB/lib/types"
)

func TestHashTableHeaderPage(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ package hash
import (
"bytes"
"encoding/binary"
testingpkg "github.com/ryogrid/SamehadaDB/testing/testing_assert"
"github.com/ryogrid/SamehadaDB/types"
testingpkg "github.com/ryogrid/SamehadaDB/lib/testing/testing_assert"
"github.com/ryogrid/SamehadaDB/lib/types"
"testing"

"github.com/ryogrid/SamehadaDB/recovery"
"github.com/ryogrid/SamehadaDB/storage/buffer"
"github.com/ryogrid/SamehadaDB/storage/disk"
"github.com/ryogrid/SamehadaDB/lib/recovery"
"github.com/ryogrid/SamehadaDB/lib/storage/buffer"
"github.com/ryogrid/SamehadaDB/lib/storage/disk"
)

func IntToBytes(val int) []byte {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/binary"
"fmt"

"github.com/ryogrid/SamehadaDB/types"
"github.com/ryogrid/SamehadaDB/lib/types"
"github.com/spaolacci/murmur3"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ package hash
import (
"encoding/binary"
"errors"
"github.com/ryogrid/SamehadaDB/storage/page"
"github.com/ryogrid/SamehadaDB/lib/storage/page"
"unsafe"

"github.com/ryogrid/SamehadaDB/common"
"github.com/ryogrid/SamehadaDB/storage/buffer"
"github.com/ryogrid/SamehadaDB/types"
"github.com/ryogrid/SamehadaDB/lib/common"
"github.com/ryogrid/SamehadaDB/lib/storage/buffer"
"github.com/ryogrid/SamehadaDB/lib/types"
"github.com/spaolacci/murmur3"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
package hash

import (
"github.com/ryogrid/SamehadaDB/storage/page"
"github.com/ryogrid/SamehadaDB/lib/storage/page"
"unsafe"

"github.com/ryogrid/SamehadaDB/storage/buffer"
"github.com/ryogrid/SamehadaDB/types"
"github.com/ryogrid/SamehadaDB/lib/storage/buffer"
"github.com/ryogrid/SamehadaDB/lib/types"
)

type hashTableIterator struct {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package hash

import "github.com/ryogrid/SamehadaDB/types"
import "github.com/ryogrid/SamehadaDB/lib/types"

// when doing hash join
// we create a temp page to store all the tuple from left table which corresponds to the input key from right tuple
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"encoding/binary"
"unsafe"

"github.com/ryogrid/SamehadaDB/storage/page"
"github.com/ryogrid/SamehadaDB/storage/tuple"
"github.com/ryogrid/SamehadaDB/types"
"github.com/ryogrid/SamehadaDB/lib/storage/page"
"github.com/ryogrid/SamehadaDB/lib/storage/tuple"
"github.com/ryogrid/SamehadaDB/lib/types"
)

const offsetFreeSpace = uint32(16)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package skip_list

import (
"fmt"
"github.com/ryogrid/SamehadaDB/common"
"github.com/ryogrid/SamehadaDB/storage/buffer"
"github.com/ryogrid/SamehadaDB/storage/page/skip_list_page"
"github.com/ryogrid/SamehadaDB/types"
"github.com/ryogrid/SamehadaDB/lib/common"
"github.com/ryogrid/SamehadaDB/lib/storage/buffer"
"github.com/ryogrid/SamehadaDB/lib/storage/page/skip_list_page"
"github.com/ryogrid/SamehadaDB/lib/types"
"math"
"math/rand"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package skip_list_bench

import (
"fmt"
"github.com/ryogrid/SamehadaDB/container/skip_list"
"github.com/ryogrid/SamehadaDB/samehada"
"github.com/ryogrid/SamehadaDB/samehada/samehada_util"
"github.com/ryogrid/SamehadaDB/types"
"github.com/ryogrid/SamehadaDB/lib/container/skip_list"
"github.com/ryogrid/SamehadaDB/lib/samehada"
"github.com/ryogrid/SamehadaDB/lib/samehada/samehada_util"
"github.com/ryogrid/SamehadaDB/lib/types"
"math/rand"
"runtime"
"sync"
Expand Down
Loading

0 comments on commit d16991a

Please sign in to comment.