- Timestamp:
- 07/04/13 20:29:50 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
java/main/src/main/java/com/framsticks/dumping/LoadStream.java
r84 r96 2 2 3 3 import com.framsticks.communication.File; 4 import com.framsticks.core.InstanceUtils; 4 5 import com.framsticks.core.Path; 5 6 import com.framsticks.params.ListSource; … … 19 20 * @author Piotr Sniegowski 20 21 */ 21 public class LoadStream {22 public class LoadStream extends Stream { 22 23 23 24 private final static Logger log = Logger.getLogger(LoadStream.class.getName()); … … 46 47 while ((line = stream.readLine()) != null) { 47 48 if (query == null) { 48 query = Strings.splitIntoPair(line, ' ', " \n");49 query = Strings.splitIntoPair(line, ' ', ""); 49 50 files = new LinkedList<File>(); 50 51 log.trace("loading " + line); … … 58 59 if (line.equals("ok")) { 59 60 if (query.first.equals("get")) { 60 Path path = instance.createIfNeeded(query.second);61 instance.processFetchedValues(path, files);61 Path path = InstanceUtils.createIfNeeded(instance, query.second); 62 InstanceUtils.processFetchedValues(path, files); 62 63 } else if (query.first.equals("info")) { 63 64 assert files.size() == 1; 64 instance.processFetchedInfo(files.get(0));65 InstanceUtils.processFetchedInfo(instance, files.get(0)); 65 66 } else { 66 67 assert false; … … 82 83 } catch (IOException e) { 83 84 log.error("failed to load: " + e); 84 future. result(null, e);85 future.handle(new FramsticksException().msg("failed to load stream").cause(e)); 85 86 return; 86 87 } 87 88 log.info("loaded in: " + stopwatch); 88 future. result(instance.getPath(mountPath.getTextual()), null);89 future.pass(Path.to(instance, mountPath.getTextual())); 89 90 } 90 91
Note: See TracChangeset
for help on using the changeset viewer.