Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bugs in metadata store #82

Merged
merged 1 commit into from
Jan 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions clients/dynamodb_streams.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package clients

import (
"net/url"

"github.com/aws/aws-sdk-go-v2/service/dynamodbstreams"
"github.com/mosuka/phalanx/errors"
)

func NewDynamoDBStreamsClientWithUri(uri string) (*dynamodbstreams.Client, error) {
// Parse URI.
u, err := url.Parse(uri)
if err != nil {
return nil, err
}

if u.Scheme != "dynamodb" {
return nil, errors.ErrInvalidUri
}

// Create AWS config.
cfg, err := NewAwsConfigWithUri(uri)
if err != nil {
return nil, err
}

return dynamodbstreams.NewFromConfig(cfg), nil
}
7 changes: 6 additions & 1 deletion cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ import (

const (
nodeNamePrefix = "node-"

// Evvent size.
// Cluster events can occur in large numbers at once,
// so make sure they are large enough.
eventSize = 1024
)

func generateNodeName() string {
Expand Down Expand Up @@ -62,7 +67,7 @@ func NewCluster(host string, bindPort int, nodeMetadata NodeMetadata, isSeedNode
nodeEventDeliegate: nodeEventDeliegate,
nodeMetadataDelegate: nodeMetadataDelegate,
logger: clusterLogger,
clusterEvents: make(chan ClusterEvent, 10),
clusterEvents: make(chan ClusterEvent, eventSize),
stopWatching: make(chan bool),
isSeedNode: isSeedNode,
indexerHash: rendezvous.New(),
Expand Down
11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,24 @@ services:
restart: always

localstack:
container_name: localstack
image: localstack/localstack:latest
environment:
SERVICES: ${LOCALSTACK_SERVICES}
DEFAULT_REGION: ${LOCALSTACK_DEFAULT_REGION}
ports:
- "4566:4566"

# dynamodb-admin:
# image: aaronshaf/dynamodb-admin:latest
# environment:
# DYNAMO_ENDPOINT: localstack:4566
# PORT: 8081
# ports:
# - 8081:8081
# depends_on:
# - localstack

phalanx:
container_name: phalanx
image: mosuka/phalanx:latest
Expand Down
2 changes: 1 addition & 1 deletion docs/aggregations.html
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ <h1 class="search-results-title">No results matching "<span class='search-query'
<script>
var gitbook = gitbook || [];
gitbook.push(function() {
gitbook.page.hasChanged({"page":{"title":"Aggregations","level":"1.13","depth":1,"next":{"title":"RESTful API","level":"1.14","depth":1,"path":"restful_api.md","ref":"restful_api.md","articles":[{"title":"Create Index API","level":"1.14.1","depth":2,"path":"restful_api/create_index_api.md","ref":"restful_api/create_index_api.md","articles":[]},{"title":"Delete Index API","level":"1.14.2","depth":2,"path":"restful_api/delete_index_api.md","ref":"restful_api/delete_index_api.md","articles":[]},{"title":"Add Documents API","level":"1.14.3","depth":2,"path":"restful_api/add_documents_api.md","ref":"restful_api/add_documents_api.md","articles":[]},{"title":"Delete Documents API","level":"1.14.4","depth":2,"path":"restful_api/delete_documents_api.md","ref":"restful_api/delete_documents_api.md","articles":[]},{"title":"Search API","level":"1.14.5","depth":2,"path":"restful_api/search_api.md","ref":"restful_api/search_api.md","articles":[]}]},"previous":{"title":"Token filters","level":"1.12.3","depth":2,"path":"analyzer/token_filters.md","ref":"analyzer/token_filters.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["hide-published-with"],"pluginsConfig":{"hide-published-with":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"aggregations.md","mtime":"2022-01-18T13:00:14.678Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2022-01-20T08:53:26.682Z"},"basePath":".","book":{"language":""}});
gitbook.page.hasChanged({"page":{"title":"Aggregations","level":"1.13","depth":1,"next":{"title":"RESTful API","level":"1.14","depth":1,"path":"restful_api.md","ref":"restful_api.md","articles":[{"title":"Create Index API","level":"1.14.1","depth":2,"path":"restful_api/create_index_api.md","ref":"restful_api/create_index_api.md","articles":[]},{"title":"Delete Index API","level":"1.14.2","depth":2,"path":"restful_api/delete_index_api.md","ref":"restful_api/delete_index_api.md","articles":[]},{"title":"Add Documents API","level":"1.14.3","depth":2,"path":"restful_api/add_documents_api.md","ref":"restful_api/add_documents_api.md","articles":[]},{"title":"Delete Documents API","level":"1.14.4","depth":2,"path":"restful_api/delete_documents_api.md","ref":"restful_api/delete_documents_api.md","articles":[]},{"title":"Search API","level":"1.14.5","depth":2,"path":"restful_api/search_api.md","ref":"restful_api/search_api.md","articles":[]}]},"previous":{"title":"Token filters","level":"1.12.3","depth":2,"path":"analyzer/token_filters.md","ref":"analyzer/token_filters.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["hide-published-with"],"pluginsConfig":{"hide-published-with":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"aggregations.md","mtime":"2022-01-18T13:00:14.678Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2022-01-26T06:16:08.079Z"},"basePath":".","book":{"language":""}});
});
</script>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/analyzer.html
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ <h1 class="search-results-title">No results matching "<span class='search-query'
<script>
var gitbook = gitbook || [];
gitbook.push(function() {
gitbook.page.hasChanged({"page":{"title":"Analyzer","level":"1.12","depth":1,"next":{"title":"Char filters","level":"1.12.1","depth":2,"path":"analyzer/char_filters.md","ref":"analyzer/char_filters.md","articles":[]},"previous":{"title":"Index Mapping","level":"1.11","depth":1,"path":"index_mapping.md","ref":"index_mapping.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["hide-published-with"],"pluginsConfig":{"hide-published-with":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"analyzer.md","mtime":"2022-01-18T13:00:14.678Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2022-01-20T08:53:26.682Z"},"basePath":".","book":{"language":""}});
gitbook.page.hasChanged({"page":{"title":"Analyzer","level":"1.12","depth":1,"next":{"title":"Char filters","level":"1.12.1","depth":2,"path":"analyzer/char_filters.md","ref":"analyzer/char_filters.md","articles":[]},"previous":{"title":"Index Mapping","level":"1.11","depth":1,"path":"index_mapping.md","ref":"index_mapping.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["hide-published-with"],"pluginsConfig":{"hide-published-with":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"analyzer.md","mtime":"2022-01-18T13:00:14.678Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2022-01-26T06:16:08.079Z"},"basePath":".","book":{"language":""}});
});
</script>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/analyzer/char_filters.html
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ <h1 class="search-results-title">No results matching "<span class='search-query'
<script>
var gitbook = gitbook || [];
gitbook.push(function() {
gitbook.page.hasChanged({"page":{"title":"Char filters","level":"1.12.1","depth":2,"next":{"title":"Tokenizers","level":"1.12.2","depth":2,"path":"analyzer/tokenizers.md","ref":"analyzer/tokenizers.md","articles":[]},"previous":{"title":"Analyzer","level":"1.12","depth":1,"path":"analyzer.md","ref":"analyzer.md","articles":[{"title":"Char filters","level":"1.12.1","depth":2,"path":"analyzer/char_filters.md","ref":"analyzer/char_filters.md","articles":[]},{"title":"Tokenizers","level":"1.12.2","depth":2,"path":"analyzer/tokenizers.md","ref":"analyzer/tokenizers.md","articles":[]},{"title":"Token filters","level":"1.12.3","depth":2,"path":"analyzer/token_filters.md","ref":"analyzer/token_filters.md","articles":[]}]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["hide-published-with"],"pluginsConfig":{"hide-published-with":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"analyzer/char_filters.md","mtime":"2022-01-18T13:00:14.678Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2022-01-20T08:53:26.682Z"},"basePath":"..","book":{"language":""}});
gitbook.page.hasChanged({"page":{"title":"Char filters","level":"1.12.1","depth":2,"next":{"title":"Tokenizers","level":"1.12.2","depth":2,"path":"analyzer/tokenizers.md","ref":"analyzer/tokenizers.md","articles":[]},"previous":{"title":"Analyzer","level":"1.12","depth":1,"path":"analyzer.md","ref":"analyzer.md","articles":[{"title":"Char filters","level":"1.12.1","depth":2,"path":"analyzer/char_filters.md","ref":"analyzer/char_filters.md","articles":[]},{"title":"Tokenizers","level":"1.12.2","depth":2,"path":"analyzer/tokenizers.md","ref":"analyzer/tokenizers.md","articles":[]},{"title":"Token filters","level":"1.12.3","depth":2,"path":"analyzer/token_filters.md","ref":"analyzer/token_filters.md","articles":[]}]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["hide-published-with"],"pluginsConfig":{"hide-published-with":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"analyzer/char_filters.md","mtime":"2022-01-18T13:00:14.678Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2022-01-26T06:16:08.079Z"},"basePath":"..","book":{"language":""}});
});
</script>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/analyzer/token_filters.html
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ <h1 class="search-results-title">No results matching "<span class='search-query'
<script>
var gitbook = gitbook || [];
gitbook.push(function() {
gitbook.page.hasChanged({"page":{"title":"Token filters","level":"1.12.3","depth":2,"next":{"title":"Aggregations","level":"1.13","depth":1,"path":"aggregations.md","ref":"aggregations.md","articles":[]},"previous":{"title":"Tokenizers","level":"1.12.2","depth":2,"path":"analyzer/tokenizers.md","ref":"analyzer/tokenizers.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["hide-published-with"],"pluginsConfig":{"hide-published-with":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"analyzer/token_filters.md","mtime":"2022-01-18T13:00:14.678Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2022-01-20T08:53:26.682Z"},"basePath":"..","book":{"language":""}});
gitbook.page.hasChanged({"page":{"title":"Token filters","level":"1.12.3","depth":2,"next":{"title":"Aggregations","level":"1.13","depth":1,"path":"aggregations.md","ref":"aggregations.md","articles":[]},"previous":{"title":"Tokenizers","level":"1.12.2","depth":2,"path":"analyzer/tokenizers.md","ref":"analyzer/tokenizers.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["hide-published-with"],"pluginsConfig":{"hide-published-with":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"analyzer/token_filters.md","mtime":"2022-01-18T13:00:14.678Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2022-01-26T06:16:08.079Z"},"basePath":"..","book":{"language":""}});
});
</script>
</div>
Expand Down
Loading