Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Lance format Lance Java RestoreOp

From Leeroopedia
Revision as of 15:28, 16 February 2026 by Admin (talk | contribs) (Auto-imported from implementations/Lance_format_Lance_Java_RestoreOp.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Knowledge Sources
Domains Java_SDK, Dataset_Management
Last Updated 2026-02-08 19:33 GMT

Overview

Description

The Restore class is an immutable operation that reverts a Lance dataset to a previously committed version. It implements the Operation interface and carries a single long field representing the target version number.

Lance datasets maintain automatic versioning where every write creates a new version. The Restore operation leverages this by creating a new version whose contents match a specified historical version. This is a zero-copy operation on the data layer since it only updates the manifest to point to the existing data of the target version.

Usage

Use Restore to roll back a dataset to a known good state after a problematic write, or to implement point-in-time recovery. The restored version becomes the latest version of the dataset.

Code Reference

Source Location

java/src/main/java/org/lance/operation/Restore.java

Signature

public class Restore implements Operation {
    public static Builder builder();
    public long version();
    public String name();  // returns "Restore"
}

Import

import org.lance.operation.Restore;

I/O Contract

Inputs
Parameter Type Required Description
version long Yes The dataset version number to restore to
Outputs
Return Type Description
version() long The target version number
name() String Returns "Restore" for JNI dispatch

Usage Examples

// Restore the dataset to version 5
Restore restoreOp = Restore.builder()
    .version(5L)
    .build();

long targetVersion = restoreOp.version(); // 5
String opName = restoreOp.name(); // "Restore"

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment