Skip to content

Commit

Permalink
leftovers
Browse files Browse the repository at this point in the history
  • Loading branch information
Romain Slootmaekers committed Apr 4, 2014
1 parent 8b7aa38 commit f7bb75b
Show file tree
Hide file tree
Showing 21 changed files with 359 additions and 524 deletions.
2 changes: 1 addition & 1 deletion debian/copyright
Expand Up @@ -4,7 +4,7 @@ Source: <url://www.arakoon.org>

Files: *
Copyright: 2010- incubaid
License: AGPL-3.0
License: Apache-2.0

Files: debian/*
Copyright: 2010 - Romain Slootmaekers <romain@incubaid.com>
Expand Down
24 changes: 1 addition & 23 deletions examples/launch.py
@@ -1,25 +1,3 @@
# This file is part of Arakoon, a distributed key-value store
#
# Copyright (C) 2013, Incubaid BVBA
#
# Licensees holding a valid Incubaid license may use this file in
# accordance with Incubaid's Arakoon commercial license agreement. For
# more information on how to enter into this agreement, please contact
# Incubaid (contact details can be found on www.arakoon.org/licensing).
#
# Alternatively, this file may be redistributed and/or modified under
# the terms of the GNU Affero General Public License version 3, as
# published by the Free Software Foundation. Under this license, this
# file is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.
#
# See the GNU Affero General Public License for more details. You should
# have received a copy of the # GNU Affero General Public License along
# with this program (file "COPYING").
#
# If not, see <http://www.gnu.org/licenses/>.

'''
Demonstration wrapper script for Arakoon node launching and error handling
Expand All @@ -37,7 +15,7 @@
# Note: when using the Pylabs extension and its 'wrapper script' support, the
# required executable path & arguments are passed to the 'wrapper script' as
# arguments, so the script should pick these up, remove any unwanted flags (e.g.
# '-daemonize'), and use what's left, instead of these
# '-daemonize'), and use what's left, instead of these
EXECUTABLE = os.path.join(os.getcwd(), 'arakoon.native')
ARGS = [EXECUTABLE,
'--node', 'arakoon_0',
Expand Down
74 changes: 33 additions & 41 deletions extension/server/NurseryManagement.py
@@ -1,23 +1,17 @@
"""
This file is part of Arakoon, a distributed key-value store. Copyright
(C) 2010 Incubaid BVBA
Licensees holding a valid Incubaid license may use this file in
accordance with Incubaid's Arakoon commercial license agreement. For
more information on how to enter into this agreement, please contact
Incubaid (contact details can be found on www.arakoon.org/licensing).
Alternatively, this file may be redistributed and/or modified under
the terms of the GNU Affero General Public License version 3, as
published by the Free Software Foundation. Under this license, this
file is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Affero General Public License for more details.
You should have received a copy of the
GNU Affero General Public License along with this program (file "COPYING").
If not, see <http://www.gnu.org/licenses/>.
Copyright (2010-2014) INCUBAID BVBA
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""

try:
Expand All @@ -31,10 +25,10 @@ class NurseryManagement:
def getNursery(self, clusterId ):
"""
Retrieve the nursery manager for the nursery with the provided keeper
@param clusterId: The keeper of the nursery
@type clusterId: string
@rtype: NurseryManager
"""
return NurseryManager( clusterId )
Expand All @@ -46,22 +40,22 @@ def getConfigLocation(clusterId):
return "%s/%s.cfg" % (cfg[ clusterId ]["path"], clusterId)
else:
raise RuntimeError("Unknown nursery cluster %s" % clusterId)

class NurseryManager:
def __init__(self,clusterId):
self._keeperCfg = NurseryManagement.getConfigLocation(clusterId)

def migrate(self, leftClusterId, separator, rightClusterId):
"""
Trigger a migration of key range in the nursery.
Either leftClusterId or rightClusterId must already be part of the nursery.
Either leftClusterId or rightClusterId must already be part of the nursery.
So it is not possible to add two clusters at the same time.
The separator will serve as the boundary of the key range that is migrated.
For more documentation see the docs on our portal (www.arakoon.org)
@param leftClusterId: The cluster that will be responsible for the key range up to the separator
@type leftClusterId: string
@param separator: The separator separating the key ranges between the two clusters
Expand All @@ -72,48 +66,46 @@ def migrate(self, leftClusterId, separator, rightClusterId):
"""
cmd = "%s -config %s --nursery-migrate %s %s %s" % (self.__which(), self._keeperCfg, leftClusterId, separator, rightClusterId)
self.__runCmd ( cmd )

def initialize(self, firstClusterId):
"""
Initialize the routing of the nursery so it only contains the provided cluster
A nursery can only be initialized once
@param firstClusterId: The first cluster of the nursery
@type firstClusterId: string
@rtype void
"""
cmd = "%s -config %s --nursery-init %s" % (self.__which(), self._keeperCfg, firstClusterId)
self.__runCmd ( cmd )

def delete(self, clusterId, separator = None):
"""
Remove a cluster from the nursery. If the cluster is a boundary cluster, no separator can be provided.
@param clusterId: The cluster to be removed
@type clusterId: string
@param separator: Separator separating the clusters neighbouring the cluster that will be removed (not valid when deleting boundary clusters
@type separator: string
@rtype void
"""
sep_string = None
if separator is None:
sep_string = '""'
else:
sep_string = separator

cmd = "%s -config %s --nursery-delete %s %s" % (self.__which(), self._keeperCfg, clusterId, sep_string)
self.__runCmd( cmd )

def __runCmd(self, cmd):
(exit, stdout, stderr) = q.system.process.run( commandline = cmd, stopOnError=False)
if exit :
raise RuntimeError( stderr )

def __which(self):
return ArakoonManagement.which_arakoon()


27 changes: 10 additions & 17 deletions extension/server/NurseryRemoteControl.py
@@ -1,25 +1,18 @@
"""
This file is part of Arakoon, a distributed key-value store. Copyright
(C) 2010 Incubaid BVBA
Copyright (2010-2014) INCUBAID BVBA
Licensees holding a valid Incubaid license may use this file in
accordance with Incubaid's Arakoon commercial license agreement. For
more information on how to enter into this agreement, please contact
Incubaid (contact details can be found on www.arakoon.org/licensing).
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Alternatively, this file may be redistributed and/or modified under
the terms of the GNU Affero General Public License version 3, as
published by the Free Software Foundation. Under this license, this
file is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.
http://www.apache.org/licenses/LICENSE-2.0
See the GNU Affero General Public License for more details.
You should have received a copy of the
GNU Affero General Public License along with this program (file "COPYING").
If not, see <http://www.gnu.org/licenses/>.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""

import socket
import RemoteControlProtocol as RCP

30 changes: 12 additions & 18 deletions extension/test/__init__.py
@@ -1,22 +1,16 @@
'''
This file is part of Arakoon, a distributed key-value store. Copyright
(C) 2010 Incubaid BVBA
"""
Copyright (2010-2014) INCUBAID BVBA
Licensees holding a valid Incubaid license may use this file in
accordance with Incubaid's Arakoon commercial license agreement. For
more information on how to enter into this agreement, please contact
Incubaid (contact details can be found on www.arakoon.org/licensing).
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Alternatively, this file may be redistributed and/or modified under
the terms of the GNU Affero General Public License version 3, as
published by the Free Software Foundation. Under this license, this
file is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.
http://www.apache.org/licenses/LICENSE-2.0
See the GNU Affero General Public License for more details.
You should have received a copy of the
GNU Affero General Public License along with this program (file "COPYING").
If not, see <http://www.gnu.org/licenses/>.
'''
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""

42 changes: 16 additions & 26 deletions extension/test/client/ArakoonClientProtocolTest.py
@@ -1,27 +1,19 @@
'''
This file is part of Arakoon, a distributed key-value store. Copyright
(C) 2010 Incubaid BVBA
Licensees holding a valid Incubaid license may use this file in
accordance with Incubaid's Arakoon commercial license agreement. For
more information on how to enter into this agreement, please contact
Incubaid (contact details can be found on www.arakoon.org/licensing).
Alternatively, this file may be redistributed and/or modified under
the terms of the GNU Affero General Public License version 3, as
published by the Free Software Foundation. Under this license, this
file is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Affero General Public License for more details.
You should have received a copy of the
GNU Affero General Public License along with this program (file "COPYING").
If not, see <http://www.gnu.org/licenses/>.
'''


#from pymonkey import q
"""
Copyright (2010-2014) INCUBAID BVBA
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""

from nose.tools import *

from arakoon import *
Expand Down Expand Up @@ -111,5 +103,3 @@ def test_decode_error_response() :
test_decode_void_response()
test_decode_string_response()
test_decode_error_response()


22 changes: 0 additions & 22 deletions extension/test/client/__init__.py
@@ -1,22 +0,0 @@
'''
This file is part of Arakoon, a distributed key-value store. Copyright
(C) 2010 Incubaid BVBA
Licensees holding a valid Incubaid license may use this file in
accordance with Incubaid's Arakoon commercial license agreement. For
more information on how to enter into this agreement, please contact
Incubaid (contact details can be found on www.arakoon.org/licensing).
Alternatively, this file may be redistributed and/or modified under
the terms of the GNU Affero General Public License version 3, as
published by the Free Software Foundation. Under this license, this
file is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Affero General Public License for more details.
You should have received a copy of the
GNU Affero General Public License along with this program (file "COPYING").
If not, see <http://www.gnu.org/licenses/>.
'''

0 comments on commit f7bb75b

Please sign in to comment.