All Downloads are FREE. Search and download functionalities are using the official Maven repository.

nstream.persist.store.snapshot.SnapshotService Maven / Gradle / Ivy

The newest version!
// Copyright 2015-2024 Nstream, inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package nstream.persist.store.snapshot;

import swim.structure.Value;
import swim.uri.Uri;

/**
 * Service that can produce a {@link SnapshotContext} that can manage snapshots taken of a RocksDB
 * database. Snapshot repository locations are described by a URI.
 */
public interface SnapshotService {

  /**
   * Determine whether this service supports the provided repository URI.
   * @param uri The URI.
   * @return True only if {@link #open(Uri, Value)} can provide a context.
   */
  boolean canHandle(Uri uri);

  /**
   * Open a snapshot context for the provided URI.
   * @param uri The URI of the snapshot repository.
   * @param parameters Configuration parameters for the store.
   * @return A snapshot repository context.
   * @throws SnapshotException The provided URI is not supported, the configuration is invalid for this implementation
   * or a problem occurred opening the repository.
   */
  SnapshotContext open(Uri uri, Value parameters) throws SnapshotException;

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy