forked from dspinellis/dgsh
-
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.
Introduce adapted sgsh regression tests
Issue: dspinellis#22
- Loading branch information
1 parent
35d656b
commit 7735841
Showing
97 changed files
with
15,733 additions
and
38 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/env sgsh | ||
# | ||
# SYNOPSIS Parallel word count | ||
# DESCRIPTION | ||
# Count number of times each word appears in the specified input file(s) | ||
# Demonstrates parallel execution mirroring the Hadoop WordCount example | ||
# via the dgsh-parallel command. | ||
# | ||
# Copyright 2014-2016 Diomidis Spinellis | ||
# | ||
# 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. | ||
# | ||
|
||
# Scatter input | ||
dgsh-tee -s | | ||
# Emulate Java's default StringTokenizer, sort, count | ||
dgsh-parallel -n 4 "tr -s ' \t\n\r\f' '\n' | LC_ALL=C sort -S 512M | uniq -c" | | ||
# Merge sorted counts | ||
dgsh-merge-sum '<|' '<|' '<|' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/sh | ||
# | ||
# Poor man's GNU date | ||
# This implements the GNU date -f - option for converting the date as | ||
# represented in the web log into the week day using the FreeBSD | ||
# date command | ||
# | ||
|
||
if [ x"$*" != x'-f - +%a' ] | ||
then | ||
echo "(poor man's) gdate usage: gdate -f - +%a" 1>&2 | ||
exit 1 | ||
fi | ||
|
||
while read d | ||
do | ||
date -j -f '%d-%b-%Y' "$d" +%a | ||
done |
Oops, something went wrong.