Spark in Action - Second Edition: Covers Apache Spark 3 With Examples in Java, Python, and Scala Jean-Georges Perrin

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 43

Spark in Action - Second Edition:

Covers Apache Spark 3 with Examples


in Java, Python, and Scala
Jean-Georges Perrin
Visit to download the full and correct content document:
https://textbookfull.com/product/spark-in-action-second-edition-covers-apache-spark-
3-with-examples-in-java-python-and-scala-jean-georges-perrin/
More products digital (pdf, epub, mobi) instant
download maybe you interests ...

Graph Algorithms Practical Examples in Apache Spark and


Neo4j 1st Edition Mark Needham

https://textbookfull.com/product/graph-algorithms-practical-
examples-in-apache-spark-and-neo4j-1st-edition-mark-needham/

Biota Grow 2C gather 2C cook Loucas

https://textbookfull.com/product/biota-grow-2c-gather-2c-cook-
loucas/

Stream Processing with Apache Spark Mastering


Structured Streaming and Spark Streaming 1st Edition
Gerard Maas

https://textbookfull.com/product/stream-processing-with-apache-
spark-mastering-structured-streaming-and-spark-streaming-1st-
edition-gerard-maas/

Spark GraphX in Action 1st Edition Michael Malak

https://textbookfull.com/product/spark-graphx-in-action-1st-
edition-michael-malak/
High Performance Spark Best Practices for Scaling and
Optimizing Apache Spark 1st Edition Holden Karau

https://textbookfull.com/product/high-performance-spark-best-
practices-for-scaling-and-optimizing-apache-spark-1st-edition-
holden-karau/

Beginning Apache Spark Using Azure Databricks:


Unleashing Large Cluster Analytics in the Cloud Robert
Ilijason

https://textbookfull.com/product/beginning-apache-spark-using-
azure-databricks-unleashing-large-cluster-analytics-in-the-cloud-
robert-ilijason/

Machine Learning with Spark Nick Pentreath

https://textbookfull.com/product/machine-learning-with-spark-
nick-pentreath/

Beginning Apache Spark Using Azure Databricks:


Unleashing Large Cluster Analytics in the Cloud 1st
Edition Robert Ilijason

https://textbookfull.com/product/beginning-apache-spark-using-
azure-databricks-unleashing-large-cluster-analytics-in-the-
cloud-1st-edition-robert-ilijason/

Introducing .NET for Apache Spark: Distributed


Processing for Massive Datasets 1st Edition Ed Elliott

https://textbookfull.com/product/introducing-net-for-apache-
spark-distributed-processing-for-massive-datasets-1st-edition-ed-
elliott/
SECOND EDITION Covers Apache Spark 3

With examples in Java,


Python, and Scala

Jean-Georges Perrin
Foreword by Rob Thomas

MANNING
Lexicon
Summary of the Spark terms involved in the deployment process

Term Definition
Application Your program that is built on and for Spark. Consists of a driver program and executors on the cluster.
Application JAR A Java archive (JAR) file containing your Spark application. It can be an uber JAR including all the
dependencies.
Cluster manager An external service for acquiring resources on the cluster. It can be the Spark built-in cluster manager.
More details in chapter 6.
Deploy mode Distinguishes where the driver process runs.
In cluster mode, the framework launches the driver inside the cluster. In client mode, the submitter
launches the driver outside the cluster.
You can find out which mode you are in by calling the deployMode() method. This method returns
a read-only property.
Driver program The process running the main() function of the application and creating the SparkContext.
Everything starts here.
Executor A process launched for an application on a worker node. The executor runs tasks and keeps data in
memory or in disk storage across them. Each application has its own executors.
Job A parallel computation consisting of multiple tasks that gets spawned in response to a Spark action
(for example, save() or collect()); check out appendix I).
Stage Each job gets divided into smaller sets of tasks, called stages, that depend on each other
(similar to the map and reduce stages in MapReduce).
Task A unit of work that will be sent to one executor.
Worker node Any node that can run application code in the cluster.

Application processes
and resources
elements

Worker node
Job: parallel tasks triggered
Application JAR after an action is called Cache
Executor

Driver program
Task Task

SparkSession
Cluster manager
(SparkContext)
Worker node
Jobs are split
into stages. Cache
Executor

The driver can access Task Task


its deployment mode.

Your code in a Nodes


JAR package
Apache Spark components
Spark in Action
SECOND EDITION

JEAN-GEORGES PERRIN
FOREWORD BY ROB THOMAS

MANNING
SHELTER ISLAND
For online information and ordering of this and other Manning books, please visit
www.manning.com. The publisher offers discounts on this book when ordered in quantity.
For more information, please contact
Special Sales Department
Manning Publications Co.
20 Baldwin Road
PO Box 761
Shelter Island, NY 11964
Email: orders@manning.com

©2020 by Manning Publications Co. All rights reserved.

No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in


any form or by means electronic, mechanical, photocopying, or otherwise, without prior written
permission of the publisher.

Many of the designations used by manufacturers and sellers to distinguish their products are
claimed as trademarks. Where those designations appear in the book, and Manning
Publications was aware of a trademark claim, the designations have been printed in initial caps
or all caps.

Recognizing the importance of preserving what has been written, it is Manning’s policy to have
the books we publish printed on acid-free paper, and we exert our best efforts to that end.
Recognizing also our responsibility to conserve the resources of our planet, Manning books are
printed on paper that is at least 15 percent recycled and processed without the use of elemental
chlorine.

Manning Publications Co. Development editor: Marina Michaels


20 Baldwin Road Technical development editor: Al Scherer
PO Box 761 Review editor: Aleks Dragosavljevic´
Shelter Island, NY 11964 Production editor: Lori Weidert
Copy editor: Sharon Wilkey
Proofreader: Melody Dolab
Technical proofreader: Rambabu Dosa and
Thomas Lockney
Typesetter: Gordan Salinovic
Cover designer: Marija Tudor

ISBN 9781617295522
Printed in the United States of America
Liz,
Thank you for your patience, support, and love during this endeavor.

Ruby, Nathaniel, Jack, and Pierre-Nicolas,


Thank you for being so understanding about my lack of availability during this venture.

I love you all.


contents
foreword xiii
preface xv
acknowledgments xvii
about this book xix
about the author xxv
about the cover illustration xxvi

PART 1 THE THEORY CRIPPLED BY AWESOME EXAMPLES .............1

1 So, what is Spark, anyway? 3


1.1 The big picture: What Spark is and what it does
What is Spark? 4 ■
The four pillars of mana 6
4

1.2 How can you use Spark? 8


Spark in a data processing/engineering scenario 8 ■
Spark in a
data science scenario 9
1.3 What can you do with Spark? 10
Spark predicts restaurant quality at NC eateries 11 Spark allows■

fast data transfer for Lumeris 11 Spark analyzes equipment logs


for CERN 12 Other use cases 12


1.4 Why you will love the dataframe 12


The dataframe from a Java perspective 13 The dataframe from

an RDBMS perspective 13 A graphical representation of the


dataframe 14

v
vi CONTENTS

1.5 Your first example 14


Recommended software 15 Downloading the code 15

Running your first application 15 Your first code 17


2 Architecture and flow


2.1
19
Building your mental model 20
2.2 Using Java code to build your mental model 21
2.3 Walking through your application 23
Connecting to a master 24 Loading, or ingesting, the CSV

file 25 Transforming your data 28 Saving the work done


■ ■

in your dataframe to a database 29

3 The majestic role of the dataframe 33


3.1 The essential role of the dataframe in Spark
Organization of a dataframe 35 ■
34
Immutability is not a swear
word 36
3.2 Using dataframes through examples 37
A dataframe after a simple CSV ingestion 39 Data is stored in ■

partitions 44 Digging in the schema 45 A dataframe after a


■ ■

JSON ingestion 46 Combining two dataframes 52


3.3 The dataframe is a Dataset<Row> 57


Reusing your POJOs 58 Creating a dataset of strings

59
Converting back and forth 60
3.4 Dataframe’s ancestor: the RDD 66

4 Fundamentally lazy 68
4.1 A real-life example of efficient laziness 69
4.2 A Spark example of efficient laziness 70
Looking at the results of transformations and actions 70 The ■

transformation process, step by step 72 The code behind the


transformation/action process 74 The mystery behind the


creation of 7 million datapoints in 182 ms 77 The mystery ■

behind the timing of actions 79


4.3 Comparing to RDBMS and traditional applications 83
Working with the teen birth rates dataset 83 Analyzing ■

differences between a traditional app and a Spark app 84


4.4 Spark is amazing for data-focused applications 86
4.5 Catalyst is your app catalyzer 86
CONTENTS vii

5 Building a simple app for deployment 90


5.1 An ingestionless example

91
Calculating p 91 The code to approximate p 93 What are ■

lambda functions in Java? 99 Approximating p by using


lambda functions 101


5.2 Interacting with Spark 102
Local mode 103 Cluster mode

104 ■
Interactive mode in
Scala and Python 107

6 Deploying your simple app


6.1
114
Beyond the example: The role of the components 116
Quick overview of the components and their interactions 116
Troubleshooting tips for the Spark architecture 120 Going ■

further 121
6.2 Building a cluster 121
Building a cluster that works for you 122 ■
Setting up the
environment 123
6.3 Building your application to run on the cluster 126
Building your application’s uber JAR 127 ■
Building your
application by using Git and Maven 129
6.4 Running your application on the cluster 132
Submitting the uber JAR 132 Running the application

133
Analyzing the Spark user interface 133

PART 2 INGESTION. ........................................................137

7 Ingestion from files


7.1
139
Common behaviors of parsers 141
7.2 Complex ingestion from CSV 141
Desired output 142 ■
Code 143
7.3 Ingesting a CSV with a known schema 144
Desired output 145 ■
Code 145
7.4 Ingesting a JSON file 146
Desired output 148 ■
Code 149
7.5 Ingesting a multiline JSON file 150
Desired output 151 ■
Code 152
7.6 Ingesting an XML file 153
Desired output 155 ■
Code 155
viii CONTENTS

7.7 Ingesting a text file 157


Desired output 158 ■
Code 158
7.8 File formats for big data 159
The problem with traditional file formats 159 Avro is a schema- ■

based serialization format 160 ORC is a columnar storage


format 161 Parquet is also a columnar storage format 161


Comparing Avro, ORC, and Parquet 161


7.9 Ingesting Avro, ORC, and Parquet files 162
Ingesting Avro 162 Ingesting ORC 164 Ingesting
■ ■

Parquet 165 Reference table for ingesting Avro, ORC, or


Parquet 167

8 Ingestion from databases 168


8.1 Ingestion from relational databases
Database connection checklist 170 Understanding the data ■
169

used in the examples 170 Desired output 172 Code 173


■ ■

Alternative code 175


8.2 The role of the dialect 176
What is a dialect, anyway? 177 JDBC dialects provided with

Spark 177 Building your own dialect 177


8.3 Advanced queries and ingestion 180


Filtering by using a WHERE clause 180 Joining data in the ■

database 183 Performing Ingestion and partitioning 185


Summary of advanced features 188


8.4 Ingestion from Elasticsearch 188
Data flow 189 The New York restaurants dataset digested by

Spark 189 Code to ingest the restaurant dataset from


Elasticsearch 191

9 Advanced ingestion: finding data sources and building


your own 194
9.1 What is a data source? 196
9.2 Benefits of a direct connection to a data source 197
Temporary files 198 ■
Data quality scripts 198 ■
Data on
demand 199
9.3 Finding data sources at Spark Packages 199
9.4 Building your own data source 199
Scope of the example project 200 ■
Your data source API and
options 202
CONTENTS ix

9.5 Behind the scenes: Building the data source itself 203
9.6 Using the register file and the advertiser class 204
9.7 Understanding the relationship between the data and
schema 207
The data source builds the relation 207 ■
Inside the relation 210
9.8 Building the schema from a JavaBean 213
9.9 Building the dataframe is magic with the utilities 215
9.10 The other classes 220

10 Ingestion through structured streaming


10.1 What’s streaming? 224
222

10.2 Creating your first stream 225


Generating a file stream 226 Consuming the records

229
Getting records, not lines 234
10.3 Ingesting data from network streams 235
10.4 Dealing with multiple streams 237
10.5 Differentiating discretized and structured streaming 242

PART 3 TRANSFORMING YOUR DATA . .................................245

11 Working with SQL


11.1
247
Working with Spark SQL 248
11.2 The difference between local and global views 251
11.3 Mixing the dataframe API and Spark SQL 253
11.4 Don’t DELETE it! 256
11.5 Going further with SQL 258

12 Transforming your data


12.1
260
What is data transformation? 261
12.2 Process and example of record-level transformation 262
Data discovery to understand the complexity 264 Data mapping ■

to draw the process 265 Writing the transformation code 268


Reviewing your data transformation to ensure a quality process 274


What about sorting? 275 Wrapping up your first Spark

transformation 275
x CONTENTS

12.3 Joining datasets 276


A closer look at the datasets to join 276 ■
Building the list of higher
education institutions per county 278 ■
Performing the
joins 283
12.4 Performing more transformations 289

13 Transforming entire documents 291


13.1 Transforming entire documents and their structure 292
Flattening your JSON document 293 ■
Building nested documents
for transfer and storage 298
13.2 The magic behind static functions 301
13.3 Performing more transformations 302
13.4 Summary 303

14 Extending transformations with user-defined functions


14.1 Extending Apache Spark 305
304

14.2 Registering and calling a UDF 306


Registering the UDF with Spark 309 Using the UDF with the

dataframe API 310 Manipulating UDFs with SQL 312


Implementing the UDF 313 Writing the service itself 314


14.3 Using UDFs to ensure a high level of data quality 316


14.4 Considering UDFs’ constraints 318

15 Aggregating your data


15.1
320
Aggregating data with Spark 321
A quick reminder on aggregations 321 ■
Performing basic
aggregations with Spark 324
15.2 Performing aggregations with live data 327
Preparing your dataset 327 ■
Aggregating data to better
understand the schools 332
15.3 Building custom aggregations with UDAFs 338

PART 4 GOING FURTHER. ................................................345

16 Cache and checkpoint: Enhancing Spark’s performances


16.1 Caching and checkpointing can increase performance
The usefulness of Spark caching 350 The subtle effectiveness of

347
348

Spark checkpointing 351 Using caching and checkpointing 352



CONTENTS xi

16.2 Caching in action 361


16.3 Going further in performance optimization 371

17 Exporting data and building full data pipelines


17.1 Exporting data 374
Building a pipeline with NASA datasets 374 Transforming

373

columns to datetime 378 Transforming the confidence


percentage to confidence level 379 Exporting the data 379


Exporting the data: What really happened? 382


17.2 Delta Lake: Enjoying a database close to your system 383
Understanding why a database is needed 384 Using Delta Lake

in your data pipeline 385 Consuming data from Delta


Lake 389
17.3 Accessing cloud storage services from Spark 392

18 Exploring deployment constraints: Understanding the


ecosystem 395
18.1 Managing resources with YARN, Mesos, and Kubernetes 396
The built-in standalone mode manages resources 397 YARN ■

manages resources in a Hadoop environment 398 Mesos is a■

standalone resource manager 399 Kubernetes orchestrates


containers 401 Choosing the right resource manager 402


18.2 Sharing files with Spark 403


Accessing the data contained in files 404 Sharing files through

distributed filesystems 404 Accessing files on shared drives or file


server 405 Using file-sharing services to distribute files 406


Other options for accessing files in Spark 407 Hybrid solution for

sharing files with Spark 408


18.3 Making sure your Spark application is secure 408
Securing the network components of your infrastructure 408
Securing Spark’s disk usage 409
appendix A Installing Eclipse 411
appendix B Installing Maven 418
appendix C Installing Git 422
appendix D Downloading the code and getting started with Eclipse 424
appendix E A history of enterprise data 430
appendix F Getting help with relational databases 434
appendix G Static functions ease your transformations 438
appendix H Maven quick cheat sheet 446
appendix I Reference for transformations and actions 450
xii CONTENTS

appendix J Enough Scala 460


appendix K Installing Spark in production and a few tips 462
appendix L Reference for ingestion 476
appendix M Reference for joins 488
appendix N Installing Elasticsearch and sample data 499
appendix O Generating streaming data 505
appendix P Reference for streaming 510
appendix Q Reference for exporting data 520
appendix R Finding help when you’re stuck 528
index 533
foreword
The analytics operating system
In the twentieth century, scale effects in business were largely driven by breadth and dis-
tribution. A company with manufacturing operations around the world had an inher-
ent cost and distribution advantage, leading to more-competitive products. A retailer
with a global base of stores had a distribution advantage that could not be matched by
a smaller company. These scale effects drove competitive advantage for decades.
The internet changed all of that. Today, three predominant scale effects exist:

Network—Lock-in that is driven by a loyal network (Facebook, Twitter, Etsy, and
so forth)

Economies of scale—Lower unit cost, driven by volume (Apple, TSMC, and so
forth)

Data—Superior machine learning and insight, driven from a dynamic corpus of
data
In Big Data Revolution (Wiley, 2015), I profiled a few companies that are capitalizing
on data as a scale effect. But, here in 2019, big data is still largely an unexploited asset
in institutions around the world. Spark, the analytics operating system, is a catalyst to
change that.
Spark has been a catalyst in changing the face of innovation at IBM. Spark is the
analytics operating system, unifying data sources and data access. The unified pro-
gramming model of Spark makes it the best choice for developers building data-rich
analytic applications. Spark reduces the time and complexity of building analytic

xiii
xiv FOREWORD

workflows, enabling builders to focus on machine learning and the ecosystem around
Spark. As we have seen time and again, an open source project is igniting innovation,
with speed and scale.
This book takes you deeper into the world of Spark. It covers the power of the
technology and the vibrancy of the ecosystem, and covers practical applications for
putting Spark to work in your company today. Whether you are working as a data engi-
neer, data scientist, or application developer, or running IT operations, this book
reveals the tools and secrets that you need to know, to drive innovation in your com-
pany or community.
Our strategy at IBM is about building on top of and around a successful open plat-
form, and adding something of our own that’s substantial and differentiated. Spark is
that platform. We have countless examples in IBM, and you will have the same in your
company as you embark on this journey.
Spark is about innovation—an analytics operating system on which new solutions
will thrive, unlocking the big data scale effect. And Spark is about a community of
Spark-savvy data scientists and data analysts who can quickly transform today’s prob-
lems into tomorrow’s solutions. Spark is one of the fastest-growing open source proj-
ects in history. Welcome to the movement.
—ROB THOMAS
SENIOR VICE PRESIDENT,
CLOUD AND DATA PLATFORM, IBM
about the cover illustration
The figure on the cover of Spark in Action is captioned “Homme et Femme de Hous-
berg, près Strasbourg” (Man and Woman from Housberg, near Strasbourg). Housberg
has become Hausbergen, a natural region and historic territory in Alsace now divided
between three villages: Niederhausbergen (lower Hausbergen), Mittelhausbergen
(middle Hausbergen), and Oberhausbergen (upper Hausbergen). The illustration is
from a collection of dress costumes from various countries by Jacques Grasset de Saint-
Sauveur (1757–1810), titled Costumes de Différents Pays, published in France in 1797.
Each illustration is finely drawn and colored by hand.
This particular illustration has special meaning to me. I am really happy it could be
used for this book. I was born in Strasbourg, Alsace, currently in France. I immensely
value my Alsatian heritage. When I decided to immigrate to the United States, I knew
I was leaving behind a bit of this culture and my family, particularly my parents and sis-
ters. My parents live in a small town called Souffelweyersheim, directly neighboring
Niederhausbergen. This illustration reminds me of them every time I see the cover
(although my dad has a lot less hair).
The rich variety of Grasset de Saint-Sauveur’s collection reminds us vividly of how
culturally separate the world’s towns and regions were just 200 years ago. Isolated
from each other, people spoke different dialects (here, Alsatian) and languages. In
the streets or in the countryside, it was easy to identify where someone lived and what
their trade or station in life was just by their dress.
The way we dress has changed since then, and the diversity by region, once so rich,
has faded away. It’s now hard to distinguish the inhabitants of different continents, let

xxvi
ABOUT THE COVER ILLUSTRATION xxvii

alone different towns, regions, or countries. Perhaps we have traded cultural diversity
for a more varied personal life—certainly for a more varied and fast-paced technolog-
ical life.
At a time when it’s hard to tell one computer book from another, Manning cele-
brates the inventiveness and initiative of the computer business with book covers
based on the rich diversity of regional life of two centuries ago, brought back to life by
Grasset de Saint-Sauveur’s pictures.
Another random document with
no related content on Scribd:
still is seen in Silenia. There the same muscular partition exists, but
the branchial lamellae on either side have disappeared, the slits
between the two chambers, which occur in Poromya, still persisting,
but separated into three groups. Cuspidaria represents the last stage
in the development. In the ventral chamber there appears nothing at
all corresponding to a branchia; the surface of the partition appears
perfectly uniform, but on careful examination three little separate
orifices, remains of the three groups of orifices in Silenia, are
observed.[276]
Relation between Branchiae and Heart.—The object of the
branchiae being, as has been already stated, to aerate the blood on
its way to the heart, we find that the heart and the branchiae stand in
very important structural relations to one another. When the
branchiae are in pairs, we find that the auricles of the heart are also
paired, the auricle on the right and left sides being supplied by the
right and left branchiae respectively. This is the case with the
Dibranchiate Cephalopods (Argonauta, Octopus, Loligo, etc.), the
Zygobranchiate Prosobranchs (Fissurella, Haliotis), and all
Pelecypoda. In the Amphineura (Chiton, etc.) there are two auricles
corresponding to the two sets of multiple branchiae. In the case of
the Tetrabranchiate Cephalopods (Nautilus) there are four auricles
corresponding to each of the four branchiae. Compare Fig. 79, A, B,
C, D, E.
On the other hand, when the branchia is single, or when both
branchiae are on the same side, and one is aborted and
functionless, the auricle is single too, and on the same side as the
branchia. This is the case with the Tectibranchiate Opisthobranchs
(Philine, Scaphander, etc.), all the Pectinibranchiate Prosobranchs
(Rachiglossa, Taenioglossa, and Ptenoglossa), and the other
Azygobranchiate Prosobranchs (Trochidae, Neritidae, etc.). In the
last case the right auricle exists, as well as the left, but is simply a
closed sac, the coalescing of the two gills on the left side having
thrown all the work upon the left auricle. Compare Fig. 79, F, G, H.
Fig. 79.—Diagram illustrating the relations between
branchiae, heart, and aorta in the Mollusca: A, In
Chiton; B, Pelecypoda; C, Dibranchiate
Cephalopoda; D, Tetrabranchiate Cephalopoda; E,
Prosobranchiata Zygobranchiata; F,
Prosobranchiata Azygobranchiata; G,
Prosobranchiata Monotocardia; H,
Opisthobranchiata Tectibranchiata: 1, Ventricle; 2,
Auricle; 3, Aorta; 3a, Cephalic aorta; 3b, Visceral
aorta; 3c, Posterior aorta. (From A. Lang.)

Circulatory System
All Mollusca, without exception, possess a circulatory system of
more or less complexity. The centre of the system is the heart, which
receives the aerated blood from the breathing organs, and propels it
to every part of the body. In the Scaphopoda alone there appears to
be no distinct heart.
The heart may consist simply of a single auricle and ventricle, and
an aorta opening out of the ventricle. From the aorta the blood is
conveyed to the various parts of the body by arteries. Veins convey
the blood back to the breathing organs, after passing over which it
returns by the branchial or pulmonary vein to the heart, thus
completing the circuit.
As regards position, the heart is situated within the pericardium, a
separate chamber which in the Pelecypoda, Cephalopoda, and the
bilaterally symmetrical Gasteropoda lies on the median line, while in
the asymmetrical Gasteropoda it is on one or other of the sides of
the body, usually the right. The veins connected with the branchiae,
and consequently the auricle into which they open, are situated
behind the ventricle in the Opisthobranchiata (whence their name),
while in the Prosobranchiata they are situated in front of the
ventricle.
The number of auricles corresponds to the number of branchiae.
Thus there is only one auricle in the great majority of
Prosobranchiata (which are accordingly classified as Monotocardia),
and also in the Opisthobranchiata, while the Pulmonata have a
single auricle corresponding to the pulmonary chamber. There are
two auricles in the Amphineura, in a small group of Gasteropoda,
hence known as Diotocardia, in all Pelecypoda, and in the
Dibranchiate Cephalopoda. In the Tetrabranchiate Cephalopoda
alone there are four auricles corresponding to the four branchiae.
A single aorta occurs only in the Amphineura and in the
Tetrabranchiate Cephalopoda. In all the other groups there are two
aortae, leading out of the anterior and posterior ends of the ventricle
in Pelecypoda and Dibranchiate Cephalopoda, while a single aorta
leads out of the posterior end alone, and subsequently bifurcates, in
most of the Gasteropoda. One aorta, the cephalic, supplies the front
part of the body, the oesophagus, stomach, mantle, etc.; the other,
the visceral aorta, supplies the posterior part, the liver and sexual
organs.
The general circulatory system in the Mollusca has not yet been
thoroughly investigated. As a general rule, the blood driven from the
ventricle through the aorta into the arteries, passes, on reaching the
alimentary canal and other adjacent organs, into a number of
irregular spaces called lacunae. These in their turn branch into
sinuses, or narrow tubes covered with muscular tissue, which
penetrate the body in every direction. In the Dibranchiate
Cephalopoda true capillaries are said to occur, which in some cases
form a direct communication between the arteries and veins.
According to some authorities[277] capillaries and veins exist in
certain Pelecypoda in connexion with the intestinal lacunae, but this
again is regarded by others as not established. A similar difference
of opinion occurs with regard to the precise function of the foot-pore
which occurs in many Mollusca, some holding that it serves as a
means for the introduction of water into the blood-vascular system,
while others regard it as a form of secretion gland, the original
purpose of which has perhaps become lost.
Blood.—As a rule, the blood of the Mollusca—i.e. not the
corpuscles but the liquor sanguinis—is colourless, or slightly tinged
with blue on exposure to the air. This is due to the presence of a
pigment termed haemocyanin, in which are found traces of copper
and iron, the former predominating. Haemoglobin, the colouring
matter of the blood in Vertebrates, is, according to Lankester,[278] of
very restricted occurrence. It is found—(1) in special corpuscles in
the blood of Solen legumen (and Arca Noae); (2) in the general
blood system of Planorbis; (3) in the muscles of the pharynx and
jaws of certain Gasteropoda, e.g. Limnaea, Paludina, Littorina,
Chiton, Aplysia. This distribution of haemoglobin is explained by
Lankester in reference to its chemical activity; whenever increased
facilities for oxidisation are required, then it may be present to do the
work. The Mollusca, being as a rule otiose, do not possess it
generally diffused in the blood, as do the Vertebrata. The actively
burrowing Solen possesses it, and perhaps its presence in Planorbis
is to be explained from its respiring the air of stagnant marshes. Its
occurrence in the pharyngeal muscles and jaws of other genera may
be due to the constant state of activity in which these organs are
kept.[279]
According to Tenison-Woods[280] a species of Arca (trapezia
Desh.) and two species of Solen, all Australian, have red blood. It is
suggested that in these cases the habits of the animal (the Solen
burrowing deeply in sand, the Arca in mud) require some highly
oxidising element, surrounded as the creature is by ooze. In Arca
pexata (N. America) the blood is red, the animal being familiarly
known as the ‘bloody clam.’ Burrowing species, however, are not all
distinguished by this peculiarity. Tenison-Woods finds red fluids in
the buccal mass of many Gasteropoda, e.g. in species of Patella,
Acmaea, Littorina, Trochus, Turbo, giving the parts the appearance
of raw meat.

The Mantle
On the dorsal side of the typical molluscan body, between the
visceral sac and the shell, lies a duplicature of the integument,
generally known as the mantle. The depending sides of the mantle,
which are usually somewhat thickened, enclose between themselves
and the body mass a chamber of varying size and shape, called the
mantle cavity, which communicates freely with the external air or
water, and encloses and furnishes a protection for the organ or
organs of respiration. On its upper or dorsal surface the mantle is
closely applied to the shell throughout its whole extent, the cells with
which it is furnished secreting the materials from which the shell is
formed (see p. 255). The whole mantle is capable, to some degree,
of secreting shelly matter, but the most active agent in its production
is the mantle edge or margin.
In the Prosobranchiata the mantle cavity, for reasons which have
already been explained, is found on the left side of the animal, its
front portion being in many cases produced into a tubular siphon.
Within the mantle cavity are found, besides the branchia, the anus,
the apertures of the kidneys, and the osphradium. In the pulmonata
the mantle fold encloses a so-called lung-cavity. The front edge of
the mantle coalesces with the integument of the neck in such a way
as to enclose the cavity very completely, the only communication
with the outer air being by means of the contractile breathing or
pulmonary aperture on the right side. In the Tectibranchiate
Opisthobranchs the mantle fold is inconsiderable, and is usually not
of sufficient extent to cover the branchia, while in the Nudibranchs,
which have no true branchiae, it disappears altogether.
In the Pelecypoda the mantle cavity is equally developed on each
side, enclosing the two sets of branchiae. The mantle may thus be
regarded as consisting of two equal portions, which form a sort of
lining to the two valves. The lower or ventral portion of the mantle
edges may be simple, or provided with ocelli (Pecten, Arca),
tentacles, cilia (Lima, Lepton), or doubled folds. The two portions of
the mantle touch one another along the whole line of the edge of the
two valves, and, although thus in contact, may remain completely
separate from one another, or else become permanently united at
one or more points. This fusion of the mantle edges corresponds to
important changes in the organisation of the animal as a whole. The
anal and branchial siphons are no more than prolongations of the
mantle edges on the posterior side into a tubular form. These
‘siphons’ exhibit the siphonal form more distinctly according as the
adjacent portions of the mantle become more definitely fused
together.

Fig. 80.—Diagram illustrating the various stages in the closing of the mantle in
Pelecypoda: A, mantle completely open; B, rudiments of siphons, mantle still
completely open; C, mantle closed at one point; D, mantle closed at two
points, with complete formation of siphonal apertures; E, development of
siphons, ventral closure more extended; F, mantle closed at three points, with
fourth orifice: f, foot; s.a, s.b, anal and branchial siphons; 1, 2, 3, first, second,
and third points of closure of mantle. (After A. Lang.)
This progressive fusion of the mantle edges may be taken as
indicating definite stages in the development of the Pelecypoda. A
perfectly free mantle edge, joined at no point with the edge of the
adjacent mantle, occurs in Nucula, Arca, Anomia, and Trigonia (see
Fig. 80, A, B). Here there is nothing in the nature of a siphon, either
anal or branchial; in other words, no contrivance exists to prevent the
spent water which has passed over the branchiae from becoming
mixed with the fresh water which is to reach them. When the mantle
edges are fused at one point only, this is invariably on the middle
part of the posterior side, thus separating off an anal opening which
may become prolonged into a tube-like form. At the same time the
adjacent underlying portions of the mantle edges draw together,
without actually coalescing, to form an opening for the incurrent
stream of water, the rudiments of the ‘branchial siphon’ (Fig. 80, C).
This is the case with most Mytilidae (see Fig. 75) with Cardita,
Astarte, and Pisidium. In the next stage the branchial opening is
separated off by the concrescence of the mantle edges beneath it,
and we have the mantle united in two places, thus forming three
openings, the ventral of which is the opening for the protrusion of the
foot (Fig. 80, D). This is the case in Yoldia, Leda, the majority of the
Eulamellibranchiata (e.g. Lucina, Cyrena, Donax, Psammobia,
Tellina, Venus, Cardium, Mactra), and all Septibranchiata. In Chama
and Tridacna the fused portions of the mantle become more
extended, and in Pholas, Xylophaga, Teredo, Pandora, and Lyonsia
this concrescence takes place over the greater length of the whole
mantle edge, so that the mantle may be regarded as closed, with the
exception of the three apertures for the foot and the two siphons
(Fig. 80, E).
In certain genera there occurs, besides these three apertures, a
fourth, in the line of junction between the pedal and branchial
orifices. It appears probable that this fourth orifice (which has been
regarded by some as an inlet for water when the siphons are
retracted), stands in relation to the byssal apparatus (Fig. 80, F). In
Lyonsia, for instance, a thick byssus protrudes through the orifice,
which is large and open. In Solen, Lutraria, Glycimeris,
Cochlodesma, Thracia, Aspergillum, and a few more genera, which
have no byssus, the orifice is very small and narrow. It is possible
that in these latter cases, the byssal apparatus having become
atrophied, the orifice has been correspondingly reduced in size.[281]
Mantle Reflected over the Shell.—It is sometimes the case that
the mantle edges tend to double back over the external surface of
the shell, and to enclose it to a greater or less extent. When this
process is carried to an extreme, the edges of the reflected mantle
unite, and the shell becomes completely internal. We see an
incipient stage of this process in Cypraea and Marginella, where the
bright polish on the surface of the shell is due to the protection
afforded by the lobes of the mantle. A considerable portion of the
shell of Scutus is concealed in a similar way, while in Cryptochiton,
Lamellaria, and Aplysia the shell is more or less completely
enclosed. Among Pulmonata, it is possible that in forms like Vitrina,
Parmacella, Limax, and Arion, we have successive stages in a
process which starts with a shell completely external, as in Helix,
and ends, not merely by enveloping the shell in the mantle, but by
effecting its disappearance altogether. In Vitrina and some allied
genera we have a type in which the mantle lobes are partly reflected
over the shell, which at the same time exhibits rather less of a spiral
form than in Helix. In the stage represented by Parmacella, the
mantle edges have coalesced over the whole of the shell, except for
a small aperture immediately over the spire; the nucleus alone of the
shell is spiral, the rest considerably flattened. In Limax the shell has
become completely internal, and is simply a flat and very thin plate,
the spiral form being entirely lost, and the nucleus represented by a
simple thickening at one end of the plate. In Arion, the final stage, we
find that the shell, being no longer needed as a protection to the vital
organs, has either become resolved into a number of independent
granules, or else has entirely disappeared.
Some indications of a similar series of changes occur in the
Pelecypoda. The mantle edge of Lepton is prolonged beyond the
area of the valves, terminating in some cases in a number of
filaments. In Galeomma and Scintilla the valves are partially
concealed by the reflected mantle lobes, and in a remarkable form
recently discovered by Dall[282] (Chlamydoconcha) the shell is
completely imbedded in the mantle, which is perforated at the
anterior end by an orifice for the mouth, and at the posterior end by a
similar orifice for the anus. In all these cases, except Lepton, it is
interesting to notice that the hinge teeth have completely
disappeared, the additional closing power gained by the external
mantle rendering the work done by a hinge unnecessary. It is quite
possible, on the analogy of the Gasteropoda mentioned above, and
also, it may be added, of the Cephalopoda and other groups, that we
have here indicated the eventual occurrence of a type of Pelecypoda
altogether deprived of valves, a greatly thickened mantle performing
the part of a shell.[283]

The following works will be found useful for further study of this
portion of the subject:—
F. Bernard, Recherches sur les organes palléaux des
Gastéropodes prosobranches: Ann. Sc. Nat. Zool. (7) ix. (1890), pp.
89–404.
G. Cuvier, Le Régne animal (ed. V. Masson); Mollusca, Text and
Atlas.
C. Grobben, Beiträge zur Kenntniss des Baues von Cuspidaria
(Neaera) cuspidata Olivi, nebst Betrachtungen über das System der
Lamellibranchiaten: Arb. Zool. Inst. Wien, x. (1893), pp. 101–146.
E. Ray Lankester, Encyclopaedia Britannica, 9th ed., vol. xvi.
(1883), Art. ‘Mollusca.’
A. Ménégaux, Recherches sur la circulation des Lamellibranches
marins: Besançon, 1890.
K. Mitsukuri, On the structure and significance of some aberrant
forms of Lamellibranchiate gills: Q. Journ. Micr. Sc., N.S. xxi. (1881),
pp. 595–608.
H. L. Osborn, On the gill in some forms of Prosobranchiate
Mollusca: Stud. Biol. Lab. Johns Hopk. Univ. iii. (1884), pp. 37–48.
R. Holman Peck, The structure of the Lamellibranchiate gill: Q.
Journ. Micr. Sc., N.S. xvii. (1877), pp. 43–66.
P. Pelseneer, Contributions à l’étude des lamellibranches: Arch.
Biol. xi. (1891), pp. 147–312.
CHAPTER VII
ORGANS OF SENSE: TOUCH, SIGHT, SMELL, HEARING—THE FOOT—THE
NERVOUS SYSTEM

Organs of Sense: I. Touch


Tactile organs, although occurring in some of the Mollusca, do not
appear to attain special or marked development, except in a few
cases. The whole surface of the skin, and particularly of the foot, is
very sensitive to the slightest impression. Nearly all Gasteropoda are
furnished with at least two cephalic tentacles, projecting like horns
from each side of the fore part of the head. At or near the base of
these are generally situated the eyes. In the Helicidae the eyes are
situated, not at the base, but at the apex of the tentacles, and in that
case—except in Vertigo—a second pair of shorter tentacles appears
beneath the longer pair. It frequently happens that several senses
are centred in a single organ; thus the upper tentacles of snails not
only carry the eyes and serve to a certain extent as tactile organs,
but they also carry the organs of smell.
The edges of the mantle, which are sometimes specialised into
lobes, appear to be keenly sensitive to touch in all Gasteropoda.
In Cypraea (Fig. 81) these lobes, or tentaculae, are a prominent
feature of the animal, and also in certain genera of the Trochidae
(Fig. 82). In most of the carnivorous land Pulmonata—e.g.
Testacella, Rhytida, Ennea—there are developed, under the lower
pair of tentacles, and close to the mouth, large labial palps or feelers.
These are connected with the cerebral ganglion by a very large
nerve, and may therefore be supposed to be of extreme
sensitiveness. In some of the large carnivorous forms (Glandina,
Aerope, compare Fig. 21, p. 54) these palpae are of great size, and
curl upwards like an enormous pair of moustaches. When a
Glandina seizes its prey, the palpae (see Fig. 83) appear to enfold it
and draw it in towards the mouth.
Fig. 81.—Cypraea moneta L., showing tentaculae
at edge of mantle, which partly envelops the
shell: Si, siphon; M, M, mantle; F, foot; T´,
tentaculae at edge of mantle. (After Quoy and
Gaimard.) × 3/2.

Fig. 82.—Monodonta
canalifera Lam., New
Ireland, showing mantle
lobes. (After Quoy and
Gaimard.)
Fig. 83.—Glandina seizing
its prey, with buccal
papillae turned back.
(Strebel.)
It is in the Opisthobranchiata that the organs of touch attain their
maximum development. Many of this group are shell-less or possess
a small internal shell, and accordingly, in the absence of this special
form of defence, a multiplied sense of touch is probably of great
service. Thus we find, besides the ordinary cephalic tentacles,
clusters or crowns of the same above the head of many
Nudibranchiata, with lobe-like prolongations of the integument, and
tentacular processes in the neighbourhood of, or surrounding the
branchiae (see Figs. 58 and Fig. 84, or even projecting from the
whole upper surface of the body (Fig. 5, C).
In the Pelecypoda, the chief organs of touch are the foot, which is
always remarkably sensitive, especially towards its point, the labial
palps on each side of the mouth, and the siphons. In certain cases
the mantle border is prolonged into a series of threads or filaments.
These are particularly noticeable in Pecten, Lepton, and Lima (Fig.
85), the mantle lobes of the common L. hians of our own coasts
being very numerous, and of a bright orange colour. In many genera
—e.g. Unio, Mactra—this sensibility to touch appears to be shared
by the whole mantle border, although it is not furnished with any
special fringing. The ‘arms’ of the Cephalopoda appear to be keenly
sensitive to touch, and this is particularly the case with the front or
tentacular pair of arms, which seem to be employed in an especial
degree for exploration and investigation of strange objects.
Fig. 84.—Idalia Leachii A. and H., British seas;
br, branchiae. (After Alder and Hancock.)

Fig. 85.—Lima squamosa Lam.,


Naples, showing tentacular lobes
of mantle (t, t); a, anus; ad.m,
adductor muscle; br, br,
branchiae; f, foot; sh, shell.
Taste.—The sense of taste is no doubt present, to a greater or
less extent, in all the head-bearing Mollusca. In many of these a
special nerve or nerves has been discovered in the pharynx,
connecting with the cerebral ganglion; this no doubt indicates the
seat of the faculty of taste. The Mollusca vary greatly in their likings
for different kinds of food. Some seem to prefer decaying and highly
odoriferous animal matter (Buccinum, Nassa), others apparently
confine themselves to fresh meat (Purpura, Natica, Testacella),
others again, although naturally vegetarian, will not refuse flesh on
occasion (Limax, Helix).
Mr. W. A. Gain[284] has made some interesting experiments on
the taste of British land Mollusca, as evidenced by the acceptance or
rejection of various kinds of food. He kept twelve species of Arion
and Limax, and eight species of Helix in captivity for many months,
and tried them with no less than 197 different kinds of food,
cannibalism included. Some curious points came out in his table of
results. Amalia gagates appears to be surprisingly omnivorous, for
out of 197 kinds of food it ate all but 25; Arion ater came next, eating
all but 40. Limax arborum, on the other hand, was dainty to a fault,
eating only seven kinds of food, and actually refusing Swedes, which
every other species took with some avidity. Certain food was
rejected by all alike, e.g. London Pride, Dog Rose, Beech and
Chestnut leaves, Spruce Fir, Common Rush, Liverwort, and Lichens;
while all, or nearly all, ate greedily of Potatoes, Turnips, Swedes,
Lettuces, Leeks, Strawberries, Boletus edulis, and common grasses.
Few of our common weeds or hedgerow flowers were altogether
rejected. Arion and Limax were decidedly less particular in their food
than Helix, nearly all of them eating earthworms and puff-balls, which
no Helix would touch. Arion ater and Limax maximus ate the slime
off one another, and portions of skin. Cyclostoma elegans and
Hyalinia nitida preferred moist dead leaves to anything else.

II. Sight

Position of Eyes.—In the majority of the head-bearing Mollusca


the eyes are two in number, and are placed on, or in the immediate
neighbourhood of the head. Sometimes they are carried on
projecting tentacles or ‘ommatophores,’ which are either simple (as
in Prosobranchiata) or capable of retraction like the fingers of a glove
(Helix, etc.). Sometimes, as in a large number of the marine
Gasteropoda, the eyes are at the outer base of the cephalic
tentacles, or are mounted on the tentacles themselves, but never at
the tip (compare Fig. 60, p. 153 and Fig. 98, p. 199). In other cases
they are placed somewhat farther back, at the sides of the neck. The
Pulmonata are usually subdivided into two great groups,
Stylommatophora and Basommatophora (Fig. 86), according as the
eyes are carried on the tip of the large tentacles (Helix, and all non-
operculate land shells), or placed at the inner side of their base
(Limnaea, Physa, etc.). In land and fresh-water operculates, the
eyes are situated at the outer base of the tentacles.

Fig. 86.—A, Limnaea peregra Müll.; e, e, eyes; t, t, tentacles; B,


Helix nemoralis Müll.; e, e, eyes; t, t, tentacles; p.o,
pulmonary orifice.
In the Helicidae, careful observation will show that the eyes are
not placed exactly in the centre of the end of the tentacle, but on its
upper side, inclining slightly outwards. The eye is probably pushed
on one side, as it were, by the development of the neighbouring
olfactory bulb. The sense of smell being far more important to these
animals than the sense of sight, the former sense develops at the
expense of the latter.
Organisation of the Molluscan Eye.—The eye in Mollusca
exhibits almost every imaginable form, from the extremely simple to
the elaborately complex. It may be, as in certain bivalves, no more
than a pigmented spot on the mantle, or it may consist, as in some of
the Cephalopoda, of a cornea, a sclerotic, a choroid, an iris, a lens,
an aqueous and vitreous humour, a retina, and an optic nerve, or of
some of these parts only.
In most land and fresh-water Mollusca the eye may be regarded,
roughly speaking, as a ball connected by an exceedingly fine thread
(the optic nerve) with a nerve centre (the cerebral ganglion). In
Paludina this ball is elliptic, in Planorbis and Neritina it is drawn out
at the back into a conical or pear shape. In Helix (Fig. 87) there is a
structureless membrane, surrounding the whole eye, a lens, and a
retina, the latter consisting of a nervous layer, a cellular layer, and a
layer of rods containing pigment, this innermost layer (that nearest
the lens) being of the thickness of half the whole retina.

Fig. 87.—Eye of Helix pomatia


L., retracted within the
tentacle; c, cornea; ep,
epithelial layer; l, lens; op.n,
optic nerve; r, retina. (After
Simroth.)
Comparing the eyes of different Gasteropoda together, we find
that they represent stages in a general course of development. Thus
in Patella the eye is scarcely more than an invagination or
depression in the integument, which is lined with pigmented and
retinal cells. The next upward stage occurs in Trochus, where the
depression becomes deeper and bladder-shaped, and is filled with a
gelatinous or crystalline mass, but still is open at the top, and
therefore permits the eye to be bathed in water. Then, as in Turbo,
the bladder becomes closed by a thin epithelial layer, which finally,
as in some Murex, becomes much thicker, while the ‘eyeball’
encloses a lens (Fig. 88), which probably corresponds with the
‘vitreous humour’ of other types.

Fig. 88.—Eyes of Gasteropoda, showing arrest of


development at successive stages: A, Patella; B,
Trochus; C, Turbo; D, Murex; ep, epidermis; l, lens;
op.n, optic nerve; r, retina; v.h, vitreous humour.
(After Hilger.)
In Nautilus the eye is of a very simple type. It consists of a cup-
shaped depression, with a small opening which is not quite closed by
the integument. The retina consists of cells which line the interior of
the depression, and which communicate directly with the branches of
the optic nerve, there being no iris or lens. This type of eye, it will be
observed, corresponds exactly with that which occurs in Patella. It
appears also to correspond to a stage in the development of eyes in
the Dibranchiata (e.g. Octopus, Sepia, Loligo). Lankester has
shown[285] that in Loligo the eye first appears as a ridge, enclosing
an oval area in the integument. By degrees the walls of this area
close in, and eventually join, enclosing the retinal cells within the
chamber in which the lens is afterwards developed (Fig. 89). It thus
appears that in some cases the development of the eye is arrested
at a point which in other cases only forms a temporary stage towards
a higher type of organisation.

Fig. 89.—Three stages in the development of


the eye of Loligo; r, r, ridge, enclosing
p.o.c, primitive optic chamber; or, orifice
between the closing ridges; s.o.c,
secondary optic chamber; ci, ci, ciliary
body; l, rudimentary lens; R, retina. (After
Lankester.)
Fig. 90.—Eye in A, Loligo; B, Helix or Limax; C, Nautilus: a.o.c, anterior optic
chamber; c, cornea; int, integument; ir, iris; l, lens; l´, external portion of
lens; op.n, optic nerve; op.g, optic ganglion; p.o.c, posterior optic
chamber; r, retina. (After Grenacher.)
The developed eye in the dibranchiate Cephalopods consists of a
transparent cornea, which may or may not be closed over the front of
the lens. Behind the cornea is a narrow chamber (the anterior optic
chamber) which is continued for three parts round the whole circle of
the eye, and into which project the front portion of the lens and the
folds of the iris. Throughout its whole extent, the anterior optic
chamber is lined by the integument, the portion of which on the inner
side is the choroid. The lens is divided into an outer and inner
segment by a thin membrane, and is supported by the ciliary body
which forms a continuation of the retina. The main portion of the lens
lies within the posterior optic chamber, at the back and sides of
which is found the retina (Grenacher).
There can be no doubt that the Cephalopoda use their eyes to
observe, but there is nothing to show that any other Mollusca use
their eyes for this purpose, the sense of smell in their case largely
taking the place of visual observation. Madame Jeannette Power
once saw[286] the Octopus in her aquarium holding a fragment of
rock in one of its arms, and watching a Pinna which was opening its
valves. As soon as they were perfectly open, the Poulpe, with
incredible address and promptitude, placed the stone between the
valves, preventing the Pinna from closing again, upon which it set
about devouring its victim. The next day the Poulpe was seen, after
crushing some Tellina, to stretch himself down close by a Triton
nodiferus, and watch it attentively. After four hours the Triton
emerged from its shell, when the Octopus sprang upon it, and
surrounded it with its arms.
Powers of Vision in Land Mollusca.—The Helicidae are
undoubtedly very short-sighted. Seldom emerging from their retreats
except in twilight and darkness, they are naturally myopic, and see
better in a subdued than in a bright light. Experiment has shown that
a Helix can perceive an object better at 6 centimetres distance in a
weak light than at 4 or 5 millimetres in a strong one. Cyclostoma
elegans and Paludina vivipara are comparatively long-sighted,
perceiving objects at a distance of 20 to 30 centimetres.[287] The
increased power of vision is due, in these two cases, to increased
elaboration in the construction of the eye, Paludina possessing a
large and almost spherical lens, to which the vitreous humour closely
adheres, while in Cyclostoma the lens is remarkably hard, and the
aqueous humour very abundant. According to V. Willem,[288] the
Pulmonata are very sensitive to the slightest movement of the air or
jarring of the surface on which they crawl, but are so short-sighted as
only to perceive a confused image of a large object at about 1 cm.,
and to distinguish the form of objects at not more than 1 or 2 mm.
The senses of touch and smell are far more active than that of sight.
A bean-pod enclosed in a narrow glass case and placed before a
hungry snail was not noticed, but when taken out of the case and
placed 8 cm. behind the snail, the latter at once turned towards it to
devour it.
Some interesting experiments were conducted by the same
author with the view of ascertaining whether snails avoid or court the
light. He placed a number of species in different wooden boxes,
which were divided into a light and a dark compartment, having
previously well soaked the boxes in water to secure a humid
atmosphere and surface, and so induce the snails to move about.

You might also like