Examples of Snapshot


Examples of com.sk89q.worldedit.world.snapshot.Snapshot

            player.printError("Snapshot/backup restore is not configured.");
            return;
        }

        Region region = session.getSelection(player.getWorld());
        Snapshot snapshot;

        if (args.argsLength() > 0) {
            try {
                snapshot = config.snapshotRepo.getSnapshot(args.getString(0));
            } catch (InvalidSnapshotException e) {
                player.printError("That snapshot does not exist or is not available.");
                return;
            }
        } else {
            snapshot = session.getSnapshot();
        }

        // No snapshot set?
        if (snapshot == null) {
            try {
                snapshot = config.snapshotRepo.getDefaultSnapshot(player.getWorld().getName());

                if (snapshot == null) {
                    player.printError("No snapshots were found. See console for details.");

                    // Okay, let's toss some debugging information!
                    File dir = config.snapshotRepo.getDirectory();

                    try {
                        logger.info("WorldEdit found no snapshots: looked in: "
                                + dir.getCanonicalPath());
                    } catch (IOException e) {
                        logger.info("WorldEdit found no snapshots: looked in "
                                + "(NON-RESOLVABLE PATH - does it exist?): "
                                + dir.getPath());
                    }

                    return;
                }
            } catch (MissingWorldException ex) {
                player.printError("No snapshots were found for this world.");
                return;
            }
        }

        ChunkStore chunkStore = null;

        // Load chunk store
        try {
            chunkStore = snapshot.getChunkStore();
            player.print("Snapshot '" + snapshot.getName() + "' loaded; now restoring...");
        } catch (DataException e) {
            player.printError("Failed to load snapshot: " + e.getMessage());
            return;
        } catch (IOException e) {
            player.printError("Failed to load snapshot: " + e.getMessage());
View Full Code Here

Examples of com.sk89q.worldedit.world.snapshot.Snapshot

        String name = args.getString(0);

        // Want the latest snapshot?
        if (name.equalsIgnoreCase("latest")) {
            try {
                Snapshot snapshot = config.snapshotRepo.getDefaultSnapshot(player.getWorld().getName());

                if (snapshot != null) {
                    session.setSnapshot(null);
                    player.print("Now using newest snapshot.");
                } else {
View Full Code Here

Examples of com.sk89q.worldedit.world.snapshot.Snapshot

            List<Snapshot> snapshots = config.snapshotRepo.getSnapshots(true, player.getWorld().getName());
            if (snapshots.size() < index) {
                player.printError("Invalid index, must be between 1 and " + snapshots.size() + ".");
                return;
            }
            Snapshot snapshot = snapshots.get(index - 1);
            if (snapshot == null) {
                player.printError("That snapshot does not exist or is not available.");
                return;
            }
            session.setSnapshot(snapshot);
            player.print("Snapshot set to: " + snapshot.getName());
        } catch (MissingWorldException e) {
            player.printError("No snapshots were found for this world.");
        }
    }
View Full Code Here

Examples of com.sk89q.worldedit.world.snapshot.Snapshot

        if (date == null) {
            player.printError("Could not detect the date inputted.");
        } else {
            try {
                Snapshot snapshot = config.snapshotRepo.getSnapshotBefore(date, player.getWorld().getName());

                if (snapshot == null) {
                    dateFormat.setTimeZone(session.getTimeZone());
                    player.printError("Couldn't find a snapshot before "
                            + dateFormat.format(date.getTime()) + ".");
                } else {
                    session.setSnapshot(snapshot);
                    player.print("Snapshot set to: " + snapshot.getName());
                }
            } catch (MissingWorldException ex) {
                player.printError("No snapshots were found for this world.");
            }
        }
View Full Code Here

Examples of com.sk89q.worldedit.world.snapshot.Snapshot

        if (date == null) {
            player.printError("Could not detect the date inputted.");
        } else {
            try {
                Snapshot snapshot = config.snapshotRepo.getSnapshotAfter(date, player.getWorld().getName());
                if (snapshot == null) {
                    dateFormat.setTimeZone(session.getTimeZone());
                    player.printError("Couldn't find a snapshot after "
                            + dateFormat.format(date.getTime()) + ".");
                } else {
                    session.setSnapshot(snapshot);
                    player.print("Snapshot set to: " + snapshot.getName());
                }
            } catch (MissingWorldException ex) {
                player.printError("No snapshots were found for this world.");
            }
        }
View Full Code Here

Examples of com.sun.tools.hat.internal.model.Snapshot

                // Undocumented option. To be used for testing purpose only
                parseonly = booleanValue(value);
            }
        }
        String fileName = args[args.length - 1];
        Snapshot model = null;
        File excludeFile = null;
        if (excludeFileName != null) {
            excludeFile = new File(excludeFileName);
            if (!excludeFile.exists()) {
                System.out.println("Exclude file " + excludeFile
                                    + " does not exist.  Aborting.");
                System.exit(1);
            }
        }

        System.out.println("Reading from " + fileName + "...");
        try {
            model = com.sun.tools.hat.internal.parser.Reader.readFile(fileName, callStack, debugLevel);
        } catch (IOException ex) {
            ex.printStackTrace();
            System.exit(1);
        } catch (RuntimeException ex) {
            ex.printStackTrace();
            System.exit(1);
        }
        System.out.println("Snapshot read, resolving...");
        model.resolve(calculateRefs);
        System.out.println("Snapshot resolved.");

        if (excludeFile != null) {
            model.setReachableExcludes(new ReachableExcludesImpl(excludeFile));
        }

        if (baselineDump != null) {
            System.out.println("Reading baseline snapshot...");
            Snapshot baseline = null;
            try {
                baseline = com.sun.tools.hat.internal.parser.Reader.readFile(baselineDump, false,
                                                      debugLevel);
            } catch (IOException ex) {
                ex.printStackTrace();
                System.exit(1);
            } catch (RuntimeException ex) {
                ex.printStackTrace();
                System.exit(1);
            }
            baseline.resolve(false);
            System.out.println("Discovering new objects...");
            model.markNewRelativeTo(baseline);
            baseline = null;    // Guard against conservative GC
        }
        if ( debugLevel == 2 ) {
View Full Code Here

Examples of com.vmware.vim.binding.vim.vm.Snapshot

   private Map<DeviceId, DiskSize> sizeDetail;
   private DiskSize vmsnFileSize;

   @Override
   protected void update(ManagedObject mo) {
      final Snapshot snap = (Snapshot)mo;
      config = snap.getConfig();
      updateSize();
   }
View Full Code Here

Examples of com.yammer.metrics.stats.Snapshot

    return variance.get()[1] / (getCount() - 1);
  }

  @Override
  public void pushMetric(MetricsRecord mr) {
    final Snapshot s = this.getSnapshot();
    mr.setMetric(getName() + "_num_ops", this.getCount());
    mr.setMetric(getName() + "_min", this.getMin());
    mr.setMetric(getName() + "_max", this.getMax());
   
    mr.setMetric(getName() + "_mean", (float) this.getMean());
    mr.setMetric(getName() + "_std_dev", (float) this.getStdDev());
   
    mr.setMetric(getName() + "_median", (float) s.getMedian());
    mr.setMetric(getName() + "_75th_percentile",
        (float) s.get75thPercentile());
    mr.setMetric(getName() + "_95th_percentile",
        (float) s.get95thPercentile());
    mr.setMetric(getName() + "_99th_percentile",
        (float) s.get99thPercentile());
  }
View Full Code Here

Examples of com.yammer.metrics.stats.Snapshot

            json.writeNumberField("mean", metric.mean());
            json.writeNumberField("std_dev", metric.stdDev());
        }

        private static void writeSampling(Sampling metric, JsonGenerator json) throws IOException {
            final Snapshot snapshot = metric.getSnapshot();
            json.writeNumberField("median", snapshot.getMedian());
            json.writeNumberField("p75", snapshot.get75thPercentile());
            json.writeNumberField("p95", snapshot.get95thPercentile());
            json.writeNumberField("p98", snapshot.get98thPercentile());
            json.writeNumberField("p99", snapshot.get99thPercentile());
            json.writeNumberField("p999", snapshot.get999thPercentile());
        }
View Full Code Here

Examples of com.yammer.metrics.stats.Snapshot

    subtree.addFloat("mean", metric.mean());
    subtree.addFloat("stddev", metric.stdDev());
  }

  protected void sendSampling(MetricTreeObject subtree, Sampling metric) throws IOException {
    final Snapshot snapshot = metric.getSnapshot();
    subtree.addFloat("median", snapshot.getMedian());
    subtree.addFloat("75percentile", snapshot.get75thPercentile());
    subtree.addFloat("95percentile", snapshot.get95thPercentile());
    subtree.addFloat("98percentile", snapshot.get98thPercentile());
    subtree.addFloat("99percentile", snapshot.get99thPercentile());
    subtree.addFloat("999percentile", snapshot.get999thPercentile());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.