Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
MKCLOS
Core Development Platform
corepkgv2
Commits
f639c467
Commit
f639c467
authored
6 years ago
by
Vivek Naik
Browse files
Options
Downloads
Patches
Plain Diff
add: method to get bucket by index id in corefdb
parent
f32e1c47
2 merge requests
!113
31 Aug MEP Merge Dev to Stg
,
!107
Add: Pack bucket and lazy writing indexes
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dalmdl/corefdb/bucket.go
+23
-0
dalmdl/corefdb/bucket.go
with
23 additions
and
0 deletions
dalmdl/corefdb/bucket.go
+
23
−
0
View file @
f639c467
...
@@ -1945,3 +1945,26 @@ func DeleteDataFromFDB(dbName string, indexID string, rs *gjson.Result, queries
...
@@ -1945,3 +1945,26 @@ func DeleteDataFromFDB(dbName string, indexID string, rs *gjson.Result, queries
}
}
return
errList
return
errList
}
}
// GetBucketByIndexID - return bucket by specified indexID
func
GetBucketByIndexID
(
dbName
,
indexID
string
)
(
Bucket
,
error
)
{
fdb
,
err
:=
GetFDBInstance
(
dbName
)
bucket
:=
Bucket
{}
if
err
!=
nil
{
loggermdl
.
LogError
(
"fdb instance not found for: "
,
dbName
)
return
bucket
,
err
}
index
,
ok
:=
fdb
.
GetFDBIndex
(
indexID
)
if
!
ok
{
loggermdl
.
LogError
(
"index not found: "
+
indexID
)
return
bucket
,
errormdl
.
Wrap
(
"index not found: "
+
indexID
)
}
bucketID
:=
index
.
BucketSequence
[
len
(
index
.
BucketSequence
)
-
1
]
bucketPtr
,
ok
:=
fdb
.
buckets
[
bucketID
]
if
!
ok
{
loggermdl
.
LogError
(
"Bucket not found: "
+
bucketID
)
return
bucket
,
errormdl
.
Wrap
(
"Bucket not found: "
+
bucketID
)
}
return
*
bucketPtr
,
nil
}
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets