Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[refact] The pdconfig property in LogMeta and PartitionMeta is redundant #2597

Closed
1 task done
haohao0103 opened this issue Jul 19, 2024 · 1 comment · Fixed by #2598
Closed
1 task done

[refact] The pdconfig property in LogMeta and PartitionMeta is redundant #2597

haohao0103 opened this issue Jul 19, 2024 · 1 comment · Fixed by #2598
Labels
bug Something isn't working pd PD module rocksdb RocksDB backend

Comments

@haohao0103
Copy link
Contributor

Bug Type (问题类型)

logic (逻辑设计问题)

Before submit

  • 我已经确认现有的 IssuesFAQ 中没有相同 / 重复问题 (I have confirmed and searched that there are no similar problems in the historical issue and documents)

Environment (环境信息)

  • Server Version: 1.5.0 (Apache Release Version)
  • Backend: RocksDB x nodes, HDD

Expected & Actual behavior (期望与实际表现)

The pdconfig property in LogMeta and PartitionMeta is redundant

MetadataRocksDBStore has already defined the pdConfig property, it seems no need to redefine it in the subclass PartitionMeta

public class MetadataRocksDBStore extends MetadataStoreBase {

    HgKVStore store;

    PDConfig pdConfig;

    public MetadataRocksDBStore(PDConfig pdConfig) {
        store = MetadataFactory.getStore(pdConfig);
        this.pdConfig = pdConfig;
    }
public class PartitionMeta extends MetadataRocksDBStore {

    static String CID_GRAPH_ID_KEY = "GraphID";
    static int CID_GRAPH_ID_MAX = 0xFFFE;
    private final PDConfig pdConfig;
    private final PartitionCache cache;

    public PartitionMeta(PDConfig pdConfig) {
        super(pdConfig);
        this.pdConfig = pdConfig;
        //this.timeout = pdConfig.getEtcd().getTimeout();
        this.cache = new PartitionCache();
    }

Vertex/Edge example (问题点 / 边数据举例)

No response

Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)

No response

@haohao0103 haohao0103 added the bug Something isn't working label Jul 19, 2024
@dosubot dosubot bot added pd PD module rocksdb RocksDB backend labels Jul 19, 2024
haohao0103 added a commit to haohao0103/incubator-hugegraph that referenced this issue Jul 19, 2024
Copy link

dosubot bot commented Jul 19, 2024

Yes, the pdconfig property in the LogMeta and PartitionMeta classes is indeed redundant, given that it is already defined in the MetadataRocksDBStore class. This redundancy should be refactored to improve the code design.

Supporting evidence from the provided code:

  • The PartitionMeta class extends MetadataRocksDBStore and already has a pdConfig property.
  • The PartitionMeta constructor initializes the pdConfig property by calling super(pdConfig) and then assigns it to this.pdConfig.
public class PartitionMeta extends MetadataRocksDBStore {

    private final PDConfig pdConfig;

    public PartitionMeta(PDConfig pdConfig) {
        super(pdConfig);
        this.pdConfig = pdConfig;
        // Additional initialization code
    }
}

Since MetadataRocksDBStore already has the pdConfig property, having it again in LogMeta and PartitionMeta is unnecessary and should be refactored [1][2].

To continue talking to Dosu, mention @dosu.

@github-project-automation github-project-automation bot moved this from In progress to Done in HugeGraph PD-Store Tasks Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pd PD module rocksdb RocksDB backend
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant