Skip to content

Commit efa1900

Browse files
authored
Merge pull request #343 from multiversx/remove-kibana-stuff
Remove kibana stuff
2 parents 651533e + d91ef78 commit efa1900

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+83
-2350
lines changed

cmd/elasticindexer/config/prefs.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
acknowledge-timeout-in-seconds = 50
1919

2020
[config.elastic-cluster]
21-
use-kibana = false
2221
url = "http://localhost:9200"
2322
username = ""
2423
password = ""

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ require (
88
github.com/gin-gonic/gin v1.10.0
99
github.com/google/uuid v1.6.0
1010
github.com/multiversx/mx-chain-communication-go v1.2.1-0.20250520083403-3f2bad6d5476
11-
github.com/multiversx/mx-chain-core-go v1.3.2-0.20250520074139-18b645ad397a
11+
github.com/multiversx/mx-chain-core-go v1.3.2-0.20250602142114-cb1013453d39
1212
github.com/multiversx/mx-chain-logger-go v1.0.16-0.20250520074859-b2faf3c90273
1313
github.com/multiversx/mx-chain-vm-common-go v1.5.17-0.20250520075408-c94bee9ee163
1414
github.com/prometheus/client_model v0.6.1

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o=
130130
github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc=
131131
github.com/multiversx/mx-chain-communication-go v1.2.1-0.20250520083403-3f2bad6d5476 h1:Dn73bH1AdG+7+3/FFRfOiivOEvwPyzZUBWWxpk8QVxc=
132132
github.com/multiversx/mx-chain-communication-go v1.2.1-0.20250520083403-3f2bad6d5476/go.mod h1:99+FW6f7X0Ri5tph+2l2GaDVrdej1do89exkfh7gilE=
133-
github.com/multiversx/mx-chain-core-go v1.3.2-0.20250520074139-18b645ad397a h1:dhCobNEcBdvutX+0UYF/l86oLVO9iUiUeF3sLFa9qhE=
134-
github.com/multiversx/mx-chain-core-go v1.3.2-0.20250520074139-18b645ad397a/go.mod h1:IO+vspNan+gT0WOHnJ95uvWygiziHZvfXpff6KnxV7g=
133+
github.com/multiversx/mx-chain-core-go v1.3.2-0.20250602142114-cb1013453d39 h1:a+98PN1XXTCYiJEdg7gpqfTOxGuQqvA8H1yglidV/p0=
134+
github.com/multiversx/mx-chain-core-go v1.3.2-0.20250602142114-cb1013453d39/go.mod h1:IO+vspNan+gT0WOHnJ95uvWygiziHZvfXpff6KnxV7g=
135135
github.com/multiversx/mx-chain-crypto-go v1.2.13-0.20250520075055-8ab2a164945d h1:NI5uKpkwP5XZu9gtDiWxmbbb07T9hXegPist17WAzY4=
136136
github.com/multiversx/mx-chain-crypto-go v1.2.13-0.20250520075055-8ab2a164945d/go.mod h1:yekQt4uB5LYXtimbhpdUbnFexjucWrQG/t+AX55bdM8=
137137
github.com/multiversx/mx-chain-logger-go v1.0.16-0.20250520074859-b2faf3c90273 h1:1I2CgGDAMINxrKI6yzSP/Y6Wow2YUmqegUXcltpGXQA=

process/elasticproc/elasticProcessor.go

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func NewElasticProcessor(arguments *ArgElasticProcessor) (*elasticProcessor, err
9696
bulkRequestMaxSize: arguments.BulkRequestMaxSize,
9797
}
9898

99-
err = ei.init(arguments.UseKibana, arguments.IndexTemplates, arguments.IndexPolicies, arguments.ExtraMappings)
99+
err = ei.init(arguments.IndexTemplates, arguments.IndexPolicies, arguments.ExtraMappings)
100100
if err != nil {
101101
return nil, err
102102
}
@@ -107,21 +107,12 @@ func NewElasticProcessor(arguments *ArgElasticProcessor) (*elasticProcessor, err
107107
}
108108

109109
// TODO move all the index create part in a new component
110-
func (ei *elasticProcessor) init(useKibana bool, indexTemplates, _ map[string]*bytes.Buffer, extraMappings []templates.ExtraMapping) error {
110+
func (ei *elasticProcessor) init(indexTemplates, _ map[string]*bytes.Buffer, extraMappings []templates.ExtraMapping) error {
111111
err := ei.createOpenDistroTemplates(indexTemplates)
112112
if err != nil {
113113
return err
114114
}
115115

116-
//nolint
117-
if useKibana {
118-
// TODO: Re-activate after we think of a solid way to handle forks+rotating indexes
119-
// err = ei.createIndexPolicies(indexPolicies)
120-
// if err != nil {
121-
// return err
122-
// }
123-
}
124-
125116
err = ei.createIndexTemplates(indexTemplates)
126117
if err != nil {
127118
return err

process/elasticproc/factory/elasticProcessorFactory.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ type ArgElasticProcessorFactory struct {
3535

3636
// CreateElasticProcessor will create a new instance of ElasticProcessor
3737
func CreateElasticProcessor(arguments ArgElasticProcessorFactory) (dataindexer.ElasticProcessor, error) {
38-
templatesAndPoliciesReader := templatesAndPolicies.CreateTemplatesAndPoliciesReader(arguments.UseKibana)
38+
templatesAndPoliciesReader := templatesAndPolicies.NewTemplatesAndPolicyReader()
3939
indexTemplates, indexPolicies, err := templatesAndPoliciesReader.GetElasticTemplatesAndPolicies()
4040
if err != nil {
4141
return nil, err

process/elasticproc/templatesAndPolicies/noKibana.go

Lines changed: 0 additions & 53 deletions
This file was deleted.
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
package templatesAndPolicies
2+
3+
import (
4+
"bytes"
5+
6+
indexer "github.com/multiversx/mx-chain-es-indexer-go/process/dataindexer"
7+
"github.com/multiversx/mx-chain-es-indexer-go/templates"
8+
"github.com/multiversx/mx-chain-es-indexer-go/templates/indices"
9+
)
10+
11+
type templatesAndPolicyReader struct{}
12+
13+
// NewTemplatesAndPolicyReader will create a new instance of templatesAndPolicyReader
14+
func NewTemplatesAndPolicyReader() *templatesAndPolicyReader {
15+
return new(templatesAndPolicyReader)
16+
}
17+
18+
// GetElasticTemplatesAndPolicies will return templates and policies
19+
func (tr *templatesAndPolicyReader) GetElasticTemplatesAndPolicies() (map[string]*bytes.Buffer, map[string]*bytes.Buffer, error) {
20+
indexPolicies := make(map[string]*bytes.Buffer)
21+
indexTemplates := make(map[string]*bytes.Buffer)
22+
23+
indexTemplates["opendistro"] = indices.OpenDistro.ToBuffer()
24+
indexTemplates[indexer.TransactionsIndex] = indices.Transactions.ToBuffer()
25+
indexTemplates[indexer.BlockIndex] = indices.Blocks.ToBuffer()
26+
indexTemplates[indexer.MiniblocksIndex] = indices.Miniblocks.ToBuffer()
27+
indexTemplates[indexer.RatingIndex] = indices.Rating.ToBuffer()
28+
indexTemplates[indexer.RoundsIndex] = indices.Rounds.ToBuffer()
29+
indexTemplates[indexer.ValidatorsIndex] = indices.Validators.ToBuffer()
30+
indexTemplates[indexer.AccountsIndex] = indices.Accounts.ToBuffer()
31+
indexTemplates[indexer.AccountsHistoryIndex] = indices.AccountsHistory.ToBuffer()
32+
indexTemplates[indexer.AccountsESDTIndex] = indices.AccountsESDT.ToBuffer()
33+
indexTemplates[indexer.AccountsESDTHistoryIndex] = indices.AccountsESDTHistory.ToBuffer()
34+
indexTemplates[indexer.EpochInfoIndex] = indices.EpochInfo.ToBuffer()
35+
indexTemplates[indexer.ReceiptsIndex] = indices.Receipts.ToBuffer()
36+
indexTemplates[indexer.ScResultsIndex] = indices.SCResults.ToBuffer()
37+
indexTemplates[indexer.SCDeploysIndex] = indices.SCDeploys.ToBuffer()
38+
indexTemplates[indexer.TokensIndex] = indices.Tokens.ToBuffer()
39+
indexTemplates[indexer.TagsIndex] = indices.Tags.ToBuffer()
40+
indexTemplates[indexer.LogsIndex] = indices.Logs.ToBuffer()
41+
indexTemplates[indexer.DelegatorsIndex] = indices.Delegators.ToBuffer()
42+
indexTemplates[indexer.OperationsIndex] = indices.Operations.ToBuffer()
43+
indexTemplates[indexer.ESDTsIndex] = indices.ESDTs.ToBuffer()
44+
indexTemplates[indexer.ValuesIndex] = indices.Values.ToBuffer()
45+
indexTemplates[indexer.EventsIndex] = indices.Events.ToBuffer()
46+
47+
return indexTemplates, indexPolicies, nil
48+
}
49+
50+
// GetExtraMappings will return an array of indices extra mappings
51+
func (tr *templatesAndPolicyReader) GetExtraMappings() ([]templates.ExtraMapping, error) {
52+
return []templates.ExtraMapping{}, nil
53+
}

process/elasticproc/templatesAndPolicies/noKibana_test.go renamed to process/elasticproc/templatesAndPolicies/reader_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
func TestTemplatesAndPolicyReaderNoKibana_GetElasticTemplatesAndPolicies(t *testing.T) {
1010
t.Parallel()
1111

12-
reader := NewTemplatesAndPolicyReaderNoKibana()
12+
reader := NewTemplatesAndPolicyReader()
1313

1414
templates, policies, err := reader.GetElasticTemplatesAndPolicies()
1515
require.Nil(t, err)

process/elasticproc/templatesAndPolicies/templatesAndPoliciesFactory.go

Lines changed: 0 additions & 10 deletions
This file was deleted.

process/elasticproc/templatesAndPolicies/templatesAndPoliciesFactory_test.go

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)