Professional Documents
Culture Documents
Spark in Action - Second Edition: Covers Apache Spark 3 With Examples in Java, Python, and Scala Jean-Georges Perrin
Spark in Action - Second Edition: Covers Apache Spark 3 With Examples in Java, Python, and Scala Jean-Georges Perrin
Spark in Action - Second Edition: Covers Apache Spark 3 With Examples in Java, Python, and Scala Jean-Georges Perrin
https://textbookfull.com/product/graph-algorithms-practical-
examples-in-apache-spark-and-neo4j-1st-edition-mark-needham/
https://textbookfull.com/product/biota-grow-2c-gather-2c-cook-
loucas/
https://textbookfull.com/product/stream-processing-with-apache-
spark-mastering-structured-streaming-and-spark-streaming-1st-
edition-gerard-maas/
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/
https://textbookfull.com/product/beginning-apache-spark-using-
azure-databricks-unleashing-large-cluster-analytics-in-the-cloud-
robert-ilijason/
https://textbookfull.com/product/machine-learning-with-spark-
nick-pentreath/
https://textbookfull.com/product/beginning-apache-spark-using-
azure-databricks-unleashing-large-cluster-analytics-in-the-
cloud-1st-edition-robert-ilijason/
https://textbookfull.com/product/introducing-net-for-apache-
spark-distributed-processing-for-massive-datasets-1st-edition-ed-
elliott/
SECOND EDITION Covers Apache Spark 3
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
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
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.
ISBN 9781617295522
Printed in the United States of America
Liz,
Thank you for your patience, support, and love during this endeavor.
dataframe 14
v
vi CONTENTS
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 ■
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
Parquet 167
Elasticsearch 191
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
transformation 275
x CONTENTS
Lake 389
17.3 Accessing cloud storage services from Spark 392
Other options for accessing files in Spark 407 Hybrid solution for
■
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
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.)
II. Sight