Learning Apache Kafka, Second Edition Nishant Garg Download PDF
Learning Apache Kafka, Second Edition Nishant Garg Download PDF
com
https://textbookfull.com/product/learning-apache-
kafka-second-edition-nishant-garg/
https://textbookfull.com/product/biota-grow-2c-gather-2c-cook-loucas/
textbookfull.com
https://textbookfull.com/product/designing-event-driven-systems-
concepts-and-patterns-for-streaming-services-with-apache-kafka-ben-
stopford/
textbookfull.com
https://textbookfull.com/product/big-data-smack-a-guide-to-apache-
spark-mesos-akka-cassandra-and-kafka-1st-edition-raul-estrada/
textbookfull.com
https://textbookfull.com/product/the-routledge-handbook-of-the-
philosophy-and-science-of-punishment-farah-focquaert/
textbookfull.com
Liberal Peace and Post-Conflict Peacebuilding in Africa
1st Edition Patrick Tom (Auth.)
https://textbookfull.com/product/liberal-peace-and-post-conflict-
peacebuilding-in-africa-1st-edition-patrick-tom-auth/
textbookfull.com
https://textbookfull.com/product/studying-the-novel-7th-edition-
jeremy-hawthorn/
textbookfull.com
https://textbookfull.com/product/a-sociology-of-food-and-
nutrition-4th-ed-the-social-appetite-4th-edition-john-germov/
textbookfull.com
https://textbookfull.com/product/20-shades-of-shifters-collection-of-
paranormal-romance-novels-1st-edition-various-authors/
textbookfull.com
https://textbookfull.com/product/answers-for-modern-communicators-a-
guide-to-effective-business-communication-1st-edition-deirdre-
breakenridge/
textbookfull.com
Farm Management Patricia A. Duffy
https://textbookfull.com/product/farm-management-patricia-a-duffy/
textbookfull.com
Learning Apache Kafka Second Edition
Table of Contents
Learning Apache Kafka Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Errata
Piracy
Questions
1. Introducing Kafka
Welcome to the world of Apache Kafka
Why do we need Kafka?
Kafka use cases
Installing Kafka
Installing prerequisites
Installing Java 1.7 or higher
Downloading Kafka
Building Kafka
Summary
2. Setting Up a Kafka Cluster
A single node – a single broker cluster
Starting the ZooKeeper server
Starting the Kafka broker
Creating a Kafka topic
Starting a producer to send messages
Starting a consumer to consume messages
A single node – multiple broker clusters
Starting ZooKeeper
Starting the Kafka broker
Creating a Kafka topic using the command line
Starting a producer to send messages
Starting a consumer to consume messages
Multiple nodes – multiple broker clusters
The Kafka broker property list
Summary
3. Kafka Design
Kafka design fundamentals
Log compaction
Message compression in Kafka
Replication in Kafka
Summary
4. Writing Producers
The Java producer API
Simple Java producers
Importing classes
Defining properties
Building the message and sending it
Creating a Java producer with custom partitioning
Importing classes
Defining properties
Implementing the Partitioner class
Building the message and sending it
The Kafka producer property list
Summary
5. Writing Consumers
Kafka consumer APIs
The high-level consumer API
The low-level consumer API
Simple Java consumers
Importing classes
Defining properties
Reading messages from a topic and printing them
Multithreaded Java consumers
Importing classes
Defining properties
Reading the message from threads and printing it
The Kafka consumer property list
Summary
6. Kafka Integrations
Kafka integration with Storm
Introducing Storm
Integrating Storm
Kafka integration with Hadoop
Introducing Hadoop
Integrating Hadoop
Hadoop producers
Hadoop consumers
Summary
7. Operationalizing Kafka
Kafka administration tools
Kafka cluster tools
Adding servers
Kafka topic tools
Kafka cluster mirroring
Integration with other tools
Summary
Index
Learning Apache Kafka Second Edition
Visit https://textbookfull.com
now to explore a rich
collection of eBooks, textbook
and enjoy exciting offers!
Learning Apache Kafka Second Edition
Copyright © 2015 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system,
or transmitted in any form or by any means, without the prior written permission of the
publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the
information presented. However, the information contained in this book is sold without
warranty, either express or implied. Neither the author, nor Packt Publishing, and its
dealers and distributors will be held liable for any damages caused or alleged to be caused
directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the
companies and products mentioned in this book by the appropriate use of capitals.
However, Packt Publishing cannot guarantee the accuracy of this information.
First published: October 2013
Second edition: February 2015
Production reference: 1210215
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78439-309-0
www.packtpub.com
Credits
Author
Nishant Garg
Reviewers
Sandeep Khurana
Saurabh Minni
Supreet Sethi
Commissioning Editor
Usha Iyer
Acquisition Editor
Meeta Rajani
Content Development Editor
Shubhangi Dhamgaye
Technical Editors
Manal Pednekar
Chinmay S. Puranik
Copy Editors
Merilyn Pereira
Aarti Saldanha
Project Coordinator
Harshal Ved
Proofreaders
Stephen Copestake
Paul Hindle
Indexer
Rekha Nair
Graphics
Sheetal Aute
Production Coordinator
Nilesh R. Mohite
Cover Work
Nilesh R. Mohite
About the Author
Nishant Garg has over 14 years of software architecture and development experience in
various technologies, such as Java Enterprise Edition, SOA, Spring, Hadoop, Hive, Flume,
Sqoop, Oozie, Spark, Shark, YARN, Impala, Kafka, Storm, Solr/Lucene, NoSQL
databases (such as HBase, Cassandra, and MongoDB), and MPP databases (such as
GreenPlum).
He received his MS in software systems from the Birla Institute of Technology and
Science, Pilani, India, and is currently working as a technical architect for the Big Data
R&D Group with Impetus Infotech Pvt. Ltd. Previously, Nishant has enjoyed working
with some of the most recognizable names in IT services and financial industries,
employing full software life cycle methodologies such as Agile and SCRUM.
Nishant has also undertaken many speaking engagements on big data technologies and is
also the author of HBase Essestials, Packt Publishing.
I would like to thank my parents (Mr. Vishnu Murti Garg and Mrs. Vimla Garg) for their
continuous encouragement and motivation throughout my life. I would also like to thank
my wife (Himani) and my kids (Nitigya and Darsh) for their never-ending support, which
keeps me going.
Finally, I would like to thank Vineet Tyagi, CTO and Head of Innovation Labs, Impetus,
and Dr. Vijay, Director of Technology, Innovation Labs, Impetus, for encouraging me to
write.
About the Reviewers
Sandeep Khurana, an 18 years veteran, comes with an extensive experience in the
Software and IT industry. Being an early entrant in the domain, he has worked in all
aspects of Java- / JEE-based technologies and frameworks such as Spring, Hibernate, JPA,
EJB, security, Struts, and so on. For the last few professional engagements in his career
and also partly due to his personal interest in consumer-facing analytics, he has been
treading in the big data realm and has extensive experience on big data technologies such
as Hadoop, Pig, Hive, ZooKeeper, Flume, Oozie, HBase and so on.
He has designed, developed, and delivered multiple enterprise-level, highly scalable,
distributed systems during the course of his career. In his long and fruitful professional
life, he has been with some of the biggest names of the industry such as IBM, Oracle,
Yahoo!, and Nokia.
Saurabh Minni is currently working as a technical architect at AdNear. He completed his
BE in computer science at the Global Academy of Technology, Bangalore. He is
passionate about programming and loves getting his hands wet with different technologies.
At AdNear, he deployed Kafka. This enabled smooth consumption of data to be processed
by Storm and Hadoop clusters. Prior to AdNear, he worked with Adobe and Intuit, where
he dabbled with C++, Delphi, Android, and Java while working on desktop and mobile
products.
Supreet Sethi is a seasoned technology leader with an eye for detail. He has proven
expertise in charting out growth strategies for technology platforms. He currently steers
the platform team to create tools that drive the infrastructure at Jabong. He often reviews
the code base from a performance point of view. These aspects also put him at the helm of
backend systems, APIs that drive mobile apps, mobile web apps, and desktop sites.
The Jabong tech team has been extremely helpful during the review process. They
provided a creative environment where Supreet was able to explore some of cutting-edge
technologies like Apache Kafka.
I would like to thank my daughter, Seher, and my wife, Smriti, for being patient observers
while I spent a few hours everyday reviewing this book.
www.PacktPub.com
Visit https://textbookfull.com
now to explore a rich
collection of eBooks, textbook
and enjoy exciting offers!
Support files, eBooks, discount offers, and
more
For support files and downloads related to your book, please visit www.PacktPub.com.
Did you know that Packt offers eBook versions of every book published, with PDF and
ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as
a print book customer, you are entitled to a discount on the eBook copy. Get in touch with
us at <[email protected]> for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up
for a range of free newsletters and receive exclusive discounts and offers on Packt books
and eBooks.
https://www2.packtpub.com/books/subscription/packtlib
Do you need instant solutions to your IT questions? PacktLib is Packt’s online digital
book library. Here, you can search, access, and read Packt’s entire library of books.
Why subscribe?
Fully searchable across every book published by Packt
Copy and paste, print, and bookmark content
On demand and accessible via a web browser
Free access for Packt account holders
If you have an account with Packt at www.PacktPub.com, you can use this to access
PacktLib today and view 9 entirely free books. Simply use your login credentials for
immediate access.
Preface
This book is here to help you get familiar with Apache Kafka and to solve your challenges
related to the consumption of millions of messages in publisher-subscriber architectures. It
is aimed at getting you started programming with Kafka so that you will have a solid
foundation to dive deep into different types of implementations and integrations for Kafka
producers and consumers.
In addition to an explanation of Apache Kafka, we also spend a chapter exploring Kafka
integration with other technologies such as Apache Hadoop and Apache Storm. Our goal
is to give you an understanding not just of what Apache Kafka is, but also how to use it as
a part of your broader technical infrastructure. In the end, we will walk you through
operationalizing Kafka where we will also talk about administration.
Random documents with unrelated
content Scribd suggests to you:
felt obliged to allude to it as a factor in his career. For good or ill,
that clubfoot, like the mark of Jason in her life, had been his destiny.
With his unusual gifts and without the sensitive shrinking from
crowds which his lameness had developed into a disease, he might
have achieved success in any profession that he had chosen. "You
stay by the fire," he added, "while I take a turn at the bossing."
She nodded. "Very well, I'll be in the dairy when you are ready for
me."
"I'll manage the whole business if you'll let me."
"But I shan't let you." She was smiling as she answered, and she
perceived from his face that he was big enough to respect her for
her inflexible purpose. While authority was still hers she would cling
to it as stubbornly as she had toiled to attain it.
He went out laughing, and she dropped back in her chair to wait
until the hour came for her work in the dairy. John Abner was right,
of course. One of the exasperating things about men, she reflected,
was that they were so often right. It was perfectly true that she
could not stay young for ever, and at forty-two, after twenty years of
arduous toil, she ought to think of the future and take the beginning
of the hill more gradually. Though she was as strong, as vital, as
young, in her arteries at least, as she had ever been, she could not,
she realized, defend herself from the inevitable wearing down of the
years. Her eyes wandered to the mirror in the bureau which had
belonged to her mother, and it seemed to her that, sitting there in
the ruddy firelight, the magic of youth enveloped her again with a
springtime freshness. Her eyes looked so young in the dimness that
they bathed her greying hair, her weatherbeaten skin, and her tall,
strong figure, which was becoming a little dry, a trifle inelastic, in the
celestial blueness of a May morning.
"I wonder if it is because I've missed everything I really wanted
that I cannot grow old?" she asked herself with a start.
It was seven o'clock when she returned from the dairy, and John
Abner was already in the kitchen demanding his supper.
"The train is certain to be hours late," he said. "There's no use
waiting any longer for Father."
"Yes, we might as well have supper. I can cook something for him
when he comes."
"I saw Mr. Garlick going over a few minutes ago. His daughter,
Molly, went down yesterday with young Mrs. Ellgood to a concert.
Mrs. Ellgood has always been crazy about music. Did you ever hear
her play on the violin?"
"No, I never went anywhere even before I was married. I'm glad
she's coming up with your father. He always liked her in spite of the
fact that she despises the country."
When supper was over, and John Abner had eaten with an
amazing appetite, they went back into her bedroom and sat down to
wait before the fire. Though she had never been what Nathan called
"an easy talker," she could always find something to say to her
stepson; and they talked now, not only of the farm, the spring
planting, the new tractor-plough they had ordered, but of books and
distant countries and the absurd illustrations in the Lives of the
Missionaries, which John Abner was reading for the fourth time.
"Alfalfa has been the making of Five Oaks," Dorinda said. "It's a
shame Pa never knew of it."
"I wonder if Doctor Greylock ever comes back to his farm. If he
does, he must be sorry he lost it."
"Well, he ruined the place, he and his father before him. It was
no better than waste land when we bought it."
John Abner bent over to caress the head of the pointer. "I can't
blame anybody for wanting to quit," he said. "There's a lot to be said
for those missionary chaps. They were the real adventurers, I
sometimes think."
He rose from his chair and shook himself. "Why, it's almost ten
o'clock. There's no use staying up any longer. If we've got to wake
before five, it is time we were both asleep."
"I believe I hear the buggy now." Dorinda bent her ear listening.
"Isn't that a noise on the bridge? Or is it only another branch
cracking?"
"You can't hear wheels in this snow. But I'll go out and take a look
round. There's a fine moon coming up."
When he had unbarred the front door, she slipped into her
raccoon coat and overshoes, and flung her knitted shawl over her
head. After a minute or two, she saw John Abner's figure moving
among the shrouded trees to the gate, and descending the steps as
carefully as she could, she followed slowly in the direction he had
taken. By the time she was midway down the walk, he had
disappeared up the frozen road. Except for the lighted house at her
back she might have been alone in a stainless world before the
creation of life. A cold white moon was shedding a silver lustre over
the landscape, which appeared as transparent as glass against the
impenetrable horizon. Even the house, when she glanced round at it,
might have been only a shadow, so unreal, so visionary, it looked in
the unearthly light of the snow. While she lingered there it seemed
to her that the movement of the air, the earth, and the stars, was
suspended. Substance and shadow melted into each other and into
the vastness of space. Not a track blurred the ground, not a cloud
trembled in the sky, not a murmur of life broke the stillness.
Presently, as she drew nearer the gate, a moving shape flitted in
from the trees by the road, and John Abner called to her that the
buggy was in sight. "I'll wait and bed down the mare," he said.
"Nimrod will be pretty hungry, I reckon, and he won't look after her
properly."
"Well, I'll go right in and fix supper for both of them."
Without waiting for the vehicle, she hurried into the house and
replenished the fire in the stove. Thin, while she broke the eggs and
put on water to boil for coffee, she told herself that Nathan's coffee
habit was as incurable as a taste for whiskey. The wood had caught
and the fire was burning well when John Abner appeared suddenly
in the doorway. He looked sleepy and a trifle disturbed.
"That wasn't Father after all," he said. "They told Nimrod there
wasn't any use waiting longer. He was shaking with cold, so I sent
him to bed. As soon as I've made the mare comfortable, I'll come
and tell you all about it."
"I was just scrambling some eggs. I wish you'd eat them. I hate
to waste things."
"All right. I'll be back in a jiffy."
He ran out as quickly as his lameness would permit, and she
arranged the supper on the table. After all, if Nathan wasn't coming
home to-night, John Abner might as well eat the eggs she had
scrambled. There was no sense in wasting good food.
After attending to the mare the boy came in and began walking
up and down the floor of the kitchen. He did not sit down at the
table, though Dorinda was bringing the steaming skillet from the
stove. "It's a nuisance all the wires are down," he said presently.
"Yes, but for that we might telephone."
"The telegraph wires have fallen too. Nimrod said they didn't
know much more at the store than we do."
"Well, you'd better sit down and eat this while it's hot. It doesn't
do any good to worry about things."
"One of the coloured men, Elisha Moody, told Nimrod he would be
coming home in an hour, and he would stop and tell us the news.
Mr. Garlick is going to wait at the station until his daughter comes."
"The news?" she asked vaguely. For the first time the idea
occurred to her that John Abner was holding back what he had
heard. "Doesn't Nimrod know when the train is expected?"
"Nobody knows. The wires are broken, but the train from
Washington went down and came up again with news of a wreck
down the road. I don't know whether it is Father's train or another,
Nimrod was all mixed up about it. He couldn't tell me anything
except that something had happened. The thing that impressed
Nimrod most was that all the freight men carried axes. He kept
repeating that over and over."
"Axes?" Dorinda's mind had stopped working. She stood there in
the middle of the kitchen floor, with the coffee-pot in her hand, and
repeated the word as if it were strange to her. Behind her the fire
crackled, and the pots of rose-geraniums she had brought away
from the window-sill stood in an orderly row on the brick hearth.
"I suppose they had to cut the coaches away from the track,"
replied John Abner indefinitely. "Elisha will tell us more when he
stops by. He's got more sense than Nimrod, who was scared out of
his wits."
"I would have given him some supper. Why didn't he come in?"
"He said his wife was waiting for him and he wanted to get to his
cabin."
Dorinda poured out the coffee and carried the pot back to the
stove. "I'm afraid your father will catch his death of cold," she said
anxiously, "and with that tooth out!"
She was fortified by a serene confidence in Nathan's ability to
take care of himself. The only uneasiness she felt was on account of
the abscess. With all his good judgment, when it came to toothache
he was no braver than a child.
John Abner seemed glad to get the hot coffee. "You might as well
keep some for Elisha," he suggested. "It's almost time he was
coming and I know he'll be thankful for something hot."
Though he ate and drank as if he were hungry, there was a
worried look in his face, and he kept turning his head in the direction
of the road.
"I don't suppose it's anything really serious," Dorinda remarked
reassuringly. "If it had been, we should certainly have heard it
sooner."
Dropping into a chair beside him, she raised a cup of coffee and
drank it slowly in sips. Presently, notwithstanding her effort to
minimize the cause for alarm, she became aware that anxiety was
stealing over her as if it emanated from her surroundings. She felt it
first in the creeping sensation which ran like spiders over her flesh;
then in an almost imperceptible twitching of her muscles; and at last
in a delicate vibration of her nerves, as if a message were passing
over electric wires in her body. Then, suddenly, the fear mounted to
her brain, and she found herself listening like John Abner for the
crunching of wheels in the snow.
"Do you hear anybody, John Abner?"
"A branch snapped, that was all. I'll make up the fire in your
chamber. It's more comfortable in there."
After he had gone into the bedroom, she fed the two dogs and
the cat before she washed the dishes and placed the coffee where it
would keep hot for Elisha. As she was leaving the kitchen she
noticed the rose-geraniums and moved the pots farther away from
the heat. "If we are going to keep up the fire, it will be too warm for
them there," she thought.
III
The log fire was blazing in her bedroom, and John Abner stood
before the window which looked on the gate and the road.
"The panes are so frosted you can't see your hand before you,"
he said, as she entered.
Standing there beside him, she gazed through the leafless boughs
of the lilac bushes. "No, even the moonlight doesn't help you," she
answered. "It must be bitterly cold in the road. I hope the mare got
warm again."
"Yes, I covered her up. Nimrod had some whiskey and he was
going to make a hot toddy." John Abner shivered in the icy draught
that crept in through the loose window sashes. "Hadn't you better lie
down?" he asked, turning back to the fire. "It won't be long now."
She shook her head. "That coffee will keep me awake. Lie down
on the couch, and I'll listen for Elisha. I drew up the shades, so he
will know we haven't gone to bed."
For a few minutes he resisted her, his eyes blinking in the firelight
while he struggled to bite back a yawn. Then he gave up and flung
himself down on the big soft couch. "It would take something
stronger than coffee to keep me awake to-night," he said. "If I drop
off, will you wake me?"
"If there is any news. But you will hear Elisha when he comes."
He laughed drowsily. "I believe I could sleep straight through
Judgment Day."
Taking the quilt from the bed, she covered him carefully from
head to foot. As she tucked him in, she remembered her wedding
night when she had found Nathan asleep on the couch in front of
the fire. "If he hadn't been like that, I couldn't have stood him," she
thought.
Sinking into the easiest chair by the flames, she picked up the
sock she had partly darned in the afternoon. Then, observing that
the lamp was shining in John Abner's face, she lowered the wick and
folding the sock, replaced it in her work basket. The chair creaked
gently as she rocked, and fearing the noise might disturb him, she
sat motionless, with her eyes on the hickory logs and her foot
touching the neck of the pointer.
While she sat there she recalled, with one of the irresponsible
flashes of memory which revived only when she was inactive, the
afternoon when she had waited in the dripping woods to see Jason
drive home with Geneva. She was a girl then; now she was a woman
and middle-aged; yet there was an intolerable quality in all suspense
which made it alike. Compared to those moments, this waiting was
as the dead to the living agony. "Suppose I had married Jason and
he was on that train, could I sit here like this?" she asked herself.
"Suppose I had married Jason instead of Nathan, would marriage
have been different?"
Then, because the question was useless and she had no room for
useless things in her practical mind, she put it sternly away from her,
and rising, slipped into her coat and went out of the house. Closing
the door softly, she passed out on the porch and down the frozen
steps to the lawn. The snow was slippery in thin places, and she
knew that Elisha would try to keep to the road where the deep drifts
were less dangerous. Advancing cautiously, she moved in the
direction of the gate, but she had gone only a few steps when she
saw Elisha's old spring wagon rolling over the bridge. Quickening her
steps dangerously, she ran over the slippery ground.
"I've kept some hot coffee for you, Uncle Elisha. Can't you come
into the kitchen and get something to eat?"
"Naw'm, I reckon I'd better be gittin' erlong home. My ole grey
mare, she's had jes' about enuff er dis yeah wedder, en she's kinder
hankerin' fur de stable."
"We can keep her here. There's plenty of room in the stable, and
you can spend the night with Ebenezer."
"Thanky, Miss Dorindy, bofe un us sutney would be glad uv er
spell er res'. My son Jasper, he's on dat ar train dat's done been
stalled down de track, an' I'se gwine out agin about'n sunup."
"Have they heard anything yet?" asked Dorinda, while the wagon
crawled over the snags of roots in the direction of the stable.
Elisha shook his muffled head. "Dey don' know nuttin', Miss
Dorindy, dat's de Gospel trufe, dey don' know nuttin' 'tall. Dar's a
train done come down Pom de Norf, en hit's gwine on wid whatevah
dey could git abo'd hit. Hi! Dey's got axes erlong, en I 'low dar ain'
nary a one un um dat kin handle an axe like my Jasper."
"I'm afraid it's a bad wreck," Dorinda said uneasily.
"Yas'm, dar's a wreck somewhar, sho 'nuff, but dey don' know
nuttin' out dar at de station. All de wires is down, ev'y las' one un
um, en dar ain' nobody done come erlong back dat went down de
road. Ef'n you'll lemme res' de night heah, me en de mare'll go out
agin befo' sunup."
"There's all the room in the world, Uncle Elisha. Wait, and I'll give
you a lantern to take to the stable." She went indoors and returned
in a few minutes with a light swinging from her hand. "As soon as
you've attended to your mare, come in and I'll have something for
you to eat."
As she passed her bedroom on the way to the kitchen she saw
that John Abner was still sleeping, and she did not stop to arouse
him. Why should she disturb his slumber when there was nothing
definite that she could tell him? Instead, she hastened about her
preparations for Elisha's supper, and by the time the old negro came
in from bedding the mare, the bacon and eggs were on the table.
Withdrawing to a safe distance from the stove, he thawed his
frostbitten hands and feet, while his grizzled head emerged like
some gigantic caterpillar from the chrysalis of shawls he had wound
about him.
"Were there many people at the station?" she inquired presently.
"Naw'm, hit was too fur fur mos' folks. Marse John Garlick, he wuz
spendin' de night in de sto', en so was Marse Jim Ellgood. Young
Marse Bob en his wife wuz bofe un um on de train."
"Well, make a good supper. Then you can go up to Ebenezer's. I
saw smoke coming out of his chimney, so it will be warm there."
Because she knew that he would enjoy his supper more if he
were permitted to eat it alone, she went back to the fire in her
bedroom where John Abner was still sleeping. She watched there in
the silence until she heard Elisha exclaim, "Good night, Miss
Dorindy!" and go out, shutting the back door behind him. Then she
locked up the house, and after lowering the wick of the hall lamp,
touched John Abner on the shoulder.
"You'd better go to bed. In a little while you will have to be up
again."
He opened his eyes and sat up, blinking at the firelight. "I could
have slept on into next week."
"Well, don't wake up. Go straight upstairs."
"Did Elisha ever come?"
"Yes, he put his mare in the stable and went up to spend the
night with Ebenezer."
"What did he tell you?"
"Only that they haven't found out anything definite at the station.
You know how cut off everything is when the wires are down. Mr.
Garlick and James Ellgood are both waiting out there all night."
"Then it was Father's train. It must have been a bad wreck."
"I'm afraid so. This suspense is so baffling. Anything in the world
might happen, and we shouldn't know of it until the next day."
Her face was pale and drawn, and while she spoke, she shivered,
not from cold but from anxiety. She saw John Abner glance quickly
toward the front window and she knew that he, like herself, was
feeling all the terror of primitive isolation. How did people stand it
when they were actually cut off by the desert or the frozen North
from communication with their kind?
"You know now what it must have been like in the old days before
we had the telegraph and the telephone," she said. "Pedlar's Mill
was scarcely more than a stopping place in the wilderness, and my
mother would be shut in for days without a sign from the outer
world."
"I never thought of it before," said John Abner, "but it must have
been pretty rough on her. The roads were no better than frozen
bogs, so she couldn't get anywhere if she wanted to."
"That was why she got her mania for work. The winter loneliness;
she said, was more than she could endure without losing her mind.
She had to move about to make company for herself. There were
weeks at a time, she told me once, when the roads were so bad that
nobody went by, not even Mr. Garlick, or an occasional negro. During
the war the trains stopped running on this branch road, and
afterwards there were only two trains passing a day."
"I suppose it was always better on the other side of the railroad."
"They're nearer the highway, of course, though that was bad
enough when Ma was first married. Over here the roads were never
mended unless a few of the farmers agreed to give so much labour,
either of slaves or free negroes. Then, after the contract was made,
something invariably got in the way and it fell through. Somebody
died or fell ill or lost all his crops. You know how indisposed tenant
farmers are to doing their share of work."
"And there wasn't even a store at Pedlar's Mill until Father started
one?"
"Nothing but the mill. That was there as far back as anybody
could remember, and there was always a Pedlar for a miller. The
farmers from this side took corn there to be ground, and sometimes
they would trade it for sugar or molasses. But the only store was far
up at the Courthouse. People bought their winter supplies when they
went to town to sell tobacco. All the tobacco money went for coffee
and sugar and clothes. That was why Pa raised a crop every year to
the end of his life."
John Abner rose and stretched himself. "Well, I'm precious glad I
live in the days of the telephone and the telegraph, with the hope of
owning an automobile when they get cheaper." Going over to the
window, he held his hand over his eyes and peered out. "You can't
see a thing but snow. We might as well be dead and buried under it.
Shall I take the butter over in the morning?"
"No, I'd like to go myself. You'd better stay and look after the
milking." How inexorable were the trivial necessities of the farm!
Anxieties might come and go, but the milking would not wait upon
life or death. Not until John Abner had gone upstairs did she
perceive that she had been talking, as her mother would have said,
"to make company for herself." "I've almost lost my taste for books,"
she thought, "and I used to be such a hungry reader."
After putting a fresh log on the fire, she flung herself on the bed,
without undressing, and lay perfectly still while a nervous tremor,
like the suspension of a drawn breath, crept over her. Toward
daybreak, when the crashing of a dead branch on one of the locust
trees sounded as if it had fallen on the roof, she realized that she
was straining every sense for the noise of an approaching vehicle in
the road. Then, rising hurriedly, she threw open the window and
leaned out into the night. Nothing there. Only the lacquered
darkness and the moon turning to a faint yellow-green over the
fields of snow!
At four o'clock she went into the kitchen and began preparations
for breakfast. When the coffee was ground, the water poured over it
in the coffee-pot, and the butterbread mixed and put into the baking
dish, she returned to her room and finished her dressing. By the
time John Abner came down to go out to the cow-barn, she was
waiting with her hat on and a pile of sheepskin rugs at her feet.
"I suppose we might as well send the butter out. Fluvanna has it
ready," she said, watching him while he lighted his lantern from the
lamp on the breakfast table. "If the trains have begun running again,
they will expect it in Washington."
"It won't hurt anyway to take it along. I'll tell Nimrod to hitch up."
They both spoke as if the wreck had been merely a temporary
inconvenience which was over. Vaguely, there swam through
Dorinda's mind the image of her mother cooking breakfast in her
best dress before she went to the Courthouse. The old woman had
worn the same expression of desperate hopefulness that Dorinda felt
now spreading like a mask of beeswax over her own features.
Already, though it was still dark, the life of the farm was stirring. As
John Abner went out, she saw the stars of lanterns swinging away
into the night, and when he returned to breakfast, Fluvanna was in
the kitchen busily frying bacon and eggs. Before they had finished
the meal, Nimrod appeared to say that the wagon was waiting, and
rising hastily Dorinda slipped on her raccoon-skin coat.
"We'd better start," she said. "Give Uncle Elisha his breakfast, and
tell him we will bring Jasper back with us. Keep the kettle on, so you
can make coffee for Mr. Nathan as soon as he gets here."
Hurrying out, she climbed into the heavy wagon, and they started
carefully down the slippery grade to the road. As they turned out of
the gate, the wheels slid over the embedded rocks to the frozen ruts
in the snow. Only a circle of road immediately in front of them was
visible, and while the wagon rolled on, this spot of ground appeared
to travel with them, never changing and never lingering in its
passage. Into this illuminated circle tiny tracks of birds drifted and
vanished like magic signs.
Presently, as they drew nearer Pedlar's Mill, a glimmer, so faint
that it was scarcely more than a ripple on the surface of black
waters, quivered in the darkness around them. With this ripple, a
formless transparency floated up in the east, as a luminous mist
swims up before an approaching candle. Out of this brightness, the
landscape dawned in fragments, like dissolving views of the Arctic
Circle. The sky was muffled overhead, but just as they reached the
station a pale glow suffused the clouds beyond the ruined mill on the
horizon.
"If the train was on time, it must have gone by an hour ago,"
Dorinda said, but she knew that there was no chance of its having
gone by.
"Hit's gwinter thaw, sho' nuff, befo' sundown," Nimrod rejoined,
speaking for the first time since they started.
"Yes, it's getting milder."
At that hour, in the bitter dawn, the station looked lonelier and
more forsaken than ever. Hemmed in by the level sea of ice, the old
warehouse and platform were flung there like dead driftwood. Even
the red streak in the sky made the winter desolation appear more
desolate.
At first she could distinguish no moving figures; but when they
came nearer, she saw a small group of men gathered round an
object which she had mistaken in the distance for one of the
deserted freight cars.
Now she saw that this object was a train of a single coach, with
an engine attached, and that the men were moving dark masses
from the car to crude stretchers laid out on the snow.
"The trains are running again," Dorinda said hoarsely. "They must
have got the track cleared."
"I hope dey's gwinter teck dis yeah budder," Nimrod returned.
"Git up heah, hosses! We ain' got no mo' time to poke."
A chill passed down Dorinda's spine; but she was unaware of the
cause that produced it, and her mind was vacant of thought. Then,
while the wagon jolted up the slope, some empty words darted into
her consciousness. "Something has happened. I feel that something
has happened."
"Do you see anybody that you know, Nimrod?"
"Naw'm, I cyarn see nobody." Then he added excitedly, "But dar's
somebody a-comin'. Ain' he ole Marse Jim Ellgood?"
The horses stopped by the fence and began nuzzling the snow,
while Nimrod dropped the reins and jumped down to lift out the
butter. Standing up in the wagon, Dorinda beat her chilled hands
together. Her limbs felt stiff with cold, and for a moment they
refused to obey her will. Then recovering control of herself, she
stepped down from the wagon and followed Nimrod in the direction
of the store. Immediately, she was aware of a bustle about the
track, and she thought, "How much human beings are like turkeys!"
The group of men had separated as she approached, and two
figures came forward to meet her across the snow. One was a
stranger; the other, though it took her an instant to recognize him,
was Bob Ellgood. "Why, he looks like an old man," she said to
herself. "He looks as old as his father." The ruddy, masterful features
were scorched and smoke-stained, and the curling fair hair was
burned to the colour of singed broomsedge. Even his eyes looked
burned, and one of his hands was rolled in a bandage.
She stopped abruptly and stood motionless. Though she was
without definite fear, an obscure dread was beating against the wall
of her consciousness. "Something has happened. Something has
happened. Something has happened." Her mind seemed to have no
relation to herself, to her feelings, to her beliefs, to her affections. It
was only an empty shed; and the darkness of this shed was filled
suddenly with the sound of swallows fluttering.
When Bob Ellgood reached her, he held out his unbandaged hand.
"Father and I were just going over to your place, Mrs. Pedlar," he
said. "We wanted to be the first to see you. We wanted you to hear
of Nathan from us——"
"Then he is dead," she said quietly. It had never seemed possible
to her that Nathan could die. He had not mattered enough for that.
But now he was dead.
"He died a hero," a stranger, whom she had never seen before,
said earnestly.
"Yes, he died a hero," Bob Ellgood snatched the words away from
the other. "That is what we wish you to know and to feel as long as
you live. He gave his life for others. He had got free, without a
scratch, and he went back into the wreck. The train had gone over
the embankment. It was burning and women were screaming. He
went down because he was strong. He went down and he never
came back."
"God! Those shrieks!" exclaimed the strange man. "I'll hear them
all my life. As long as I live, I'll never stop hearing them."
"He got free?" she repeated stupidly.
"But he went back. He got an axe from somebody, and he went
back because he was strong. He was cutting the car away to get a
woman out. He did get her out——" He broke off and added hastily,
"When we found him, he was quite dead. . . ."
Dorinda stared at him vacantly, seeing nothing but his blackened
features and the scorched place on his head. "Will they bring him to
the farm?" she asked.
"If you wish it." Bob's voice was shaken. "But we feel that we
should like him to rest in the churchyard."
Silently, scarcely knowing what he asked, she assented. So
Nathan had forced people to take him seriously, even though he had
to die before they would do it. Was it worth it? she wondered. Would
it have pleased him if he had known?
"May I go to the church? Have they taken him there?"
She saw that Bob hesitated before he answered. "I hope you
won't see him," he replied after a minute. "We believe he was killed
instantly, but——" He broke off and then went on desperately, "If
you will go home and leave the arrangements to us, we promise you
that everything shall be as he would have wished. We should like
him to have the funeral of a hero."
"The funeral of a hero!" she echoed. She did not know, she could
not imagine what kind of funeral that would be; but she felt
intuitively that Nathan would have liked it, and that she had no right
to deny him the funeral that he would have liked.
Without replying in words, she bent her head and turned back to
the wagon, where a completely demoralized Nimrod awaited her. A
stunned sensation held her emotions imprisoned, and a few minutes
later, as she drove homeward, it occurred to her that she was
proving unequal again to one of the supreme occasions of her life.
Emotionally, would she always prove unequal to the demands of life?
She was not feeling what she knew that she ought to feel; she was
not feeling what she knew that they expected of her. Her stern
judgment told her that she was a hypocrite; but it was hypocrisy
against which she was inert and helpless. Though she was
overwhelmed by the general tragedy, she was without a keen sense
of widowhood. Something within her soul, that thin clear flame
which was herself, remained unshaken by her loss, as it had
remained unshaken by every tragedy but one in her life. She was
leaving Nathan, with regret but not with grief, to his belated
popularity. How could she begrudge him in death the thing that he
had wanted most when he was alive? Yes, beholding him as she did
with compassion but without pretense, she knew that he would have
enjoyed the funeral of a hero.
IV
V
Although Dorinda would have been astonished had she
discovered it, the years after Nathan's death were the richest and
happiest of her life. They were years of relentless endeavour, for a
world war was fought and won with the help of the farmers; but
they were years which rushed over her like weathered leaves in a
storm. To the end, the war came no nearer to her than a battle in
history. There was none of the flame-like vividness that suffused her
mother's memories of the starving years and the burning houses of
the Confederacy. Only when she saw victory in terms of crops, not
battles, could she feel that she was part of it.
In the beginning the Germans had seemed less a mortal enemy
than an evil spirit at large, and she had fought them as her great-
grandfather might have fought a heresy or a pestilence. That men
should destroy one another appeared to her less incredible than that
they should deliberately destroy the resources which made life
endurable. That they should destroy in a day, in an hour, the
materials which she was sacrificing her youth to provide! At night,
lying in bed with limbs that ached so she could not sleep, and a
mind that was a blank from exhaustion, she would hear the rotation
of crops drumming deliriously in her thoughts. Potatoes. Corn.
Wheat. Cow-peas. Clover. Alfalfa. And back again. Alfalfa. Cowpeas.
Potatoes. Corn. Wheat. Clover. That was all the seasons meant to
her, one after one. Her youth was going, she knew; but youth had
brought so little that age could take away, why should she regret it?
The hair on her temples had turned from grey to white; her skin,
beneath its warm flush, was creased with lines and roughened from
exposure; but her eyes were still bright and clear, though the caged
look had gone out of them.
What she felt most, as the struggle went on, was the failure of
elasticity. The tyranny of detail was more exacting, and she
rebounded less quickly from disappointment. Notwithstanding what
Doctor Faraday had called her "superb constitution," her health
began to cause her uneasiness. "The war has done this," she
thought, "and if it has cost me my youth, imagine what it has cost
the men who are fighting." It was a necessary folly, she supposed,
but it was a folly against which she rebelled. Had humanity been
trying unwisely to hurry evolution, and had the crust of civilization
proved too thin to restrain the outbreak of volcanic impulses? Her
two years with Doctor Faraday had accustomed her to the biological
interpretation of history. "And the worst thing about the war," she
concluded grimly, "is not the fighting. It is not even the murder and
plunder of the weaker. The worst thing about it is the number of
people, both men and women, who enjoy it, who embark upon it as
upon a colossal adventure."
If John Abner had gone to France, the war would have come
closer to her; but John Abner was tied by his clubfoot to the farm.
The crowning humiliation of his life came, she knew, when he
watched the other boys from Pedlar's Mill start off for the training
camp. Her pity for him was stronger than her relief that she could
keep him, and she wished with all her heart that he could have
gone. "You will be more useful on the farm," she said consolingly, as
they turned away; but he only shook his head and stared mutely
after the receding train. What John Abner desired, she saw, was not
usefulness but glory.
Of the boys they saw go, a few were killed; but they were boys
whom she knew only by sight. Two of Josiah's sons went, and one
died of influenza after he had been decorated three times; but this
boy had lived away so long that she did not feel close to him. Bob
Ellgood's second son returned a nervous wreck from shell shock, and
whenever Dorinda saw him on the porch at Green Acres, trying to
make baskets of straw, she would feel that her heart was melting in
pity. But even then the war did not actually touch her. Her nearest
approach to the fighting was when Fluvanna's son Jubal died in a
French hospital, and she was obliged to read the later aloud because
Fluvanna was too distressed to spell out the words. Dorinda had
known Jubal from his babyhood. He had grows up on the farm, and
she had taught him to read. The day the news came the two women
worked until they were ready to drop from exhaustion. Work had
always been Dorinda's salvation. It was saving her now from the war
as it had once saved her from the memory of Jason.