• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

apache / iotdb / #9683

pending completion
#9683

push

travis_ci

web-flow
[IOTDB-6043] Pipe: a framework to support wal hardlink mode (#10440)

Co-authored-by: Steve Yurong Su <rong@apache.org>

150 of 150 new or added lines in 17 files covered. (100.0%)

79218 of 164968 relevant lines covered (48.02%)

0.48 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

93.33
/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/resource/PipeResourceManager.java
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one
3
 * or more contributor license agreements.  See the NOTICE file
4
 * distributed with this work for additional information
5
 * regarding copyright ownership.  The ASF licenses this file
6
 * to you under the Apache License, Version 2.0 (the
7
 * "License"); you may not use this file except in compliance
8
 * with the License.  You may obtain a copy of the License at
9
 *
10
 *     http://www.apache.org/licenses/LICENSE-2.0
11
 *
12
 * Unless required by applicable law or agreed to in writing,
13
 * software distributed under the License is distributed on an
14
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
 * KIND, either express or implied.  See the License for the
16
 * specific language governing permissions and limitations
17
 * under the License.
18
 */
19

20
package org.apache.iotdb.db.pipe.resource;
21

22
import org.apache.iotdb.commons.pipe.config.PipeConfig;
23
import org.apache.iotdb.db.pipe.resource.tsfile.PipeTsFileResourceManager;
24
import org.apache.iotdb.db.pipe.resource.wal.PipeWALResourceManager;
25
import org.apache.iotdb.db.pipe.resource.wal.hardlink.PipeWALHardlinkResourceManager;
26
import org.apache.iotdb.db.pipe.resource.wal.selfhost.PipeWALSelfHostResourceManager;
27

28
import java.util.concurrent.atomic.AtomicReference;
29

30
public class PipeResourceManager {
31

32
  private final PipeTsFileResourceManager pipeTsFileResourceManager;
33
  private final AtomicReference<PipeWALResourceManager> pipeWALResourceManager;
34

35
  public static PipeTsFileResourceManager tsfile() {
36
    return PipeResourceManagerHolder.INSTANCE.pipeTsFileResourceManager;
1✔
37
  }
38

39
  public static PipeWALResourceManager wal() {
40
    if (PipeResourceManagerHolder.INSTANCE.pipeWALResourceManager.get() == null) {
1✔
41
      synchronized (PipeResourceManagerHolder.INSTANCE) {
1✔
42
        if (PipeResourceManagerHolder.INSTANCE.pipeWALResourceManager.get() == null) {
1✔
43
          PipeResourceManagerHolder.INSTANCE.pipeWALResourceManager.set(
1✔
44
              PipeConfig.getInstance().getPipeHardLinkWALEnabled()
1✔
45
                  ? new PipeWALHardlinkResourceManager()
×
46
                  : new PipeWALSelfHostResourceManager());
1✔
47
        }
48
      }
1✔
49
    }
50
    return PipeResourceManagerHolder.INSTANCE.pipeWALResourceManager.get();
1✔
51
  }
52

53
  ///////////////////////////// SINGLETON /////////////////////////////
54

55
  private PipeResourceManager() {
1✔
56
    pipeTsFileResourceManager = new PipeTsFileResourceManager();
1✔
57
    pipeWALResourceManager = new AtomicReference<>();
1✔
58
  }
1✔
59

60
  private static class PipeResourceManagerHolder {
61
    private static final PipeResourceManager INSTANCE = new PipeResourceManager();
1✔
62
  }
63
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc