Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Carlos Ramos Carreño
neoppod
Commits
c995200a
Commit
c995200a
authored
Jun 12, 2017
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
storage: new --disable-drop-partitions option
parent
6ee35041
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
0 deletions
+12
-0
neo/lib/config.py
neo/lib/config.py
+3
-0
neo/scripts/neostorage.py
neo/scripts/neostorage.py
+5
-0
neo/storage/app.py
neo/storage/app.py
+1
-0
neo/storage/handlers/initialization.py
neo/storage/handlers/initialization.py
+3
-0
No files found.
neo/lib/config.py
View file @
c995200a
...
@@ -97,6 +97,9 @@ class ConfigurationManager(object):
...
@@ -97,6 +97,9 @@ class ConfigurationManager(object):
bind
=
self
.
__get
(
'bind'
)
bind
=
self
.
__get
(
'bind'
)
return
parseNodeAddress
(
bind
,
0
)
return
parseNodeAddress
(
bind
,
0
)
def
getDisableDropPartitions
(
self
):
return
self
.
__get
(
'disable_drop_partitions'
,
True
)
def
getDatabase
(
self
):
def
getDatabase
(
self
):
return
self
.
__get
(
'database'
)
return
self
.
__get
(
'database'
)
...
...
neo/scripts/neostorage.py
View file @
c995200a
...
@@ -30,6 +30,11 @@ parser.add_option('-d', '--database', help = 'database connections string')
...
@@ -30,6 +30,11 @@ parser.add_option('-d', '--database', help = 'database connections string')
parser
.
add_option
(
'-e'
,
'--engine'
,
help
=
'database engine'
)
parser
.
add_option
(
'-e'
,
'--engine'
,
help
=
'database engine'
)
parser
.
add_option
(
'-w'
,
'--wait'
,
help
=
'seconds to wait for backend to be '
parser
.
add_option
(
'-w'
,
'--wait'
,
help
=
'seconds to wait for backend to be '
'available, before erroring-out (-1 = infinite)'
,
type
=
'float'
,
default
=
0
)
'available, before erroring-out (-1 = infinite)'
,
type
=
'float'
,
default
=
0
)
parser
.
add_option
(
'--disable-drop-partitions'
,
action
=
'store_true'
,
help
=
'do not delete data of discarded cells, which is'
' useful for big databases because the current'
' implementation is inefficient (this option should'
' disappear in the future)'
)
parser
.
add_option
(
'--reset'
,
action
=
'store_true'
,
parser
.
add_option
(
'--reset'
,
action
=
'store_true'
,
help
=
'remove an existing database if any, and exit'
)
help
=
'remove an existing database if any, and exit'
)
...
...
neo/storage/app.py
View file @
c995200a
...
@@ -48,6 +48,7 @@ class Application(BaseApplication):
...
@@ -48,6 +48,7 @@ class Application(BaseApplication):
self
.
dm
=
buildDatabaseManager
(
config
.
getAdapter
(),
self
.
dm
=
buildDatabaseManager
(
config
.
getAdapter
(),
(
config
.
getDatabase
(),
config
.
getEngine
(),
config
.
getWait
()),
(
config
.
getDatabase
(),
config
.
getEngine
(),
config
.
getWait
()),
)
)
self
.
disable_drop_partitions
=
config
.
getDisableDropPartitions
()
# load master nodes
# load master nodes
for
master_address
in
config
.
getMasters
():
for
master_address
in
config
.
getMasters
():
...
...
neo/storage/handlers/initialization.py
View file @
c995200a
...
@@ -38,6 +38,9 @@ class InitializationHandler(BaseMasterHandler):
...
@@ -38,6 +38,9 @@ class InitializationHandler(BaseMasterHandler):
# delete objects database
# delete objects database
dm
=
app
.
dm
dm
=
app
.
dm
if
unassigned_set
:
if
unassigned_set
:
if
app
.
disable_drop_partitions
:
logging
.
info
(
"don't drop data for partitions %r"
,
unassigned_set
)
else
:
logging
.
debug
(
'drop data for partitions %r'
,
unassigned_set
)
logging
.
debug
(
'drop data for partitions %r'
,
unassigned_set
)
dm
.
dropPartitions
(
unassigned_set
)
dm
.
dropPartitions
(
unassigned_set
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment