code: private Snapshot createSnapshot(SnapshotDescriptor descriptor) {
      if (storage.level() == StorageLevel.MEMORY) {
        return createMemorySnapshot(descriptor);
      } else {
        return createDiskSnapshot(descriptor);
      }
    }
docs: Creates a new snapshot buffer.