forked from apache/pinot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support to upload segments in batch mode with METADATA upload type
- Loading branch information
Showing
12 changed files
with
1,159 additions
and
405 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
293 changes: 285 additions & 8 deletions
293
.../org/apache/pinot/controller/api/resources/PinotSegmentUploadDownloadRestletResource.java
Large diffs are not rendered by default.
Oops, something went wrong.
103 changes: 103 additions & 0 deletions
103
...ontroller/src/main/java/org/apache/pinot/controller/api/upload/SegmentUploadMetadata.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
package org.apache.pinot.controller.api.upload; | ||
|
||
import java.io.File; | ||
import java.net.URI; | ||
import java.util.Objects; | ||
import org.apache.commons.lang3.tuple.Pair; | ||
import org.apache.helix.zookeeper.datamodel.ZNRecord; | ||
import org.apache.pinot.segment.spi.SegmentMetadata; | ||
|
||
|
||
public class SegmentUploadMetadata { | ||
private final String _segmentDownloadURIStr; | ||
private final String _sourceDownloadURIStr; | ||
private final URI _finalSegmentLocationURI; | ||
private final Long _segmentSizeInBytes; | ||
private final SegmentMetadata _segmentMetadata; | ||
private final Pair<String, File> _encryptionInfo; | ||
private ZNRecord _segmentMetadataZNRecord; | ||
|
||
public SegmentUploadMetadata(String segmentDownloadURIStr, String sourceDownloadURIStr, URI finalSegmentLocationURI, | ||
Long segmentSizeInBytes, SegmentMetadata segmentMetadata, Pair<String, File> encryptionInfo) { | ||
_segmentDownloadURIStr = segmentDownloadURIStr; | ||
_sourceDownloadURIStr = sourceDownloadURIStr; | ||
_segmentSizeInBytes = segmentSizeInBytes; | ||
_segmentMetadata = segmentMetadata; | ||
_encryptionInfo = encryptionInfo; | ||
_finalSegmentLocationURI = finalSegmentLocationURI; | ||
} | ||
|
||
public String getSegmentDownloadURIStr() { | ||
return _segmentDownloadURIStr; | ||
} | ||
|
||
public String getSourceDownloadURIStr() { | ||
return _sourceDownloadURIStr; | ||
} | ||
|
||
public URI getFinalSegmentLocationURI() { | ||
return _finalSegmentLocationURI; | ||
} | ||
|
||
public Long getSegmentSizeInBytes() { | ||
return _segmentSizeInBytes; | ||
} | ||
|
||
public SegmentMetadata getSegmentMetadata() { | ||
return _segmentMetadata; | ||
} | ||
|
||
public Pair<String, File> getEncryptionInfo() { | ||
return _encryptionInfo; | ||
} | ||
|
||
public void setSegmentMetadataZNRecord(ZNRecord segmentMetadataZNRecord) { | ||
_segmentMetadataZNRecord = segmentMetadataZNRecord; | ||
} | ||
|
||
public ZNRecord getSegmentMetadataZNRecord() { | ||
return _segmentMetadataZNRecord; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
if (o == null || getClass() != o.getClass()) { | ||
return false; | ||
} | ||
SegmentUploadMetadata that = (SegmentUploadMetadata) o; | ||
return Objects.equals(_segmentDownloadURIStr, that._segmentDownloadURIStr) | ||
&& Objects.equals(_sourceDownloadURIStr, that._sourceDownloadURIStr) | ||
&& Objects.equals(_finalSegmentLocationURI, that._finalSegmentLocationURI) | ||
&& Objects.equals(_segmentSizeInBytes, that._segmentSizeInBytes) | ||
&& Objects.equals(_segmentMetadata, that._segmentMetadata) | ||
&& Objects.equals(_encryptionInfo, that._encryptionInfo) | ||
&& Objects.equals(_segmentMetadataZNRecord, that._segmentMetadataZNRecord); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(_segmentDownloadURIStr, _sourceDownloadURIStr, _finalSegmentLocationURI, | ||
_segmentSizeInBytes, _segmentMetadata, _encryptionInfo, _segmentMetadataZNRecord); | ||
} | ||
} |
Oops, something went wrong.