Changeset 27530 for gs2-extensions/parallel-building
- Timestamp:
- 2013-06-04T11:08:37+12:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gs2-extensions/parallel-building/trunk/src/bin/script/hadoop_import.pl
r27495 r27530 83 83 mkdir($gs_results_dir, 0755); 84 84 } 85 my $gs_archives_dir = $gs_collection_dir . '/archives';86 85 # - directories within HDFS 87 86 #my $hdfs_input_dir = &urlCat('hdfs://' . $ENV{'HDFSHOST'} . ':' . $ENV{'HDFSPORT'}, 'user', $username, 'gsdl', 'collect', $collection, 'import'); … … 112 111 } 113 112 # - clear out the archives regardless 114 print " * Clearing existing archives directory for this collection... "; 113 my $gs_archives_dir = $gs_collection_dir . '/archives'; 114 my $deleted_archives = 0; 115 115 if (-e $gs_archives_dir) 116 116 { 117 print " * Clearing existing archives directory for this collection... "; 117 118 &shellCommand('rm -rf "' . $gs_archives_dir . '"'); 119 $deleted_archives = 1; 118 120 } 119 121 mkdir($gs_archives_dir, 0755); 120 122 if (&hdfsTest('d', 0, $hdfs_output_dir)) 121 123 { 124 if (!$deleted_archives) 125 { 126 print " * Clearing existing archives directory for this collection... "; 127 } 122 128 &hdfsCommand('rmr', $hdfs_output_dir); 123 } 129 $deleted_archives = 1; 130 } 131 if ($deleted_archives) 132 { 133 print "Done!\n"; 134 } 135 # - watch for cached directories for Media based collections 136 my $gs_cached_dir = $gs_collection_dir . '/cached'; 137 if (-e $gs_cached_dir) 138 { 139 print " * Clearing existing cached media directory for this collection... "; 140 &shellCommand('rm -rf "' . $gs_cached_dir . '"'); 141 print "Done!\n"; 142 } 143 124 144 # - clear out any old logs 145 print " * Clearing existing logs for this collection... "; 146 my $gs_logs_dir = $gs_collection_dir . '/logs'; 147 if (!&dirIsEmpty($gs_logs_dir)) 148 { 149 &shellCommand('rm ' . $gs_logs_dir . '/*.*'); 150 } 125 151 if (!&dirIsEmpty('/tmp/greenstone')) 126 152 { … … 136 162 137 163 # - flush DNS cache too, so we are playing on a level field 164 print " * Flushing disk cache... "; 138 165 &shellCommand('flush_caches.pl'); 139 166 if ($is_rocks_cluster) … … 141 168 &shellCommand('rocks run host "flush_caches.pl"'); 142 169 } 170 print "Done!\n"; 143 171 144 172 # 3. Special case for *Server type infodbs (namely TDBServer and GDBMServer)
Note:
See TracChangeset
for help on using the changeset viewer.