Skip to content

Commit

Permalink
Issue #58: fix up required argument handling for newExtent and newExt…
Browse files Browse the repository at this point in the history
…entForRecovery commands [ci skip]
  • Loading branch information
dalehenrich committed Mar 21, 2015
1 parent 5bec1a7 commit 154d5b2
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 13 deletions.
21 changes: 16 additions & 5 deletions bin/stoneNewExtent
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ the stone will be restarted with the -N option.
If the -s option is not specified, $GEMSTONE/bin/extent0.seaside.dbf will be used as
the initial extent.
With the -n option, the stone is not restart started.
With the -n option, the stone is not restarted and the <snapshot-file-path> is required.
OPTIONS
-h
display help
-n
No startStone.
No startStone. <snapshot-file-path> required.
-s <snapshot-file-path>
Path to snapshot file used to create stone.
Expand Down Expand Up @@ -72,11 +72,22 @@ popd >& /dev/null
echo "Shutdown stone"
$GS_HOME/bin/stopStone $stoneName

echo "Copy snapshot"
$GS_HOME/bin/tode newExtent $stoneName $snapshotFile

echo "Restarting stone"
if [ "${noRestart}" = "false" ] ; then
echo "Copy snapshot and remove tranlogs"
$GS_HOME/bin/tode newExtent $stoneName $snapshotFile

# -N option used to ignore the tranlog files during restart
echo "Restarting stone"
$GS_HOME/bin/startStone -N $stoneName
else
echo "Copy snapshot and leave tranlogs for recovery"

if [ "${snapshotFile}x" = "x" ] ; then
echo "Must specify <snapshot-file-path>, when using the -n (no restart option)"
echo " Tranlogs left in $GS_HOME/gemstone/stones/${stoneName}/tranlogs"
echo " Are not likely to be appropriate for $GEMSTONE/bin/extent0.seaside.dbf"
usage; exit 1
fi
$GS_HOME/bin/tode newExtentForRecovery $stoneName $snapshotFile
fi
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ activation
activate
self activateHelp
ifTrue: [ ^ self ].
self arguments size < 1
ifTrue: [
self printHelp.
^ self exitFailure: 'Missing stone name' ].
self self checkArguments.
self newExtent.
self shouldRemoveTranlogs
ifTrue: [ self removeTranlogs ].
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
private
checkArguments
self arguments size < 1
ifTrue: [
self printHelp.
^ self exitFailure: 'Missing stone name' ]
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"commandName" : "dkh 7/19/2014 07:54",
"description" : "dkh 7/19/2014 07:54" },
"instance" : {
"activate" : "dkh 3/20/2015 18:27",
"activate" : "dkh 3/20/2015 19:32",
"checkArguments" : "dkh 3/20/2015 19:32",
"gsVers" : "dkh 7/19/2014 07:59",
"newExtent" : "dkh 3/20/2015 18:27",
"removeTranlogs" : "dkh 3/20/2015 18:26",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Usage: newExtentForBackup [ --help] <stone-name> <snapshot-file-path>
Usage: newExtentForRecovery [ --help] <stone-name> <snapshot-file-path>
<stone-name> name of the stone to be created
<snapshot-file-path> Path to extent snapshot file to be used to
restore the stone.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
private
checkArguments
self arguments size < 1
ifTrue: [
self printHelp.
^ self exitFailure: 'Missing stone name' ].
self arguments size < 2
ifTrue: [
self printHelp.
^ self exitFailure: 'Missing snapshot file path' ]
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
"commandName" : "dkh 3/20/2015 18:24",
"description" : "dkh 3/20/2015 18:22" },
"instance" : {
"checkArguments" : "dkh 3/20/2015 19:33",
"shouldRemoveTranlogs" : "dkh 3/20/2015 18:20" } }
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
],
"classvars" : [
],
"commentStamp" : "dkh 3/20/2015 18:24",
"commentStamp" : "dkh 3/20/2015 19:24",
"instvars" : [
],
"name" : "GsDevKitNewExtentForRecoveryCommandLineHandler",
Expand Down

Large diffs are not rendered by default.

0 comments on commit 154d5b2

Please sign in to comment.