CoxAutomotiveDataSolutions/spark-distcp
CoxAutomotiveDataSolutions/spark-distcp has 47 GitHub stars and 33 forks. GitHot measured 0 stars in 24 hours and 0 in 7 days. Last checked 2026-11-13 00:13 UTC. Last push 2023-12-20.
Comment ces chiffres sont mesurés
A re-implementation of Hadoop DistCP in Apache Spark
Progression mesurée des étoiles
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- Historique en cours
- in 1 month
- Historique en cours
Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.
README.md
OriginalSparkDistCP
What is SparkDistCP?
SparkDistCP is an attempt at reimplementing Hadoop DistCP in Apache Spark.
There are several reasons you might want to do this:
- Using DistCP in a Spark-only/non-YARN environment
- Reducing DistCP copy times by generating many smaller tasks therefore limiting long-running tasks/map tasks
- To use DistCP programmatically through Spark
Note: Not all features of Hadoop DistCP have been reimplemented yet. See What is currently missing from SparkDistCP? for an overview on what has not yet been implemented.
Further note: SparkDistCP is in early development therefore you should use this library with caution! We provide absolutely no guarantee that this tool will not cause accidental data loss.
How do I run SparkDistCP?
You can run SparkDistCP from the command-line using:
bin/spark-submit --packages com.coxautodata:spark-distcp_2.11:{{version}} --class com.coxautodata.SparkDistCP "" --help
The empty string is needed here as spark-submit requires an application Jar to be specified however the Main class is in the dependency specified in packages.
The usage of the command-line arguments resembles that of the Hadoop DistCP:
Usage: [options] [source_path...] <target_path>
Like Hadoop DistCP, SparkDistCP takes several options, one or more source paths and a target path.
SparkDistCP can also be invoked programmatically from a Spark shell in two way:
- By calling
maindirectory and passing an array of command-line arguments:
import com.coxautodata.SparkDistCP
SparkDistCP.main(Array("--help"))
- Or using the typed API:
def run(sparkSession: SparkSession, sourcePaths: Seq[Path], destinationPath: Path, options: SparkDistCPOptions): Unit
For example:
import org.apache.hadoop.fs.Path
import com.coxautodata.{SparkDistCP, SparkDistCPOptions}
SparkDistCP.run(spark, Seq(new Path("hdfs://nn1:8020/foo/bar")), new Path("hdfs://nn2:8020/bar/foo"), SparkDistCPOptions(dryRun = true))
Options:
| SparkDistCP Flag | Equivalent Hadoop DistCP Flag | Description | Notes |
|---|---|---|---|
--i |
-i |
Ignore failures | |
--log <path> |
-log |
Write logs to a URI | Logs can be written to any URI with a supported scheme on the classpath. |
--dryrun |
N/A | Perform a trial run with no changes made | |
--verbose |
-v |
Run in verbose mode | Does not affect logfile output |
--overwrite |
-overwrite |
Overwrite destination | Changes how destination paths are generated identically to how Hadoop DistCP does. |
--update |
-update |
Overwrite if source and destination differ in size, or checksum | Does not currently compare blocksize unlike Hadoop DistCP. Changes how destination paths are generated identically to how Hadoop DistCP does. |
--filters <path> |
-filters |
The path to a file containing a list of pattern strings, one string per line, such that paths matching the pattern will be excluded from the copy. | File can be stored on any URI with a supported scheme on the classpath. |
--delete |
-delete |
Delete the files existing in the dst but not in src | |
--numListstatusThreads <int> |
-numListstatusThreads |
Number of threads to use for building file listing | |
--consistentPathBehaviour |
N/A | Revert the path behaviour when using overwrite or update to the path behaviour of non-overwrite/non-update | |
--maxFilesPerTask <int> |
N/A | Maximum number of files to copy in a single Spark task | |
--maxBytesPerTask <bytes> |
N/A | Maximum number of bytes to copy in a single Spark task |
Path Behaviour
SparkDistCP aims to have the same interesting path behaviour to that of Hadoop DistCP (specifically around update and overwrite).
What is currently missing from SparkDistCP?
SparkDistCP is not a complete like-for-like reimplementation of Hadoop DistCP and there are differences in behaviour and features:
- No use of blocks, including during the copy and for comparison when using the
updateflag - No use of snapshots
- No atomic commit option
- No preserve flag
- No append flag
- No file list flag
- No option to limit bandwidth
- No option to skip CRC check
- When using the delete option files are not moved into trash
- The log file in no way resembles that created by Hadoop DistCP
How can I contribute to SparkDistCP?
We welcome all users to contribute to the development of SparkDistCP by raising pull-requests. We kindly ask that you include suitable unit tests along with proposed changes.
As you can see above, there is a wealth of work that can be done on SparkDistCP to reach feature parity with hadoop DistCP.
What is SparkDistCP licensed under?
Licensed 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.
Copyright 2019 Cox Automotive UK Limited
Explorer des projets similaires
Asabeneh/30-Days-Of-Python
Le défi de programmation 30 Days of Python est un guide pas à pas pour apprendre le langage de programmation Python en 30 jours. Ce défi peut prendre plus de 100 jours. Avancez à votre rythme. Ces vidéos peuvent aussi vous aider : https://www.youtube.com/channel/UC7PNRuno1rzYPb1xLa4yktw
78,618 étoilesgrafana/grafana
Plateforme ouverte et composable d’observabilité et de visualisation de données. Visualise les métriques, les journaux et les traces issus de plusieurs sources, comme Prometheus, Loki, Elasticsearch, InfluxDB, Postgres et bien d’autres.
77,859 étoilesredis/redis
Pour les développeurs qui créent des applications en temps réel pilotées par les données, Redis est le cache, le serveur de structures de données et le moteur de requêtes documentaires et vectorielles préféré, le plus rapide et le plus riche en fonctionnalités.
77,472 étoilesapache/superset
Apache Superset est une plateforme de visualisation et d'exploration de données.
75,495 étoiles