Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
WordCount_lab
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
dangq
WordCount_lab
Commits
584b40fb
Commit
584b40fb
authored
Mar 23, 2015
by
dangq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pair.java updated
parent
fcb3be1d
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
226 additions
and
192 deletions
+226
-192
.idea/misc.xml
.idea/misc.xml
+13
-13
.idea/workspace.xml
.idea/workspace.xml
+195
-176
src/main/java/fr/eurecom/dsg/mapreduce/Pair.java
src/main/java/fr/eurecom/dsg/mapreduce/Pair.java
+18
-3
No files found.
.idea/misc.xml
View file @
584b40fb
...
...
@@ -77,19 +77,6 @@
<option
name=
"PORT"
value=
"5005"
/>
<method
/>
</configuration>
<configuration
default=
"true"
type=
"Applet"
factoryName=
"Applet"
>
<module
name=
""
/>
<option
name=
"MAIN_CLASS_NAME"
/>
<option
name=
"HTML_FILE_NAME"
/>
<option
name=
"HTML_USED"
value=
"false"
/>
<option
name=
"WIDTH"
value=
"400"
/>
<option
name=
"HEIGHT"
value=
"300"
/>
<option
name=
"POLICY_FILE"
value=
"$APPLICATION_HOME_DIR$/bin/appletviewer.policy"
/>
<option
name=
"VM_PARAMETERS"
/>
<option
name=
"ALTERNATIVE_JRE_PATH_ENABLED"
value=
"false"
/>
<option
name=
"ALTERNATIVE_JRE_PATH"
/>
<method
/>
</configuration>
<configuration
default=
"true"
type=
"TestNG"
factoryName=
"TestNG"
>
<extension
name=
"coverage"
enabled=
"false"
merge=
"false"
sample_coverage=
"true"
runner=
"idea"
/>
<module
name=
""
/>
...
...
@@ -118,6 +105,19 @@
<listeners
/>
<method
/>
</configuration>
<configuration
default=
"true"
type=
"Applet"
factoryName=
"Applet"
>
<module
name=
""
/>
<option
name=
"MAIN_CLASS_NAME"
/>
<option
name=
"HTML_FILE_NAME"
/>
<option
name=
"HTML_USED"
value=
"false"
/>
<option
name=
"WIDTH"
value=
"400"
/>
<option
name=
"HEIGHT"
value=
"300"
/>
<option
name=
"POLICY_FILE"
value=
"$APPLICATION_HOME_DIR$/bin/appletviewer.policy"
/>
<option
name=
"VM_PARAMETERS"
/>
<option
name=
"ALTERNATIVE_JRE_PATH_ENABLED"
value=
"false"
/>
<option
name=
"ALTERNATIVE_JRE_PATH"
/>
<method
/>
</configuration>
<configuration
default=
"true"
type=
"Application"
factoryName=
"Application"
>
<extension
name=
"coverage"
enabled=
"false"
merge=
"false"
sample_coverage=
"true"
runner=
"idea"
/>
<option
name=
"MAIN_CLASS_NAME"
/>
...
...
.idea/workspace.xml
View file @
584b40fb
This diff is collapsed.
Click to expand it.
src/main/java/fr/eurecom/dsg/mapreduce/Pair.java
View file @
584b40fb
...
...
@@ -28,13 +28,28 @@ public class Pair extends Configured implements Tool {
TextPair
,
// TODO: change Object to output key type
IntWritable
>
{
// TODO: change Object to output value type
// TODO: implement mapper
protected
void
map
(
LongWritable
key
,
Text
text
,
Context
context
)
{
protected
void
map
(
LongWritable
key
,
Text
text
,
Context
context
)
throws
IOException
,
InterruptedException
{
//TODO :
String
line
=
this
.
toString
();
line
=
line
.
replaceAll
(
"[^a-zA-Z0-9_]+"
,
" "
);
line
=
line
.
replaceAll
(
"^\\s+"
,
""
);
String
[]
words
=
line
.
split
(
"\\s+"
);
for
(
int
i
=
0
;
i
<
words
.
length
-
1
;
i
++)
{
String
first
=
words
[
i
];
for
(
int
j
=
0
;
j
<
words
.
length
-
1
;
j
++)
{
if
(
i
!=
j
){
String
second
=
words
[
i
+
1
];
context
.
write
(
new
TextPair
(
first
,
second
),
new
IntWritable
(
1
));}
}
}
}
}
//TextPair tp = new TextPair();
//context.write(tp, IntWritable(1));
}
}
public
static
class
PairReducer
extends
Reducer
<
TextPair
,
// TODO: change Object to input key type
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment