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

apache / iotdb / #9867

18 Aug 2023 06:05AM UTC coverage: 48.003% (-0.08%) from 48.081%
#9867

push

travis_ci

web-flow
[To rel/1.2] [IOTDB-6115] Fix Limit & Offset push down doesn't take effect while there exist null value

103 of 103 new or added lines in 23 files covered. (100.0%)

79802 of 166243 relevant lines covered (48.0%)

0.48 hits per line

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

66.67
/iotdb-core/tsfile/src/main/java/org/apache/iotdb/tsfile/utils/PublicBAOS.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.tsfile.utils;
21

22
import java.io.ByteArrayOutputStream;
23
import java.io.IOException;
24
import java.io.OutputStream;
25

26
/**
27
 * A subclass extending <code>ByteArrayOutputStream</code>. It's used to return the byte array
28
 * directly. Note that the size of byte array is large than actual size of valid contents, thus it's
29
 * used cooperating with <code>size()</code> or <code>capacity = size</code>
30
 */
31
public class PublicBAOS extends ByteArrayOutputStream {
32

33
  public PublicBAOS() {
34
    super();
1✔
35
  }
1✔
36

37
  public PublicBAOS(int size) {
38
    super(size);
×
39
  }
×
40

41
  /**
42
   * get current all bytes data
43
   *
44
   * @return all bytes data
45
   */
46
  public byte[] getBuf() {
47

48
    return this.buf;
1✔
49
  }
50

51
  /**
52
   * It's not a thread-safe method. Override the super class's implementation. Remove the
53
   * synchronized key word, to save the synchronization overhead.
54
   *
55
   * <p>Writes the complete contents of this byte array output stream to the specified output stream
56
   * argument, as if by calling the output stream's write method using <code>
57
   * out.write(buf, 0, count)</code>.
58
   *
59
   * @param out the output stream to which to write the data.
60
   * @exception IOException if an I/O error occurs.
61
   */
62
  @Override
63
  @SuppressWarnings("squid:S3551")
64
  public void writeTo(OutputStream out) throws IOException {
65
    out.write(buf, 0, count);
1✔
66
  }
1✔
67

68
  /**
69
   * It's not a thread-safe method. Override the super class's implementation. Remove the
70
   * synchronized key word, to save the synchronization overhead.
71
   *
72
   * <p>Resets the <code>count</code> field of this byte array output stream to zero, so that all
73
   * currently accumulated output in the output stream is discarded. The output stream can be used
74
   * again, reusing the already allocated buffer space.
75
   */
76
  @Override
77
  @SuppressWarnings("squid:S3551")
78
  public void reset() {
79
    count = 0;
1✔
80
  }
1✔
81

82
  /**
83
   * The synchronized keyword in this function is intentionally removed. For details, see
84
   * https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=173085039
85
   */
86
  @Override
87
  @SuppressWarnings("squid:S3551")
88
  public int size() {
89
    return count;
1✔
90
  }
91

92
  public void truncate(int size) {
93
    count = size;
×
94
  }
×
95
}
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

© 2025 Coveralls, Inc