1

I am implementing a depth first tree traversal code a large tree. It's single traversal process can span several days because of the long processing time at each node and in between the system might crash or shutdown.

Therefore I want to make the whole process resumable if it the process stops in between for some reason. For that reason I am planning make the whole process backed by persistent datastore which essentially stores the state of the process.

As I figured out that for depth first traversal I will need a Stack type of data structure and which can be realized through a linked list type of array implementation. So my question is if there is some datastore which provides the ability to persist large array to maintain the order of the entities to represent a stack by it. Or if there is some other way through which I can maintain the state of my traversal in a persistent storage.

Thanks.

4

1 回答 1

0

恕我直言:您可以使用链接列表实现自定义的堆栈行为类。这个自定义类应该是可序列化的。间歇性地存储对象的状态。因此,即使系统崩溃,您也会丢失一些数据并通过从持久存储中反序列化对象来重新创建完整的结构。

于 2012-12-27T11:38:07.117 回答