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

ExpediaGroup / beekeeper / #814

07 Apr 2026 07:33PM UTC coverage: 87.706% (-0.07%) from 87.774%
#814

Pull #201

ninhomilton
Clean up
Pull Request #201: Upgrade to Java 21 and Spring Boot 3.2.12

10 of 12 new or added lines in 3 files covered. (83.33%)

115 existing lines in 33 files now uncovered.

1541 of 1757 relevant lines covered (87.71%)

0.88 hits per line

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

80.77
/beekeeper-core/src/main/java/com/expediagroup/beekeeper/core/model/HousekeepingPath.java
1
/**
2
 * Copyright (C) 2019-2026 Expedia, Inc.
3
 *
4
 * <p>Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
5
 * except in compliance with the License. You may obtain a copy of the License at
6
 *
7
 * <p>http://www.apache.org/licenses/LICENSE-2.0
8
 *
9
 * <p>Unless required by applicable law or agreed to in writing, software distributed under the
10
 * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11
 * express or implied. See the License for the specific language governing permissions and
12
 * limitations under the License.
13
 */
14
package com.expediagroup.beekeeper.core.model;
15

16
import static java.lang.String.format;
17

18
import java.time.LocalDateTime;
19

20
import org.hibernate.annotations.UpdateTimestamp;
21

22
import jakarta.persistence.Column;
23
import jakarta.persistence.Convert;
24
import jakarta.persistence.Entity;
25
import jakarta.persistence.EnumType;
26
import jakarta.persistence.Enumerated;
27
import jakarta.persistence.GeneratedValue;
28
import jakarta.persistence.GenerationType;
29
import jakarta.persistence.Id;
30
import jakarta.persistence.Table;
31
import lombok.Builder;
32
import lombok.Data;
33
import lombok.EqualsAndHashCode;
34
import lombok.NoArgsConstructor;
35

36
import com.expediagroup.beekeeper.core.error.BeekeeperException;
37
import com.expediagroup.beekeeper.core.monitoring.MetricTag;
38

39
@Data
40
@NoArgsConstructor
41
@Entity
42
@Table(name = "housekeeping_path")
43
public class HousekeepingPath implements HousekeepingEntity {
44

45
  @Id
46
  @GeneratedValue(strategy = GenerationType.IDENTITY)
47
  private Long id;
48

49
  @Column(name = "path", nullable = false, unique = true)
50
  private String path;
51

52
  @Column(name = "database_name")
53
  private String databaseName;
54

55
  @Column(name = "table_name")
56
  private String tableName;
57

58
  @Column(name = "housekeeping_status", nullable = false)
59
  @Enumerated(EnumType.STRING)
60
  private HousekeepingStatus housekeepingStatus;
61

62
  @EqualsAndHashCode.Exclude
63
  @Column(name = "creation_timestamp", nullable = false, updatable = false)
64
  private LocalDateTime creationTimestamp;
65

66
  @EqualsAndHashCode.Exclude
67
  @Column(name = "modified_timestamp")
68
  @UpdateTimestamp
69
  private LocalDateTime modifiedTimestamp;
70

71
  @Column(name = "cleanup_timestamp", nullable = false)
72
  private LocalDateTime cleanupTimestamp;
73

74
  @Column(name = "cleanup_delay", nullable = false)
75
  @Convert(converter = PeriodDurationConverter.class)
76
  private PeriodDuration cleanupDelay;
77

78
  @Column(name = "cleanup_attempts", nullable = false)
79
  private int cleanupAttempts;
80

81
  @Column(name = "client_id")
82
  private String clientId;
83

84
  @Column(name = "lifecycle_type", nullable = false)
85
  private String lifecycleType;
86

87
  @Builder
88
  public HousekeepingPath(
89
      Long id,
90
      String path,
91
      String databaseName,
92
      String tableName,
93
      HousekeepingStatus housekeepingStatus,
94
      LocalDateTime creationTimestamp,
95
      LocalDateTime modifiedTimestamp,
96
      PeriodDuration cleanupDelay,
97
      int cleanupAttempts,
98
      String lifecycleType,
99
      String clientId) {
1✔
100
    this.id = id;
1✔
101
    this.path = path;
1✔
102
    this.databaseName = databaseName;
1✔
103
    this.tableName = tableName;
1✔
104
    this.housekeepingStatus = housekeepingStatus;
1✔
105
    this.creationTimestamp = creationTimestamp;
1✔
106
    this.modifiedTimestamp = modifiedTimestamp;
1✔
107
    this.cleanupDelay = cleanupDelay;
1✔
108
    this.cleanupTimestamp = configureCleanupTimestamp();
1✔
109
    this.cleanupAttempts = cleanupAttempts;
1✔
110
    this.lifecycleType = lifecycleType;
1✔
111
    this.clientId = clientId;
1✔
112
  }
1✔
113

114
  public void setCleanupDelay(PeriodDuration cleanupDelay) {
115
    this.cleanupDelay = cleanupDelay;
×
116
    cleanupTimestamp = creationTimestamp.plus(cleanupDelay);
×
117
  }
×
118

119
  @Override
120
  public MetricTag getMetricTag() {
121
    return new MetricTag("table", String.join(".", databaseName, tableName));
1✔
122
  }
123

124
  @Override
125
  public String toString() {
126
    return format(
1✔
127
        "%s(path=%s, databaseName=%s, tableName=%s, housekeepingStatus=%s, creationTimestamp=%s, modifiedTimestamp=%s, cleanupTimestamp=%s, cleanupDelay=%s, cleanupAttempts=%s, clientId=%s, lifecycleType=%s)",
128
        HousekeepingPath.class.getSimpleName(), path, databaseName, tableName, housekeepingStatus, creationTimestamp,
1✔
129
        modifiedTimestamp, cleanupTimestamp, cleanupDelay, cleanupAttempts, clientId, lifecycleType);
130
  }
131

132
  private LocalDateTime configureCleanupTimestamp() {
133
    if (creationTimestamp == null) {
134
      throw new BeekeeperException("Path requires a creation timestamp");
135
    }
136
    if (cleanupDelay == null) {
137
      throw new BeekeeperException("Path requires a cleanup delay");
1✔
138
    }
139
    return creationTimestamp.plus(cleanupDelay);
140
  }
141

142
}
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